aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e100.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r--drivers/net/e100.c45
1 files changed, 22 insertions, 23 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index f37170cc1a3..dc5e38aefca 100644
--- a/drivers/net/e100.c
+++ b/drivers/net/e100.c
@@ -1,7 +1,7 @@
1/******************************************************************************* 1/*******************************************************************************
2 2
3 3
4 Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. 4 Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
5 5
6 This program is free software; you can redistribute it and/or modify it 6 This program is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the Free 7 under the terms of the GNU General Public License as published by the Free
@@ -138,7 +138,6 @@
138 * - Stratus87247: protect MDI control register manipulations 138 * - Stratus87247: protect MDI control register manipulations
139 */ 139 */
140 140
141#include <linux/config.h>
142#include <linux/module.h> 141#include <linux/module.h>
143#include <linux/moduleparam.h> 142#include <linux/moduleparam.h>
144#include <linux/kernel.h> 143#include <linux/kernel.h>
@@ -159,10 +158,10 @@
159 158
160 159
161#define DRV_NAME "e100" 160#define DRV_NAME "e100"
162#define DRV_EXT "-NAPI" 161#define DRV_EXT "-NAPI"
163#define DRV_VERSION "3.5.10-k2"DRV_EXT 162#define DRV_VERSION "3.5.16-k2"DRV_EXT
164#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" 163#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
165#define DRV_COPYRIGHT "Copyright(c) 1999-2005 Intel Corporation" 164#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation"
166#define PFX DRV_NAME ": " 165#define PFX DRV_NAME ": "
167 166
168#define E100_WATCHDOG_PERIOD (2 * HZ) 167#define E100_WATCHDOG_PERIOD (2 * HZ)
@@ -174,8 +173,11 @@ MODULE_LICENSE("GPL");
174MODULE_VERSION(DRV_VERSION); 173MODULE_VERSION(DRV_VERSION);
175 174
176static int debug = 3; 175static int debug = 3;
176static int eeprom_bad_csum_allow = 0;
177module_param(debug, int, 0); 177module_param(debug, int, 0);
178module_param(eeprom_bad_csum_allow, int, 0);
178MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)"); 179MODULE_PARM_DESC(debug, "Debug level (0=none,...,16=all)");
180MODULE_PARM_DESC(eeprom_bad_csum_allow, "Allow bad eeprom checksums");
179#define DPRINTK(nlevel, klevel, fmt, args...) \ 181#define DPRINTK(nlevel, klevel, fmt, args...) \
180 (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \ 182 (void)((NETIF_MSG_##nlevel & nic->msg_enable) && \
181 printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \ 183 printk(KERN_##klevel PFX "%s: %s: " fmt, nic->netdev->name, \
@@ -757,7 +759,8 @@ static int e100_eeprom_load(struct nic *nic)
757 checksum = le16_to_cpu(0xBABA - checksum); 759 checksum = le16_to_cpu(0xBABA - checksum);
758 if(checksum != nic->eeprom[nic->eeprom_wc - 1]) { 760 if(checksum != nic->eeprom[nic->eeprom_wc - 1]) {
759 DPRINTK(PROBE, ERR, "EEPROM corrupted\n"); 761 DPRINTK(PROBE, ERR, "EEPROM corrupted\n");
760 return -EAGAIN; 762 if (!eeprom_bad_csum_allow)
763 return -EAGAIN;
761 } 764 }
762 765
763 return 0; 766 return 0;
@@ -1392,15 +1395,11 @@ static int e100_phy_init(struct nic *nic)
1392 } 1395 }
1393 1396
1394 if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && 1397 if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
1395 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) { 1398 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) &&
1396 /* enable/disable MDI/MDI-X auto-switching. 1399 !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) {
1397 MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */ 1400 /* enable/disable MDI/MDI-X auto-switching. */
1398 if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) || 1401 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
1399 (nic->mac == mac_82551_10) || (nic->mii.force_media) || 1402 nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
1400 !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
1401 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
1402 else
1403 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH);
1404 } 1403 }
1405 1404
1406 return 0; 1405 return 0;
@@ -1764,11 +1763,10 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
1764#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) 1763#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
1765static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) 1764static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
1766{ 1765{
1767 if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN))) 1766 if(!(rx->skb = netdev_alloc_skb(nic->netdev, RFD_BUF_LEN + NET_IP_ALIGN)))
1768 return -ENOMEM; 1767 return -ENOMEM;
1769 1768
1770 /* Align, init, and map the RFD. */ 1769 /* Align, init, and map the RFD. */
1771 rx->skb->dev = nic->netdev;
1772 skb_reserve(rx->skb, NET_IP_ALIGN); 1770 skb_reserve(rx->skb, NET_IP_ALIGN);
1773 memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd)); 1771 memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
1774 rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data, 1772 rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
@@ -2064,7 +2062,7 @@ static int e100_up(struct nic *nic)
2064 e100_set_multicast_list(nic->netdev); 2062 e100_set_multicast_list(nic->netdev);
2065 e100_start_receiver(nic, NULL); 2063 e100_start_receiver(nic, NULL);
2066 mod_timer(&nic->watchdog, jiffies); 2064 mod_timer(&nic->watchdog, jiffies);
2067 if((err = request_irq(nic->pdev->irq, e100_intr, SA_SHIRQ, 2065 if((err = request_irq(nic->pdev->irq, e100_intr, IRQF_SHARED,
2068 nic->netdev->name, nic->netdev))) 2066 nic->netdev->name, nic->netdev)))
2069 goto err_no_irq; 2067 goto err_no_irq;
2070 netif_wake_queue(nic->netdev); 2068 netif_wake_queue(nic->netdev);
@@ -2144,7 +2142,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)
2144 2142
2145 e100_start_receiver(nic, NULL); 2143 e100_start_receiver(nic, NULL);
2146 2144
2147 if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) { 2145 if(!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) {
2148 err = -ENOMEM; 2146 err = -ENOMEM;
2149 goto err_loopback_none; 2147 goto err_loopback_none;
2150 } 2148 }
@@ -2479,7 +2477,7 @@ static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
2479 } 2477 }
2480} 2478}
2481 2479
2482static struct ethtool_ops e100_ethtool_ops = { 2480static const struct ethtool_ops e100_ethtool_ops = {
2483 .get_settings = e100_get_settings, 2481 .get_settings = e100_get_settings,
2484 .set_settings = e100_set_settings, 2482 .set_settings = e100_set_settings,
2485 .get_drvinfo = e100_get_drvinfo, 2483 .get_drvinfo = e100_get_drvinfo,
@@ -2678,9 +2676,9 @@ static int __devinit e100_probe(struct pci_dev *pdev,
2678 goto err_out_free; 2676 goto err_out_free;
2679 } 2677 }
2680 2678
2681 DPRINTK(PROBE, INFO, "addr 0x%lx, irq %d, " 2679 DPRINTK(PROBE, INFO, "addr 0x%llx, irq %d, "
2682 "MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n", 2680 "MAC addr %02X:%02X:%02X:%02X:%02X:%02X\n",
2683 pci_resource_start(pdev, 0), pdev->irq, 2681 (unsigned long long)pci_resource_start(pdev, 0), pdev->irq,
2684 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2], 2682 netdev->dev_addr[0], netdev->dev_addr[1], netdev->dev_addr[2],
2685 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]); 2683 netdev->dev_addr[3], netdev->dev_addr[4], netdev->dev_addr[5]);
2686 2684
@@ -2796,6 +2794,7 @@ static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel
2796 /* Detach; put netif into state similar to hotplug unplug. */ 2794 /* Detach; put netif into state similar to hotplug unplug. */
2797 netif_poll_enable(netdev); 2795 netif_poll_enable(netdev);
2798 netif_device_detach(netdev); 2796 netif_device_detach(netdev);
2797 pci_disable_device(pdev);
2799 2798
2800 /* Request a slot reset. */ 2799 /* Request a slot reset. */
2801 return PCI_ERS_RESULT_NEED_RESET; 2800 return PCI_ERS_RESULT_NEED_RESET;
@@ -2874,7 +2873,7 @@ static int __init e100_init_module(void)
2874 printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION); 2873 printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
2875 printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT); 2874 printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
2876 } 2875 }
2877 return pci_module_init(&e100_driver); 2876 return pci_register_driver(&e100_driver);
2878} 2877}
2879 2878
2880static void __exit e100_cleanup_module(void) 2879static void __exit e100_cleanup_module(void)