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.c30
1 files changed, 13 insertions, 17 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c
index ce850f1078b5..47d970896a5c 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
@@ -158,10 +158,10 @@
158 158
159 159
160#define DRV_NAME "e100" 160#define DRV_NAME "e100"
161#define DRV_EXT "-NAPI" 161#define DRV_EXT "-NAPI"
162#define DRV_VERSION "3.5.10-k2"DRV_EXT 162#define DRV_VERSION "3.5.16-k2"DRV_EXT
163#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver" 163#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
164#define DRV_COPYRIGHT "Copyright(c) 1999-2005 Intel Corporation" 164#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation"
165#define PFX DRV_NAME ": " 165#define PFX DRV_NAME ": "
166 166
167#define E100_WATCHDOG_PERIOD (2 * HZ) 167#define E100_WATCHDOG_PERIOD (2 * HZ)
@@ -1395,15 +1395,11 @@ static int e100_phy_init(struct nic *nic)
1395 } 1395 }
1396 1396
1397 if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && 1397 if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
1398 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) { 1398 (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) &&
1399 /* enable/disable MDI/MDI-X auto-switching. 1399 !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) {
1400 MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */ 1400 /* enable/disable MDI/MDI-X auto-switching. */
1401 if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) || 1401 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
1402 (nic->mac == mac_82551_10) || (nic->mii.force_media) || 1402 nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
1403 !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
1404 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
1405 else
1406 mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH);
1407 } 1403 }
1408 1404
1409 return 0; 1405 return 0;
@@ -1767,11 +1763,10 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
1767#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN) 1763#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
1768static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx) 1764static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
1769{ 1765{
1770 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)))
1771 return -ENOMEM; 1767 return -ENOMEM;
1772 1768
1773 /* Align, init, and map the RFD. */ 1769 /* Align, init, and map the RFD. */
1774 rx->skb->dev = nic->netdev;
1775 skb_reserve(rx->skb, NET_IP_ALIGN); 1770 skb_reserve(rx->skb, NET_IP_ALIGN);
1776 memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd)); 1771 memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
1777 rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data, 1772 rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
@@ -2147,7 +2142,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)
2147 2142
2148 e100_start_receiver(nic, NULL); 2143 e100_start_receiver(nic, NULL);
2149 2144
2150 if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) { 2145 if(!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) {
2151 err = -ENOMEM; 2146 err = -ENOMEM;
2152 goto err_loopback_none; 2147 goto err_loopback_none;
2153 } 2148 }
@@ -2799,6 +2794,7 @@ static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel
2799 /* Detach; put netif into state similar to hotplug unplug. */ 2794 /* Detach; put netif into state similar to hotplug unplug. */
2800 netif_poll_enable(netdev); 2795 netif_poll_enable(netdev);
2801 netif_device_detach(netdev); 2796 netif_device_detach(netdev);
2797 pci_disable_device(pdev);
2802 2798
2803 /* Request a slot reset. */ 2799 /* Request a slot reset. */
2804 return PCI_ERS_RESULT_NEED_RESET; 2800 return PCI_ERS_RESULT_NEED_RESET;
@@ -2877,7 +2873,7 @@ static int __init e100_init_module(void)
2877 printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION); 2873 printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
2878 printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT); 2874 printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
2879 } 2875 }
2880 return pci_module_init(&e100_driver); 2876 return pci_register_driver(&e100_driver);
2881} 2877}
2882 2878
2883static void __exit e100_cleanup_module(void) 2879static void __exit e100_cleanup_module(void)