51 printk(
"sonic_open: initializing sonic driver.\n");
58 dev_kfree_skb(lp->
rx_skb[i]);
81 dev_kfree_skb(lp->
rx_skb[i]);
96 netif_start_queue(dev);
99 printk(
"sonic_open: Initialization done.\n");
108 static int sonic_close(
struct net_device *dev)
116 netif_stop_queue(dev);
132 dev_kfree_skb(lp->
tx_skb[i]);
144 dev_kfree_skb(lp->
rx_skb[i]);
152 static void sonic_tx_timeout(
struct net_device *dev)
170 dev_kfree_skb(lp->
tx_skb[i]);
176 lp->
stats.tx_errors++;
178 netif_wake_queue(dev);
209 printk(
"sonic_send_packet: skb=%p, dev=%p\n", skb, dev);
257 netif_stop_queue(dev);
259 }
else netif_start_queue(dev);
262 printk(
"sonic_send_packet: issuing Tx command\n");
309 if (td_status & 0x0001) {
310 lp->
stats.tx_packets++;
313 lp->
stats.tx_errors++;
314 if (td_status & 0x0642)
315 lp->
stats.tx_aborted_errors++;
316 if (td_status & 0x0180)
317 lp->
stats.tx_carrier_errors++;
318 if (td_status & 0x0020)
319 lp->
stats.tx_window_errors++;
320 if (td_status & 0x0004)
321 lp->
stats.tx_fifo_errors++;
340 netif_wake_queue(dev);
351 lp->
stats.rx_fifo_errors++;
356 printk(
"%s: rx descriptors exhausted\n", dev->
name);
357 lp->
stats.rx_dropped++;
362 printk(
"%s: rx buffer area exceeded\n", dev->
name);
363 lp->
stats.rx_dropped++;
369 lp->
stats.rx_frame_errors += 65536;
373 lp->
stats.rx_crc_errors += 65536;
377 lp->
stats.rx_missed_errors += 65536;
390 printk(
KERN_ERR "%s: Bus retry occurred! Device interrupt disabled.\n",
426 if (new_skb ==
NULL) {
428 lp->
stats.rx_dropped++;
433 skb_reserve(new_skb, 2);
438 dev_kfree_skb(new_skb);
440 lp->
stats.rx_dropped++;
451 lp->
stats.rx_packets++;
458 bufadr_l = (
unsigned long)new_laddr & 0xffff;
459 bufadr_h = (
unsigned long)new_laddr >> 16;
464 lp->
stats.rx_errors++;
466 lp->
stats.rx_frame_errors++;
468 lp->
stats.rx_crc_errors++;
480 printk(
"%s: rx buffer exhausted\n", dev->
name);
484 printk(
KERN_ERR "%s: rx desc without RCR_LPKT. Shouldn't happen !?\n",
528 static void sonic_multicast_list(
struct net_device *dev)
547 printk(
"sonic_multicast_list: mc_count %d\n",
549 sonic_set_cam_enable(dev, 1);
553 sonic_cda_put(dev, i,
SONIC_CD_CAP0, addr[1] << 8 | addr[0]);
554 sonic_cda_put(dev, i,
SONIC_CD_CAP1, addr[3] << 8 | addr[2]);
555 sonic_cda_put(dev, i,
SONIC_CD_CAP2, addr[5] << 8 | addr[4]);
556 sonic_set_cam_enable(dev, sonic_get_cam_enable(dev) | (1 << i));
567 printk(
"sonic_multicast_list: setting RCR=%x\n", rcr);
601 printk(
"sonic_init: initialize receive resource area\n");
627 printk(
"sonic_init: issuing RRRA command\n");
645 printk(
"sonic_init: initialize receive descriptors\n");
660 lp->
eol_rx = SONIC_NUM_RDS - 1;
669 printk(
"sonic_init: initialize transmit descriptors\n");
687 lp->
eol_tx = SONIC_NUM_TDS - 1;
695 sonic_set_cam_enable(dev, 1);
697 for (i = 0; i < 16; i++)
716 if (sonic_debug > 2) {
717 printk(
"sonic_init: CMD=%x, ISR=%x\n, i=%d",
736 printk(
"sonic_init: new status=%x\n",