aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/a2065.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/a2065.c')
-rw-r--r--drivers/net/a2065.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/drivers/net/a2065.c b/drivers/net/a2065.c
index f4ea62641acd..5f7258fea19d 100644
--- a/drivers/net/a2065.c
+++ b/drivers/net/a2065.c
@@ -93,7 +93,7 @@ struct lance_init_block {
93 unsigned short rx_len; /* receive len and high addr */ 93 unsigned short rx_len; /* receive len and high addr */
94 unsigned short tx_ptr; /* transmit descriptor addr */ 94 unsigned short tx_ptr; /* transmit descriptor addr */
95 unsigned short tx_len; /* transmit len and high addr */ 95 unsigned short tx_len; /* transmit len and high addr */
96 96
97 /* The Tx and Rx ring entries must aligned on 8-byte boundaries. */ 97 /* The Tx and Rx ring entries must aligned on 8-byte boundaries. */
98 struct lance_rx_desc brx_ring[RX_RING_SIZE]; 98 struct lance_rx_desc brx_ring[RX_RING_SIZE];
99 struct lance_tx_desc btx_ring[TX_RING_SIZE]; 99 struct lance_tx_desc btx_ring[TX_RING_SIZE];
@@ -115,7 +115,7 @@ struct lance_private {
115 115
116 int rx_new, tx_new; 116 int rx_new, tx_new;
117 int rx_old, tx_old; 117 int rx_old, tx_old;
118 118
119 int lance_log_rx_bufs, lance_log_tx_bufs; 119 int lance_log_rx_bufs, lance_log_tx_bufs;
120 int rx_ring_mod_mask, tx_ring_mod_mask; 120 int rx_ring_mod_mask, tx_ring_mod_mask;
121 121
@@ -190,7 +190,7 @@ static void lance_init_ring (struct net_device *dev)
190 190
191 if (ZERO) 191 if (ZERO)
192 printk(KERN_DEBUG "TX rings:\n"); 192 printk(KERN_DEBUG "TX rings:\n");
193 193
194 /* Setup the Tx ring entries */ 194 /* Setup the Tx ring entries */
195 for (i = 0; i <= (1<<lp->lance_log_tx_bufs); i++) { 195 for (i = 0; i <= (1<<lp->lance_log_tx_bufs); i++) {
196 leptr = LANCE_ADDR(&aib->tx_buf[i][0]); 196 leptr = LANCE_ADDR(&aib->tx_buf[i][0]);
@@ -219,14 +219,14 @@ static void lance_init_ring (struct net_device *dev)
219 } 219 }
220 220
221 /* Setup the initialization block */ 221 /* Setup the initialization block */
222 222
223 /* Setup rx descriptor pointer */ 223 /* Setup rx descriptor pointer */
224 leptr = LANCE_ADDR(&aib->brx_ring); 224 leptr = LANCE_ADDR(&aib->brx_ring);
225 ib->rx_len = (lp->lance_log_rx_bufs << 13) | (leptr >> 16); 225 ib->rx_len = (lp->lance_log_rx_bufs << 13) | (leptr >> 16);
226 ib->rx_ptr = leptr; 226 ib->rx_ptr = leptr;
227 if (ZERO) 227 if (ZERO)
228 printk(KERN_DEBUG "RX ptr: %8.8x\n", leptr); 228 printk(KERN_DEBUG "RX ptr: %8.8x\n", leptr);
229 229
230 /* Setup tx descriptor pointer */ 230 /* Setup tx descriptor pointer */
231 leptr = LANCE_ADDR(&aib->btx_ring); 231 leptr = LANCE_ADDR(&aib->btx_ring);
232 ib->tx_len = (lp->lance_log_tx_bufs << 13) | (leptr >> 16); 232 ib->tx_len = (lp->lance_log_tx_bufs << 13) | (leptr >> 16);
@@ -286,7 +286,7 @@ static int lance_rx (struct net_device *dev)
286 } 286 }
287 printk ("]\n"); 287 printk ("]\n");
288#endif 288#endif
289 289
290 ll->rdp = LE_C0_RINT|LE_C0_INEA; 290 ll->rdp = LE_C0_RINT|LE_C0_INEA;
291 for (rd = &ib->brx_ring [lp->rx_new]; 291 for (rd = &ib->brx_ring [lp->rx_new];
292 !((bits = rd->rmd1_bits) & LE_R1_OWN); 292 !((bits = rd->rmd1_bits) & LE_R1_OWN);
@@ -319,7 +319,7 @@ static int lance_rx (struct net_device *dev)
319 lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask; 319 lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask;
320 return 0; 320 return 0;
321 } 321 }
322 322
323 skb->dev = dev; 323 skb->dev = dev;
324 skb_reserve (skb, 2); /* 16 byte align */ 324 skb_reserve (skb, 2); /* 16 byte align */
325 skb_put (skb, len); /* make room */ 325 skb_put (skb, len); /* make room */
@@ -361,10 +361,10 @@ static int lance_tx (struct net_device *dev)
361 /* If we hit a packet not owned by us, stop */ 361 /* If we hit a packet not owned by us, stop */
362 if (td->tmd1_bits & LE_T1_OWN) 362 if (td->tmd1_bits & LE_T1_OWN)
363 break; 363 break;
364 364
365 if (td->tmd1_bits & LE_T1_ERR) { 365 if (td->tmd1_bits & LE_T1_ERR) {
366 status = td->misc; 366 status = td->misc;
367 367
368 lp->stats.tx_errors++; 368 lp->stats.tx_errors++;
369 if (status & LE_T3_RTY) lp->stats.tx_aborted_errors++; 369 if (status & LE_T3_RTY) lp->stats.tx_aborted_errors++;
370 if (status & LE_T3_LCOL) lp->stats.tx_window_errors++; 370 if (status & LE_T3_LCOL) lp->stats.tx_window_errors++;
@@ -417,7 +417,7 @@ static int lance_tx (struct net_device *dev)
417 417
418 lp->stats.tx_packets++; 418 lp->stats.tx_packets++;
419 } 419 }
420 420
421 j = (j + 1) & lp->tx_ring_mod_mask; 421 j = (j + 1) & lp->tx_ring_mod_mask;
422 } 422 }
423 lp->tx_old = j; 423 lp->tx_old = j;
@@ -452,7 +452,7 @@ lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
452 /* Clear the error condition */ 452 /* Clear the error condition */
453 ll->rdp = LE_C0_BABL|LE_C0_ERR|LE_C0_MISS|LE_C0_INEA; 453 ll->rdp = LE_C0_BABL|LE_C0_ERR|LE_C0_MISS|LE_C0_INEA;
454 } 454 }
455 455
456 if (csr0 & LE_C0_RINT) 456 if (csr0 & LE_C0_RINT)
457 lance_rx (dev); 457 lance_rx (dev);
458 458
@@ -528,7 +528,7 @@ static inline int lance_reset (struct net_device *dev)
528 struct lance_private *lp = netdev_priv(dev); 528 struct lance_private *lp = netdev_priv(dev);
529 volatile struct lance_regs *ll = lp->ll; 529 volatile struct lance_regs *ll = lp->ll;
530 int status; 530 int status;
531 531
532 /* Stop the lance */ 532 /* Stop the lance */
533 ll->rap = LE_CSR0; 533 ll->rap = LE_CSR0;
534 ll->rdp = LE_C0_STOP; 534 ll->rdp = LE_C0_STOP;
@@ -569,7 +569,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
569 569
570 skblen = skb->len; 570 skblen = skb->len;
571 len = skblen; 571 len = skblen;
572 572
573 if (len < ETH_ZLEN) { 573 if (len < ETH_ZLEN) {
574 len = ETH_ZLEN; 574 len = ETH_ZLEN;
575 if (skb_padto(skb, ETH_ZLEN)) 575 if (skb_padto(skb, ETH_ZLEN))
@@ -587,7 +587,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
587 /* dump the packet */ 587 /* dump the packet */
588 { 588 {
589 int i; 589 int i;
590 590
591 for (i = 0; i < 64; i++) { 591 for (i = 0; i < 64; i++) {
592 if ((i % 16) == 0) 592 if ((i % 16) == 0)
593 printk("\n" KERN_DEBUG); 593 printk("\n" KERN_DEBUG);
@@ -599,13 +599,13 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
599 entry = lp->tx_new & lp->tx_ring_mod_mask; 599 entry = lp->tx_new & lp->tx_ring_mod_mask;
600 ib->btx_ring [entry].length = (-len) | 0xf000; 600 ib->btx_ring [entry].length = (-len) | 0xf000;
601 ib->btx_ring [entry].misc = 0; 601 ib->btx_ring [entry].misc = 0;
602 602
603 memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen); 603 memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
604 604
605 /* Clear the slack of the packet, do I need this? */ 605 /* Clear the slack of the packet, do I need this? */
606 if (len != skblen) 606 if (len != skblen)
607 memset ((char *) &ib->tx_buf [entry][skblen], 0, len - skblen); 607 memset ((char *) &ib->tx_buf [entry][skblen], 0, len - skblen);
608 608
609 /* Now, give the packet to the lance */ 609 /* Now, give the packet to the lance */
610 ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN); 610 ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
611 lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask; 611 lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
@@ -619,7 +619,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
619 ll->rdp = LE_C0_INEA | LE_C0_TDMD; 619 ll->rdp = LE_C0_INEA | LE_C0_TDMD;
620 dev->trans_start = jiffies; 620 dev->trans_start = jiffies;
621 dev_kfree_skb (skb); 621 dev_kfree_skb (skb);
622 622
623 local_irq_restore(flags); 623 local_irq_restore(flags);
624 624
625 return status; 625 return status;
@@ -642,9 +642,9 @@ static void lance_load_multicast (struct net_device *dev)
642 char *addrs; 642 char *addrs;
643 int i; 643 int i;
644 u32 crc; 644 u32 crc;
645 645
646 /* set all multicast bits */ 646 /* set all multicast bits */
647 if (dev->flags & IFF_ALLMULTI){ 647 if (dev->flags & IFF_ALLMULTI){
648 ib->filter [0] = 0xffffffff; 648 ib->filter [0] = 0xffffffff;
649 ib->filter [1] = 0xffffffff; 649 ib->filter [1] = 0xffffffff;
650 return; 650 return;
@@ -661,7 +661,7 @@ static void lance_load_multicast (struct net_device *dev)
661 /* multicast address? */ 661 /* multicast address? */
662 if (!(*addrs & 1)) 662 if (!(*addrs & 1))
663 continue; 663 continue;
664 664
665 crc = ether_crc_le(6, addrs); 665 crc = ether_crc_le(6, addrs);
666 crc = crc >> 26; 666 crc = crc >> 26;
667 mcast_table [crc >> 4] |= 1 << (crc & 0xf); 667 mcast_table [crc >> 4] |= 1 << (crc & 0xf);