diff options
Diffstat (limited to 'drivers/net/ns83820.c')
-rw-r--r-- | drivers/net/ns83820.c | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/drivers/net/ns83820.c b/drivers/net/ns83820.c index 0dedd34804c3..ff76b81d5f3b 100644 --- a/drivers/net/ns83820.c +++ b/drivers/net/ns83820.c | |||
@@ -65,7 +65,7 @@ | |||
65 | * 0.20 - fix stupid RFEN thinko. i am such a smurf. | 65 | * 0.20 - fix stupid RFEN thinko. i am such a smurf. |
66 | * 20040828 0.21 - add hardware vlan accleration | 66 | * 20040828 0.21 - add hardware vlan accleration |
67 | * by Neil Horman <nhorman@redhat.com> | 67 | * by Neil Horman <nhorman@redhat.com> |
68 | * 20050406 0.22 - improved DAC ifdefs from Andi Kleen | 68 | * 20050406 0.22 - improved DAC ifdefs from Andi Kleen |
69 | * - removal of dead code from Adrian Bunk | 69 | * - removal of dead code from Adrian Bunk |
70 | * - fix half duplex collision behaviour | 70 | * - fix half duplex collision behaviour |
71 | * Driver Overview | 71 | * Driver Overview |
@@ -377,7 +377,7 @@ static int lnksts = 0; /* CFG_LNKSTS bit polarity */ | |||
377 | #define LINK_DOWN 0x02 | 377 | #define LINK_DOWN 0x02 |
378 | #define LINK_UP 0x04 | 378 | #define LINK_UP 0x04 |
379 | 379 | ||
380 | #define HW_ADDR_LEN sizeof(dma_addr_t) | 380 | #define HW_ADDR_LEN sizeof(dma_addr_t) |
381 | #define desc_addr_set(desc, addr) \ | 381 | #define desc_addr_set(desc, addr) \ |
382 | do { \ | 382 | do { \ |
383 | ((desc)[0] = cpu_to_le32(addr)); \ | 383 | ((desc)[0] = cpu_to_le32(addr)); \ |
@@ -493,7 +493,7 @@ static inline void kick_rx(struct net_device *ndev) | |||
493 | (((NR_TX_DESC-2 + dev->tx_done_idx - dev->tx_free_idx) % NR_TX_DESC) > MIN_TX_DESC_FREE) | 493 | (((NR_TX_DESC-2 + dev->tx_done_idx - dev->tx_free_idx) % NR_TX_DESC) > MIN_TX_DESC_FREE) |
494 | 494 | ||
495 | 495 | ||
496 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 496 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
497 | static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp) | 497 | static void ns83820_vlan_rx_register(struct net_device *ndev, struct vlan_group *grp) |
498 | { | 498 | { |
499 | struct ns83820 *dev = PRIV(ndev); | 499 | struct ns83820 *dev = PRIV(ndev); |
@@ -865,7 +865,7 @@ static void fastcall ns83820_rx_kick(struct net_device *ndev) | |||
865 | } | 865 | } |
866 | 866 | ||
867 | /* rx_irq | 867 | /* rx_irq |
868 | * | 868 | * |
869 | */ | 869 | */ |
870 | static void FASTCALL(rx_irq(struct net_device *ndev)); | 870 | static void FASTCALL(rx_irq(struct net_device *ndev)); |
871 | static void fastcall rx_irq(struct net_device *ndev) | 871 | static void fastcall rx_irq(struct net_device *ndev) |
@@ -921,14 +921,14 @@ static void fastcall rx_irq(struct net_device *ndev) | |||
921 | * that are 64 bytes with a vlan header appended | 921 | * that are 64 bytes with a vlan header appended |
922 | * like arp frames, or pings, are flagged as Runts | 922 | * like arp frames, or pings, are flagged as Runts |
923 | * when the tag is stripped and hardware. This | 923 | * when the tag is stripped and hardware. This |
924 | * also means that the OK bit in the descriptor | 924 | * also means that the OK bit in the descriptor |
925 | * is cleared when the frame comes in so we have | 925 | * is cleared when the frame comes in so we have |
926 | * to do a specific length check here to make sure | 926 | * to do a specific length check here to make sure |
927 | * the frame would have been ok, had we not stripped | 927 | * the frame would have been ok, had we not stripped |
928 | * the tag. | 928 | * the tag. |
929 | */ | 929 | */ |
930 | if (likely((CMDSTS_OK & cmdsts) || | 930 | if (likely((CMDSTS_OK & cmdsts) || |
931 | ((cmdsts & CMDSTS_RUNT) && len >= 56))) { | 931 | ((cmdsts & CMDSTS_RUNT) && len >= 56))) { |
932 | #else | 932 | #else |
933 | if (likely(CMDSTS_OK & cmdsts)) { | 933 | if (likely(CMDSTS_OK & cmdsts)) { |
934 | #endif | 934 | #endif |
@@ -945,7 +945,7 @@ static void fastcall rx_irq(struct net_device *ndev) | |||
945 | skb->ip_summed = CHECKSUM_NONE; | 945 | skb->ip_summed = CHECKSUM_NONE; |
946 | } | 946 | } |
947 | skb->protocol = eth_type_trans(skb, ndev); | 947 | skb->protocol = eth_type_trans(skb, ndev); |
948 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 948 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
949 | if(extsts & EXTSTS_VPKT) { | 949 | if(extsts & EXTSTS_VPKT) { |
950 | unsigned short tag; | 950 | unsigned short tag; |
951 | tag = ntohs(extsts & EXTSTS_VTG_MASK); | 951 | tag = ntohs(extsts & EXTSTS_VTG_MASK); |
@@ -1047,7 +1047,7 @@ static void do_tx_done(struct net_device *ndev) | |||
1047 | dev_kfree_skb_irq(skb); | 1047 | dev_kfree_skb_irq(skb); |
1048 | atomic_dec(&dev->nr_tx_skbs); | 1048 | atomic_dec(&dev->nr_tx_skbs); |
1049 | } else | 1049 | } else |
1050 | pci_unmap_page(dev->pci_dev, | 1050 | pci_unmap_page(dev->pci_dev, |
1051 | addr, | 1051 | addr, |
1052 | len, | 1052 | len, |
1053 | PCI_DMA_TODEVICE); | 1053 | PCI_DMA_TODEVICE); |
@@ -1359,8 +1359,8 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr) | |||
1359 | dev->tx_idx = 0; | 1359 | dev->tx_idx = 0; |
1360 | } | 1360 | } |
1361 | /* The may have been a race between a pci originated read | 1361 | /* The may have been a race between a pci originated read |
1362 | * and the descriptor update from the cpu. Just in case, | 1362 | * and the descriptor update from the cpu. Just in case, |
1363 | * kick the transmitter if the hardware thinks it is on a | 1363 | * kick the transmitter if the hardware thinks it is on a |
1364 | * different descriptor than we are. | 1364 | * different descriptor than we are. |
1365 | */ | 1365 | */ |
1366 | if (dev->tx_idx != dev->tx_free_idx) | 1366 | if (dev->tx_idx != dev->tx_free_idx) |
@@ -1388,8 +1388,8 @@ static void ns83820_do_isr(struct net_device *ndev, u32 isr) | |||
1388 | 1388 | ||
1389 | /* The TxIdle interrupt can come in before the transmit has | 1389 | /* The TxIdle interrupt can come in before the transmit has |
1390 | * completed. Normally we reap packets off of the combination | 1390 | * completed. Normally we reap packets off of the combination |
1391 | * of TxDesc and TxIdle and leave TxOk disabled (since it | 1391 | * of TxDesc and TxIdle and leave TxOk disabled (since it |
1392 | * occurs on every packet), but when no further irqs of this | 1392 | * occurs on every packet), but when no further irqs of this |
1393 | * nature are expected, we must enable TxOk. | 1393 | * nature are expected, we must enable TxOk. |
1394 | */ | 1394 | */ |
1395 | if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) { | 1395 | if ((ISR_TXIDLE & isr) && (dev->tx_done_idx != dev->tx_free_idx)) { |
@@ -1956,7 +1956,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1956 | /* When compiled with 64 bit addressing, we must always enable | 1956 | /* When compiled with 64 bit addressing, we must always enable |
1957 | * the 64 bit descriptor format. | 1957 | * the 64 bit descriptor format. |
1958 | */ | 1958 | */ |
1959 | if (sizeof(dma_addr_t) == 8) | 1959 | if (sizeof(dma_addr_t) == 8) |
1960 | dev->CFG_cache |= CFG_M64ADDR; | 1960 | dev->CFG_cache |= CFG_M64ADDR; |
1961 | if (using_dac) | 1961 | if (using_dac) |
1962 | dev->CFG_cache |= CFG_T64ADDR; | 1962 | dev->CFG_cache |= CFG_T64ADDR; |
@@ -1994,7 +1994,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
1994 | writel(dev->CFG_cache, dev->base + CFG); | 1994 | writel(dev->CFG_cache, dev->base + CFG); |
1995 | } | 1995 | } |
1996 | 1996 | ||
1997 | #if 0 /* Huh? This sets the PCI latency register. Should be done via | 1997 | #if 0 /* Huh? This sets the PCI latency register. Should be done via |
1998 | * the PCI layer. FIXME. | 1998 | * the PCI layer. FIXME. |
1999 | */ | 1999 | */ |
2000 | if (readl(dev->base + SRR)) | 2000 | if (readl(dev->base + SRR)) |
@@ -2006,7 +2006,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
2006 | * can be transmitted is 8192 - FLTH - burst size. | 2006 | * can be transmitted is 8192 - FLTH - burst size. |
2007 | * If only the transmit fifo was larger... | 2007 | * If only the transmit fifo was larger... |
2008 | */ | 2008 | */ |
2009 | /* Ramit : 1024 DMA is not a good idea, it ends up banging | 2009 | /* Ramit : 1024 DMA is not a good idea, it ends up banging |
2010 | * some DELL and COMPAQ SMP systems */ | 2010 | * some DELL and COMPAQ SMP systems */ |
2011 | writel(TXCFG_CSI | TXCFG_HBI | TXCFG_ATP | TXCFG_MXDMA512 | 2011 | writel(TXCFG_CSI | TXCFG_HBI | TXCFG_ATP | TXCFG_MXDMA512 |
2012 | | ((1600 / 32) * 0x100), | 2012 | | ((1600 / 32) * 0x100), |
@@ -2020,8 +2020,8 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
2020 | /* Set Rx to full duplex, don't accept runt, errored, long or length | 2020 | /* Set Rx to full duplex, don't accept runt, errored, long or length |
2021 | * range errored packets. Use 512 byte DMA. | 2021 | * range errored packets. Use 512 byte DMA. |
2022 | */ | 2022 | */ |
2023 | /* Ramit : 1024 DMA is not a good idea, it ends up banging | 2023 | /* Ramit : 1024 DMA is not a good idea, it ends up banging |
2024 | * some DELL and COMPAQ SMP systems | 2024 | * some DELL and COMPAQ SMP systems |
2025 | * Turn on ALP, only we are accpeting Jumbo Packets */ | 2025 | * Turn on ALP, only we are accpeting Jumbo Packets */ |
2026 | writel(RXCFG_AEP | RXCFG_ARP | RXCFG_AIRL | RXCFG_RX_FD | 2026 | writel(RXCFG_AEP | RXCFG_ARP | RXCFG_AIRL | RXCFG_RX_FD |
2027 | | RXCFG_STRIPCRC | 2027 | | RXCFG_STRIPCRC |
@@ -2045,7 +2045,7 @@ static int __devinit ns83820_init_one(struct pci_dev *pci_dev, const struct pci_ | |||
2045 | * also turn on tag stripping if hardware acceleration is enabled | 2045 | * also turn on tag stripping if hardware acceleration is enabled |
2046 | */ | 2046 | */ |
2047 | #ifdef NS83820_VLAN_ACCEL_SUPPORT | 2047 | #ifdef NS83820_VLAN_ACCEL_SUPPORT |
2048 | #define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN|VRCR_VTREN) | 2048 | #define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN|VRCR_VTREN) |
2049 | #else | 2049 | #else |
2050 | #define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN) | 2050 | #define VRCR_INIT_VALUE (VRCR_IPEN|VRCR_VTDEN) |
2051 | #endif | 2051 | #endif |