13 #include <linux/hdlc.h>
15 #include <linux/netdevice.h>
30 "Rx LOS Chng Int r=%02x (LOS|OOF=%02x)\n",
73 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Ethernet controller interrupt! (CSR5 = %08X)\n",
81 "Receive interrupt (LOS=%d, OOF=%d)\n",
85 "Receive buffer unavailable\n");
88 "Receive process stopped\n");
104 "Transmit buffer unavailable\n");
107 "Transmit process stopped\n");
114 sc->
ether.interrupt_enable_mask);
127 current_read = sc->
ether.rx_ring_current_read;
128 dev_dbg(&sc->
pdev->dev,
"intr_rx current_read = %d\n", current_read);
132 while (!(sc->
ether.rx_ring[current_read].rdes0 &
134 current_desc = &sc->
ether.rx_ring[current_read];
141 sc->
ether.rx_ring_current_read = current_read;
145 while (!(sc->
ether.rx_ring[current_read].rdes0 &
147 current_desc = &sc->
ether.rx_ring[current_read];
149 dev_dbg(&sc->
pdev->dev,
"rdes0: %08X rdes1: %08X\n",
152 m = sc->
ether.rx_data[current_read];
156 dev_dbg(&sc->
pdev->dev,
"mbuf was received (mbuf len = %d)\n",
199 "error interrupt: NO_ERROR_MESSAGE = %d\n",
210 "SBE 2T3E3: descriptor error\n");
217 "SBE 2T3E3: collision seen\n");
223 "SBE 2T3E3: dribbling bits error\n");
230 "SBE 2T3E3: crc error\n");
251 if (rcv_len > 1600) {
255 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: oversized rx: rdes0 = %08X\n",
256 current_desc->
rdes0);
261 sc->
ether.rx_data[current_read] = m2;
266 skb_reset_mac_header(m);
273 "setting ERROR_MESSAGES->0\n");
286 sc->
ether.rx_ring_current_read = current_read;
293 u32 current_read, current_write;
297 spin_lock(&sc->
ether.tx_lock);
299 current_read = sc->
ether.tx_ring_current_read;
300 current_write = sc->
ether.tx_ring_current_write;
302 while (current_read != current_write) {
303 current_desc = &sc->
ether.tx_ring[current_read];
309 "txeof: tdes0 = %08X tdes1 = %08X\n",
322 current_desc->
tdes0 = 0;
325 current_desc->
tdes2 = 0;
326 sc->
ether.tx_free_cnt++;
334 if (sc->
ether.tx_data[current_read]) {
345 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: transmit jabber timeout\n");
351 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: loss of carrier\n");
356 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: no carrier\n");
362 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: link fail report\n");
368 " transmission underflow error\n");
370 spin_unlock(&sc->
ether.tx_lock);
377 dev_err(&sc->
pdev->dev,
"SBE 2T3E3: transmission deferred\n");
385 sc->
ether.tx_ring_current_read = current_read;
388 if (sc->
ether.tx_full &&
390 sc->
ether.tx_full = 0;
391 netif_wake_queue(sc->
dev);
393 spin_unlock(&sc->
ether.tx_lock);
440 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Framer interrupt! (REG[0x05] = %02X)\n", status);
457 if (sc->
s.
OOF != old_OOF) {
460 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Disabling eth interrupts\n");
465 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Enabling eth interrupts\n");
489 "Framer interrupt T3 RX (REG[0x13] = %02X)\n",
499 "Framer interrupt T3: OOF (%d)\n",
511 "Framer interrupt T3 RX (REG[0x17] = %02X)\n",
518 "Framer interrupt T3 RX (REG[0x18] = %02X)\n",
525 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Framer interrupt T3 TX (REG[0x31] = %02X)\n",
529 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Framer interrupt T3 TX (REG[0x34] = %02X)\n",
544 "Framer interrupt E3 RX (REG[0x14] = %02X)\n",
554 "Framer interrupt E3: OOF (%d)\n",
567 "Framer interrupt E3 RX (REG[0x15] = %02X)\n",
576 dev_dbg(&sc->
pdev->dev,
"SBE 2T3E3: Framer interrupt E3 TX (REG[0x34] = %02X)\n",