• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-WNDR4500-V1.0.1.40_1.0.68/src/linux/linux-2.6/drivers/isdn/hardware/avm/

Lines Matching refs:base

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