diff options
Diffstat (limited to 'drivers/net/sungem.c')
-rw-r--r-- | drivers/net/sungem.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index b17efa9cc530..c9c7650826c0 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -1157,7 +1157,7 @@ static void gem_pcs_reset(struct gem *gp) | |||
1157 | if (limit-- <= 0) | 1157 | if (limit-- <= 0) |
1158 | break; | 1158 | break; |
1159 | } | 1159 | } |
1160 | if (limit <= 0) | 1160 | if (limit < 0) |
1161 | printk(KERN_WARNING "%s: PCS reset bit would not clear.\n", | 1161 | printk(KERN_WARNING "%s: PCS reset bit would not clear.\n", |
1162 | gp->dev->name); | 1162 | gp->dev->name); |
1163 | } | 1163 | } |
@@ -1229,7 +1229,7 @@ static void gem_reset(struct gem *gp) | |||
1229 | break; | 1229 | break; |
1230 | } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST)); | 1230 | } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST)); |
1231 | 1231 | ||
1232 | if (limit <= 0) | 1232 | if (limit < 0) |
1233 | printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); | 1233 | printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); |
1234 | 1234 | ||
1235 | if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes) | 1235 | if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes) |
@@ -2221,6 +2221,8 @@ static int gem_do_start(struct net_device *dev) | |||
2221 | 2221 | ||
2222 | gp->running = 1; | 2222 | gp->running = 1; |
2223 | 2223 | ||
2224 | napi_enable(&gp->napi); | ||
2225 | |||
2224 | if (gp->lstate == link_up) { | 2226 | if (gp->lstate == link_up) { |
2225 | netif_carrier_on(gp->dev); | 2227 | netif_carrier_on(gp->dev); |
2226 | gem_set_link_modes(gp); | 2228 | gem_set_link_modes(gp); |
@@ -2238,6 +2240,8 @@ static int gem_do_start(struct net_device *dev) | |||
2238 | spin_lock_irqsave(&gp->lock, flags); | 2240 | spin_lock_irqsave(&gp->lock, flags); |
2239 | spin_lock(&gp->tx_lock); | 2241 | spin_lock(&gp->tx_lock); |
2240 | 2242 | ||
2243 | napi_disable(&gp->napi); | ||
2244 | |||
2241 | gp->running = 0; | 2245 | gp->running = 0; |
2242 | gem_reset(gp); | 2246 | gem_reset(gp); |
2243 | gem_clean_rings(gp); | 2247 | gem_clean_rings(gp); |
@@ -2338,8 +2342,6 @@ static int gem_open(struct net_device *dev) | |||
2338 | if (!gp->asleep) | 2342 | if (!gp->asleep) |
2339 | rc = gem_do_start(dev); | 2343 | rc = gem_do_start(dev); |
2340 | gp->opened = (rc == 0); | 2344 | gp->opened = (rc == 0); |
2341 | if (gp->opened) | ||
2342 | napi_enable(&gp->napi); | ||
2343 | 2345 | ||
2344 | mutex_unlock(&gp->pm_mutex); | 2346 | mutex_unlock(&gp->pm_mutex); |
2345 | 2347 | ||
@@ -2476,8 +2478,6 @@ static int gem_resume(struct pci_dev *pdev) | |||
2476 | 2478 | ||
2477 | /* Re-attach net device */ | 2479 | /* Re-attach net device */ |
2478 | netif_device_attach(dev); | 2480 | netif_device_attach(dev); |
2479 | |||
2480 | napi_enable(&gp->napi); | ||
2481 | } | 2481 | } |
2482 | 2482 | ||
2483 | spin_lock_irqsave(&gp->lock, flags); | 2483 | spin_lock_irqsave(&gp->lock, flags); |
@@ -2998,8 +2998,11 @@ static const struct net_device_ops gem_netdev_ops = { | |||
2998 | .ndo_do_ioctl = gem_ioctl, | 2998 | .ndo_do_ioctl = gem_ioctl, |
2999 | .ndo_tx_timeout = gem_tx_timeout, | 2999 | .ndo_tx_timeout = gem_tx_timeout, |
3000 | .ndo_change_mtu = gem_change_mtu, | 3000 | .ndo_change_mtu = gem_change_mtu, |
3001 | .ndo_set_mac_address = eth_mac_addr, | ||
3002 | .ndo_validate_addr = eth_validate_addr, | 3001 | .ndo_validate_addr = eth_validate_addr, |
3002 | .ndo_set_mac_address = gem_set_mac_address, | ||
3003 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
3004 | .ndo_poll_controller = gem_poll_controller, | ||
3005 | #endif | ||
3003 | }; | 3006 | }; |
3004 | 3007 | ||
3005 | static int __devinit gem_init_one(struct pci_dev *pdev, | 3008 | static int __devinit gem_init_one(struct pci_dev *pdev, |
@@ -3161,10 +3164,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev, | |||
3161 | dev->watchdog_timeo = 5 * HZ; | 3164 | dev->watchdog_timeo = 5 * HZ; |
3162 | dev->irq = pdev->irq; | 3165 | dev->irq = pdev->irq; |
3163 | dev->dma = 0; | 3166 | dev->dma = 0; |
3164 | dev->set_mac_address = gem_set_mac_address; | ||
3165 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
3166 | dev->poll_controller = gem_poll_controller; | ||
3167 | #endif | ||
3168 | 3167 | ||
3169 | /* Set that now, in case PM kicks in now */ | 3168 | /* Set that now, in case PM kicks in now */ |
3170 | pci_set_drvdata(pdev, dev); | 3169 | pci_set_drvdata(pdev, dev); |