• Home
  • Raw
  • Download

Lines Matching refs:base

219 static inline unsigned char b1outp(unsigned int base,  in b1outp()  argument
223 outb(value, base + offset); in b1outp()
224 return inb(base + B1_ANALYSE); in b1outp()
228 static inline int b1_rx_full(unsigned int base) in b1_rx_full() argument
230 return inb(base + B1_INSTAT) & 0x1; in b1_rx_full()
233 static inline unsigned char b1_get_byte(unsigned int base) in b1_get_byte() argument
236 while (!b1_rx_full(base) && time_before(jiffies, stop)); in b1_get_byte()
237 if (b1_rx_full(base)) in b1_get_byte()
238 return inb(base + B1_READ); in b1_get_byte()
239 printk(KERN_CRIT "b1lli(0x%x): rx not full after 1 second\n", base); in b1_get_byte()
243 static inline unsigned int b1_get_word(unsigned int base) in b1_get_word() argument
246 val |= b1_get_byte(base); in b1_get_word()
247 val |= (b1_get_byte(base) << 8); in b1_get_word()
248 val |= (b1_get_byte(base) << 16); in b1_get_word()
249 val |= (b1_get_byte(base) << 24); in b1_get_word()
253 static inline int b1_tx_empty(unsigned int base) in b1_tx_empty() argument
255 return inb(base + B1_OUTSTAT) & 0x1; in b1_tx_empty()
258 static inline void b1_put_byte(unsigned int base, unsigned char val) in b1_put_byte() argument
260 while (!b1_tx_empty(base)); in b1_put_byte()
261 b1outp(base, B1_WRITE, val); in b1_put_byte()
264 static inline int b1_save_put_byte(unsigned int base, unsigned char val) in b1_save_put_byte() argument
267 while (!b1_tx_empty(base) && time_before(jiffies, stop)); in b1_save_put_byte()
268 if (!b1_tx_empty(base)) return -1; in b1_save_put_byte()
269 b1outp(base, B1_WRITE, val); in b1_save_put_byte()
273 static inline void b1_put_word(unsigned int base, unsigned int val) in b1_put_word() argument
275 b1_put_byte(base, val & 0xff); in b1_put_word()
276 b1_put_byte(base, (val >> 8) & 0xff); in b1_put_word()
277 b1_put_byte(base, (val >> 16) & 0xff); in b1_put_word()
278 b1_put_byte(base, (val >> 24) & 0xff); in b1_put_word()
281 static inline unsigned int b1_get_slice(unsigned int base, in b1_get_slice() argument
286 len = i = b1_get_word(base); in b1_get_slice()
287 while (i-- > 0) *dp++ = b1_get_byte(base); in b1_get_slice()
291 static inline void b1_put_slice(unsigned int base, in b1_put_slice() argument
295 b1_put_word(base, i); in b1_put_slice()
297 b1_put_byte(base, *dp++); in b1_put_slice()
300 static void b1_wr_reg(unsigned int base, in b1_wr_reg() argument
304 b1_put_byte(base, WRITE_REGISTER); in b1_wr_reg()
305 b1_put_word(base, reg); in b1_wr_reg()
306 b1_put_word(base, value); in b1_wr_reg()
309 static inline unsigned int b1_rd_reg(unsigned int base, in b1_rd_reg() argument
312 b1_put_byte(base, READ_REGISTER); in b1_rd_reg()
313 b1_put_word(base, reg); in b1_rd_reg()
314 return b1_get_word(base); in b1_rd_reg()
318 static inline void b1_reset(unsigned int base) in b1_reset() argument
320 b1outp(base, B1_RESET, 0); in b1_reset()
323 b1outp(base, B1_RESET, 1); in b1_reset()
326 b1outp(base, B1_RESET, 0); in b1_reset()
330 static inline unsigned char b1_disable_irq(unsigned int base) in b1_disable_irq() argument
332 return b1outp(base, B1_INSTAT, 0x00); in b1_disable_irq()
337 static inline void b1_set_test_bit(unsigned int base, in b1_set_test_bit() argument
341 b1_wr_reg(base, B1_STAT0(cardtype), onoff ? 0x21 : 0x20); in b1_set_test_bit()
344 static inline int b1_get_test_bit(unsigned int base, in b1_get_test_bit() argument
347 return (b1_rd_reg(base, B1_STAT0(cardtype)) & 0x01) != 0; in b1_get_test_bit()
386 static inline void t1outp(unsigned int base, in t1outp() argument
390 outb(value, base + offset); in t1outp()
393 static inline unsigned char t1inp(unsigned int base, in t1inp() argument
396 return inb(base + offset); in t1inp()
399 static inline int t1_isfastlink(unsigned int base) in t1_isfastlink() argument
401 return (inb(base + T1_IDENT) & ~0x82) == 1; in t1_isfastlink()
404 static inline unsigned char t1_fifostatus(unsigned int base) in t1_fifostatus() argument
406 return inb(base + T1_FIFOSTAT); in t1_fifostatus()
409 static inline unsigned int t1_get_slice(unsigned int base, in t1_get_slice() argument
417 len = i = b1_get_word(base); in t1_get_slice()
418 if (t1_isfastlink(base)) { in t1_get_slice()
421 status = t1_fifostatus(base) & (T1F_IREADY | T1F_IHALF); in t1_get_slice()
426 insb(base + B1_READ, dp, FIFO_INPBSIZE); in t1_get_slice()
434 insb(base + B1_READ, dp, i); in t1_get_slice()
442 *dp++ = b1_get_byte(base); in t1_get_slice()
453 base, len, wcnt, bcnt); in t1_get_slice()
457 *dp++ = b1_get_byte(base); in t1_get_slice()
462 static inline void t1_put_slice(unsigned int base, in t1_put_slice() argument
466 b1_put_word(base, i); in t1_put_slice()
467 if (t1_isfastlink(base)) { in t1_put_slice()
470 status = t1_fifostatus(base) & (T1F_OREADY | T1F_OHALF); in t1_put_slice()
474 outsb(base + B1_WRITE, dp, FIFO_OUTBSIZE); in t1_put_slice()
479 outsb(base + B1_WRITE, dp, i); in t1_put_slice()
484 b1_put_byte(base, *dp++); in t1_put_slice()
491 b1_put_byte(base, *dp++); in t1_put_slice()
495 static inline void t1_disable_irq(unsigned int base) in t1_disable_irq() argument
497 t1outp(base, T1_IRQMASTER, 0x00); in t1_disable_irq()
500 static inline void t1_reset(unsigned int base) in t1_reset() argument
503 b1_reset(base); in t1_reset()
505 t1outp(base, B1_INSTAT, 0x00); in t1_reset()
506 t1outp(base, B1_OUTSTAT, 0x00); in t1_reset()
507 t1outp(base, T1_IRQMASTER, 0x00); in t1_reset()
509 t1outp(base, T1_RESETBOARD, 0xf); in t1_reset()
512 static inline void b1_setinterrupt(unsigned int base, unsigned irq, in b1_setinterrupt() argument
517 t1outp(base, B1_INSTAT, 0x00); in b1_setinterrupt()
518 t1outp(base, B1_INSTAT, 0x02); in b1_setinterrupt()
519 t1outp(base, T1_IRQMASTER, 0x08); in b1_setinterrupt()
522 b1outp(base, B1_INSTAT, 0x00); in b1_setinterrupt()
523 b1outp(base, B1_RESET, b1_irq_table[irq]); in b1_setinterrupt()
524 b1outp(base, B1_INSTAT, 0x02); in b1_setinterrupt()
530 b1outp(base, B1_INSTAT, 0x00); in b1_setinterrupt()
531 b1outp(base, B1_RESET, 0xf0); in b1_setinterrupt()
532 b1outp(base, B1_INSTAT, 0x02); in b1_setinterrupt()
536 b1outp(base, B1_RESET, 0xf0); in b1_setinterrupt()
544 int b1_detect(unsigned int base, enum avmcardtype cardtype);