source: trunk/package/ep80579-drivers/patches/102-iegbe_nuke_polling_netdev.patch @ 20648

Last change on this file since 20648 was 20648, checked in by kaloz, 7 years ago

[x86]: add a subtarget and drivers for the Intel Tolapai SoC

File size: 3.1 KB
  • Embedded/src/GbE/iegbe.h

    a b struct iegbe_adapter { 
    316316                                int cleaned_count); 
    317317        struct iegbe_rx_ring *rx_ring;      /* One per active queue */ 
    318318        struct napi_struct napi; 
    319         struct net_device *polling_netdev;  /* One per active queue */ 
    320319 
    321320        int num_tx_queues; 
    322321        int num_rx_queues; 
  • Embedded/src/GbE/iegbe_main.c

    a b static int __devinit iegbe_probe(struct  
    763763        struct iegbe_hw *hw; 
    764764 
    765765        static int cards_found = 0; 
    766     int i, err, pci_using_dac; 
     766        int err, pci_using_dac; 
    767767        u16 eeprom_data = 0; 
    768768        u16 eeprom_apme_mask = E1000_EEPROM_APME; 
    769769        int bars;  
    err_eeprom: 
    984984                iegbe_phy_hw_reset(hw); 
    985985        if (hw->flash_address) 
    986986                iounmap(hw->flash_address); 
    987         for (i = 0; i < adapter->num_rx_queues; i++) 
    988                 dev_put(&adapter->polling_netdev[i]); 
    989987        kfree(adapter->tx_ring); 
    990988        kfree(adapter->rx_ring); 
    991         kfree(adapter->polling_netdev); 
    992989err_sw_init: 
    993990        iounmap(hw->hw_addr); 
    994991err_ioremap: 
    iegbe_remove(struct pci_dev *pdev) 
    10171014    struct net_device *netdev = pci_get_drvdata(pdev); 
    10181015    struct iegbe_adapter *adapter = netdev_priv(netdev); 
    10191016    uint32_t manc; 
    1020     int i; 
    10211017 
    10221018    if(adapter->hw.mac_type >= iegbe_82540 
    10231019       && adapter->hw.mac_type != iegbe_icp_xxxx 
    iegbe_remove(struct pci_dev *pdev) 
    10301026    } 
    10311027 
    10321028    unregister_netdev(netdev); 
    1033     for (i = 0x0; i < adapter->num_rx_queues; i++) 
    1034                 dev_put(&adapter->polling_netdev[i]); 
    1035  
    10361029    if(!iegbe_check_phy_reset_block(&adapter->hw)) { 
    10371030        iegbe_phy_hw_reset(&adapter->hw); 
    10381031    } 
    10391032    kfree(adapter->tx_ring); 
    10401033    kfree(adapter->rx_ring); 
    1041     kfree(adapter->polling_netdev); 
    10421034 
    10431035    iounmap(adapter->hw.hw_addr); 
    10441036    pci_release_regions(pdev); 
    iegbe_sw_init(struct iegbe_adapter *adap 
    10611053    struct iegbe_hw *hw = &adapter->hw; 
    10621054    struct net_device *netdev = adapter->netdev; 
    10631055    struct pci_dev *pdev = adapter->pdev; 
    1064     int i; 
    10651056 
    10661057    /* PCI config space info */ 
    10671058 
    iegbe_sw_init(struct iegbe_adapter *adap 
    11111102                return -ENOMEM; 
    11121103        } 
    11131104 
    1114         for (i = 0; i < adapter->num_rx_queues; i++) { 
    1115                 adapter->polling_netdev[i].priv = adapter; 
    1116                 dev_hold(&adapter->polling_netdev[i]); 
    1117                 set_bit(__LINK_STATE_START, &adapter->polling_netdev[i].state); 
    1118         } 
    11191105        spin_lock_init(&adapter->tx_queue_lock); 
    11201106 
    11211107        /* 
    iegbe_sw_init(struct iegbe_adapter *adap 
    11371123 * @adapter: board private structure to initialize 
    11381124 * 
    11391125 * We allocate one ring per queue at run-time since we don't know the 
    1140  * number of queues at compile-time.  The polling_netdev array is 
    1141  * intended for Multiqueue, but should work fine with a single queue. 
     1126 * number of queues at compile-time. 
    11421127 **/ 
    11431128 
    11441129static int __devinit 
    iegbe_alloc_queues(struct iegbe_adapter  
    11581143                return -ENOMEM; 
    11591144        } 
    11601145 
    1161         adapter->polling_netdev = kcalloc(adapter->num_rx_queues, 
    1162                                           sizeof(struct net_device), 
    1163                                           GFP_KERNEL); 
    1164         if (!adapter->polling_netdev) { 
    1165                 kfree(adapter->tx_ring); 
    1166                 kfree(adapter->rx_ring); 
    1167                 return -ENOMEM; 
    1168         } 
    1169  
    11701146    return E1000_SUCCESS; 
    11711147} 
    11721148 
Note: See TracBrowser for help on using the repository browser.