diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-08-29 16:40:27 -0400 |
commit | c1b054d03f5b31c33eaa0b267c629b118eaf3790 (patch) | |
tree | 9333907ca767be24fcb3667877242976c3e3c8dd /drivers/net/e100.c | |
parent | 559fb51ba7e66fe298b8355fabde1275b7def35f (diff) | |
parent | bf4e70e54cf31dcca48d279c7f7e71328eebe749 (diff) |
Merge /spare/repo/linux-2.6/
Diffstat (limited to 'drivers/net/e100.c')
-rw-r--r-- | drivers/net/e100.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 4a47df5a9ff9..d0fa2448761d 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -143,6 +143,7 @@ | |||
143 | #include <linux/delay.h> | 143 | #include <linux/delay.h> |
144 | #include <linux/init.h> | 144 | #include <linux/init.h> |
145 | #include <linux/pci.h> | 145 | #include <linux/pci.h> |
146 | #include <linux/dma-mapping.h> | ||
146 | #include <linux/netdevice.h> | 147 | #include <linux/netdevice.h> |
147 | #include <linux/etherdevice.h> | 148 | #include <linux/etherdevice.h> |
148 | #include <linux/mii.h> | 149 | #include <linux/mii.h> |
@@ -1092,11 +1093,16 @@ static int e100_phy_init(struct nic *nic) | |||
1092 | } | 1093 | } |
1093 | 1094 | ||
1094 | if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && | 1095 | if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) && |
1095 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) && | 1096 | (mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) { |
1096 | (nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) | 1097 | /* enable/disable MDI/MDI-X auto-switching. |
1097 | /* enable/disable MDI/MDI-X auto-switching */ | 1098 | MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */ |
1098 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, | 1099 | if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) || |
1099 | nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH); | 1100 | (nic->mac == mac_82551_10) || (nic->mii.force_media) || |
1101 | !(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled)) | ||
1102 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0); | ||
1103 | else | ||
1104 | mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH); | ||
1105 | } | ||
1100 | 1106 | ||
1101 | return 0; | 1107 | return 0; |
1102 | } | 1108 | } |
@@ -1665,8 +1671,10 @@ static irqreturn_t e100_intr(int irq, void *dev_id, struct pt_regs *regs) | |||
1665 | if(stat_ack & stat_ack_rnr) | 1671 | if(stat_ack & stat_ack_rnr) |
1666 | nic->ru_running = RU_SUSPENDED; | 1672 | nic->ru_running = RU_SUSPENDED; |
1667 | 1673 | ||
1668 | e100_disable_irq(nic); | 1674 | if(likely(netif_rx_schedule_prep(netdev))) { |
1669 | netif_rx_schedule(netdev); | 1675 | e100_disable_irq(nic); |
1676 | __netif_rx_schedule(netdev); | ||
1677 | } | ||
1670 | 1678 | ||
1671 | return IRQ_HANDLED; | 1679 | return IRQ_HANDLED; |
1672 | } | 1680 | } |
@@ -2286,7 +2294,7 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2286 | goto err_out_disable_pdev; | 2294 | goto err_out_disable_pdev; |
2287 | } | 2295 | } |
2288 | 2296 | ||
2289 | if((err = pci_set_dma_mask(pdev, 0xFFFFFFFFULL))) { | 2297 | if((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK))) { |
2290 | DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); | 2298 | DPRINTK(PROBE, ERR, "No usable DMA configuration, aborting.\n"); |
2291 | goto err_out_free_res; | 2299 | goto err_out_free_res; |
2292 | } | 2300 | } |
@@ -2334,11 +2342,11 @@ static int __devinit e100_probe(struct pci_dev *pdev, | |||
2334 | goto err_out_iounmap; | 2342 | goto err_out_iounmap; |
2335 | } | 2343 | } |
2336 | 2344 | ||
2337 | e100_phy_init(nic); | ||
2338 | |||
2339 | if((err = e100_eeprom_load(nic))) | 2345 | if((err = e100_eeprom_load(nic))) |
2340 | goto err_out_free; | 2346 | goto err_out_free; |
2341 | 2347 | ||
2348 | e100_phy_init(nic); | ||
2349 | |||
2342 | memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN); | 2350 | memcpy(netdev->dev_addr, nic->eeprom, ETH_ALEN); |
2343 | if(!is_valid_ether_addr(netdev->dev_addr)) { | 2351 | if(!is_valid_ether_addr(netdev->dev_addr)) { |
2344 | DPRINTK(PROBE, ERR, "Invalid MAC address from " | 2352 | DPRINTK(PROBE, ERR, "Invalid MAC address from " |
@@ -2439,9 +2447,8 @@ static int e100_resume(struct pci_dev *pdev) | |||
2439 | #endif | 2447 | #endif |
2440 | 2448 | ||
2441 | 2449 | ||
2442 | static void e100_shutdown(struct device *dev) | 2450 | static void e100_shutdown(struct pci_dev *pdev) |
2443 | { | 2451 | { |
2444 | struct pci_dev *pdev = container_of(dev, struct pci_dev, dev); | ||
2445 | struct net_device *netdev = pci_get_drvdata(pdev); | 2452 | struct net_device *netdev = pci_get_drvdata(pdev); |
2446 | struct nic *nic = netdev_priv(netdev); | 2453 | struct nic *nic = netdev_priv(netdev); |
2447 | 2454 | ||
@@ -2462,11 +2469,7 @@ static struct pci_driver e100_driver = { | |||
2462 | .suspend = e100_suspend, | 2469 | .suspend = e100_suspend, |
2463 | .resume = e100_resume, | 2470 | .resume = e100_resume, |
2464 | #endif | 2471 | #endif |
2465 | 2472 | .shutdown = e100_shutdown, | |
2466 | .driver = { | ||
2467 | .shutdown = e100_shutdown, | ||
2468 | } | ||
2469 | |||
2470 | }; | 2473 | }; |
2471 | 2474 | ||
2472 | static int __init e100_init_module(void) | 2475 | static int __init e100_init_module(void) |