diff options
Diffstat (limited to 'drivers/net/atl1e/atl1e_main.c')
-rw-r--r-- | drivers/net/atl1e/atl1e_main.c | 47 |
1 files changed, 26 insertions, 21 deletions
diff --git a/drivers/net/atl1e/atl1e_main.c b/drivers/net/atl1e/atl1e_main.c index 9b603528143d..bb9094d4cbc9 100644 --- a/drivers/net/atl1e/atl1e_main.c +++ b/drivers/net/atl1e/atl1e_main.c | |||
@@ -1326,9 +1326,9 @@ static irqreturn_t atl1e_intr(int irq, void *data) | |||
1326 | AT_WRITE_REG(hw, REG_IMR, | 1326 | AT_WRITE_REG(hw, REG_IMR, |
1327 | IMR_NORMAL_MASK & ~ISR_RX_EVENT); | 1327 | IMR_NORMAL_MASK & ~ISR_RX_EVENT); |
1328 | AT_WRITE_FLUSH(hw); | 1328 | AT_WRITE_FLUSH(hw); |
1329 | if (likely(netif_rx_schedule_prep(netdev, | 1329 | if (likely(netif_rx_schedule_prep( |
1330 | &adapter->napi))) | 1330 | &adapter->napi))) |
1331 | __netif_rx_schedule(netdev, &adapter->napi); | 1331 | __netif_rx_schedule(&adapter->napi); |
1332 | } | 1332 | } |
1333 | } while (--max_ints > 0); | 1333 | } while (--max_ints > 0); |
1334 | /* re-enable Interrupt*/ | 1334 | /* re-enable Interrupt*/ |
@@ -1460,7 +1460,6 @@ static void atl1e_clean_rx_irq(struct atl1e_adapter *adapter, u8 que, | |||
1460 | netif_receive_skb(skb); | 1460 | netif_receive_skb(skb); |
1461 | } | 1461 | } |
1462 | 1462 | ||
1463 | netdev->last_rx = jiffies; | ||
1464 | skip_pkt: | 1463 | skip_pkt: |
1465 | /* skip current packet whether it's ok or not. */ | 1464 | /* skip current packet whether it's ok or not. */ |
1466 | rx_page->read_offset += | 1465 | rx_page->read_offset += |
@@ -1502,7 +1501,6 @@ static int atl1e_clean(struct napi_struct *napi, int budget) | |||
1502 | { | 1501 | { |
1503 | struct atl1e_adapter *adapter = | 1502 | struct atl1e_adapter *adapter = |
1504 | container_of(napi, struct atl1e_adapter, napi); | 1503 | container_of(napi, struct atl1e_adapter, napi); |
1505 | struct net_device *netdev = adapter->netdev; | ||
1506 | struct pci_dev *pdev = adapter->pdev; | 1504 | struct pci_dev *pdev = adapter->pdev; |
1507 | u32 imr_data; | 1505 | u32 imr_data; |
1508 | int work_done = 0; | 1506 | int work_done = 0; |
@@ -1516,7 +1514,7 @@ static int atl1e_clean(struct napi_struct *napi, int budget) | |||
1516 | /* If no Tx and not enough Rx work done, exit the polling mode */ | 1514 | /* If no Tx and not enough Rx work done, exit the polling mode */ |
1517 | if (work_done < budget) { | 1515 | if (work_done < budget) { |
1518 | quit_polling: | 1516 | quit_polling: |
1519 | netif_rx_complete(netdev, napi); | 1517 | netif_rx_complete(napi); |
1520 | imr_data = AT_READ_REG(&adapter->hw, REG_IMR); | 1518 | imr_data = AT_READ_REG(&adapter->hw, REG_IMR); |
1521 | AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT); | 1519 | AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT); |
1522 | /* test debug */ | 1520 | /* test debug */ |
@@ -2254,26 +2252,33 @@ static void atl1e_shutdown(struct pci_dev *pdev) | |||
2254 | atl1e_suspend(pdev, PMSG_SUSPEND); | 2252 | atl1e_suspend(pdev, PMSG_SUSPEND); |
2255 | } | 2253 | } |
2256 | 2254 | ||
2255 | static const struct net_device_ops atl1e_netdev_ops = { | ||
2256 | .ndo_open = atl1e_open, | ||
2257 | .ndo_stop = atl1e_close, | ||
2258 | .ndo_start_xmit = atl1e_xmit_frame, | ||
2259 | .ndo_get_stats = atl1e_get_stats, | ||
2260 | .ndo_set_multicast_list = atl1e_set_multi, | ||
2261 | .ndo_validate_addr = eth_validate_addr, | ||
2262 | .ndo_set_mac_address = atl1e_set_mac_addr, | ||
2263 | .ndo_change_mtu = atl1e_change_mtu, | ||
2264 | .ndo_do_ioctl = atl1e_ioctl, | ||
2265 | .ndo_tx_timeout = atl1e_tx_timeout, | ||
2266 | .ndo_vlan_rx_register = atl1e_vlan_rx_register, | ||
2267 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2268 | .ndo_poll_controller = atl1e_netpoll, | ||
2269 | #endif | ||
2270 | |||
2271 | }; | ||
2272 | |||
2257 | static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) | 2273 | static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev) |
2258 | { | 2274 | { |
2259 | SET_NETDEV_DEV(netdev, &pdev->dev); | 2275 | SET_NETDEV_DEV(netdev, &pdev->dev); |
2260 | pci_set_drvdata(pdev, netdev); | 2276 | pci_set_drvdata(pdev, netdev); |
2261 | 2277 | ||
2262 | netdev->irq = pdev->irq; | 2278 | netdev->irq = pdev->irq; |
2263 | netdev->open = &atl1e_open; | 2279 | netdev->netdev_ops = &atl1e_netdev_ops; |
2264 | netdev->stop = &atl1e_close; | 2280 | |
2265 | netdev->hard_start_xmit = &atl1e_xmit_frame; | ||
2266 | netdev->get_stats = &atl1e_get_stats; | ||
2267 | netdev->set_multicast_list = &atl1e_set_multi; | ||
2268 | netdev->set_mac_address = &atl1e_set_mac_addr; | ||
2269 | netdev->change_mtu = &atl1e_change_mtu; | ||
2270 | netdev->do_ioctl = &atl1e_ioctl; | ||
2271 | netdev->tx_timeout = &atl1e_tx_timeout; | ||
2272 | netdev->watchdog_timeo = AT_TX_WATCHDOG; | 2281 | netdev->watchdog_timeo = AT_TX_WATCHDOG; |
2273 | netdev->vlan_rx_register = atl1e_vlan_rx_register; | ||
2274 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
2275 | netdev->poll_controller = atl1e_netpoll; | ||
2276 | #endif | ||
2277 | atl1e_set_ethtool_ops(netdev); | 2282 | atl1e_set_ethtool_ops(netdev); |
2278 | 2283 | ||
2279 | netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | | 2284 | netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM | |
@@ -2488,7 +2493,7 @@ static pci_ers_result_t | |||
2488 | atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) | 2493 | atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) |
2489 | { | 2494 | { |
2490 | struct net_device *netdev = pci_get_drvdata(pdev); | 2495 | struct net_device *netdev = pci_get_drvdata(pdev); |
2491 | struct atl1e_adapter *adapter = netdev->priv; | 2496 | struct atl1e_adapter *adapter = netdev_priv(netdev); |
2492 | 2497 | ||
2493 | netif_device_detach(netdev); | 2498 | netif_device_detach(netdev); |
2494 | 2499 | ||
@@ -2511,7 +2516,7 @@ atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state) | |||
2511 | static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev) | 2516 | static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev) |
2512 | { | 2517 | { |
2513 | struct net_device *netdev = pci_get_drvdata(pdev); | 2518 | struct net_device *netdev = pci_get_drvdata(pdev); |
2514 | struct atl1e_adapter *adapter = netdev->priv; | 2519 | struct atl1e_adapter *adapter = netdev_priv(netdev); |
2515 | 2520 | ||
2516 | if (pci_enable_device(pdev)) { | 2521 | if (pci_enable_device(pdev)) { |
2517 | dev_err(&pdev->dev, | 2522 | dev_err(&pdev->dev, |
@@ -2539,7 +2544,7 @@ static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev) | |||
2539 | static void atl1e_io_resume(struct pci_dev *pdev) | 2544 | static void atl1e_io_resume(struct pci_dev *pdev) |
2540 | { | 2545 | { |
2541 | struct net_device *netdev = pci_get_drvdata(pdev); | 2546 | struct net_device *netdev = pci_get_drvdata(pdev); |
2542 | struct atl1e_adapter *adapter = netdev->priv; | 2547 | struct atl1e_adapter *adapter = netdev_priv(netdev); |
2543 | 2548 | ||
2544 | if (netif_running(netdev)) { | 2549 | if (netif_running(netdev)) { |
2545 | if (atl1e_up(adapter)) { | 2550 | if (atl1e_up(adapter)) { |