aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igc/igc_main.c
diff options
context:
space:
mode:
authorSasha Neftin <sasha.neftin@intel.com>2018-10-11 03:17:28 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-10-17 16:52:00 -0400
commitab4056126813c889ee6c8fb24ca8f75b84c981ab (patch)
tree66acd757449a65ac904b8471051f90f61c865d1e /drivers/net/ethernet/intel/igc/igc_main.c
parentc0071c7aa5fe0a6aa4cfc8426af893307ccd276d (diff)
igc: Add NVM support
Add code for NVM support and get MAC address, complete probe method. Signed-off-by: Sasha Neftin <sasha.neftin@intel.com> Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_main.c')
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index f2ad49fcd39b..115fc2a544d7 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -27,9 +27,13 @@ static const char igc_driver_string[] = DRV_SUMMARY;
27static const char igc_copyright[] = 27static const char igc_copyright[] =
28 "Copyright(c) 2018 Intel Corporation."; 28 "Copyright(c) 2018 Intel Corporation.";
29 29
30static const struct igc_info *igc_info_tbl[] = {
31 [board_base] = &igc_base_info,
32};
33
30static const struct pci_device_id igc_pci_tbl[] = { 34static const struct pci_device_id igc_pci_tbl[] = {
31 { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LM) }, 35 { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_LM), board_base },
32 { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_V) }, 36 { PCI_VDEVICE(INTEL, IGC_DEV_ID_I225_V), board_base },
33 /* required last entry */ 37 /* required last entry */
34 {0, } 38 {0, }
35}; 39};
@@ -3289,6 +3293,7 @@ static int igc_probe(struct pci_dev *pdev,
3289 struct igc_adapter *adapter; 3293 struct igc_adapter *adapter;
3290 struct net_device *netdev; 3294 struct net_device *netdev;
3291 struct igc_hw *hw; 3295 struct igc_hw *hw;
3296 const struct igc_info *ei = igc_info_tbl[ent->driver_data];
3292 int err, pci_using_dac; 3297 int err, pci_using_dac;
3293 3298
3294 err = pci_enable_device_mem(pdev); 3299 err = pci_enable_device_mem(pdev);
@@ -3370,6 +3375,14 @@ static int igc_probe(struct pci_dev *pdev,
3370 hw->subsystem_vendor_id = pdev->subsystem_vendor; 3375 hw->subsystem_vendor_id = pdev->subsystem_vendor;
3371 hw->subsystem_device_id = pdev->subsystem_device; 3376 hw->subsystem_device_id = pdev->subsystem_device;
3372 3377
3378 /* Copy the default MAC and PHY function pointers */
3379 memcpy(&hw->mac.ops, ei->mac_ops, sizeof(hw->mac.ops));
3380
3381 /* Initialize skew-specific constants */
3382 err = ei->get_invariants(hw);
3383 if (err)
3384 goto err_sw_init;
3385
3373 /* setup the private structure */ 3386 /* setup the private structure */
3374 err = igc_sw_init(adapter); 3387 err = igc_sw_init(adapter);
3375 if (err) 3388 if (err)
@@ -3403,6 +3416,9 @@ static int igc_probe(struct pci_dev *pdev,
3403 /* carrier off reporting is important to ethtool even BEFORE open */ 3416 /* carrier off reporting is important to ethtool even BEFORE open */
3404 netif_carrier_off(netdev); 3417 netif_carrier_off(netdev);
3405 3418
3419 /* Check if Media Autosense is enabled */
3420 adapter->ei = *ei;
3421
3406 /* print pcie link status and MAC address */ 3422 /* print pcie link status and MAC address */
3407 pcie_print_link_status(pdev); 3423 pcie_print_link_status(pdev);
3408 netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr); 3424 netdev_info(netdev, "MAC: %pM\n", netdev->dev_addr);