diff options
author | hm <hm@FreeBSD.org> | 2001-01-21 10:12:50 +0000 |
---|---|---|
committer | hm <hm@FreeBSD.org> | 2001-01-21 10:12:50 +0000 |
commit | 9c4d942508aa142dc84c8dffc05cafeb76564b71 (patch) | |
tree | bd4d0aee922cfac6cb59e45ee3e1384a1c0298bf /sys/i4b/layer1/iwic/i4b_iwic_bchan.c | |
parent | 7e6a9379747e18efa22fdb285658e4641d2718cf (diff) | |
download | FreeBSD-src-9c4d942508aa142dc84c8dffc05cafeb76564b71.zip FreeBSD-src-9c4d942508aa142dc84c8dffc05cafeb76564b71.tar.gz |
Update the iwic driver: fix error handling for rx errors on the D-channel
which prevents erroneous packets from being put onto the protocol stack;
enhance error detection for B-channel HDLC errors; remove old cvs id´s.
Diffstat (limited to 'sys/i4b/layer1/iwic/i4b_iwic_bchan.c')
-rw-r--r-- | sys/i4b/layer1/iwic/i4b_iwic_bchan.c | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c b/sys/i4b/layer1/iwic/i4b_iwic_bchan.c index a636f24..5e6948f 100644 --- a/sys/i4b/layer1/iwic/i4b_iwic_bchan.c +++ b/sys/i4b/layer1/iwic/i4b_iwic_bchan.c @@ -31,7 +31,7 @@ * * $FreeBSD$ * - * last edit-date: [Fri Jan 12 16:57:01 2001] + * last edit-date: [Tue Jan 16 13:21:24 2001] * *---------------------------------------------------------------------------*/ @@ -88,33 +88,48 @@ iwic_bchan_xirq(struct iwic_softc *sc, int chan_no) if (irq_stat & B_EXIR_RDOV) { - NDBGL1(L1_H_XFRERR, "RDOV"); + NDBGL1(L1_H_XFRERR, "iwic%d: EXIR B-channel Receive Data Overflow", sc->sc_unit); } if (irq_stat & B_EXIR_XDUN) { - NDBGL1(L1_H_XFRERR, "XDUN"); + NDBGL1(L1_H_XFRERR, "iwic%d: EXIR B-channel Transmit Data Underrun", sc->sc_unit); + cmd |= (B_CMDR_XRST); /*XXX must retransmit frame ! */ } /* RX message end interrupt */ if(irq_stat & B_EXIR_RME) { -/* XXXX */ int error = 0; - register int fifo_data_len; + int error; NDBGL1(L1_H_IRQ, "B_EXIR_RME"); - - fifo_data_len = ((IWIC_READ(sc,chan->offset+B_RBCL)) & - ((IWIC_BCHAN_FIFO_LEN)-1)); - - if(fifo_data_len == 0) - fifo_data_len = IWIC_BCHAN_FIFO_LEN; + + error = (IWIC_READ(sc,chan->offset+B_STAR) & + (B_STAR_RDOV | B_STAR_CRCE | B_STAR_RMB)); + + if(error) + { + if(error & B_STAR_RDOV) + NDBGL1(L1_H_XFRERR, "iwic%d: B-channel Receive Data Overflow", sc->sc_unit); + if(error & B_STAR_CRCE) + NDBGL1(L1_H_XFRERR, "iwic%d: B-channel CRC Error", sc->sc_unit); + if(error & B_STAR_RMB) + NDBGL1(L1_H_XFRERR, "iwic%d: B-channel Receive Message Aborted", sc->sc_unit); + } /* all error conditions checked, now decide and take action */ if(error == 0) { + register int fifo_data_len; + fifo_data_len = ((IWIC_READ(sc,chan->offset+B_RBCL)) & + ((IWIC_BCHAN_FIFO_LEN)-1)); + + if(fifo_data_len == 0) + fifo_data_len = IWIC_BCHAN_FIFO_LEN; + + if(chan->in_mbuf == NULL) { if((chan->in_mbuf = i4b_Bgetmbuf(BCH_MAX_DATALEN)) == NULL) @@ -684,7 +699,7 @@ iwic_bchannel_start(int unit, int chan_no) } /*---------------------------------------------------------------------------* - * + * return B-channel statistics *---------------------------------------------------------------------------*/ static void iwic_bchannel_stat(int unit, int chan_no, bchan_statistics_t *bsp) |