aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb
diff options
context:
space:
mode:
authorJeff Kirsher <jeffrey.t.kirsher@intel.com>2014-02-25 20:58:56 -0500
committerDavid S. Miller <davem@davemloft.net>2014-02-26 15:54:52 -0500
commit167f3f71c7e31da56c907b7363a36667a59dde85 (patch)
tree9e0c4d6c1dbafab38b4614eebfde8cc373505622 /drivers/net/ethernet/intel/igb
parent87557440d82a569829e65069bb856c7d8c535f57 (diff)
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: Stephen Hemminger <stephen@networkplumber.org> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/intel/igb')
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.c4
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_82575.h2
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_i210.c20
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_i210.h9
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_phy.c71
-rw-r--r--drivers/net/ethernet/intel/igb/e1000_phy.h1
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ptp.c6
8 files changed, 17 insertions, 98 deletions
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c
index 06df6928f44c..0ee7049157b0 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.c
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.c
@@ -2720,7 +2720,7 @@ static const u8 e1000_emc_therm_limit[4] = {
2720 * 2720 *
2721 * Updates the temperatures in mac.thermal_sensor_data 2721 * Updates the temperatures in mac.thermal_sensor_data
2722 **/ 2722 **/
2723s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw) 2723static s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
2724{ 2724{
2725 s32 status = E1000_SUCCESS; 2725 s32 status = E1000_SUCCESS;
2726 u16 ets_offset; 2726 u16 ets_offset;
@@ -2774,7 +2774,7 @@ s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw)
2774 * Sets the thermal sensor thresholds according to the NVM map 2774 * Sets the thermal sensor thresholds according to the NVM map
2775 * and save off the threshold and location values into mac.thermal_sensor_data 2775 * and save off the threshold and location values into mac.thermal_sensor_data
2776 **/ 2776 **/
2777s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw) 2777static s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *hw)
2778{ 2778{
2779 s32 status = E1000_SUCCESS; 2779 s32 status = E1000_SUCCESS;
2780 u16 ets_offset; 2780 u16 ets_offset;
diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.h b/drivers/net/ethernet/intel/igb/e1000_82575.h
index 8c2437722aad..622d80d59e2b 100644
--- a/drivers/net/ethernet/intel/igb/e1000_82575.h
+++ b/drivers/net/ethernet/intel/igb/e1000_82575.h
@@ -266,8 +266,6 @@ u16 igb_rxpbs_adjust_82580(u32 data);
266s32 igb_read_emi_reg(struct e1000_hw *, u16 addr, u16 *data); 266s32 igb_read_emi_reg(struct e1000_hw *, u16 addr, u16 *data);
267s32 igb_set_eee_i350(struct e1000_hw *); 267s32 igb_set_eee_i350(struct e1000_hw *);
268s32 igb_set_eee_i354(struct e1000_hw *); 268s32 igb_set_eee_i354(struct e1000_hw *);
269s32 igb_init_thermal_sensor_thresh_generic(struct e1000_hw *);
270s32 igb_get_thermal_sensor_data_generic(struct e1000_hw *hw);
271 269
272#define E1000_I2C_THERMAL_SENSOR_ADDR 0xF8 270#define E1000_I2C_THERMAL_SENSOR_ADDR 0xF8
273#define E1000_EMC_INTERNAL_DATA 0x00 271#define E1000_EMC_INTERNAL_DATA 0x00
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c
index 0c0393316a3a..9f32c781c474 100644
--- a/drivers/net/ethernet/intel/igb/e1000_i210.c
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.c
@@ -35,6 +35,8 @@
35#include "e1000_hw.h" 35#include "e1000_hw.h"
36#include "e1000_i210.h" 36#include "e1000_i210.h"
37 37
38static s32 igb_update_flash_i210(struct e1000_hw *hw);
39
38/** 40/**
39 * igb_get_hw_semaphore_i210 - Acquire hardware semaphore 41 * igb_get_hw_semaphore_i210 - Acquire hardware semaphore
40 * @hw: pointer to the HW structure 42 * @hw: pointer to the HW structure
@@ -111,7 +113,7 @@ static s32 igb_get_hw_semaphore_i210(struct e1000_hw *hw)
111 * Return successful if access grant bit set, else clear the request for 113 * Return successful if access grant bit set, else clear the request for
112 * EEPROM access and return -E1000_ERR_NVM (-1). 114 * EEPROM access and return -E1000_ERR_NVM (-1).
113 **/ 115 **/
114s32 igb_acquire_nvm_i210(struct e1000_hw *hw) 116static s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
115{ 117{
116 return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); 118 return igb_acquire_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
117} 119}
@@ -123,7 +125,7 @@ s32 igb_acquire_nvm_i210(struct e1000_hw *hw)
123 * Stop any current commands to the EEPROM and clear the EEPROM request bit, 125 * Stop any current commands to the EEPROM and clear the EEPROM request bit,
124 * then release the semaphores acquired. 126 * then release the semaphores acquired.
125 **/ 127 **/
126void igb_release_nvm_i210(struct e1000_hw *hw) 128static void igb_release_nvm_i210(struct e1000_hw *hw)
127{ 129{
128 igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM); 130 igb_release_swfw_sync_i210(hw, E1000_SWFW_EEP_SM);
129} 131}
@@ -206,8 +208,8 @@ void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask)
206 * Reads a 16 bit word from the Shadow Ram using the EERD register. 208 * Reads a 16 bit word from the Shadow Ram using the EERD register.
207 * Uses necessary synchronization semaphores. 209 * Uses necessary synchronization semaphores.
208 **/ 210 **/
209s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, 211static s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
210 u16 *data) 212 u16 *data)
211{ 213{
212 s32 status = E1000_SUCCESS; 214 s32 status = E1000_SUCCESS;
213 u16 i, count; 215 u16 i, count;
@@ -306,8 +308,8 @@ out:
306 * If error code is returned, data and Shadow RAM may be inconsistent - buffer 308 * If error code is returned, data and Shadow RAM may be inconsistent - buffer
307 * partially written. 309 * partially written.
308 **/ 310 **/
309s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, 311static s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
310 u16 *data) 312 u16 *data)
311{ 313{
312 s32 status = E1000_SUCCESS; 314 s32 status = E1000_SUCCESS;
313 u16 i, count; 315 u16 i, count;
@@ -555,7 +557,7 @@ s32 igb_read_invm_version(struct e1000_hw *hw,
555 * Calculates the EEPROM checksum by reading/adding each word of the EEPROM 557 * Calculates the EEPROM checksum by reading/adding each word of the EEPROM
556 * and then verifies that the sum of the EEPROM is equal to 0xBABA. 558 * and then verifies that the sum of the EEPROM is equal to 0xBABA.
557 **/ 559 **/
558s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw) 560static s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
559{ 561{
560 s32 status = E1000_SUCCESS; 562 s32 status = E1000_SUCCESS;
561 s32 (*read_op_ptr)(struct e1000_hw *, u16, u16, u16 *); 563 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 * up to the checksum. Then calculates the EEPROM checksum and writes the 592 * up to the checksum. Then calculates the EEPROM checksum and writes the
591 * value to the EEPROM. Next commit EEPROM data onto the Flash. 593 * value to the EEPROM. Next commit EEPROM data onto the Flash.
592 **/ 594 **/
593s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw) 595static s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
594{ 596{
595 s32 ret_val = E1000_SUCCESS; 597 s32 ret_val = E1000_SUCCESS;
596 u16 checksum = 0; 598 u16 checksum = 0;
@@ -684,7 +686,7 @@ bool igb_get_flash_presence_i210(struct e1000_hw *hw)
684 * @hw: pointer to the HW structure 686 * @hw: pointer to the HW structure
685 * 687 *
686 **/ 688 **/
687s32 igb_update_flash_i210(struct e1000_hw *hw) 689static s32 igb_update_flash_i210(struct e1000_hw *hw)
688{ 690{
689 s32 ret_val = E1000_SUCCESS; 691 s32 ret_val = E1000_SUCCESS;
690 u32 flup; 692 u32 flup;
diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.h b/drivers/net/ethernet/intel/igb/e1000_i210.h
index 2d913716573a..a068866927e8 100644
--- a/drivers/net/ethernet/intel/igb/e1000_i210.h
+++ b/drivers/net/ethernet/intel/igb/e1000_i210.h
@@ -28,17 +28,8 @@
28#ifndef _E1000_I210_H_ 28#ifndef _E1000_I210_H_
29#define _E1000_I210_H_ 29#define _E1000_I210_H_
30 30
31s32 igb_update_flash_i210(struct e1000_hw *hw);
32s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw);
33s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw);
34s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
35 u16 *data);
36s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
37 u16 *data);
38s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask); 31s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
39void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask); 32void igb_release_swfw_sync_i210(struct e1000_hw *hw, u16 mask);
40s32 igb_acquire_nvm_i210(struct e1000_hw *hw);
41void igb_release_nvm_i210(struct e1000_hw *hw);
42s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data); 33s32 igb_valid_led_default_i210(struct e1000_hw *hw, u16 *data);
43s32 igb_read_invm_version(struct e1000_hw *hw, 34s32 igb_read_invm_version(struct e1000_hw *hw,
44 struct e1000_fw_version *invm_ver); 35 struct e1000_fw_version *invm_ver);
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c
index ad2b74d95138..c0f2a16d16dc 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.c
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.c
@@ -394,77 +394,6 @@ s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data)
394} 394}
395 395
396/** 396/**
397 * e1000_write_sfp_data_byte - Writes SFP module data.
398 * @hw: pointer to the HW structure
399 * @offset: byte location offset to write to
400 * @data: data to write
401 *
402 * Writes one byte to SFP module data stored
403 * in SFP resided EEPROM memory or SFP diagnostic area.
404 * Function should be called with
405 * E1000_I2CCMD_SFP_DATA_ADDR(<byte offset>) for SFP module database access
406 * E1000_I2CCMD_SFP_DIAG_ADDR(<byte offset>) for SFP diagnostics parameters
407 * access
408 **/
409s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data)
410{
411 u32 i = 0;
412 u32 i2ccmd = 0;
413 u32 data_local = 0;
414
415 if (offset > E1000_I2CCMD_SFP_DIAG_ADDR(255)) {
416 hw_dbg("I2CCMD command address exceeds upper limit\n");
417 return -E1000_ERR_PHY;
418 }
419 /* The programming interface is 16 bits wide
420 * so we need to read the whole word first
421 * then update appropriate byte lane and write
422 * the updated word back.
423 */
424 /* Set up Op-code, EEPROM Address,in the I2CCMD
425 * register. The MAC will take care of interfacing
426 * with an EEPROM to write the data given.
427 */
428 i2ccmd = ((offset << E1000_I2CCMD_REG_ADDR_SHIFT) |
429 E1000_I2CCMD_OPCODE_READ);
430 /* Set a command to read single word */
431 wr32(E1000_I2CCMD, i2ccmd);
432 for (i = 0; i < E1000_I2CCMD_PHY_TIMEOUT; i++) {
433 udelay(50);
434 /* Poll the ready bit to see if lastly
435 * launched I2C operation completed
436 */
437 i2ccmd = rd32(E1000_I2CCMD);
438 if (i2ccmd & E1000_I2CCMD_READY) {
439 /* Check if this is READ or WRITE phase */
440 if ((i2ccmd & E1000_I2CCMD_OPCODE_READ) ==
441 E1000_I2CCMD_OPCODE_READ) {
442 /* Write the selected byte
443 * lane and update whole word
444 */
445 data_local = i2ccmd & 0xFF00;
446 data_local |= data;
447 i2ccmd = ((offset <<
448 E1000_I2CCMD_REG_ADDR_SHIFT) |
449 E1000_I2CCMD_OPCODE_WRITE | data_local);
450 wr32(E1000_I2CCMD, i2ccmd);
451 } else {
452 break;
453 }
454 }
455 }
456 if (!(i2ccmd & E1000_I2CCMD_READY)) {
457 hw_dbg("I2CCMD Write did not complete\n");
458 return -E1000_ERR_PHY;
459 }
460 if (i2ccmd & E1000_I2CCMD_ERROR) {
461 hw_dbg("I2CCMD Error bit set\n");
462 return -E1000_ERR_PHY;
463 }
464 return 0;
465}
466
467/**
468 * igb_read_phy_reg_igp - Read igp PHY register 397 * igb_read_phy_reg_igp - Read igp PHY register
469 * @hw: pointer to the HW structure 398 * @hw: pointer to the HW structure
470 * @offset: register offset to be read 399 * @offset: register offset to be read
diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.h b/drivers/net/ethernet/intel/igb/e1000_phy.h
index 6a0873f2095a..55b3f8c6f34c 100644
--- a/drivers/net/ethernet/intel/igb/e1000_phy.h
+++ b/drivers/net/ethernet/intel/igb/e1000_phy.h
@@ -70,7 +70,6 @@ s32 igb_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data);
70s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data); 70s32 igb_read_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 *data);
71s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data); 71s32 igb_write_phy_reg_i2c(struct e1000_hw *hw, u32 offset, u16 data);
72s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data); 72s32 igb_read_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 *data);
73s32 e1000_write_sfp_data_byte(struct e1000_hw *hw, u16 offset, u8 data);
74s32 igb_copper_link_setup_82580(struct e1000_hw *hw); 73s32 igb_copper_link_setup_82580(struct e1000_hw *hw);
75s32 igb_get_phy_info_82580(struct e1000_hw *hw); 74s32 igb_get_phy_info_82580(struct e1000_hw *hw);
76s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw); 75s32 igb_phy_force_speed_duplex_82580(struct e1000_hw *hw);
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index ccf472f073dd..65f3c774327d 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -525,9 +525,7 @@ void igb_set_fw_version(struct igb_adapter *);
525void igb_ptp_init(struct igb_adapter *adapter); 525void igb_ptp_init(struct igb_adapter *adapter);
526void igb_ptp_stop(struct igb_adapter *adapter); 526void igb_ptp_stop(struct igb_adapter *adapter);
527void igb_ptp_reset(struct igb_adapter *adapter); 527void igb_ptp_reset(struct igb_adapter *adapter);
528void igb_ptp_tx_work(struct work_struct *work);
529void igb_ptp_rx_hang(struct igb_adapter *adapter); 528void igb_ptp_rx_hang(struct igb_adapter *adapter);
530void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
531void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb); 529void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, struct sk_buff *skb);
532void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va, 530void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, unsigned char *va,
533 struct sk_buff *skb); 531 struct sk_buff *skb);
diff --git a/drivers/net/ethernet/intel/igb/igb_ptp.c b/drivers/net/ethernet/intel/igb/igb_ptp.c
index 5a54e3dc535d..d9f3976ee47e 100644
--- a/drivers/net/ethernet/intel/igb/igb_ptp.c
+++ b/drivers/net/ethernet/intel/igb/igb_ptp.c
@@ -75,6 +75,8 @@
75#define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT) 75#define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT)
76#define IGB_NBITS_82580 40 76#define IGB_NBITS_82580 40
77 77
78static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter);
79
78/* SYSTIM read access for the 82576 */ 80/* SYSTIM read access for the 82576 */
79static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) 81static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc)
80{ 82{
@@ -372,7 +374,7 @@ static int igb_ptp_enable(struct ptp_clock_info *ptp,
372 * This work function polls the TSYNCTXCTL valid bit to determine when a 374 * This work function polls the TSYNCTXCTL valid bit to determine when a
373 * timestamp has been taken for the current stored skb. 375 * timestamp has been taken for the current stored skb.
374 **/ 376 **/
375void igb_ptp_tx_work(struct work_struct *work) 377static void igb_ptp_tx_work(struct work_struct *work)
376{ 378{
377 struct igb_adapter *adapter = container_of(work, struct igb_adapter, 379 struct igb_adapter *adapter = container_of(work, struct igb_adapter,
378 ptp_tx_work); 380 ptp_tx_work);
@@ -466,7 +468,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter)
466 * available, then it must have been for this skb here because we only 468 * available, then it must have been for this skb here because we only
467 * allow only one such packet into the queue. 469 * allow only one such packet into the queue.
468 **/ 470 **/
469void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) 471static void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
470{ 472{
471 struct e1000_hw *hw = &adapter->hw; 473 struct e1000_hw *hw = &adapter->hw;
472 struct skb_shared_hwtstamps shhwtstamps; 474 struct skb_shared_hwtstamps shhwtstamps;