static int b1dma_fromlink(avmcard *card, void *buf, unsigned int len) { unsigned long stop = jiffies + 1 * HZ; /* maximum wait time 1 sec */ unsigned char *s = (unsigned char *)buf; while (len--) { while ( !b1dma_rx_full(card->port) && time_before(jiffies, stop)); if (!b1dma_rx_full(card->port)) return -1; *s++ = t1inp(card->port, 0x00); } return 0; }
static int b1dma_fromlink(iavc_softc_t *sc, void *buf, int len) { volatile int spin; char *s = (char*) buf; while (len--) { spin = 0; while (!b1dma_rx_full(sc) && spin < 100000) spin++; if (!b1dma_rx_full(sc)) return -1; *s++ = t1io_inp(sc, 0); } return 0; }