Skip to content

Commit

Permalink
igc: Cleanup the redundant code
Browse files Browse the repository at this point in the history
The default flow control settings for the i225 device is both
'rx' and 'tx' pause frames. There is no depend on the NVM value.
This patch comes to fix this and clean up the driver code.

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>
  • Loading branch information
Sasha Neftin authored and Jeff Kirsher committed May 28, 2019
1 parent 0373ad4 commit 62a5b84
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions drivers/net/ethernet/intel/igc/igc_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
#include "igc_hw.h"

/* forward declaration */
static s32 igc_set_default_fc(struct igc_hw *hw);
static s32 igc_set_fc_watermarks(struct igc_hw *hw);

/**
Expand Down Expand Up @@ -96,13 +95,10 @@ s32 igc_setup_link(struct igc_hw *hw)
goto out;

/* If requested flow control is set to default, set flow control
* based on the EEPROM flow control settings.
* to the both 'rx' and 'tx' pause frames.
*/
if (hw->fc.requested_mode == igc_fc_default) {
ret_val = igc_set_default_fc(hw);
if (ret_val)
goto out;
}
if (hw->fc.requested_mode == igc_fc_default)
hw->fc.requested_mode = igc_fc_full;

/* We want to save off the original Flow Control configuration just
* in case we get disconnected and then reconnected into a different
Expand Down Expand Up @@ -135,19 +131,6 @@ s32 igc_setup_link(struct igc_hw *hw)
return ret_val;
}

/**
* igc_set_default_fc - Set flow control default values
* @hw: pointer to the HW structure
*
* Read the EEPROM for the default values for flow control and store the
* values.
*/
static s32 igc_set_default_fc(struct igc_hw *hw)
{
hw->fc.requested_mode = igc_fc_full;
return 0;
}

/**
* igc_force_mac_fc - Force the MAC's flow control settings
* @hw: pointer to the HW structure
Expand Down

0 comments on commit 62a5b84

Please sign in to comment.