Commit 167f3f71 authored by Jeff Kirsher's avatar Jeff Kirsher Committed by David S. Miller

igb: make local functions static and remove dead code

Based on Stephen Hemminger's original patch.
Make local functions static, and remove unused functions.
Reported-by: default avatarStephen Hemminger <stephen@networkplumber.org>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarAaron Brown <aaron.f.brown@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 87557440
...@@ -2720,7 +2720,7 @@ static const u8 e1000_emc_therm_limit[4] = { ...@@ -2720,7 +2720,7 @@ static const u8 e1000_emc_therm_limit[4] = {
* *
* Updates the temperatures in mac.thermal_sensor_data * Updates the temperatures in mac.thermal_sensor_data
**/ **/
s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw) static s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
{ {
s32 status = E1000_SUCCESS; s32 status = E1000_SUCCESS;
u16 ets_offset; u16 ets_offset;
...@@ -2774,7 +2774,7 @@ s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw) ...@@ -2774,7 +2774,7 @@ s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
* Sets the thermal sensor thresholds according to the NVM map * Sets the thermal sensor thresholds according to the NVM map
* and save off the threshold and location values into mac.thermal_sensor_data * and save off the threshold and location values into mac.thermal_sensor_data
**/ **/
s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw) static s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw)
{ {
s32 status = E1000_SUCCESS; s32 status = E1000_SUCCESS;
u16 ets_offset; u16 ets_offset;
......
...@@ -266,8 +266,6 @@ u16 igb_rxpbs_adjust_82580(u32 data); ...@@ -266,8 +266,6 @@ u16 igb_rxpbs_adjust_82580(u32 data);
s32 igb_read_emi_reg(struct e1000_hw *, u16 addr, u16 *data); s32 igb_read_emi_reg(struct e1000_hw *, u16 addr, u16 *data);
s32 igb_set_eee_i350(struct e1000_hw *); s32 igb_set_eee_i350(struct e1000_hw *);
s32 igb_set_eee_i354(struct e1000_hw *); s32 igb_set_eee_i354(struct e1000_hw *);
s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *);
s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw);
#define E1000_I2C_THERMAL_SENSOR_ADDR 0xF8 #define E1000_I2C_THERMAL_SENSOR_ADDR 0xF8
#define E1000_EMC_INTERNAL_DATA 0x00 #define E1000_EMC_INTERNAL_DATA 0x00
......
...@@ -35,6 +35,8 @@ ...@@ -35,6 +35,8 @@
#include "e1000_hw.h" #include "e1000_hw.h"
#include "e1000_i210.h" #include "e1000_i210.h"
static s32 igb_update_flash_i210(struct e1000_hw *hw);
/** /**
* igb_get_hw_semaphore_i210 - Acquire hardware semaphore * igb_get_hw_semaphore_i210 - Acquire hardware semaphore
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -111,7 +113,7 @@ static s32 igb_get_hw_semaphore_i210(struct e1000_hw *hw) ...@@ -111,7 +113,7 @@ static s32 igb_get_hw_semaphore_i210(struct e1000_hw *hw)
* Return successful if access grant bit set, else clear the request for * Return successful if access grant bit set, else clear the request for
* EEPROM access and return -E1000_ERR_NVM (-1). * EEPROM access and return -E1000_ERR_NVM (-1).
**/ **/
s32 igb_acquire_nvm_i210(struct e1000_hw *hw) static s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
{ {
return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
} }
...@@ -123,7 +125,7 @@ s32 igb_acquire_nvm_i210(struct e1000_hw *hw) ...@@ -123,7 +125,7 @@ s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
* Stop any current commands to the EEPROM and clear the EEPROM request bit, * Stop any current commands to the EEPROM and clear the EEPROM request bit,
* then release the semaphores acquired. * then release the semaphores acquired.
**/ **/
void igb_release_nvm_i210(struct e1000_hw *hw) static void igb_release_nvm_i210(struct e1000_hw *hw)
{ {
igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
} }
...@@ -206,8 +208,8 @@ void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask) ...@@ -206,8 +208,8 @@ void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask)
* Reads a 16 bit word from the Shadow Ram using the EERD register. * Reads a 16 bit word from the Shadow Ram using the EERD register.
* Uses necessary synchronization semaphores. * Uses necessary synchronization semaphores.
**/ **/
s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, static s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data) u16 *data)
{ {
s32 status = E1000_SUCCESS; s32 status = E1000_SUCCESS;
u16 i, count; u16 i, count;
...@@ -306,8 +308,8 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -306,8 +308,8 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
* If error code is returned, data and Shadow RAM may be inconsistent - buffer * If error code is returned, data and Shadow RAM may be inconsistent - buffer
* partially written. * partially written.
**/ **/
s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, static s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data) u16 *data)
{ {
s32 status = E1000_SUCCESS; s32 status = E1000_SUCCESS;
u16 i, count; u16 i, count;
...@@ -555,7 +557,7 @@ s32 igb_read_invm_version(struct e1000_hw *hw, ...@@ -555,7 +557,7 @@ s32 igb_read_invm_version(struct e1000_hw *hw,
* Calculates the EEPROM checksum by reading/adding each word of the EEPROM * Calculates the EEPROM checksum by reading/adding each word of the EEPROM
* and then verifies that the sum of the EEPROM is equal to 0xBABA. * and then verifies that the sum of the EEPROM is equal to 0xBABA.
**/ **/
s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw) static s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
{ {
s32 status = E1000_SUCCESS; s32 status = E1000_SUCCESS;
s32 (*read_op_ptr)(struct e1000_hw *, u16, u16, u16 *); s32 (*read_op_ptr)(struct e1000_hw *, u16, u16, u16 *);
...@@ -590,7 +592,7 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -590,7 +592,7 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
* up to the checksum. Then calculates the EEPROM checksum and writes the * up to the checksum. Then calculates the EEPROM checksum and writes the
* value to the EEPROM. Next commit EEPROM data onto the Flash. * value to the EEPROM. Next commit EEPROM data onto the Flash.
**/ **/
s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw) static s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
{ {
s32 ret_val = E1000_SUCCESS; s32 ret_val = E1000_SUCCESS;
u16 checksum = 0; u16 checksum = 0;
...@@ -684,7 +686,7 @@ bool igb_get_flash_presence_i210(struct e1000_hw *hw) ...@@ -684,7 +686,7 @@ bool igb_get_flash_presence_i210(struct e1000_hw *hw)
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
**/ **/
s32 igb_update_flash_i210(struct e1000_hw *hw) static s32 igb_update_flash_i210(struct e1000_hw *hw)
{ {
s32 ret_val = E1000_SUCCESS; s32 ret_val = E1000_SUCCESS;
u32 flup; u32 flup;
......
...@@ -28,17 +28,8 @@ ...@@ -28,17 +28,8 @@
#ifndef _E1000_I210_H_ #ifndef _E1000_I210_H_
#define _E1000_I210_H_ #define _E1000_I210_H_
s32 igb_update_flash_i210(struct e1000_hw *hw);
s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw);
s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw);
s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data);
s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data);
s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask); s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask); void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
s32 igb_acquire_nvm_i210(struct e1000_hw *hw);
void igb_release_nvm_i210(struct e1000_hw *hw);
s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data); s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
s32 igb_read_invm_version(struct e1000_hw *hw, s32 igb_read_invm_version(struct e1000_hw *hw,
struct e1000_fw_version *invm_ver); struct e1000_fw_version *invm_ver);
......
...@@ -393,77 +393,6 @@ s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data) ...@@ -393,77 +393,6 @@ s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data)
return 0; return 0;
} }
/**
* e1000_write_sfp_data_byte - Writes SFP module data.
* @hw: pointer to the HW structure
* @offset: byte location offset to write to
* @data: data to write
*
* Writes one byte to SFP module data stored
* in SFP resided EEPROM memory or SFP diagnostic area.
* Function should be called with
* E1000_I2CCMD_SFP_DATA_ADDR(<byte offset>) for SFP module database access
* E1000_I2CCMD_SFP_DIAG_ADDR(<byte offset>) for SFP diagnostics parameters
* access
**/
s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
{
u32 i = 0;
u32 i2ccmd = 0;
u32 data_local = 0;
if (offset > E1000_I2CCMD_SFP_DIAG_ADDR(255)) {
hw_dbg("I2CCMD command address exceeds upper limit\n");
return -E1000_ERR_PHY;
}
/* The programming interface is 16 bits wide
* so we need to read the whole word first
* then update appropriate byte lane and write
* the updated word back.
*/
/* Set up Op-code, EEPROM Address,in the I2CCMD
* register. The MAC will take care of interfacing
* with an EEPROM to write the data given.
*/
i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
E1000_I2CCMD_OPCODE_READ);
/* Set a command to read single word */
wr32(E1000_I2CCMD, i2ccmd);
for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
udelay(50);
/* Poll the ready bit to see if lastly
* launched I2C operation completed
*/
i2ccmd = rd32(E1000_I2CCMD);
if (i2ccmd & E1000_I2CCMD_READY) {
/* Check if this is READ or WRITE phase */
if ((i2ccmd & E1000_I2CCMD_OPCODE_READ) ==
E1000_I2CCMD_OPCODE_READ) {
/* Write the selected byte
* lane and update whole word
*/
data_local = i2ccmd & 0xFF00;
data_local |= data;
i2ccmd = ((offset <<
E1000_I2CCMD_REG_ADDR_SHIFT) |
E1000_I2CCMD_OPCODE_WRITE | data_local);
wr32(E1000_I2CCMD, i2ccmd);
} else {
break;
}
}
}
if (!(i2ccmd & E1000_I2CCMD_READY)) {
hw_dbg("I2CCMD Write did not complete\n");
return -E1000_ERR_PHY;
}
if (i2ccmd & E1000_I2CCMD_ERROR) {
hw_dbg("I2CCMD Error bit set\n");
return -E1000_ERR_PHY;
}
return 0;
}
/** /**
* igb_read_phy_reg_igp - Read igp PHY register * igb_read_phy_reg_igp - Read igp PHY register
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
......
...@@ -70,7 +70,6 @@ s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data); ...@@ -70,7 +70,6 @@ s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data); s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data); s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data); s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data);
s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data);
s32 igb_copper_link_setup_82580(struct e1000_hw *hw); s32 igb_copper_link_setup_82580(struct e1000_hw *hw);
s32 igb_get_phy_info_82580(struct e1000_hw *hw); s32 igb_get_phy_info_82580(struct e1000_hw *hw);
s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw); s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
......
...@@ -525,9 +525,7 @@ void igb_set_fw_version(struct igb_adapter *); ...@@ -525,9 +525,7 @@ void igb_set_fw_version(struct igb_adapter *);
void igb_ptp_init(struct igb_adapter *adapter); void igb_ptp_init(struct igb_adapter *adapter);
void igb_ptp_stop(struct igb_adapter *adapter); void igb_ptp_stop(struct igb_adapter *adapter);
void igb_ptp_reset(struct igb_adapter *adapter); void igb_ptp_reset(struct igb_adapter *adapter);
void igb_ptp_tx_work(struct work_struct *work);
void igb_ptp_rx_hang(struct igb_adapter *adapter); void igb_ptp_rx_hang(struct igb_adapter *adapter);
void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
struct sk_buff *skb); struct sk_buff *skb);
......
...@@ -75,6 +75,8 @@ ...@@ -75,6 +75,8 @@
#define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT) #define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT)
#define IGB_NBITS_82580 40 #define IGB_NBITS_82580 40
static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
/* SYSTIM read access for the 82576 */ /* SYSTIM read access for the 82576 */
static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc)
{ {
...@@ -372,7 +374,7 @@ static int igb_ptp_enable(struct ptp_clock_info *ptp, ...@@ -372,7 +374,7 @@ static int igb_ptp_enable(struct ptp_clock_info *ptp,
* This work function polls the TSYNCTXCTL valid bit to determine when a * This work function polls the TSYNCTXCTL valid bit to determine when a
* timestamp has been taken for the current stored skb. * timestamp has been taken for the current stored skb.
**/ **/
void igb_ptp_tx_work(struct work_struct *work) static void igb_ptp_tx_work(struct work_struct *work)
{ {
struct igb_adapter *adapter = container_of(work, struct igb_adapter, struct igb_adapter *adapter = container_of(work, struct igb_adapter,
ptp_tx_work); ptp_tx_work);
...@@ -466,7 +468,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter) ...@@ -466,7 +468,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter)
* available, then it must have been for this skb here because we only * available, then it must have been for this skb here because we only
* allow only one such packet into the queue. * allow only one such packet into the queue.
**/ **/
void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
struct skb_shared_hwtstamps shhwtstamps; struct skb_shared_hwtstamps shhwtstamps;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment