diff options
author | Jeff Garzik <jeff@garzik.org> | 2006-09-13 13:24:59 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-13 13:24:59 -0400 |
commit | 6aa20a2235535605db6d6d2bd850298b2fe7f31e (patch) | |
tree | df0b855043407b831d57f2f2c271f8aab48444f4 /drivers/net/gt96100eth.c | |
parent | 7a291083225af6e22ffaa46b3d91cfc1a1ccaab4 (diff) |
drivers/net: Trim trailing whitespace
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/gt96100eth.c')
-rw-r--r-- | drivers/net/gt96100eth.c | 170 |
1 files changed, 85 insertions, 85 deletions
diff --git a/drivers/net/gt96100eth.c b/drivers/net/gt96100eth.c index 2b4db7414475..5a6d830754da 100644 --- a/drivers/net/gt96100eth.c +++ b/drivers/net/gt96100eth.c | |||
@@ -17,9 +17,9 @@ | |||
17 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. | 17 | * 59 Temple Place - Suite 330, Boston MA 02111-1307, USA. |
18 | * | 18 | * |
19 | * Ethernet driver for the MIPS GT96100 Advanced Communication Controller. | 19 | * Ethernet driver for the MIPS GT96100 Advanced Communication Controller. |
20 | * | 20 | * |
21 | * Revision history | 21 | * Revision history |
22 | * | 22 | * |
23 | * 11.11.2001 Moved to 2.4.14, ppopov@mvista.com. Modified driver to add | 23 | * 11.11.2001 Moved to 2.4.14, ppopov@mvista.com. Modified driver to add |
24 | * proper gt96100A support. | 24 | * proper gt96100A support. |
25 | * 12.05.2001 Moved eth port 0 to irq 3 (mapped to GT_SERINT0 on EV96100A) | 25 | * 12.05.2001 Moved eth port 0 to irq 3 (mapped to GT_SERINT0 on EV96100A) |
@@ -160,9 +160,9 @@ chip_name(int chip_rev) | |||
160 | static void * dmaalloc(size_t size, dma_addr_t *dma_handle) | 160 | static void * dmaalloc(size_t size, dma_addr_t *dma_handle) |
161 | { | 161 | { |
162 | void *ret; | 162 | void *ret; |
163 | 163 | ||
164 | ret = (void *)__get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(size)); | 164 | ret = (void *)__get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(size)); |
165 | 165 | ||
166 | if (ret != NULL) { | 166 | if (ret != NULL) { |
167 | dma_cache_inv((unsigned long)ret, size); | 167 | dma_cache_inv((unsigned long)ret, size); |
168 | if (dma_handle != NULL) | 168 | if (dma_handle != NULL) |
@@ -194,7 +194,7 @@ parse_mac_addr(struct net_device *dev, char* macstr) | |||
194 | { | 194 | { |
195 | int i, j; | 195 | int i, j; |
196 | unsigned char result, value; | 196 | unsigned char result, value; |
197 | 197 | ||
198 | for (i=0; i<6; i++) { | 198 | for (i=0; i<6; i++) { |
199 | result = 0; | 199 | result = 0; |
200 | if (i != 5 && *(macstr+2) != '.') { | 200 | if (i != 5 && *(macstr+2) != '.') { |
@@ -202,10 +202,10 @@ parse_mac_addr(struct net_device *dev, char* macstr) | |||
202 | i, *(macstr+2)); | 202 | i, *(macstr+2)); |
203 | return -EINVAL; | 203 | return -EINVAL; |
204 | } | 204 | } |
205 | 205 | ||
206 | for (j=0; j<2; j++) { | 206 | for (j=0; j<2; j++) { |
207 | if (isxdigit(*macstr) && | 207 | if (isxdigit(*macstr) && |
208 | (value = isdigit(*macstr) ? *macstr-'0' : | 208 | (value = isdigit(*macstr) ? *macstr-'0' : |
209 | toupper(*macstr)-'A'+10) < 16) { | 209 | toupper(*macstr)-'A'+10) < 16) { |
210 | result = result*16 + value; | 210 | result = result*16 + value; |
211 | macstr++; | 211 | macstr++; |
@@ -241,7 +241,7 @@ read_MII(int phy_addr, u32 reg) | |||
241 | return -ENODEV; | 241 | return -ENODEV; |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | GT96100_WRITE(GT96100_ETH_SMI_REG, smir); | 245 | GT96100_WRITE(GT96100_ETH_SMI_REG, smir); |
246 | 246 | ||
247 | timedout = 20; | 247 | timedout = 20; |
@@ -249,7 +249,7 @@ read_MII(int phy_addr, u32 reg) | |||
249 | while (!((smir = GT96100_READ(GT96100_ETH_SMI_REG)) & smirReadValid)) { | 249 | while (!((smir = GT96100_READ(GT96100_ETH_SMI_REG)) & smirReadValid)) { |
250 | // snooze for 1 msec and check again | 250 | // snooze for 1 msec and check again |
251 | gt96100_delay(1); | 251 | gt96100_delay(1); |
252 | 252 | ||
253 | if (--timedout == 0) { | 253 | if (--timedout == 0) { |
254 | printk(KERN_ERR "%s: timeout!!\n", __FUNCTION__); | 254 | printk(KERN_ERR "%s: timeout!!\n", __FUNCTION__); |
255 | return -ENODEV; | 255 | return -ENODEV; |
@@ -301,7 +301,7 @@ write_MII(int phy_addr, u32 reg, u16 data) | |||
301 | while (GT96100_READ(GT96100_ETH_SMI_REG) & smirBusy) { | 301 | while (GT96100_READ(GT96100_ETH_SMI_REG) & smirBusy) { |
302 | // snooze for 1 msec and check again | 302 | // snooze for 1 msec and check again |
303 | gt96100_delay(1); | 303 | gt96100_delay(1); |
304 | 304 | ||
305 | if (--timedout == 0) { | 305 | if (--timedout == 0) { |
306 | printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__); | 306 | printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__); |
307 | return -1; | 307 | return -1; |
@@ -317,7 +317,7 @@ dump_MII(int dbg_lvl, struct net_device *dev) | |||
317 | { | 317 | { |
318 | int i, val; | 318 | int i, val; |
319 | struct gt96100_private *gp = netdev_priv(dev); | 319 | struct gt96100_private *gp = netdev_priv(dev); |
320 | 320 | ||
321 | if (dbg_lvl <= GT96100_DEBUG) { | 321 | if (dbg_lvl <= GT96100_DEBUG) { |
322 | for (i=0; i<7; i++) { | 322 | for (i=0; i<7; i++) { |
323 | if ((val = read_MII(gp->phy_addr, i)) >= 0) | 323 | if ((val = read_MII(gp->phy_addr, i)) >= 0) |
@@ -336,7 +336,7 @@ dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx, | |||
336 | { | 336 | { |
337 | int i; | 337 | int i; |
338 | char buf[100], octet[5]; | 338 | char buf[100], octet[5]; |
339 | 339 | ||
340 | if (dbg_lvl <= GT96100_DEBUG) { | 340 | if (dbg_lvl <= GT96100_DEBUG) { |
341 | sprintf(buf, pfx, func); | 341 | sprintf(buf, pfx, func); |
342 | for (i = 0; i < 6; i++) { | 342 | for (i = 0; i < 6; i++) { |
@@ -354,13 +354,13 @@ dump_skb(int dbg_lvl, struct net_device *dev, struct sk_buff *skb) | |||
354 | { | 354 | { |
355 | int i; | 355 | int i; |
356 | unsigned char* skbdata; | 356 | unsigned char* skbdata; |
357 | 357 | ||
358 | if (dbg_lvl <= GT96100_DEBUG) { | 358 | if (dbg_lvl <= GT96100_DEBUG) { |
359 | dbg(dbg_lvl, "%s: skb=%p, skb->data=%p, skb->len=%d\n", | 359 | dbg(dbg_lvl, "%s: skb=%p, skb->data=%p, skb->len=%d\n", |
360 | __FUNCTION__, skb, skb->data, skb->len); | 360 | __FUNCTION__, skb, skb->data, skb->len); |
361 | 361 | ||
362 | skbdata = (unsigned char*)KSEG1ADDR(skb->data); | 362 | skbdata = (unsigned char*)KSEG1ADDR(skb->data); |
363 | 363 | ||
364 | for (i=0; i<skb->len; i++) { | 364 | for (i=0; i<skb->len; i++) { |
365 | if (!(i % 16)) | 365 | if (!(i % 16)) |
366 | printk(KERN_DEBUG "\n %3.3x: %2.2x,", | 366 | printk(KERN_DEBUG "\n %3.3x: %2.2x,", |
@@ -406,7 +406,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr) | |||
406 | } | 406 | } |
407 | 407 | ||
408 | dump_hw_addr(3, dev, "%s: nib swap/invt addr=", __FUNCTION__, hash_ea); | 408 | dump_hw_addr(3, dev, "%s: nib swap/invt addr=", __FUNCTION__, hash_ea); |
409 | 409 | ||
410 | if (gp->hash_mode == 0) { | 410 | if (gp->hash_mode == 0) { |
411 | hashResult = ((u16)hash_ea[0] & 0xfc) << 7; | 411 | hashResult = ((u16)hash_ea[0] & 0xfc) << 7; |
412 | stmp = ((u16)hash_ea[0] & 0x03) | | 412 | stmp = ((u16)hash_ea[0] & 0x03) | |
@@ -423,7 +423,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr) | |||
423 | 423 | ||
424 | tblEntryAddr = | 424 | tblEntryAddr = |
425 | (u32 *)(&gp->hash_table[((u32)hashResult & 0x7ff) << 3]); | 425 | (u32 *)(&gp->hash_table[((u32)hashResult & 0x7ff) << 3]); |
426 | 426 | ||
427 | dbg(3, "%s: tblEntryAddr=%p\n", tblEntryAddr, __FUNCTION__); | 427 | dbg(3, "%s: tblEntryAddr=%p\n", tblEntryAddr, __FUNCTION__); |
428 | 428 | ||
429 | for (i=0; i<HASH_HOP_NUMBER; i++) { | 429 | for (i=0; i<HASH_HOP_NUMBER; i++) { |
@@ -431,7 +431,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr) | |||
431 | !(*tblEntryAddr & hteSkip)) { | 431 | !(*tblEntryAddr & hteSkip)) { |
432 | // This entry is already occupied, go to next entry | 432 | // This entry is already occupied, go to next entry |
433 | tblEntryAddr += 2; | 433 | tblEntryAddr += 2; |
434 | dbg(3, "%s: skipping to %p\n", __FUNCTION__, | 434 | dbg(3, "%s: skipping to %p\n", __FUNCTION__, |
435 | tblEntryAddr); | 435 | tblEntryAddr); |
436 | } else { | 436 | } else { |
437 | memset(tblEntryAddr, 0, 8); | 437 | memset(tblEntryAddr, 0, 8); |
@@ -455,7 +455,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr) | |||
455 | } | 455 | } |
456 | 456 | ||
457 | #endif | 457 | #endif |
458 | 458 | ||
459 | return 0; | 459 | return 0; |
460 | } | 460 | } |
461 | 461 | ||
@@ -465,7 +465,7 @@ read_mib_counters(struct gt96100_private *gp) | |||
465 | { | 465 | { |
466 | u32* mib_regs = (u32*)&gp->mib; | 466 | u32* mib_regs = (u32*)&gp->mib; |
467 | int i; | 467 | int i; |
468 | 468 | ||
469 | for (i=0; i<sizeof(mib_counters_t)/sizeof(u32); i++) | 469 | for (i=0; i<sizeof(mib_counters_t)/sizeof(u32); i++) |
470 | mib_regs[i] = GT96100ETH_READ(gp, GT96100_ETH_MIB_COUNT_BASE + | 470 | mib_regs[i] = GT96100ETH_READ(gp, GT96100_ETH_MIB_COUNT_BASE + |
471 | i*sizeof(u32)); | 471 | i*sizeof(u32)); |
@@ -477,9 +477,9 @@ update_stats(struct gt96100_private *gp) | |||
477 | { | 477 | { |
478 | mib_counters_t *mib = &gp->mib; | 478 | mib_counters_t *mib = &gp->mib; |
479 | struct net_device_stats *stats = &gp->stats; | 479 | struct net_device_stats *stats = &gp->stats; |
480 | 480 | ||
481 | read_mib_counters(gp); | 481 | read_mib_counters(gp); |
482 | 482 | ||
483 | stats->rx_packets = mib->totalFramesReceived; | 483 | stats->rx_packets = mib->totalFramesReceived; |
484 | stats->tx_packets = mib->framesSent; | 484 | stats->tx_packets = mib->framesSent; |
485 | stats->rx_bytes = mib->totalByteReceived; | 485 | stats->rx_bytes = mib->totalByteReceived; |
@@ -512,7 +512,7 @@ abort(struct net_device *dev, u32 abort_bits) | |||
512 | 512 | ||
513 | // make sure only the Rx/Tx abort bits are set | 513 | // make sure only the Rx/Tx abort bits are set |
514 | abort_bits &= (sdcmrAR | sdcmrAT); | 514 | abort_bits &= (sdcmrAR | sdcmrAT); |
515 | 515 | ||
516 | spin_lock(&gp->lock); | 516 | spin_lock(&gp->lock); |
517 | 517 | ||
518 | // abort any Rx/Tx DMA immediately | 518 | // abort any Rx/Tx DMA immediately |
@@ -525,7 +525,7 @@ abort(struct net_device *dev, u32 abort_bits) | |||
525 | while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) { | 525 | while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) { |
526 | // snooze for 1 msec and check again | 526 | // snooze for 1 msec and check again |
527 | gt96100_delay(1); | 527 | gt96100_delay(1); |
528 | 528 | ||
529 | if (--timedout == 0) { | 529 | if (--timedout == 0) { |
530 | err("%s: timeout!!\n", __FUNCTION__); | 530 | err("%s: timeout!!\n", __FUNCTION__); |
531 | break; | 531 | break; |
@@ -563,7 +563,7 @@ enable_ether_irq(struct net_device *dev) | |||
563 | */ | 563 | */ |
564 | int intr_mask_reg = (gp->port_num == 0) ? | 564 | int intr_mask_reg = (gp->port_num == 0) ? |
565 | GT96100_SERINT0_MASK : GT96100_INT0_HIGH_MASK; | 565 | GT96100_SERINT0_MASK : GT96100_INT0_HIGH_MASK; |
566 | 566 | ||
567 | if (gp->chip_rev >= REV_GT96100A_1) { | 567 | if (gp->chip_rev >= REV_GT96100A_1) { |
568 | intMask = icrTxBufferLow | icrTxEndLow | | 568 | intMask = icrTxBufferLow | icrTxEndLow | |
569 | icrTxErrorLow | icrRxOVR | icrTxUdr | | 569 | icrTxErrorLow | icrRxOVR | icrTxUdr | |
@@ -576,10 +576,10 @@ enable_ether_irq(struct net_device *dev) | |||
576 | icrRxBuffer | icrRxError | | 576 | icrRxBuffer | icrRxError | |
577 | icrMIIPhySTC | icrEtherIntSum; | 577 | icrMIIPhySTC | icrEtherIntSum; |
578 | } | 578 | } |
579 | 579 | ||
580 | // unmask interrupts | 580 | // unmask interrupts |
581 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, intMask); | 581 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, intMask); |
582 | 582 | ||
583 | intMask = GT96100_READ(intr_mask_reg); | 583 | intMask = GT96100_READ(intr_mask_reg); |
584 | intMask |= 1<<gp->port_num; | 584 | intMask |= 1<<gp->port_num; |
585 | GT96100_WRITE(intr_mask_reg, intMask); | 585 | GT96100_WRITE(intr_mask_reg, intMask); |
@@ -596,7 +596,7 @@ disable_ether_irq(struct net_device *dev) | |||
596 | intMask = GT96100_READ(intr_mask_reg); | 596 | intMask = GT96100_READ(intr_mask_reg); |
597 | intMask &= ~(1<<gp->port_num); | 597 | intMask &= ~(1<<gp->port_num); |
598 | GT96100_WRITE(intr_mask_reg, intMask); | 598 | GT96100_WRITE(intr_mask_reg, intMask); |
599 | 599 | ||
600 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, 0); | 600 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, 0); |
601 | } | 601 | } |
602 | 602 | ||
@@ -643,13 +643,13 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
643 | int retval; | 643 | int retval; |
644 | unsigned char chip_rev; | 644 | unsigned char chip_rev; |
645 | struct net_device *dev = NULL; | 645 | struct net_device *dev = NULL; |
646 | 646 | ||
647 | if (gtif->irq < 0) { | 647 | if (gtif->irq < 0) { |
648 | printk(KERN_ERR "%s: irq unknown - probing not supported\n", | 648 | printk(KERN_ERR "%s: irq unknown - probing not supported\n", |
649 | __FUNCTION__); | 649 | __FUNCTION__); |
650 | return -ENODEV; | 650 | return -ENODEV; |
651 | } | 651 | } |
652 | 652 | ||
653 | pci_read_config_byte(pci, PCI_REVISION_ID, &chip_rev); | 653 | pci_read_config_byte(pci, PCI_REVISION_ID, &chip_rev); |
654 | 654 | ||
655 | if (chip_rev >= REV_GT96100A_1) { | 655 | if (chip_rev >= REV_GT96100A_1) { |
@@ -665,14 +665,14 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
665 | phyAD |= phy_addr << (port_num*5); | 665 | phyAD |= phy_addr << (port_num*5); |
666 | GT96100_WRITE(GT96100_ETH_PHY_ADDR_REG, phyAD); | 666 | GT96100_WRITE(GT96100_ETH_PHY_ADDR_REG, phyAD); |
667 | } | 667 | } |
668 | 668 | ||
669 | // probe for the external PHY | 669 | // probe for the external PHY |
670 | if ((phy_id1 = read_MII(phy_addr, 2)) <= 0 || | 670 | if ((phy_id1 = read_MII(phy_addr, 2)) <= 0 || |
671 | (phy_id2 = read_MII(phy_addr, 3)) <= 0) { | 671 | (phy_id2 = read_MII(phy_addr, 3)) <= 0) { |
672 | printk(KERN_ERR "%s: no PHY found on MII%d\n", __FUNCTION__, port_num); | 672 | printk(KERN_ERR "%s: no PHY found on MII%d\n", __FUNCTION__, port_num); |
673 | return -ENODEV; | 673 | return -ENODEV; |
674 | } | 674 | } |
675 | 675 | ||
676 | if (!request_region(gtif->iobase, GT96100_ETH_IO_SIZE, "GT96100ETH")) { | 676 | if (!request_region(gtif->iobase, GT96100_ETH_IO_SIZE, "GT96100ETH")) { |
677 | printk(KERN_ERR "%s: request_region failed\n", __FUNCTION__); | 677 | printk(KERN_ERR "%s: request_region failed\n", __FUNCTION__); |
678 | return -EBUSY; | 678 | return -EBUSY; |
@@ -682,7 +682,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
682 | if (!dev) | 682 | if (!dev) |
683 | goto out; | 683 | goto out; |
684 | gtif->dev = dev; | 684 | gtif->dev = dev; |
685 | 685 | ||
686 | /* private struct aligned and zeroed by alloc_etherdev */ | 686 | /* private struct aligned and zeroed by alloc_etherdev */ |
687 | /* Fill in the 'dev' fields. */ | 687 | /* Fill in the 'dev' fields. */ |
688 | dev->base_addr = gtif->iobase; | 688 | dev->base_addr = gtif->iobase; |
@@ -720,12 +720,12 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
720 | retval = -ENOMEM; | 720 | retval = -ENOMEM; |
721 | goto out1; | 721 | goto out1; |
722 | } | 722 | } |
723 | 723 | ||
724 | gp->tx_ring = (gt96100_td_t *)(gp->rx_ring + RX_RING_SIZE); | 724 | gp->tx_ring = (gt96100_td_t *)(gp->rx_ring + RX_RING_SIZE); |
725 | gp->tx_ring_dma = | 725 | gp->tx_ring_dma = |
726 | gp->rx_ring_dma + sizeof(gt96100_rd_t) * RX_RING_SIZE; | 726 | gp->rx_ring_dma + sizeof(gt96100_rd_t) * RX_RING_SIZE; |
727 | } | 727 | } |
728 | 728 | ||
729 | // Allocate the Rx Data Buffers | 729 | // Allocate the Rx Data Buffers |
730 | if (gp->rx_buff == NULL) { | 730 | if (gp->rx_buff == NULL) { |
731 | gp->rx_buff = dmaalloc(PKT_BUF_SZ*RX_RING_SIZE, | 731 | gp->rx_buff = dmaalloc(PKT_BUF_SZ*RX_RING_SIZE, |
@@ -735,7 +735,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
735 | goto out2; | 735 | goto out2; |
736 | } | 736 | } |
737 | } | 737 | } |
738 | 738 | ||
739 | dbg(3, "%s: rx_ring=%p, tx_ring=%p\n", __FUNCTION__, | 739 | dbg(3, "%s: rx_ring=%p, tx_ring=%p\n", __FUNCTION__, |
740 | gp->rx_ring, gp->tx_ring); | 740 | gp->rx_ring, gp->tx_ring); |
741 | 741 | ||
@@ -748,11 +748,11 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num) | |||
748 | goto out3; | 748 | goto out3; |
749 | } | 749 | } |
750 | } | 750 | } |
751 | 751 | ||
752 | dbg(3, "%s: hash=%p\n", __FUNCTION__, gp->hash_table); | 752 | dbg(3, "%s: hash=%p\n", __FUNCTION__, gp->hash_table); |
753 | 753 | ||
754 | spin_lock_init(&gp->lock); | 754 | spin_lock_init(&gp->lock); |
755 | 755 | ||
756 | dev->open = gt96100_open; | 756 | dev->open = gt96100_open; |
757 | dev->hard_start_xmit = gt96100_tx; | 757 | dev->hard_start_xmit = gt96100_tx; |
758 | dev->stop = gt96100_close; | 758 | dev->stop = gt96100_close; |
@@ -812,7 +812,7 @@ reset_tx(struct net_device *dev) | |||
812 | } | 812 | } |
813 | /* Wrap the ring. */ | 813 | /* Wrap the ring. */ |
814 | gp->tx_ring[i-1].next = cpu_to_dma32(gp->tx_ring_dma); | 814 | gp->tx_ring[i-1].next = cpu_to_dma32(gp->tx_ring_dma); |
815 | 815 | ||
816 | // setup only the lowest priority TxCDP reg | 816 | // setup only the lowest priority TxCDP reg |
817 | GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR0, gp->tx_ring_dma); | 817 | GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR0, gp->tx_ring_dma); |
818 | GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR1, 0); | 818 | GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR1, 0); |
@@ -830,7 +830,7 @@ reset_rx(struct net_device *dev) | |||
830 | int i; | 830 | int i; |
831 | 831 | ||
832 | abort(dev, sdcmrAR); | 832 | abort(dev, sdcmrAR); |
833 | 833 | ||
834 | for (i=0; i<RX_RING_SIZE; i++) { | 834 | for (i=0; i<RX_RING_SIZE; i++) { |
835 | gp->rx_ring[i].next = | 835 | gp->rx_ring[i].next = |
836 | cpu_to_dma32(gp->rx_ring_dma + | 836 | cpu_to_dma32(gp->rx_ring_dma + |
@@ -876,7 +876,7 @@ gt96100_check_tx_consistent(struct gt96100_private *gp) | |||
876 | 876 | ||
877 | diff = diff<0 ? TX_RING_SIZE + diff : diff; | 877 | diff = diff<0 ? TX_RING_SIZE + diff : diff; |
878 | diff = gp->tx_count == TX_RING_SIZE ? diff + TX_RING_SIZE : diff; | 878 | diff = gp->tx_count == TX_RING_SIZE ? diff + TX_RING_SIZE : diff; |
879 | 879 | ||
880 | return (diff != gp->tx_count); | 880 | return (diff != gp->tx_count); |
881 | } | 881 | } |
882 | 882 | ||
@@ -886,16 +886,16 @@ gt96100_init(struct net_device *dev) | |||
886 | struct gt96100_private *gp = netdev_priv(dev); | 886 | struct gt96100_private *gp = netdev_priv(dev); |
887 | u32 tmp; | 887 | u32 tmp; |
888 | u16 mii_reg; | 888 | u16 mii_reg; |
889 | 889 | ||
890 | dbg(3, "%s: dev=%p\n", __FUNCTION__, dev); | 890 | dbg(3, "%s: dev=%p\n", __FUNCTION__, dev); |
891 | dbg(3, "%s: scs10_lo=%4x, scs10_hi=%4x\n", __FUNCTION__, | 891 | dbg(3, "%s: scs10_lo=%4x, scs10_hi=%4x\n", __FUNCTION__, |
892 | GT96100_READ(0x8), GT96100_READ(0x10)); | 892 | GT96100_READ(0x8), GT96100_READ(0x10)); |
893 | dbg(3, "%s: scs32_lo=%4x, scs32_hi=%4x\n", __FUNCTION__, | 893 | dbg(3, "%s: scs32_lo=%4x, scs32_hi=%4x\n", __FUNCTION__, |
894 | GT96100_READ(0x18), GT96100_READ(0x20)); | 894 | GT96100_READ(0x18), GT96100_READ(0x20)); |
895 | 895 | ||
896 | // Stop and disable Port | 896 | // Stop and disable Port |
897 | hard_stop(dev); | 897 | hard_stop(dev); |
898 | 898 | ||
899 | // Setup CIU Arbiter | 899 | // Setup CIU Arbiter |
900 | tmp = GT96100_READ(GT96100_CIU_ARBITER_CONFIG); | 900 | tmp = GT96100_READ(GT96100_CIU_ARBITER_CONFIG); |
901 | tmp |= (0x0c << (gp->port_num*2)); // set Ether DMA req priority to hi | 901 | tmp |= (0x0c << (gp->port_num*2)); // set Ether DMA req priority to hi |
@@ -905,7 +905,7 @@ gt96100_init(struct net_device *dev) | |||
905 | tmp |= (1<<31); | 905 | tmp |= (1<<31); |
906 | #endif | 906 | #endif |
907 | GT96100_WRITE(GT96100_CIU_ARBITER_CONFIG, tmp); | 907 | GT96100_WRITE(GT96100_CIU_ARBITER_CONFIG, tmp); |
908 | dbg(3, "%s: CIU Config=%x/%x\n", __FUNCTION__, | 908 | dbg(3, "%s: CIU Config=%x/%x\n", __FUNCTION__, |
909 | tmp, GT96100_READ(GT96100_CIU_ARBITER_CONFIG)); | 909 | tmp, GT96100_READ(GT96100_CIU_ARBITER_CONFIG)); |
910 | 910 | ||
911 | // Set routing. | 911 | // Set routing. |
@@ -917,7 +917,7 @@ gt96100_init(struct net_device *dev) | |||
917 | tmp = GT96100_READ(GT96100_GPP_CONFIG2); | 917 | tmp = GT96100_READ(GT96100_GPP_CONFIG2); |
918 | tmp |= 0x7fff << (gp->port_num*16); | 918 | tmp |= 0x7fff << (gp->port_num*16); |
919 | GT96100_WRITE(GT96100_GPP_CONFIG2, tmp); | 919 | GT96100_WRITE(GT96100_GPP_CONFIG2, tmp); |
920 | 920 | ||
921 | /* Set up MII port pin directions */ | 921 | /* Set up MII port pin directions */ |
922 | tmp = GT96100_READ(GT96100_GPP_IO2); | 922 | tmp = GT96100_READ(GT96100_GPP_IO2); |
923 | tmp |= 0x003d << (gp->port_num*16); | 923 | tmp |= 0x003d << (gp->port_num*16); |
@@ -953,7 +953,7 @@ gt96100_init(struct net_device *dev) | |||
953 | mii_reg = read_MII(gp->phy_addr, 0x11); /* int enable register */ | 953 | mii_reg = read_MII(gp->phy_addr, 0x11); /* int enable register */ |
954 | mii_reg |= 2; /* enable mii interrupt */ | 954 | mii_reg |= 2; /* enable mii interrupt */ |
955 | write_MII(gp->phy_addr, 0x11, mii_reg); | 955 | write_MII(gp->phy_addr, 0x11, mii_reg); |
956 | 956 | ||
957 | dbg(3, "%s: PhyAD=%x\n", __FUNCTION__, | 957 | dbg(3, "%s: PhyAD=%x\n", __FUNCTION__, |
958 | GT96100_READ(GT96100_ETH_PHY_ADDR_REG)); | 958 | GT96100_READ(GT96100_ETH_PHY_ADDR_REG)); |
959 | 959 | ||
@@ -976,12 +976,12 @@ gt96100_init(struct net_device *dev) | |||
976 | GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD); | 976 | GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD); |
977 | dbg(3, "%s: SDMA Comm=%x\n", __FUNCTION__, | 977 | dbg(3, "%s: SDMA Comm=%x\n", __FUNCTION__, |
978 | GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM)); | 978 | GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM)); |
979 | 979 | ||
980 | // enable this port (set hash size to 1/2K) | 980 | // enable this port (set hash size to 1/2K) |
981 | GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG, pcrEN | pcrHS); | 981 | GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG, pcrEN | pcrHS); |
982 | dbg(3, "%s: Port Config=%x\n", __FUNCTION__, | 982 | dbg(3, "%s: Port Config=%x\n", __FUNCTION__, |
983 | GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG)); | 983 | GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG)); |
984 | 984 | ||
985 | /* | 985 | /* |
986 | * Disable all Type-of-Service queueing. All Rx packets will be | 986 | * Disable all Type-of-Service queueing. All Rx packets will be |
987 | * treated normally and will be sent to the lowest priority | 987 | * treated normally and will be sent to the lowest priority |
@@ -998,7 +998,7 @@ gt96100_init(struct net_device *dev) | |||
998 | GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG_EXT, | 998 | GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG_EXT, |
999 | pcxrFCTL | pcxrFCTLen | pcxrFLP | | 999 | pcxrFCTL | pcxrFCTLen | pcxrFLP | |
1000 | pcxrPRIOrxOverride | pcxrMIBclrMode); | 1000 | pcxrPRIOrxOverride | pcxrMIBclrMode); |
1001 | 1001 | ||
1002 | dbg(3, "%s: Port Config Ext=%x\n", __FUNCTION__, | 1002 | dbg(3, "%s: Port Config Ext=%x\n", __FUNCTION__, |
1003 | GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG_EXT)); | 1003 | GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG_EXT)); |
1004 | 1004 | ||
@@ -1018,7 +1018,7 @@ static int | |||
1018 | gt96100_open(struct net_device *dev) | 1018 | gt96100_open(struct net_device *dev) |
1019 | { | 1019 | { |
1020 | int retval; | 1020 | int retval; |
1021 | 1021 | ||
1022 | dbg(2, "%s: dev=%p\n", __FUNCTION__, dev); | 1022 | dbg(2, "%s: dev=%p\n", __FUNCTION__, dev); |
1023 | 1023 | ||
1024 | // Initialize and startup the GT-96100 ethernet port | 1024 | // Initialize and startup the GT-96100 ethernet port |
@@ -1033,7 +1033,7 @@ gt96100_open(struct net_device *dev) | |||
1033 | err("unable to get IRQ %d\n", dev->irq); | 1033 | err("unable to get IRQ %d\n", dev->irq); |
1034 | return retval; | 1034 | return retval; |
1035 | } | 1035 | } |
1036 | 1036 | ||
1037 | dbg(2, "%s: Initialization done.\n", __FUNCTION__); | 1037 | dbg(2, "%s: Initialization done.\n", __FUNCTION__); |
1038 | 1038 | ||
1039 | return 0; | 1039 | return 0; |
@@ -1051,7 +1051,7 @@ gt96100_close(struct net_device *dev) | |||
1051 | } | 1051 | } |
1052 | 1052 | ||
1053 | free_irq(dev->irq, dev); | 1053 | free_irq(dev->irq, dev); |
1054 | 1054 | ||
1055 | return 0; | 1055 | return 0; |
1056 | } | 1056 | } |
1057 | 1057 | ||
@@ -1068,21 +1068,21 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev) | |||
1068 | nextIn = gp->tx_next_in; | 1068 | nextIn = gp->tx_next_in; |
1069 | 1069 | ||
1070 | dbg(3, "%s: nextIn=%d\n", __FUNCTION__, nextIn); | 1070 | dbg(3, "%s: nextIn=%d\n", __FUNCTION__, nextIn); |
1071 | 1071 | ||
1072 | if (gp->tx_count >= TX_RING_SIZE) { | 1072 | if (gp->tx_count >= TX_RING_SIZE) { |
1073 | warn("Tx Ring full, pkt dropped.\n"); | 1073 | warn("Tx Ring full, pkt dropped.\n"); |
1074 | gp->stats.tx_dropped++; | 1074 | gp->stats.tx_dropped++; |
1075 | spin_unlock_irqrestore(&gp->lock, flags); | 1075 | spin_unlock_irqrestore(&gp->lock, flags); |
1076 | return 1; | 1076 | return 1; |
1077 | } | 1077 | } |
1078 | 1078 | ||
1079 | if (!(gp->last_psr & psrLink)) { | 1079 | if (!(gp->last_psr & psrLink)) { |
1080 | err("%s: Link down, pkt dropped.\n", __FUNCTION__); | 1080 | err("%s: Link down, pkt dropped.\n", __FUNCTION__); |
1081 | gp->stats.tx_dropped++; | 1081 | gp->stats.tx_dropped++; |
1082 | spin_unlock_irqrestore(&gp->lock, flags); | 1082 | spin_unlock_irqrestore(&gp->lock, flags); |
1083 | return 1; | 1083 | return 1; |
1084 | } | 1084 | } |
1085 | 1085 | ||
1086 | if (dma32_to_cpu(gp->tx_ring[nextIn].cmdstat) & txOwn) { | 1086 | if (dma32_to_cpu(gp->tx_ring[nextIn].cmdstat) & txOwn) { |
1087 | err("%s: device owns descriptor, pkt dropped.\n", __FUNCTION__); | 1087 | err("%s: device owns descriptor, pkt dropped.\n", __FUNCTION__); |
1088 | gp->stats.tx_dropped++; | 1088 | gp->stats.tx_dropped++; |
@@ -1091,7 +1091,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev) | |||
1091 | spin_unlock_irqrestore(&gp->lock, flags); | 1091 | spin_unlock_irqrestore(&gp->lock, flags); |
1092 | return 1; | 1092 | return 1; |
1093 | } | 1093 | } |
1094 | 1094 | ||
1095 | // Prepare the Descriptor at tx_next_in | 1095 | // Prepare the Descriptor at tx_next_in |
1096 | gp->tx_skbuff[nextIn] = skb; | 1096 | gp->tx_skbuff[nextIn] = skb; |
1097 | gp->tx_ring[nextIn].byte_cnt = cpu_to_dma16(skb->len); | 1097 | gp->tx_ring[nextIn].byte_cnt = cpu_to_dma16(skb->len); |
@@ -1103,7 +1103,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev) | |||
1103 | gp->tx_ring[nextIn].cmdstat = | 1103 | gp->tx_ring[nextIn].cmdstat = |
1104 | cpu_to_dma32((u32)(txOwn | txGenCRC | txEI | | 1104 | cpu_to_dma32((u32)(txOwn | txGenCRC | txEI | |
1105 | txPad | txFirst | txLast)); | 1105 | txPad | txFirst | txLast)); |
1106 | 1106 | ||
1107 | dump_tx_desc(4, dev, nextIn); | 1107 | dump_tx_desc(4, dev, nextIn); |
1108 | dump_skb(4, dev, skb); | 1108 | dump_skb(4, dev, skb); |
1109 | 1109 | ||
@@ -1120,7 +1120,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev) | |||
1120 | netif_stop_queue(dev); | 1120 | netif_stop_queue(dev); |
1121 | dbg(2, "Tx Ring now full, queue stopped.\n"); | 1121 | dbg(2, "Tx Ring now full, queue stopped.\n"); |
1122 | } | 1122 | } |
1123 | 1123 | ||
1124 | dev->trans_start = jiffies; | 1124 | dev->trans_start = jiffies; |
1125 | spin_unlock_irqrestore(&gp->lock, flags); | 1125 | spin_unlock_irqrestore(&gp->lock, flags); |
1126 | 1126 | ||
@@ -1136,7 +1136,7 @@ gt96100_rx(struct net_device *dev, u32 status) | |||
1136 | int pkt_len, nextOut, cdp; | 1136 | int pkt_len, nextOut, cdp; |
1137 | gt96100_rd_t *rd; | 1137 | gt96100_rd_t *rd; |
1138 | u32 cmdstat; | 1138 | u32 cmdstat; |
1139 | 1139 | ||
1140 | dbg(3, "%s: dev=%p, status=%x\n", __FUNCTION__, dev, status); | 1140 | dbg(3, "%s: dev=%p, status=%x\n", __FUNCTION__, dev, status); |
1141 | 1141 | ||
1142 | cdp = (GT96100ETH_READ(gp, GT96100_ETH_1ST_RX_DESC_PTR0) | 1142 | cdp = (GT96100ETH_READ(gp, GT96100_ETH_1ST_RX_DESC_PTR0) |
@@ -1145,13 +1145,13 @@ gt96100_rx(struct net_device *dev, u32 status) | |||
1145 | // Continue until we reach 1st descriptor pointer | 1145 | // Continue until we reach 1st descriptor pointer |
1146 | for (nextOut = gp->rx_next_out; nextOut != cdp; | 1146 | for (nextOut = gp->rx_next_out; nextOut != cdp; |
1147 | nextOut = (nextOut + 1) % RX_RING_SIZE) { | 1147 | nextOut = (nextOut + 1) % RX_RING_SIZE) { |
1148 | 1148 | ||
1149 | if (--gp->intr_work_done == 0) | 1149 | if (--gp->intr_work_done == 0) |
1150 | break; | 1150 | break; |
1151 | 1151 | ||
1152 | rd = &gp->rx_ring[nextOut]; | 1152 | rd = &gp->rx_ring[nextOut]; |
1153 | cmdstat = dma32_to_cpu(rd->cmdstat); | 1153 | cmdstat = dma32_to_cpu(rd->cmdstat); |
1154 | 1154 | ||
1155 | dbg(4, "%s: Rx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__, | 1155 | dbg(4, "%s: Rx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__, |
1156 | cmdstat, nextOut); | 1156 | cmdstat, nextOut); |
1157 | 1157 | ||
@@ -1202,9 +1202,9 @@ gt96100_rx(struct net_device *dev, u32 status) | |||
1202 | // continue to drop every descriptor of this packet | 1202 | // continue to drop every descriptor of this packet |
1203 | continue; | 1203 | continue; |
1204 | } | 1204 | } |
1205 | 1205 | ||
1206 | pkt_len = dma16_to_cpu(rd->byte_cnt); | 1206 | pkt_len = dma16_to_cpu(rd->byte_cnt); |
1207 | 1207 | ||
1208 | /* Create new skb. */ | 1208 | /* Create new skb. */ |
1209 | skb = dev_alloc_skb(pkt_len+2); | 1209 | skb = dev_alloc_skb(pkt_len+2); |
1210 | if (skb == NULL) { | 1210 | if (skb == NULL) { |
@@ -1220,7 +1220,7 @@ gt96100_rx(struct net_device *dev, u32 status) | |||
1220 | &gp->rx_buff[nextOut*PKT_BUF_SZ], pkt_len); | 1220 | &gp->rx_buff[nextOut*PKT_BUF_SZ], pkt_len); |
1221 | skb->protocol = eth_type_trans(skb, dev); | 1221 | skb->protocol = eth_type_trans(skb, dev); |
1222 | dump_skb(4, dev, skb); | 1222 | dump_skb(4, dev, skb); |
1223 | 1223 | ||
1224 | netif_rx(skb); /* pass the packet to upper layers */ | 1224 | netif_rx(skb); /* pass the packet to upper layers */ |
1225 | dev->last_rx = jiffies; | 1225 | dev->last_rx = jiffies; |
1226 | 1226 | ||
@@ -1228,7 +1228,7 @@ gt96100_rx(struct net_device *dev, u32 status) | |||
1228 | cmdstat |= (u32)rxOwn; | 1228 | cmdstat |= (u32)rxOwn; |
1229 | rd->cmdstat = cpu_to_dma32(cmdstat); | 1229 | rd->cmdstat = cpu_to_dma32(cmdstat); |
1230 | } | 1230 | } |
1231 | 1231 | ||
1232 | if (nextOut == gp->rx_next_out) | 1232 | if (nextOut == gp->rx_next_out) |
1233 | dbg(3, "%s: RxCDP did not increment?\n", __FUNCTION__); | 1233 | dbg(3, "%s: RxCDP did not increment?\n", __FUNCTION__); |
1234 | 1234 | ||
@@ -1247,20 +1247,20 @@ gt96100_tx_complete(struct net_device *dev, u32 status) | |||
1247 | 1247 | ||
1248 | cdp = (GT96100ETH_READ(gp, GT96100_ETH_CURR_TX_DESC_PTR0) | 1248 | cdp = (GT96100ETH_READ(gp, GT96100_ETH_CURR_TX_DESC_PTR0) |
1249 | - gp->tx_ring_dma) / sizeof(gt96100_td_t); | 1249 | - gp->tx_ring_dma) / sizeof(gt96100_td_t); |
1250 | 1250 | ||
1251 | // Continue until we reach the current descriptor pointer | 1251 | // Continue until we reach the current descriptor pointer |
1252 | for (nextOut = gp->tx_next_out; nextOut != cdp; | 1252 | for (nextOut = gp->tx_next_out; nextOut != cdp; |
1253 | nextOut = (nextOut + 1) % TX_RING_SIZE) { | 1253 | nextOut = (nextOut + 1) % TX_RING_SIZE) { |
1254 | 1254 | ||
1255 | if (--gp->intr_work_done == 0) | 1255 | if (--gp->intr_work_done == 0) |
1256 | break; | 1256 | break; |
1257 | 1257 | ||
1258 | td = &gp->tx_ring[nextOut]; | 1258 | td = &gp->tx_ring[nextOut]; |
1259 | cmdstat = dma32_to_cpu(td->cmdstat); | 1259 | cmdstat = dma32_to_cpu(td->cmdstat); |
1260 | 1260 | ||
1261 | dbg(3, "%s: Tx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__, | 1261 | dbg(3, "%s: Tx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__, |
1262 | cmdstat, nextOut); | 1262 | cmdstat, nextOut); |
1263 | 1263 | ||
1264 | if (cmdstat & (u32)txOwn) { | 1264 | if (cmdstat & (u32)txOwn) { |
1265 | /* | 1265 | /* |
1266 | * DMA is not finished writing descriptor??? | 1266 | * DMA is not finished writing descriptor??? |
@@ -1269,7 +1269,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status) | |||
1269 | */ | 1269 | */ |
1270 | break; | 1270 | break; |
1271 | } | 1271 | } |
1272 | 1272 | ||
1273 | // increment Tx error stats | 1273 | // increment Tx error stats |
1274 | if (cmdstat & (u32)txErrorSummary) { | 1274 | if (cmdstat & (u32)txErrorSummary) { |
1275 | dbg(2, "%s: Tx error, cmdstat = %x\n", __FUNCTION__, | 1275 | dbg(2, "%s: Tx error, cmdstat = %x\n", __FUNCTION__, |
@@ -1282,7 +1282,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status) | |||
1282 | if (cmdstat & (u32)txLateCollision) | 1282 | if (cmdstat & (u32)txLateCollision) |
1283 | gp->stats.tx_window_errors++; | 1283 | gp->stats.tx_window_errors++; |
1284 | } | 1284 | } |
1285 | 1285 | ||
1286 | if (cmdstat & (u32)txCollision) | 1286 | if (cmdstat & (u32)txCollision) |
1287 | gp->stats.collisions += | 1287 | gp->stats.collisions += |
1288 | (u32)((cmdstat & txReTxCntMask) >> | 1288 | (u32)((cmdstat & txReTxCntMask) >> |
@@ -1297,10 +1297,10 @@ gt96100_tx_complete(struct net_device *dev, u32 status) | |||
1297 | __FUNCTION__); | 1297 | __FUNCTION__); |
1298 | } | 1298 | } |
1299 | } | 1299 | } |
1300 | 1300 | ||
1301 | // decrement tx ring buffer count | 1301 | // decrement tx ring buffer count |
1302 | if (gp->tx_count) gp->tx_count--; | 1302 | if (gp->tx_count) gp->tx_count--; |
1303 | 1303 | ||
1304 | // free the skb | 1304 | // free the skb |
1305 | if (gp->tx_skbuff[nextOut]) { | 1305 | if (gp->tx_skbuff[nextOut]) { |
1306 | dbg(3, "%s: good Tx, skb=%p\n", __FUNCTION__, | 1306 | dbg(3, "%s: good Tx, skb=%p\n", __FUNCTION__, |
@@ -1317,7 +1317,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status) | |||
1317 | if (gt96100_check_tx_consistent(gp)) { | 1317 | if (gt96100_check_tx_consistent(gp)) { |
1318 | err("%s: Tx queue inconsistent!\n", __FUNCTION__); | 1318 | err("%s: Tx queue inconsistent!\n", __FUNCTION__); |
1319 | } | 1319 | } |
1320 | 1320 | ||
1321 | if ((status & icrTxEndLow) && gp->tx_count != 0) { | 1321 | if ((status & icrTxEndLow) && gp->tx_count != 0) { |
1322 | // we must restart the DMA | 1322 | // we must restart the DMA |
1323 | dbg(3, "%s: Restarting Tx DMA\n", __FUNCTION__); | 1323 | dbg(3, "%s: Restarting Tx DMA\n", __FUNCTION__); |
@@ -1374,7 +1374,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
1374 | psr & psrTxLow ? "running":"stopped", | 1374 | psr & psrTxLow ? "running":"stopped", |
1375 | psr & psrTxHigh ? "running":"stopped", | 1375 | psr & psrTxHigh ? "running":"stopped", |
1376 | psr & psrTxInProg ? "on":"off"); | 1376 | psr & psrTxInProg ? "on":"off"); |
1377 | 1377 | ||
1378 | if ((psr & psrLink) && !gp->tx_full && | 1378 | if ((psr & psrLink) && !gp->tx_full && |
1379 | netif_queue_stopped(dev)) { | 1379 | netif_queue_stopped(dev)) { |
1380 | dbg(0, "%s: Link up, waking queue.\n", | 1380 | dbg(0, "%s: Link up, waking queue.\n", |
@@ -1393,21 +1393,21 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
1393 | if (--gp->intr_work_done == 0) | 1393 | if (--gp->intr_work_done == 0) |
1394 | break; | 1394 | break; |
1395 | } | 1395 | } |
1396 | 1396 | ||
1397 | if (status & (icrTxBufferLow | icrTxEndLow)) | 1397 | if (status & (icrTxBufferLow | icrTxEndLow)) |
1398 | gt96100_tx_complete(dev, status); | 1398 | gt96100_tx_complete(dev, status); |
1399 | 1399 | ||
1400 | if (status & (icrRxBuffer | icrRxError)) { | 1400 | if (status & (icrRxBuffer | icrRxError)) { |
1401 | gt96100_rx(dev, status); | 1401 | gt96100_rx(dev, status); |
1402 | } | 1402 | } |
1403 | 1403 | ||
1404 | // Now check TX errors (RX errors were handled in gt96100_rx) | 1404 | // Now check TX errors (RX errors were handled in gt96100_rx) |
1405 | if (status & icrTxErrorLow) { | 1405 | if (status & icrTxErrorLow) { |
1406 | err("%s: Tx resource error\n", __FUNCTION__); | 1406 | err("%s: Tx resource error\n", __FUNCTION__); |
1407 | if (--gp->intr_work_done == 0) | 1407 | if (--gp->intr_work_done == 0) |
1408 | break; | 1408 | break; |
1409 | } | 1409 | } |
1410 | 1410 | ||
1411 | if (status & icrTxUdr) { | 1411 | if (status & icrTxUdr) { |
1412 | err("%s: Tx underrun error\n", __FUNCTION__); | 1412 | err("%s: Tx underrun error\n", __FUNCTION__); |
1413 | if (--gp->intr_work_done == 0) | 1413 | if (--gp->intr_work_done == 0) |
@@ -1420,7 +1420,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs) | |||
1420 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_CAUSE, 0); | 1420 | GT96100ETH_WRITE(gp, GT96100_ETH_INT_CAUSE, 0); |
1421 | dbg(3, "%s: hit max work\n", __FUNCTION__); | 1421 | dbg(3, "%s: hit max work\n", __FUNCTION__); |
1422 | } | 1422 | } |
1423 | 1423 | ||
1424 | dbg(3, "%s: exit, icr=%x\n", __FUNCTION__, | 1424 | dbg(3, "%s: exit, icr=%x\n", __FUNCTION__, |
1425 | GT96100ETH_READ(gp, GT96100_ETH_INT_CAUSE)); | 1425 | GT96100ETH_READ(gp, GT96100_ETH_INT_CAUSE)); |
1426 | 1426 | ||
@@ -1434,9 +1434,9 @@ gt96100_tx_timeout(struct net_device *dev) | |||
1434 | { | 1434 | { |
1435 | struct gt96100_private *gp = netdev_priv(dev); | 1435 | struct gt96100_private *gp = netdev_priv(dev); |
1436 | unsigned long flags; | 1436 | unsigned long flags; |
1437 | 1437 | ||
1438 | spin_lock_irqsave(&gp->lock, flags); | 1438 | spin_lock_irqsave(&gp->lock, flags); |
1439 | 1439 | ||
1440 | if (!(gp->last_psr & psrLink)) { | 1440 | if (!(gp->last_psr & psrLink)) { |
1441 | err("tx_timeout: link down.\n"); | 1441 | err("tx_timeout: link down.\n"); |
1442 | spin_unlock_irqrestore(&gp->lock, flags); | 1442 | spin_unlock_irqrestore(&gp->lock, flags); |
@@ -1448,7 +1448,7 @@ gt96100_tx_timeout(struct net_device *dev) | |||
1448 | spin_unlock_irqrestore(&gp->lock, flags); | 1448 | spin_unlock_irqrestore(&gp->lock, flags); |
1449 | reset_tx(dev); | 1449 | reset_tx(dev); |
1450 | enable_ether_irq(dev); | 1450 | enable_ether_irq(dev); |
1451 | 1451 | ||
1452 | netif_wake_queue(dev); | 1452 | netif_wake_queue(dev); |
1453 | } | 1453 | } |
1454 | } | 1454 | } |
@@ -1460,7 +1460,7 @@ gt96100_set_rx_mode(struct net_device *dev) | |||
1460 | struct gt96100_private *gp = netdev_priv(dev); | 1460 | struct gt96100_private *gp = netdev_priv(dev); |
1461 | unsigned long flags; | 1461 | unsigned long flags; |
1462 | //struct dev_mc_list *mcptr; | 1462 | //struct dev_mc_list *mcptr; |
1463 | 1463 | ||
1464 | dbg(3, "%s: dev=%p, flags=%x\n", __FUNCTION__, dev, dev->flags); | 1464 | dbg(3, "%s: dev=%p, flags=%x\n", __FUNCTION__, dev, dev->flags); |
1465 | 1465 | ||
1466 | // stop the Receiver DMA | 1466 | // stop the Receiver DMA |
@@ -1491,7 +1491,7 @@ gt96100_set_rx_mode(struct net_device *dev) | |||
1491 | } | 1491 | } |
1492 | } | 1492 | } |
1493 | #endif | 1493 | #endif |
1494 | 1494 | ||
1495 | // restart Rx DMA | 1495 | // restart Rx DMA |
1496 | GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD); | 1496 | GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD); |
1497 | 1497 | ||