1326
1326
AT_WRITE_REG(hw, REG_IMR,
1327
1327
IMR_NORMAL_MASK & ~ISR_RX_EVENT);
1328
1328
AT_WRITE_FLUSH(hw);
1329
if (likely(netif_rx_schedule_prep(netdev,
1329
if (likely(napi_schedule_prep(
1330
1330
&adapter->napi)))
1331
__netif_rx_schedule(netdev, &adapter->napi);
1331
__napi_schedule(&adapter->napi);
1333
1333
} while (--max_ints > 0);
1334
1334
/* re-enable Interrupt*/
1503
1502
struct atl1e_adapter *adapter =
1504
1503
container_of(napi, struct atl1e_adapter, napi);
1505
struct net_device *netdev = adapter->netdev;
1506
1504
struct pci_dev *pdev = adapter->pdev;
1508
1506
int work_done = 0;
1516
1514
/* If no Tx and not enough Rx work done, exit the polling mode */
1517
1515
if (work_done < budget) {
1519
netif_rx_complete(netdev, napi);
1517
napi_complete(napi);
1520
1518
imr_data = AT_READ_REG(&adapter->hw, REG_IMR);
1521
1519
AT_WRITE_REG(&adapter->hw, REG_IMR, imr_data | ISR_RX_EVENT);
1522
1520
/* test debug */
2254
2252
atl1e_suspend(pdev, PMSG_SUSPEND);
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,
2257
2273
static int atl1e_init_netdev(struct net_device *netdev, struct pci_dev *pdev)
2259
2275
SET_NETDEV_DEV(netdev, &pdev->dev);
2260
2276
pci_set_drvdata(pdev, netdev);
2262
2278
netdev->irq = pdev->irq;
2263
netdev->open = &atl1e_open;
2264
netdev->stop = &atl1e_close;
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;
2279
netdev->netdev_ops = &atl1e_netdev_ops;
2272
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;
2277
2282
atl1e_set_ethtool_ops(netdev);
2279
2284
netdev->features = NETIF_F_SG | NETIF_F_HW_CSUM |
2321
2326
* various kernel subsystems to support the mechanics required by a
2322
2327
* fixed-high-32-bit system.
2324
if ((pci_set_dma_mask(pdev, DMA_32BIT_MASK) != 0) ||
2325
(pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK) != 0)) {
2329
if ((pci_set_dma_mask(pdev, DMA_BIT_MASK(32)) != 0) ||
2330
(pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32)) != 0)) {
2326
2331
dev_err(&pdev->dev, "No usable DMA configuration,aborting\n");
2488
2493
atl1e_io_error_detected(struct pci_dev *pdev, pci_channel_state_t state)
2490
2495
struct net_device *netdev = pci_get_drvdata(pdev);
2491
struct atl1e_adapter *adapter = netdev->priv;
2496
struct atl1e_adapter *adapter = netdev_priv(netdev);
2493
2498
netif_device_detach(netdev);
2511
2516
static pci_ers_result_t atl1e_io_slot_reset(struct pci_dev *pdev)
2513
2518
struct net_device *netdev = pci_get_drvdata(pdev);
2514
struct atl1e_adapter *adapter = netdev->priv;
2519
struct atl1e_adapter *adapter = netdev_priv(netdev);
2516
2521
if (pci_enable_device(pdev)) {
2517
2522
dev_err(&pdev->dev,
2539
2544
static void atl1e_io_resume(struct pci_dev *pdev)
2541
2546
struct net_device *netdev = pci_get_drvdata(pdev);
2542
struct atl1e_adapter *adapter = netdev->priv;
2547
struct atl1e_adapter *adapter = netdev_priv(netdev);
2544
2549
if (netif_running(netdev)) {
2545
2550
if (atl1e_up(adapter)) {