static int b1dma_tolink(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_tx_empty(card->port) && time_before(jiffies, stop)); if (!b1dma_tx_empty(card->port)) return -1; t1outp(card->port, 0x01, *s++); } return 0; }
static int b1dma_tolink(iavc_softc_t *sc, void *buf, int len) { volatile int spin; char *s = (char*) buf; while (len--) { spin = 0; while (!b1dma_tx_empty(sc) && spin < 100000) spin++; if (!b1dma_tx_empty(sc)) return -1; t1io_outp(sc, 1, *s++); } return 0; }