diff options
Diffstat (limited to 'drivers/net/epic100.c')
-rw-r--r-- | drivers/net/epic100.c | 56 |
1 files changed, 28 insertions, 28 deletions
diff --git a/drivers/net/epic100.c b/drivers/net/epic100.c index 2f7b86837fe8..8d680ce600d7 100644 --- a/drivers/net/epic100.c +++ b/drivers/net/epic100.c | |||
@@ -21,15 +21,15 @@ | |||
21 | http://www.scyld.com/network/epic100.html | 21 | http://www.scyld.com/network/epic100.html |
22 | 22 | ||
23 | --------------------------------------------------------------------- | 23 | --------------------------------------------------------------------- |
24 | 24 | ||
25 | Linux kernel-specific changes: | 25 | Linux kernel-specific changes: |
26 | 26 | ||
27 | LK1.1.2 (jgarzik): | 27 | LK1.1.2 (jgarzik): |
28 | * Merge becker version 1.09 (4/08/2000) | 28 | * Merge becker version 1.09 (4/08/2000) |
29 | 29 | ||
30 | LK1.1.3: | 30 | LK1.1.3: |
31 | * Major bugfix to 1.09 driver (Francis Romieu) | 31 | * Major bugfix to 1.09 driver (Francis Romieu) |
32 | 32 | ||
33 | LK1.1.4 (jgarzik): | 33 | LK1.1.4 (jgarzik): |
34 | * Merge becker test version 1.09 (5/29/2000) | 34 | * Merge becker test version 1.09 (5/29/2000) |
35 | 35 | ||
@@ -66,7 +66,7 @@ | |||
66 | LK1.1.14 (Kryzsztof Halasa): | 66 | LK1.1.14 (Kryzsztof Halasa): |
67 | * fix spurious bad initializations | 67 | * fix spurious bad initializations |
68 | * pound phy a la SMSC's app note on the subject | 68 | * pound phy a la SMSC's app note on the subject |
69 | 69 | ||
70 | AC1.1.14ac | 70 | AC1.1.14ac |
71 | * fix power up/down for ethtool that broke in 1.11 | 71 | * fix power up/down for ethtool that broke in 1.11 |
72 | 72 | ||
@@ -244,7 +244,7 @@ static struct pci_device_id epic_pci_tbl[] = { | |||
244 | }; | 244 | }; |
245 | MODULE_DEVICE_TABLE (pci, epic_pci_tbl); | 245 | MODULE_DEVICE_TABLE (pci, epic_pci_tbl); |
246 | 246 | ||
247 | 247 | ||
248 | #ifndef USE_IO_OPS | 248 | #ifndef USE_IO_OPS |
249 | #undef inb | 249 | #undef inb |
250 | #undef inw | 250 | #undef inw |
@@ -370,7 +370,7 @@ static int epic_close(struct net_device *dev); | |||
370 | static struct net_device_stats *epic_get_stats(struct net_device *dev); | 370 | static struct net_device_stats *epic_get_stats(struct net_device *dev); |
371 | static void set_rx_mode(struct net_device *dev); | 371 | static void set_rx_mode(struct net_device *dev); |
372 | 372 | ||
373 | 373 | ||
374 | 374 | ||
375 | static int __devinit epic_init_one (struct pci_dev *pdev, | 375 | static int __devinit epic_init_one (struct pci_dev *pdev, |
376 | const struct pci_device_id *ent) | 376 | const struct pci_device_id *ent) |
@@ -392,9 +392,9 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
392 | printk (KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s", | 392 | printk (KERN_INFO "%s" KERN_INFO "%s" KERN_INFO "%s", |
393 | version, version2, version3); | 393 | version, version2, version3); |
394 | #endif | 394 | #endif |
395 | 395 | ||
396 | card_idx++; | 396 | card_idx++; |
397 | 397 | ||
398 | ret = pci_enable_device(pdev); | 398 | ret = pci_enable_device(pdev); |
399 | if (ret) | 399 | if (ret) |
400 | goto out; | 400 | goto out; |
@@ -405,7 +405,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
405 | ret = -ENODEV; | 405 | ret = -ENODEV; |
406 | goto err_out_disable; | 406 | goto err_out_disable; |
407 | } | 407 | } |
408 | 408 | ||
409 | pci_set_master(pdev); | 409 | pci_set_master(pdev); |
410 | 410 | ||
411 | ret = pci_request_regions(pdev, DRV_NAME); | 411 | ret = pci_request_regions(pdev, DRV_NAME); |
@@ -498,7 +498,7 @@ static int __devinit epic_init_one (struct pci_dev *pdev, | |||
498 | ep->pci_dev = pdev; | 498 | ep->pci_dev = pdev; |
499 | ep->chip_id = chip_idx; | 499 | ep->chip_id = chip_idx; |
500 | ep->chip_flags = pci_id_tbl[chip_idx].drv_flags; | 500 | ep->chip_flags = pci_id_tbl[chip_idx].drv_flags; |
501 | ep->irq_mask = | 501 | ep->irq_mask = |
502 | (ep->chip_flags & TYPE2_INTR ? PCIBusErr175 : PCIBusErr170) | 502 | (ep->chip_flags & TYPE2_INTR ? PCIBusErr175 : PCIBusErr170) |
503 | | CntFull | TxUnderrun | EpicNapiEvent; | 503 | | CntFull | TxUnderrun | EpicNapiEvent; |
504 | 504 | ||
@@ -587,7 +587,7 @@ err_out_disable: | |||
587 | pci_disable_device(pdev); | 587 | pci_disable_device(pdev); |
588 | goto out; | 588 | goto out; |
589 | } | 589 | } |
590 | 590 | ||
591 | /* Serial EEPROM section. */ | 591 | /* Serial EEPROM section. */ |
592 | 592 | ||
593 | /* EEPROM_Ctrl bits. */ | 593 | /* EEPROM_Ctrl bits. */ |
@@ -709,7 +709,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int value) | |||
709 | 709 | ||
710 | outw(value, ioaddr + MIIData); | 710 | outw(value, ioaddr + MIIData); |
711 | outl((phy_id << 9) | (loc << 4) | MII_WRITEOP, ioaddr + MIICtrl); | 711 | outl((phy_id << 9) | (loc << 4) | MII_WRITEOP, ioaddr + MIICtrl); |
712 | for (i = 10000; i > 0; i--) { | 712 | for (i = 10000; i > 0; i--) { |
713 | barrier(); | 713 | barrier(); |
714 | if ((inl(ioaddr + MIICtrl) & MII_WRITEOP) == 0) | 714 | if ((inl(ioaddr + MIICtrl) & MII_WRITEOP) == 0) |
715 | break; | 715 | break; |
@@ -717,7 +717,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int loc, int value) | |||
717 | return; | 717 | return; |
718 | } | 718 | } |
719 | 719 | ||
720 | 720 | ||
721 | static int epic_open(struct net_device *dev) | 721 | static int epic_open(struct net_device *dev) |
722 | { | 722 | { |
723 | struct epic_private *ep = dev->priv; | 723 | struct epic_private *ep = dev->priv; |
@@ -760,7 +760,7 @@ static int epic_open(struct net_device *dev) | |||
760 | #endif | 760 | #endif |
761 | 761 | ||
762 | udelay(20); /* Looks like EPII needs that if you want reliable RX init. FIXME: pci posting bug? */ | 762 | udelay(20); /* Looks like EPII needs that if you want reliable RX init. FIXME: pci posting bug? */ |
763 | 763 | ||
764 | for (i = 0; i < 3; i++) | 764 | for (i = 0; i < 3; i++) |
765 | outl(cpu_to_le16(((u16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4); | 765 | outl(cpu_to_le16(((u16*)dev->dev_addr)[i]), ioaddr + LAN0 + i*4); |
766 | 766 | ||
@@ -803,7 +803,7 @@ static int epic_open(struct net_device *dev) | |||
803 | 803 | ||
804 | /* Enable interrupts by setting the interrupt mask. */ | 804 | /* Enable interrupts by setting the interrupt mask. */ |
805 | outl((ep->chip_flags & TYPE2_INTR ? PCIBusErr175 : PCIBusErr170) | 805 | outl((ep->chip_flags & TYPE2_INTR ? PCIBusErr175 : PCIBusErr170) |
806 | | CntFull | TxUnderrun | 806 | | CntFull | TxUnderrun |
807 | | RxError | RxHeader | EpicNapiEvent, ioaddr + INTMASK); | 807 | | RxError | RxHeader | EpicNapiEvent, ioaddr + INTMASK); |
808 | 808 | ||
809 | if (debug > 1) | 809 | if (debug > 1) |
@@ -831,7 +831,7 @@ static void epic_pause(struct net_device *dev) | |||
831 | struct epic_private *ep = dev->priv; | 831 | struct epic_private *ep = dev->priv; |
832 | 832 | ||
833 | netif_stop_queue (dev); | 833 | netif_stop_queue (dev); |
834 | 834 | ||
835 | /* Disable interrupts by clearing the interrupt mask. */ | 835 | /* Disable interrupts by clearing the interrupt mask. */ |
836 | outl(0x00000000, ioaddr + INTMASK); | 836 | outl(0x00000000, ioaddr + INTMASK); |
837 | /* Stop the chip's Tx and Rx DMA processes. */ | 837 | /* Stop the chip's Tx and Rx DMA processes. */ |
@@ -987,7 +987,7 @@ static void epic_init_ring(struct net_device *dev) | |||
987 | for (i = 0; i < RX_RING_SIZE; i++) { | 987 | for (i = 0; i < RX_RING_SIZE; i++) { |
988 | ep->rx_ring[i].rxstatus = 0; | 988 | ep->rx_ring[i].rxstatus = 0; |
989 | ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz); | 989 | ep->rx_ring[i].buflength = cpu_to_le32(ep->rx_buf_sz); |
990 | ep->rx_ring[i].next = ep->rx_ring_dma + | 990 | ep->rx_ring[i].next = ep->rx_ring_dma + |
991 | (i+1)*sizeof(struct epic_rx_desc); | 991 | (i+1)*sizeof(struct epic_rx_desc); |
992 | ep->rx_skbuff[i] = NULL; | 992 | ep->rx_skbuff[i] = NULL; |
993 | } | 993 | } |
@@ -1002,7 +1002,7 @@ static void epic_init_ring(struct net_device *dev) | |||
1002 | break; | 1002 | break; |
1003 | skb->dev = dev; /* Mark as being used by this device. */ | 1003 | skb->dev = dev; /* Mark as being used by this device. */ |
1004 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ | 1004 | skb_reserve(skb, 2); /* 16 byte align the IP header. */ |
1005 | ep->rx_ring[i].bufaddr = pci_map_single(ep->pci_dev, | 1005 | ep->rx_ring[i].bufaddr = pci_map_single(ep->pci_dev, |
1006 | skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1006 | skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1007 | ep->rx_ring[i].rxstatus = cpu_to_le32(DescOwn); | 1007 | ep->rx_ring[i].rxstatus = cpu_to_le32(DescOwn); |
1008 | } | 1008 | } |
@@ -1013,7 +1013,7 @@ static void epic_init_ring(struct net_device *dev) | |||
1013 | for (i = 0; i < TX_RING_SIZE; i++) { | 1013 | for (i = 0; i < TX_RING_SIZE; i++) { |
1014 | ep->tx_skbuff[i] = NULL; | 1014 | ep->tx_skbuff[i] = NULL; |
1015 | ep->tx_ring[i].txstatus = 0x0000; | 1015 | ep->tx_ring[i].txstatus = 0x0000; |
1016 | ep->tx_ring[i].next = ep->tx_ring_dma + | 1016 | ep->tx_ring[i].next = ep->tx_ring_dma + |
1017 | (i+1)*sizeof(struct epic_tx_desc); | 1017 | (i+1)*sizeof(struct epic_tx_desc); |
1018 | } | 1018 | } |
1019 | ep->tx_ring[i-1].next = ep->tx_ring_dma; | 1019 | ep->tx_ring[i-1].next = ep->tx_ring_dma; |
@@ -1026,7 +1026,7 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1026 | int entry, free_count; | 1026 | int entry, free_count; |
1027 | u32 ctrl_word; | 1027 | u32 ctrl_word; |
1028 | unsigned long flags; | 1028 | unsigned long flags; |
1029 | 1029 | ||
1030 | if (skb->len < ETH_ZLEN) { | 1030 | if (skb->len < ETH_ZLEN) { |
1031 | skb = skb_padto(skb, ETH_ZLEN); | 1031 | skb = skb_padto(skb, ETH_ZLEN); |
1032 | if (skb == NULL) | 1032 | if (skb == NULL) |
@@ -1042,7 +1042,7 @@ static int epic_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1042 | entry = ep->cur_tx % TX_RING_SIZE; | 1042 | entry = ep->cur_tx % TX_RING_SIZE; |
1043 | 1043 | ||
1044 | ep->tx_skbuff[entry] = skb; | 1044 | ep->tx_skbuff[entry] = skb; |
1045 | ep->tx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, skb->data, | 1045 | ep->tx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, skb->data, |
1046 | skb->len, PCI_DMA_TODEVICE); | 1046 | skb->len, PCI_DMA_TODEVICE); |
1047 | if (free_count < TX_QUEUE_LEN/2) {/* Typical path */ | 1047 | if (free_count < TX_QUEUE_LEN/2) {/* Typical path */ |
1048 | ctrl_word = cpu_to_le32(0x100000); /* No interrupt */ | 1048 | ctrl_word = cpu_to_le32(0x100000); /* No interrupt */ |
@@ -1126,7 +1126,7 @@ static void epic_tx(struct net_device *dev, struct epic_private *ep) | |||
1126 | 1126 | ||
1127 | /* Free the original skb. */ | 1127 | /* Free the original skb. */ |
1128 | skb = ep->tx_skbuff[entry]; | 1128 | skb = ep->tx_skbuff[entry]; |
1129 | pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, | 1129 | pci_unmap_single(ep->pci_dev, ep->tx_ring[entry].bufaddr, |
1130 | skb->len, PCI_DMA_TODEVICE); | 1130 | skb->len, PCI_DMA_TODEVICE); |
1131 | dev_kfree_skb_irq(skb); | 1131 | dev_kfree_skb_irq(skb); |
1132 | ep->tx_skbuff[entry] = NULL; | 1132 | ep->tx_skbuff[entry] = NULL; |
@@ -1281,8 +1281,8 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1281 | ep->rx_buf_sz, | 1281 | ep->rx_buf_sz, |
1282 | PCI_DMA_FROMDEVICE); | 1282 | PCI_DMA_FROMDEVICE); |
1283 | } else { | 1283 | } else { |
1284 | pci_unmap_single(ep->pci_dev, | 1284 | pci_unmap_single(ep->pci_dev, |
1285 | ep->rx_ring[entry].bufaddr, | 1285 | ep->rx_ring[entry].bufaddr, |
1286 | ep->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1286 | ep->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1287 | skb_put(skb = ep->rx_skbuff[entry], pkt_len); | 1287 | skb_put(skb = ep->rx_skbuff[entry], pkt_len); |
1288 | ep->rx_skbuff[entry] = NULL; | 1288 | ep->rx_skbuff[entry] = NULL; |
@@ -1307,7 +1307,7 @@ static int epic_rx(struct net_device *dev, int budget) | |||
1307 | break; | 1307 | break; |
1308 | skb->dev = dev; /* Mark as being used by this device. */ | 1308 | skb->dev = dev; /* Mark as being used by this device. */ |
1309 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ | 1309 | skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */ |
1310 | ep->rx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, | 1310 | ep->rx_ring[entry].bufaddr = pci_map_single(ep->pci_dev, |
1311 | skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1311 | skb->data, ep->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1312 | work_done++; | 1312 | work_done++; |
1313 | } | 1313 | } |
@@ -1403,7 +1403,7 @@ static int epic_close(struct net_device *dev) | |||
1403 | ep->rx_ring[i].rxstatus = 0; /* Not owned by Epic chip. */ | 1403 | ep->rx_ring[i].rxstatus = 0; /* Not owned by Epic chip. */ |
1404 | ep->rx_ring[i].buflength = 0; | 1404 | ep->rx_ring[i].buflength = 0; |
1405 | if (skb) { | 1405 | if (skb) { |
1406 | pci_unmap_single(ep->pci_dev, ep->rx_ring[i].bufaddr, | 1406 | pci_unmap_single(ep->pci_dev, ep->rx_ring[i].bufaddr, |
1407 | ep->rx_buf_sz, PCI_DMA_FROMDEVICE); | 1407 | ep->rx_buf_sz, PCI_DMA_FROMDEVICE); |
1408 | dev_kfree_skb(skb); | 1408 | dev_kfree_skb(skb); |
1409 | } | 1409 | } |
@@ -1414,7 +1414,7 @@ static int epic_close(struct net_device *dev) | |||
1414 | ep->tx_skbuff[i] = NULL; | 1414 | ep->tx_skbuff[i] = NULL; |
1415 | if (!skb) | 1415 | if (!skb) |
1416 | continue; | 1416 | continue; |
1417 | pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, | 1417 | pci_unmap_single(ep->pci_dev, ep->tx_ring[i].bufaddr, |
1418 | skb->len, PCI_DMA_TODEVICE); | 1418 | skb->len, PCI_DMA_TODEVICE); |
1419 | dev_kfree_skb(skb); | 1419 | dev_kfree_skb(skb); |
1420 | } | 1420 | } |
@@ -1607,7 +1607,7 @@ static void __devexit epic_remove_one (struct pci_dev *pdev) | |||
1607 | { | 1607 | { |
1608 | struct net_device *dev = pci_get_drvdata(pdev); | 1608 | struct net_device *dev = pci_get_drvdata(pdev); |
1609 | struct epic_private *ep = dev->priv; | 1609 | struct epic_private *ep = dev->priv; |
1610 | 1610 | ||
1611 | pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); | 1611 | pci_free_consistent(pdev, TX_TOTAL_SIZE, ep->tx_ring, ep->tx_ring_dma); |
1612 | pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma); | 1612 | pci_free_consistent(pdev, RX_TOTAL_SIZE, ep->rx_ring, ep->rx_ring_dma); |
1613 | unregister_netdev(dev); | 1613 | unregister_netdev(dev); |