diff options
author | Sasha Neftin <sasha.neftin@intel.com> | 2018-10-11 03:17:26 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-10-17 16:49:33 -0400 |
commit | c0071c7aa5fe0a6aa4cfc8426af893307ccd276d (patch) | |
tree | 4d06a191d99c460db8158f5b328826504c666354 /drivers/net/ethernet/intel/igc/igc_main.c | |
parent | 0507ef8a0372b80c30555bbeec7215f2cf874ecd (diff) |
igc: Add HW initialization code
Add code for hardware initialization and reset
Add code for semaphore handling
Signed-off-by: Sasha Neftin <sasha.neftin@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.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c index db7b6820e0f0..f2ad49fcd39b 100644 --- a/drivers/net/ethernet/intel/igc/igc_main.c +++ b/drivers/net/ethernet/intel/igc/igc_main.c | |||
@@ -64,6 +64,14 @@ enum latency_range { | |||
64 | 64 | ||
65 | static void igc_reset(struct igc_adapter *adapter) | 65 | static void igc_reset(struct igc_adapter *adapter) |
66 | { | 66 | { |
67 | struct pci_dev *pdev = adapter->pdev; | ||
68 | struct igc_hw *hw = &adapter->hw; | ||
69 | |||
70 | hw->mac.ops.reset_hw(hw); | ||
71 | |||
72 | if (hw->mac.ops.init_hw(hw)) | ||
73 | dev_err(&pdev->dev, "Hardware Error\n"); | ||
74 | |||
67 | if (!netif_running(adapter->netdev)) | 75 | if (!netif_running(adapter->netdev)) |
68 | igc_power_down_link(adapter); | 76 | igc_power_down_link(adapter); |
69 | } | 77 | } |
@@ -3556,6 +3564,19 @@ static int igc_sw_init(struct igc_adapter *adapter) | |||
3556 | } | 3564 | } |
3557 | 3565 | ||
3558 | /** | 3566 | /** |
3567 | * igc_get_hw_dev - return device | ||
3568 | * @hw: pointer to hardware structure | ||
3569 | * | ||
3570 | * used by hardware layer to print debugging information | ||
3571 | */ | ||
3572 | struct net_device *igc_get_hw_dev(struct igc_hw *hw) | ||
3573 | { | ||
3574 | struct igc_adapter *adapter = hw->back; | ||
3575 | |||
3576 | return adapter->netdev; | ||
3577 | } | ||
3578 | |||
3579 | /** | ||
3559 | * igc_init_module - Driver Registration Routine | 3580 | * igc_init_module - Driver Registration Routine |
3560 | * | 3581 | * |
3561 | * igc_init_module is the first routine called when the driver is | 3582 | * igc_init_module is the first routine called when the driver is |