diff options
author | Joe Perches <joe@perches.com> | 2008-07-11 18:17:02 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2008-07-22 19:34:33 -0400 |
commit | 6479884509e6cd30c6708fbf05fafc0d1fc85f7a (patch) | |
tree | 261e980073b9984611d950f7e9f043141b52612e /drivers/net/e1000/e1000_hw.c | |
parent | cdc18a670923d01a762d66be582bfe763772d441 (diff) |
e1000: neaten function declarations
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/e1000/e1000_hw.c')
-rw-r--r-- | drivers/net/e1000/e1000_hw.c | 558 |
1 files changed, 195 insertions, 363 deletions
diff --git a/drivers/net/e1000/e1000_hw.c b/drivers/net/e1000/e1000_hw.c index 9a4b6cbddf2c..d6c272ae437f 100644 --- a/drivers/net/e1000/e1000_hw.c +++ b/drivers/net/e1000/e1000_hw.c | |||
@@ -42,48 +42,65 @@ static void e1000_release_software_semaphore(struct e1000_hw *hw); | |||
42 | 42 | ||
43 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw); | 43 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw); |
44 | static s32 e1000_check_downshift(struct e1000_hw *hw); | 44 | static s32 e1000_check_downshift(struct e1000_hw *hw); |
45 | static s32 e1000_check_polarity(struct e1000_hw *hw, e1000_rev_polarity *polarity); | 45 | static s32 e1000_check_polarity(struct e1000_hw *hw, |
46 | e1000_rev_polarity *polarity); | ||
46 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw); | 47 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw); |
47 | static void e1000_clear_vfta(struct e1000_hw *hw); | 48 | static void e1000_clear_vfta(struct e1000_hw *hw); |
48 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw); | 49 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw); |
49 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, | 50 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, |
50 | bool link_up); | 51 | bool link_up); |
51 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw); | 52 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw); |
52 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw); | 53 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw); |
53 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank); | 54 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank); |
54 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw); | 55 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw); |
55 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, u16 *max_length); | 56 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, |
57 | u16 *max_length); | ||
56 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw); | 58 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw); |
57 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw); | 59 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw); |
58 | static s32 e1000_get_software_flag(struct e1000_hw *hw); | 60 | static s32 e1000_get_software_flag(struct e1000_hw *hw); |
59 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw); | 61 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw); |
60 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout); | 62 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout); |
61 | static s32 e1000_id_led_init(struct e1000_hw *hw); | 63 | static s32 e1000_id_led_init(struct e1000_hw *hw); |
62 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, u32 cnf_base_addr, u32 cnf_size); | 64 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, |
65 | u32 cnf_base_addr, | ||
66 | u32 cnf_size); | ||
63 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw); | 67 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw); |
64 | static void e1000_init_rx_addrs(struct e1000_hw *hw); | 68 | static void e1000_init_rx_addrs(struct e1000_hw *hw); |
65 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw); | 69 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw); |
66 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw); | 70 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw); |
67 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw); | 71 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw); |
68 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw); | 72 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw); |
69 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, u16 offset, u8 *sum); | 73 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, |
70 | static s32 e1000_mng_write_cmd_header(struct e1000_hw* hw, struct e1000_host_mng_command_header* hdr); | 74 | u16 offset, u8 *sum); |
75 | static s32 e1000_mng_write_cmd_header(struct e1000_hw* hw, | ||
76 | struct e1000_host_mng_command_header | ||
77 | *hdr); | ||
71 | static s32 e1000_mng_write_commit(struct e1000_hw *hw); | 78 | static s32 e1000_mng_write_commit(struct e1000_hw *hw); |
72 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 79 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, |
73 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 80 | struct e1000_phy_info *phy_info); |
74 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 81 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, |
75 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 82 | struct e1000_phy_info *phy_info); |
83 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, | ||
84 | u16 *data); | ||
85 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, | ||
86 | u16 *data); | ||
76 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd); | 87 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd); |
77 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info); | 88 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, |
89 | struct e1000_phy_info *phy_info); | ||
78 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw); | 90 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw); |
79 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data); | 91 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data); |
80 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); | 92 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, |
93 | u8 byte); | ||
81 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); | 94 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte); |
82 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data); | 95 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data); |
83 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, u16 *data); | 96 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
84 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, u16 data); | 97 | u16 *data); |
85 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 98 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
86 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, u16 *data); | 99 | u16 data); |
100 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | ||
101 | u16 *data); | ||
102 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | ||
103 | u16 *data); | ||
87 | static void e1000_release_software_flag(struct e1000_hw *hw); | 104 | static void e1000_release_software_flag(struct e1000_hw *hw); |
88 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); | 105 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active); |
89 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active); | 106 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active); |
@@ -101,23 +118,21 @@ static s32 e1000_config_mac_to_phy(struct e1000_hw *hw); | |||
101 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl); | 118 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl); |
102 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl); | 119 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl); |
103 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, | 120 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, |
104 | u16 count); | 121 | u16 count); |
105 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw); | 122 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw); |
106 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw); | 123 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw); |
107 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, | 124 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, |
108 | u16 words, u16 *data); | 125 | u16 words, u16 *data); |
109 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, | 126 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset, |
110 | u16 offset, u16 words, | 127 | u16 words, u16 *data); |
111 | u16 *data); | ||
112 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw); | 128 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw); |
113 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd); | 129 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd); |
114 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd); | 130 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd); |
115 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, | 131 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, u16 count); |
116 | u16 count); | ||
117 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 132 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
118 | u16 phy_data); | 133 | u16 phy_data); |
119 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw,u32 reg_addr, | 134 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw,u32 reg_addr, |
120 | u16 *phy_data); | 135 | u16 *phy_data); |
121 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count); | 136 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count); |
122 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw); | 137 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw); |
123 | static void e1000_release_eeprom(struct e1000_hw *hw); | 138 | static void e1000_release_eeprom(struct e1000_hw *hw); |
@@ -127,8 +142,7 @@ static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw); | |||
127 | static s32 e1000_set_phy_mode(struct e1000_hw *hw); | 142 | static s32 e1000_set_phy_mode(struct e1000_hw *hw); |
128 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); | 143 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer); |
129 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); | 144 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length); |
130 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, | 145 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex); |
131 | u16 duplex); | ||
132 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); | 146 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw); |
133 | 147 | ||
134 | /* IGP cable length table */ | 148 | /* IGP cable length table */ |
@@ -159,8 +173,7 @@ u16 e1000_igp_2_cable_length_table[IGP02E1000_AGC_LENGTH_TABLE_SIZE] = | |||
159 | * | 173 | * |
160 | * hw - Struct containing variables accessed by shared code | 174 | * hw - Struct containing variables accessed by shared code |
161 | *****************************************************************************/ | 175 | *****************************************************************************/ |
162 | static s32 | 176 | static s32 e1000_set_phy_type(struct e1000_hw *hw) |
163 | e1000_set_phy_type(struct e1000_hw *hw) | ||
164 | { | 177 | { |
165 | DEBUGFUNC("e1000_set_phy_type"); | 178 | DEBUGFUNC("e1000_set_phy_type"); |
166 | 179 | ||
@@ -210,8 +223,7 @@ e1000_set_phy_type(struct e1000_hw *hw) | |||
210 | * | 223 | * |
211 | * hw - Struct containing variables accessed by shared code | 224 | * hw - Struct containing variables accessed by shared code |
212 | *****************************************************************************/ | 225 | *****************************************************************************/ |
213 | static void | 226 | static void e1000_phy_init_script(struct e1000_hw *hw) |
214 | e1000_phy_init_script(struct e1000_hw *hw) | ||
215 | { | 227 | { |
216 | u32 ret_val; | 228 | u32 ret_val; |
217 | u16 phy_saved_data; | 229 | u16 phy_saved_data; |
@@ -306,8 +318,7 @@ e1000_phy_init_script(struct e1000_hw *hw) | |||
306 | * | 318 | * |
307 | * hw - Struct containing variables accessed by shared code | 319 | * hw - Struct containing variables accessed by shared code |
308 | *****************************************************************************/ | 320 | *****************************************************************************/ |
309 | s32 | 321 | s32 e1000_set_mac_type(struct e1000_hw *hw) |
310 | e1000_set_mac_type(struct e1000_hw *hw) | ||
311 | { | 322 | { |
312 | DEBUGFUNC("e1000_set_mac_type"); | 323 | DEBUGFUNC("e1000_set_mac_type"); |
313 | 324 | ||
@@ -474,8 +485,7 @@ e1000_set_mac_type(struct e1000_hw *hw) | |||
474 | * | 485 | * |
475 | * hw - Struct containing variables accessed by shared code | 486 | * hw - Struct containing variables accessed by shared code |
476 | * **************************************************************************/ | 487 | * **************************************************************************/ |
477 | void | 488 | void e1000_set_media_type(struct e1000_hw *hw) |
478 | e1000_set_media_type(struct e1000_hw *hw) | ||
479 | { | 489 | { |
480 | u32 status; | 490 | u32 status; |
481 | 491 | ||
@@ -528,8 +538,7 @@ e1000_set_media_type(struct e1000_hw *hw) | |||
528 | * | 538 | * |
529 | * hw - Struct containing variables accessed by shared code | 539 | * hw - Struct containing variables accessed by shared code |
530 | *****************************************************************************/ | 540 | *****************************************************************************/ |
531 | s32 | 541 | s32 e1000_reset_hw(struct e1000_hw *hw) |
532 | e1000_reset_hw(struct e1000_hw *hw) | ||
533 | { | 542 | { |
534 | u32 ctrl; | 543 | u32 ctrl; |
535 | u32 ctrl_ext; | 544 | u32 ctrl_ext; |
@@ -747,8 +756,7 @@ e1000_reset_hw(struct e1000_hw *hw) | |||
747 | * This function contains hardware limitation workarounds for PCI-E adapters | 756 | * This function contains hardware limitation workarounds for PCI-E adapters |
748 | * | 757 | * |
749 | *****************************************************************************/ | 758 | *****************************************************************************/ |
750 | static void | 759 | static void e1000_initialize_hardware_bits(struct e1000_hw *hw) |
751 | e1000_initialize_hardware_bits(struct e1000_hw *hw) | ||
752 | { | 760 | { |
753 | if ((hw->mac_type >= e1000_82571) && (!hw->initialize_hw_bits_disable)) { | 761 | if ((hw->mac_type >= e1000_82571) && (!hw->initialize_hw_bits_disable)) { |
754 | /* Settings common to all PCI-express silicon */ | 762 | /* Settings common to all PCI-express silicon */ |
@@ -866,8 +874,7 @@ e1000_initialize_hardware_bits(struct e1000_hw *hw) | |||
866 | * configuration and flow control settings. Clears all on-chip counters. Leaves | 874 | * configuration and flow control settings. Clears all on-chip counters. Leaves |
867 | * the transmit and receive units disabled and uninitialized. | 875 | * the transmit and receive units disabled and uninitialized. |
868 | *****************************************************************************/ | 876 | *****************************************************************************/ |
869 | s32 | 877 | s32 e1000_init_hw(struct e1000_hw *hw) |
870 | e1000_init_hw(struct e1000_hw *hw) | ||
871 | { | 878 | { |
872 | u32 ctrl; | 879 | u32 ctrl; |
873 | u32 i; | 880 | u32 i; |
@@ -1054,8 +1061,7 @@ e1000_init_hw(struct e1000_hw *hw) | |||
1054 | * | 1061 | * |
1055 | * hw - Struct containing variables accessed by shared code. | 1062 | * hw - Struct containing variables accessed by shared code. |
1056 | *****************************************************************************/ | 1063 | *****************************************************************************/ |
1057 | static s32 | 1064 | static s32 e1000_adjust_serdes_amplitude(struct e1000_hw *hw) |
1058 | e1000_adjust_serdes_amplitude(struct e1000_hw *hw) | ||
1059 | { | 1065 | { |
1060 | u16 eeprom_data; | 1066 | u16 eeprom_data; |
1061 | s32 ret_val; | 1067 | s32 ret_val; |
@@ -1100,8 +1106,7 @@ e1000_adjust_serdes_amplitude(struct e1000_hw *hw) | |||
1100 | * established. Assumes the hardware has previously been reset and the | 1106 | * established. Assumes the hardware has previously been reset and the |
1101 | * transmitter and receiver are not enabled. | 1107 | * transmitter and receiver are not enabled. |
1102 | *****************************************************************************/ | 1108 | *****************************************************************************/ |
1103 | s32 | 1109 | s32 e1000_setup_link(struct e1000_hw *hw) |
1104 | e1000_setup_link(struct e1000_hw *hw) | ||
1105 | { | 1110 | { |
1106 | u32 ctrl_ext; | 1111 | u32 ctrl_ext; |
1107 | s32 ret_val; | 1112 | s32 ret_val; |
@@ -1233,8 +1238,7 @@ e1000_setup_link(struct e1000_hw *hw) | |||
1233 | * link. Assumes the hardware has been previously reset and the transmitter | 1238 | * link. Assumes the hardware has been previously reset and the transmitter |
1234 | * and receiver are not enabled. | 1239 | * and receiver are not enabled. |
1235 | *****************************************************************************/ | 1240 | *****************************************************************************/ |
1236 | static s32 | 1241 | static s32 e1000_setup_fiber_serdes_link(struct e1000_hw *hw) |
1237 | e1000_setup_fiber_serdes_link(struct e1000_hw *hw) | ||
1238 | { | 1242 | { |
1239 | u32 ctrl; | 1243 | u32 ctrl; |
1240 | u32 status; | 1244 | u32 status; |
@@ -1380,8 +1384,7 @@ e1000_setup_fiber_serdes_link(struct e1000_hw *hw) | |||
1380 | * | 1384 | * |
1381 | * hw - Struct containing variables accessed by shared code | 1385 | * hw - Struct containing variables accessed by shared code |
1382 | ******************************************************************************/ | 1386 | ******************************************************************************/ |
1383 | static s32 | 1387 | static s32 e1000_copper_link_preconfig(struct e1000_hw *hw) |
1384 | e1000_copper_link_preconfig(struct e1000_hw *hw) | ||
1385 | { | 1388 | { |
1386 | u32 ctrl; | 1389 | u32 ctrl; |
1387 | s32 ret_val; | 1390 | s32 ret_val; |
@@ -1440,8 +1443,7 @@ e1000_copper_link_preconfig(struct e1000_hw *hw) | |||
1440 | * | 1443 | * |
1441 | * hw - Struct containing variables accessed by shared code | 1444 | * hw - Struct containing variables accessed by shared code |
1442 | *********************************************************************/ | 1445 | *********************************************************************/ |
1443 | static s32 | 1446 | static s32 e1000_copper_link_igp_setup(struct e1000_hw *hw) |
1444 | e1000_copper_link_igp_setup(struct e1000_hw *hw) | ||
1445 | { | 1447 | { |
1446 | u32 led_ctrl; | 1448 | u32 led_ctrl; |
1447 | s32 ret_val; | 1449 | s32 ret_val; |
@@ -1587,8 +1589,7 @@ e1000_copper_link_igp_setup(struct e1000_hw *hw) | |||
1587 | * | 1589 | * |
1588 | * hw - Struct containing variables accessed by shared code | 1590 | * hw - Struct containing variables accessed by shared code |
1589 | *********************************************************************/ | 1591 | *********************************************************************/ |
1590 | static s32 | 1592 | static s32 e1000_copper_link_ggp_setup(struct e1000_hw *hw) |
1591 | e1000_copper_link_ggp_setup(struct e1000_hw *hw) | ||
1592 | { | 1593 | { |
1593 | s32 ret_val; | 1594 | s32 ret_val; |
1594 | u16 phy_data; | 1595 | u16 phy_data; |
@@ -1735,8 +1736,7 @@ e1000_copper_link_ggp_setup(struct e1000_hw *hw) | |||
1735 | * | 1736 | * |
1736 | * hw - Struct containing variables accessed by shared code | 1737 | * hw - Struct containing variables accessed by shared code |
1737 | *********************************************************************/ | 1738 | *********************************************************************/ |
1738 | static s32 | 1739 | static s32 e1000_copper_link_mgp_setup(struct e1000_hw *hw) |
1739 | e1000_copper_link_mgp_setup(struct e1000_hw *hw) | ||
1740 | { | 1740 | { |
1741 | s32 ret_val; | 1741 | s32 ret_val; |
1742 | u16 phy_data; | 1742 | u16 phy_data; |
@@ -1839,8 +1839,7 @@ e1000_copper_link_mgp_setup(struct e1000_hw *hw) | |||
1839 | * | 1839 | * |
1840 | * hw - Struct containing variables accessed by shared code | 1840 | * hw - Struct containing variables accessed by shared code |
1841 | *********************************************************************/ | 1841 | *********************************************************************/ |
1842 | static s32 | 1842 | static s32 e1000_copper_link_autoneg(struct e1000_hw *hw) |
1843 | e1000_copper_link_autoneg(struct e1000_hw *hw) | ||
1844 | { | 1843 | { |
1845 | s32 ret_val; | 1844 | s32 ret_val; |
1846 | u16 phy_data; | 1845 | u16 phy_data; |
@@ -1910,8 +1909,7 @@ e1000_copper_link_autoneg(struct e1000_hw *hw) | |||
1910 | * | 1909 | * |
1911 | * hw - Struct containing variables accessed by shared code | 1910 | * hw - Struct containing variables accessed by shared code |
1912 | ******************************************************************************/ | 1911 | ******************************************************************************/ |
1913 | static s32 | 1912 | static s32 e1000_copper_link_postconfig(struct e1000_hw *hw) |
1914 | e1000_copper_link_postconfig(struct e1000_hw *hw) | ||
1915 | { | 1913 | { |
1916 | s32 ret_val; | 1914 | s32 ret_val; |
1917 | DEBUGFUNC("e1000_copper_link_postconfig"); | 1915 | DEBUGFUNC("e1000_copper_link_postconfig"); |
@@ -1948,8 +1946,7 @@ e1000_copper_link_postconfig(struct e1000_hw *hw) | |||
1948 | * | 1946 | * |
1949 | * hw - Struct containing variables accessed by shared code | 1947 | * hw - Struct containing variables accessed by shared code |
1950 | ******************************************************************************/ | 1948 | ******************************************************************************/ |
1951 | static s32 | 1949 | static s32 e1000_setup_copper_link(struct e1000_hw *hw) |
1952 | e1000_setup_copper_link(struct e1000_hw *hw) | ||
1953 | { | 1950 | { |
1954 | s32 ret_val; | 1951 | s32 ret_val; |
1955 | u16 i; | 1952 | u16 i; |
@@ -2062,8 +2059,7 @@ e1000_setup_copper_link(struct e1000_hw *hw) | |||
2062 | * | 2059 | * |
2063 | * hw - Struct containing variables accessed by shared code | 2060 | * hw - Struct containing variables accessed by shared code |
2064 | ******************************************************************************/ | 2061 | ******************************************************************************/ |
2065 | static s32 | 2062 | static s32 e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) |
2066 | e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) | ||
2067 | { | 2063 | { |
2068 | s32 ret_val = E1000_SUCCESS; | 2064 | s32 ret_val = E1000_SUCCESS; |
2069 | u32 tipg; | 2065 | u32 tipg; |
@@ -2098,8 +2094,7 @@ e1000_configure_kmrn_for_10_100(struct e1000_hw *hw, u16 duplex) | |||
2098 | return ret_val; | 2094 | return ret_val; |
2099 | } | 2095 | } |
2100 | 2096 | ||
2101 | static s32 | 2097 | static s32 e1000_configure_kmrn_for_1000(struct e1000_hw *hw) |
2102 | e1000_configure_kmrn_for_1000(struct e1000_hw *hw) | ||
2103 | { | 2098 | { |
2104 | s32 ret_val = E1000_SUCCESS; | 2099 | s32 ret_val = E1000_SUCCESS; |
2105 | u16 reg_data; | 2100 | u16 reg_data; |
@@ -2135,8 +2130,7 @@ e1000_configure_kmrn_for_1000(struct e1000_hw *hw) | |||
2135 | * | 2130 | * |
2136 | * hw - Struct containing variables accessed by shared code | 2131 | * hw - Struct containing variables accessed by shared code |
2137 | ******************************************************************************/ | 2132 | ******************************************************************************/ |
2138 | s32 | 2133 | s32 e1000_phy_setup_autoneg(struct e1000_hw *hw) |
2139 | e1000_phy_setup_autoneg(struct e1000_hw *hw) | ||
2140 | { | 2134 | { |
2141 | s32 ret_val; | 2135 | s32 ret_val; |
2142 | u16 mii_autoneg_adv_reg; | 2136 | u16 mii_autoneg_adv_reg; |
@@ -2284,8 +2278,7 @@ e1000_phy_setup_autoneg(struct e1000_hw *hw) | |||
2284 | * | 2278 | * |
2285 | * hw - Struct containing variables accessed by shared code | 2279 | * hw - Struct containing variables accessed by shared code |
2286 | ******************************************************************************/ | 2280 | ******************************************************************************/ |
2287 | static s32 | 2281 | static s32 e1000_phy_force_speed_duplex(struct e1000_hw *hw) |
2288 | e1000_phy_force_speed_duplex(struct e1000_hw *hw) | ||
2289 | { | 2282 | { |
2290 | u32 ctrl; | 2283 | u32 ctrl; |
2291 | s32 ret_val; | 2284 | s32 ret_val; |
@@ -2535,8 +2528,7 @@ e1000_phy_force_speed_duplex(struct e1000_hw *hw) | |||
2535 | * Link should have been established previously. Reads the speed and duplex | 2528 | * Link should have been established previously. Reads the speed and duplex |
2536 | * information from the Device Status register. | 2529 | * information from the Device Status register. |
2537 | ******************************************************************************/ | 2530 | ******************************************************************************/ |
2538 | void | 2531 | void e1000_config_collision_dist(struct e1000_hw *hw) |
2539 | e1000_config_collision_dist(struct e1000_hw *hw) | ||
2540 | { | 2532 | { |
2541 | u32 tctl, coll_dist; | 2533 | u32 tctl, coll_dist; |
2542 | 2534 | ||
@@ -2565,8 +2557,7 @@ e1000_config_collision_dist(struct e1000_hw *hw) | |||
2565 | * The contents of the PHY register containing the needed information need to | 2557 | * The contents of the PHY register containing the needed information need to |
2566 | * be passed in. | 2558 | * be passed in. |
2567 | ******************************************************************************/ | 2559 | ******************************************************************************/ |
2568 | static s32 | 2560 | static s32 e1000_config_mac_to_phy(struct e1000_hw *hw) |
2569 | e1000_config_mac_to_phy(struct e1000_hw *hw) | ||
2570 | { | 2561 | { |
2571 | u32 ctrl; | 2562 | u32 ctrl; |
2572 | s32 ret_val; | 2563 | s32 ret_val; |
@@ -2624,8 +2615,7 @@ e1000_config_mac_to_phy(struct e1000_hw *hw) | |||
2624 | * by the PHY rather than the MAC. Software must also configure these | 2615 | * by the PHY rather than the MAC. Software must also configure these |
2625 | * bits when link is forced on a fiber connection. | 2616 | * bits when link is forced on a fiber connection. |
2626 | *****************************************************************************/ | 2617 | *****************************************************************************/ |
2627 | s32 | 2618 | s32 e1000_force_mac_fc(struct e1000_hw *hw) |
2628 | e1000_force_mac_fc(struct e1000_hw *hw) | ||
2629 | { | 2619 | { |
2630 | u32 ctrl; | 2620 | u32 ctrl; |
2631 | 2621 | ||
@@ -2691,8 +2681,7 @@ e1000_force_mac_fc(struct e1000_hw *hw) | |||
2691 | * based on the flow control negotiated by the PHY. In TBI mode, the TFCE | 2681 | * based on the flow control negotiated by the PHY. In TBI mode, the TFCE |
2692 | * and RFCE bits will be automaticaly set to the negotiated flow control mode. | 2682 | * and RFCE bits will be automaticaly set to the negotiated flow control mode. |
2693 | *****************************************************************************/ | 2683 | *****************************************************************************/ |
2694 | static s32 | 2684 | static s32 e1000_config_fc_after_link_up(struct e1000_hw *hw) |
2695 | e1000_config_fc_after_link_up(struct e1000_hw *hw) | ||
2696 | { | 2685 | { |
2697 | s32 ret_val; | 2686 | s32 ret_val; |
2698 | u16 mii_status_reg; | 2687 | u16 mii_status_reg; |
@@ -2896,8 +2885,7 @@ e1000_config_fc_after_link_up(struct e1000_hw *hw) | |||
2896 | * | 2885 | * |
2897 | * Called by any function that needs to check the link status of the adapter. | 2886 | * Called by any function that needs to check the link status of the adapter. |
2898 | *****************************************************************************/ | 2887 | *****************************************************************************/ |
2899 | s32 | 2888 | s32 e1000_check_for_link(struct e1000_hw *hw) |
2900 | e1000_check_for_link(struct e1000_hw *hw) | ||
2901 | { | 2889 | { |
2902 | u32 rxcw = 0; | 2890 | u32 rxcw = 0; |
2903 | u32 ctrl; | 2891 | u32 ctrl; |
@@ -3132,10 +3120,7 @@ e1000_check_for_link(struct e1000_hw *hw) | |||
3132 | * speed - Speed of the connection | 3120 | * speed - Speed of the connection |
3133 | * duplex - Duplex setting of the connection | 3121 | * duplex - Duplex setting of the connection |
3134 | *****************************************************************************/ | 3122 | *****************************************************************************/ |
3135 | s32 | 3123 | s32 e1000_get_speed_and_duplex(struct e1000_hw *hw, u16 *speed, u16 *duplex) |
3136 | e1000_get_speed_and_duplex(struct e1000_hw *hw, | ||
3137 | u16 *speed, | ||
3138 | u16 *duplex) | ||
3139 | { | 3124 | { |
3140 | u32 status; | 3125 | u32 status; |
3141 | s32 ret_val; | 3126 | s32 ret_val; |
@@ -3214,8 +3199,7 @@ e1000_get_speed_and_duplex(struct e1000_hw *hw, | |||
3214 | * | 3199 | * |
3215 | * hw - Struct containing variables accessed by shared code | 3200 | * hw - Struct containing variables accessed by shared code |
3216 | ******************************************************************************/ | 3201 | ******************************************************************************/ |
3217 | static s32 | 3202 | static s32 e1000_wait_autoneg(struct e1000_hw *hw) |
3218 | e1000_wait_autoneg(struct e1000_hw *hw) | ||
3219 | { | 3203 | { |
3220 | s32 ret_val; | 3204 | s32 ret_val; |
3221 | u16 i; | 3205 | u16 i; |
@@ -3249,9 +3233,7 @@ e1000_wait_autoneg(struct e1000_hw *hw) | |||
3249 | * hw - Struct containing variables accessed by shared code | 3233 | * hw - Struct containing variables accessed by shared code |
3250 | * ctrl - Device control register's current value | 3234 | * ctrl - Device control register's current value |
3251 | ******************************************************************************/ | 3235 | ******************************************************************************/ |
3252 | static void | 3236 | static void e1000_raise_mdi_clk(struct e1000_hw *hw, u32 *ctrl) |
3253 | e1000_raise_mdi_clk(struct e1000_hw *hw, | ||
3254 | u32 *ctrl) | ||
3255 | { | 3237 | { |
3256 | /* Raise the clock input to the Management Data Clock (by setting the MDC | 3238 | /* Raise the clock input to the Management Data Clock (by setting the MDC |
3257 | * bit), and then delay 10 microseconds. | 3239 | * bit), and then delay 10 microseconds. |
@@ -3267,9 +3249,7 @@ e1000_raise_mdi_clk(struct e1000_hw *hw, | |||
3267 | * hw - Struct containing variables accessed by shared code | 3249 | * hw - Struct containing variables accessed by shared code |
3268 | * ctrl - Device control register's current value | 3250 | * ctrl - Device control register's current value |
3269 | ******************************************************************************/ | 3251 | ******************************************************************************/ |
3270 | static void | 3252 | static void e1000_lower_mdi_clk(struct e1000_hw *hw, u32 *ctrl) |
3271 | e1000_lower_mdi_clk(struct e1000_hw *hw, | ||
3272 | u32 *ctrl) | ||
3273 | { | 3253 | { |
3274 | /* Lower the clock input to the Management Data Clock (by clearing the MDC | 3254 | /* Lower the clock input to the Management Data Clock (by clearing the MDC |
3275 | * bit), and then delay 10 microseconds. | 3255 | * bit), and then delay 10 microseconds. |
@@ -3288,10 +3268,7 @@ e1000_lower_mdi_clk(struct e1000_hw *hw, | |||
3288 | * | 3268 | * |
3289 | * Bits are shifted out in MSB to LSB order. | 3269 | * Bits are shifted out in MSB to LSB order. |
3290 | ******************************************************************************/ | 3270 | ******************************************************************************/ |
3291 | static void | 3271 | static void e1000_shift_out_mdi_bits(struct e1000_hw *hw, u32 data, u16 count) |
3292 | e1000_shift_out_mdi_bits(struct e1000_hw *hw, | ||
3293 | u32 data, | ||
3294 | u16 count) | ||
3295 | { | 3272 | { |
3296 | u32 ctrl; | 3273 | u32 ctrl; |
3297 | u32 mask; | 3274 | u32 mask; |
@@ -3338,8 +3315,7 @@ e1000_shift_out_mdi_bits(struct e1000_hw *hw, | |||
3338 | * | 3315 | * |
3339 | * Bits are shifted in in MSB to LSB order. | 3316 | * Bits are shifted in in MSB to LSB order. |
3340 | ******************************************************************************/ | 3317 | ******************************************************************************/ |
3341 | static u16 | 3318 | static u16 e1000_shift_in_mdi_bits(struct e1000_hw *hw) |
3342 | e1000_shift_in_mdi_bits(struct e1000_hw *hw) | ||
3343 | { | 3319 | { |
3344 | u32 ctrl; | 3320 | u32 ctrl; |
3345 | u16 data = 0; | 3321 | u16 data = 0; |
@@ -3384,8 +3360,7 @@ e1000_shift_in_mdi_bits(struct e1000_hw *hw) | |||
3384 | return data; | 3360 | return data; |
3385 | } | 3361 | } |
3386 | 3362 | ||
3387 | static s32 | 3363 | static s32 e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) |
3388 | e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) | ||
3389 | { | 3364 | { |
3390 | u32 swfw_sync = 0; | 3365 | u32 swfw_sync = 0; |
3391 | u32 swmask = mask; | 3366 | u32 swmask = mask; |
@@ -3428,8 +3403,7 @@ e1000_swfw_sync_acquire(struct e1000_hw *hw, u16 mask) | |||
3428 | return E1000_SUCCESS; | 3403 | return E1000_SUCCESS; |
3429 | } | 3404 | } |
3430 | 3405 | ||
3431 | static void | 3406 | static void e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) |
3432 | e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) | ||
3433 | { | 3407 | { |
3434 | u32 swfw_sync; | 3408 | u32 swfw_sync; |
3435 | u32 swmask = mask; | 3409 | u32 swmask = mask; |
@@ -3464,10 +3438,7 @@ e1000_swfw_sync_release(struct e1000_hw *hw, u16 mask) | |||
3464 | * hw - Struct containing variables accessed by shared code | 3438 | * hw - Struct containing variables accessed by shared code |
3465 | * reg_addr - address of the PHY register to read | 3439 | * reg_addr - address of the PHY register to read |
3466 | ******************************************************************************/ | 3440 | ******************************************************************************/ |
3467 | s32 | 3441 | s32 e1000_read_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 *phy_data) |
3468 | e1000_read_phy_reg(struct e1000_hw *hw, | ||
3469 | u32 reg_addr, | ||
3470 | u16 *phy_data) | ||
3471 | { | 3442 | { |
3472 | u32 ret_val; | 3443 | u32 ret_val; |
3473 | u16 swfw; | 3444 | u16 swfw; |
@@ -3523,9 +3494,8 @@ e1000_read_phy_reg(struct e1000_hw *hw, | |||
3523 | return ret_val; | 3494 | return ret_val; |
3524 | } | 3495 | } |
3525 | 3496 | ||
3526 | static s32 | 3497 | static s32 e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
3527 | e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 3498 | u16 *phy_data) |
3528 | u16 *phy_data) | ||
3529 | { | 3499 | { |
3530 | u32 i; | 3500 | u32 i; |
3531 | u32 mdic = 0; | 3501 | u32 mdic = 0; |
@@ -3603,9 +3573,7 @@ e1000_read_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
3603 | * reg_addr - address of the PHY register to write | 3573 | * reg_addr - address of the PHY register to write |
3604 | * data - data to write to the PHY | 3574 | * data - data to write to the PHY |
3605 | ******************************************************************************/ | 3575 | ******************************************************************************/ |
3606 | s32 | 3576 | s32 e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, u16 phy_data) |
3607 | e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, | ||
3608 | u16 phy_data) | ||
3609 | { | 3577 | { |
3610 | u32 ret_val; | 3578 | u32 ret_val; |
3611 | u16 swfw; | 3579 | u16 swfw; |
@@ -3661,9 +3629,8 @@ e1000_write_phy_reg(struct e1000_hw *hw, u32 reg_addr, | |||
3661 | return ret_val; | 3629 | return ret_val; |
3662 | } | 3630 | } |
3663 | 3631 | ||
3664 | static s32 | 3632 | static s32 e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, |
3665 | e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | 3633 | u16 phy_data) |
3666 | u16 phy_data) | ||
3667 | { | 3634 | { |
3668 | u32 i; | 3635 | u32 i; |
3669 | u32 mdic = 0; | 3636 | u32 mdic = 0; |
@@ -3723,10 +3690,7 @@ e1000_write_phy_reg_ex(struct e1000_hw *hw, u32 reg_addr, | |||
3723 | return E1000_SUCCESS; | 3690 | return E1000_SUCCESS; |
3724 | } | 3691 | } |
3725 | 3692 | ||
3726 | static s32 | 3693 | static s32 e1000_read_kmrn_reg(struct e1000_hw *hw, u32 reg_addr, u16 *data) |
3727 | e1000_read_kmrn_reg(struct e1000_hw *hw, | ||
3728 | u32 reg_addr, | ||
3729 | u16 *data) | ||
3730 | { | 3694 | { |
3731 | u32 reg_val; | 3695 | u32 reg_val; |
3732 | u16 swfw; | 3696 | u16 swfw; |
@@ -3756,10 +3720,7 @@ e1000_read_kmrn_reg(struct e1000_hw *hw, | |||
3756 | return E1000_SUCCESS; | 3720 | return E1000_SUCCESS; |
3757 | } | 3721 | } |
3758 | 3722 | ||
3759 | static s32 | 3723 | static s32 e1000_write_kmrn_reg(struct e1000_hw *hw, u32 reg_addr, u16 data) |
3760 | e1000_write_kmrn_reg(struct e1000_hw *hw, | ||
3761 | u32 reg_addr, | ||
3762 | u16 data) | ||
3763 | { | 3724 | { |
3764 | u32 reg_val; | 3725 | u32 reg_val; |
3765 | u16 swfw; | 3726 | u16 swfw; |
@@ -3788,8 +3749,7 @@ e1000_write_kmrn_reg(struct e1000_hw *hw, | |||
3788 | * | 3749 | * |
3789 | * hw - Struct containing variables accessed by shared code | 3750 | * hw - Struct containing variables accessed by shared code |
3790 | ******************************************************************************/ | 3751 | ******************************************************************************/ |
3791 | s32 | 3752 | s32 e1000_phy_hw_reset(struct e1000_hw *hw) |
3792 | e1000_phy_hw_reset(struct e1000_hw *hw) | ||
3793 | { | 3753 | { |
3794 | u32 ctrl, ctrl_ext; | 3754 | u32 ctrl, ctrl_ext; |
3795 | u32 led_ctrl; | 3755 | u32 led_ctrl; |
@@ -3882,8 +3842,7 @@ e1000_phy_hw_reset(struct e1000_hw *hw) | |||
3882 | * | 3842 | * |
3883 | * Sets bit 15 of the MII Control register | 3843 | * Sets bit 15 of the MII Control register |
3884 | ******************************************************************************/ | 3844 | ******************************************************************************/ |
3885 | s32 | 3845 | s32 e1000_phy_reset(struct e1000_hw *hw) |
3886 | e1000_phy_reset(struct e1000_hw *hw) | ||
3887 | { | 3846 | { |
3888 | s32 ret_val; | 3847 | s32 ret_val; |
3889 | u16 phy_data; | 3848 | u16 phy_data; |
@@ -3934,8 +3893,7 @@ e1000_phy_reset(struct e1000_hw *hw) | |||
3934 | * | 3893 | * |
3935 | * hw - struct containing variables accessed by shared code | 3894 | * hw - struct containing variables accessed by shared code |
3936 | ******************************************************************************/ | 3895 | ******************************************************************************/ |
3937 | void | 3896 | void e1000_phy_powerdown_workaround(struct e1000_hw *hw) |
3938 | e1000_phy_powerdown_workaround(struct e1000_hw *hw) | ||
3939 | { | 3897 | { |
3940 | s32 reg; | 3898 | s32 reg; |
3941 | u16 phy_data; | 3899 | u16 phy_data; |
@@ -3987,8 +3945,7 @@ e1000_phy_powerdown_workaround(struct e1000_hw *hw) | |||
3987 | * | 3945 | * |
3988 | * hw - struct containing variables accessed by shared code | 3946 | * hw - struct containing variables accessed by shared code |
3989 | ******************************************************************************/ | 3947 | ******************************************************************************/ |
3990 | static s32 | 3948 | static s32 e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) |
3991 | e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) | ||
3992 | { | 3949 | { |
3993 | s32 ret_val; | 3950 | s32 ret_val; |
3994 | s32 reg; | 3951 | s32 reg; |
@@ -4040,8 +3997,7 @@ e1000_kumeran_lock_loss_workaround(struct e1000_hw *hw) | |||
4040 | * | 3997 | * |
4041 | * hw - Struct containing variables accessed by shared code | 3998 | * hw - Struct containing variables accessed by shared code |
4042 | ******************************************************************************/ | 3999 | ******************************************************************************/ |
4043 | static s32 | 4000 | static s32 e1000_detect_gig_phy(struct e1000_hw *hw) |
4044 | e1000_detect_gig_phy(struct e1000_hw *hw) | ||
4045 | { | 4001 | { |
4046 | s32 phy_init_status, ret_val; | 4002 | s32 phy_init_status, ret_val; |
4047 | u16 phy_id_high, phy_id_low; | 4003 | u16 phy_id_high, phy_id_low; |
@@ -4136,8 +4092,7 @@ e1000_detect_gig_phy(struct e1000_hw *hw) | |||
4136 | * | 4092 | * |
4137 | * hw - Struct containing variables accessed by shared code | 4093 | * hw - Struct containing variables accessed by shared code |
4138 | ******************************************************************************/ | 4094 | ******************************************************************************/ |
4139 | static s32 | 4095 | static s32 e1000_phy_reset_dsp(struct e1000_hw *hw) |
4140 | e1000_phy_reset_dsp(struct e1000_hw *hw) | ||
4141 | { | 4096 | { |
4142 | s32 ret_val; | 4097 | s32 ret_val; |
4143 | DEBUGFUNC("e1000_phy_reset_dsp"); | 4098 | DEBUGFUNC("e1000_phy_reset_dsp"); |
@@ -4163,9 +4118,8 @@ e1000_phy_reset_dsp(struct e1000_hw *hw) | |||
4163 | * hw - Struct containing variables accessed by shared code | 4118 | * hw - Struct containing variables accessed by shared code |
4164 | * phy_info - PHY information structure | 4119 | * phy_info - PHY information structure |
4165 | ******************************************************************************/ | 4120 | ******************************************************************************/ |
4166 | static s32 | 4121 | static s32 e1000_phy_igp_get_info(struct e1000_hw *hw, |
4167 | e1000_phy_igp_get_info(struct e1000_hw *hw, | 4122 | struct e1000_phy_info *phy_info) |
4168 | struct e1000_phy_info *phy_info) | ||
4169 | { | 4123 | { |
4170 | s32 ret_val; | 4124 | s32 ret_val; |
4171 | u16 phy_data, min_length, max_length, average; | 4125 | u16 phy_data, min_length, max_length, average; |
@@ -4240,9 +4194,8 @@ e1000_phy_igp_get_info(struct e1000_hw *hw, | |||
4240 | * hw - Struct containing variables accessed by shared code | 4194 | * hw - Struct containing variables accessed by shared code |
4241 | * phy_info - PHY information structure | 4195 | * phy_info - PHY information structure |
4242 | ******************************************************************************/ | 4196 | ******************************************************************************/ |
4243 | static s32 | 4197 | static s32 e1000_phy_ife_get_info(struct e1000_hw *hw, |
4244 | e1000_phy_ife_get_info(struct e1000_hw *hw, | 4198 | struct e1000_phy_info *phy_info) |
4245 | struct e1000_phy_info *phy_info) | ||
4246 | { | 4199 | { |
4247 | s32 ret_val; | 4200 | s32 ret_val; |
4248 | u16 phy_data; | 4201 | u16 phy_data; |
@@ -4290,9 +4243,8 @@ e1000_phy_ife_get_info(struct e1000_hw *hw, | |||
4290 | * hw - Struct containing variables accessed by shared code | 4243 | * hw - Struct containing variables accessed by shared code |
4291 | * phy_info - PHY information structure | 4244 | * phy_info - PHY information structure |
4292 | ******************************************************************************/ | 4245 | ******************************************************************************/ |
4293 | static s32 | 4246 | static s32 e1000_phy_m88_get_info(struct e1000_hw *hw, |
4294 | e1000_phy_m88_get_info(struct e1000_hw *hw, | 4247 | struct e1000_phy_info *phy_info) |
4295 | struct e1000_phy_info *phy_info) | ||
4296 | { | 4248 | { |
4297 | s32 ret_val; | 4249 | s32 ret_val; |
4298 | u16 phy_data; | 4250 | u16 phy_data; |
@@ -4369,9 +4321,7 @@ e1000_phy_m88_get_info(struct e1000_hw *hw, | |||
4369 | * hw - Struct containing variables accessed by shared code | 4321 | * hw - Struct containing variables accessed by shared code |
4370 | * phy_info - PHY information structure | 4322 | * phy_info - PHY information structure |
4371 | ******************************************************************************/ | 4323 | ******************************************************************************/ |
4372 | s32 | 4324 | s32 e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info) |
4373 | e1000_phy_get_info(struct e1000_hw *hw, | ||
4374 | struct e1000_phy_info *phy_info) | ||
4375 | { | 4325 | { |
4376 | s32 ret_val; | 4326 | s32 ret_val; |
4377 | u16 phy_data; | 4327 | u16 phy_data; |
@@ -4415,8 +4365,7 @@ e1000_phy_get_info(struct e1000_hw *hw, | |||
4415 | return e1000_phy_m88_get_info(hw, phy_info); | 4365 | return e1000_phy_m88_get_info(hw, phy_info); |
4416 | } | 4366 | } |
4417 | 4367 | ||
4418 | s32 | 4368 | s32 e1000_validate_mdi_setting(struct e1000_hw *hw) |
4419 | e1000_validate_mdi_setting(struct e1000_hw *hw) | ||
4420 | { | 4369 | { |
4421 | DEBUGFUNC("e1000_validate_mdi_settings"); | 4370 | DEBUGFUNC("e1000_validate_mdi_settings"); |
4422 | 4371 | ||
@@ -4436,8 +4385,7 @@ e1000_validate_mdi_setting(struct e1000_hw *hw) | |||
4436 | * | 4385 | * |
4437 | * hw - Struct containing variables accessed by shared code | 4386 | * hw - Struct containing variables accessed by shared code |
4438 | *****************************************************************************/ | 4387 | *****************************************************************************/ |
4439 | s32 | 4388 | s32 e1000_init_eeprom_params(struct e1000_hw *hw) |
4440 | e1000_init_eeprom_params(struct e1000_hw *hw) | ||
4441 | { | 4389 | { |
4442 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4390 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4443 | u32 eecd = E1000_READ_REG(hw, EECD); | 4391 | u32 eecd = E1000_READ_REG(hw, EECD); |
@@ -4626,9 +4574,7 @@ e1000_init_eeprom_params(struct e1000_hw *hw) | |||
4626 | * hw - Struct containing variables accessed by shared code | 4574 | * hw - Struct containing variables accessed by shared code |
4627 | * eecd - EECD's current value | 4575 | * eecd - EECD's current value |
4628 | *****************************************************************************/ | 4576 | *****************************************************************************/ |
4629 | static void | 4577 | static void e1000_raise_ee_clk(struct e1000_hw *hw, u32 *eecd) |
4630 | e1000_raise_ee_clk(struct e1000_hw *hw, | ||
4631 | u32 *eecd) | ||
4632 | { | 4578 | { |
4633 | /* Raise the clock input to the EEPROM (by setting the SK bit), and then | 4579 | /* Raise the clock input to the EEPROM (by setting the SK bit), and then |
4634 | * wait <delay> microseconds. | 4580 | * wait <delay> microseconds. |
@@ -4645,9 +4591,7 @@ e1000_raise_ee_clk(struct e1000_hw *hw, | |||
4645 | * hw - Struct containing variables accessed by shared code | 4591 | * hw - Struct containing variables accessed by shared code |
4646 | * eecd - EECD's current value | 4592 | * eecd - EECD's current value |
4647 | *****************************************************************************/ | 4593 | *****************************************************************************/ |
4648 | static void | 4594 | static void e1000_lower_ee_clk(struct e1000_hw *hw, u32 *eecd) |
4649 | e1000_lower_ee_clk(struct e1000_hw *hw, | ||
4650 | u32 *eecd) | ||
4651 | { | 4595 | { |
4652 | /* Lower the clock input to the EEPROM (by clearing the SK bit), and then | 4596 | /* Lower the clock input to the EEPROM (by clearing the SK bit), and then |
4653 | * wait 50 microseconds. | 4597 | * wait 50 microseconds. |
@@ -4665,10 +4609,7 @@ e1000_lower_ee_clk(struct e1000_hw *hw, | |||
4665 | * data - data to send to the EEPROM | 4609 | * data - data to send to the EEPROM |
4666 | * count - number of bits to shift out | 4610 | * count - number of bits to shift out |
4667 | *****************************************************************************/ | 4611 | *****************************************************************************/ |
4668 | static void | 4612 | static void e1000_shift_out_ee_bits(struct e1000_hw *hw, u16 data, u16 count) |
4669 | e1000_shift_out_ee_bits(struct e1000_hw *hw, | ||
4670 | u16 data, | ||
4671 | u16 count) | ||
4672 | { | 4613 | { |
4673 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4614 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4674 | u32 eecd; | 4615 | u32 eecd; |
@@ -4718,9 +4659,7 @@ e1000_shift_out_ee_bits(struct e1000_hw *hw, | |||
4718 | * | 4659 | * |
4719 | * hw - Struct containing variables accessed by shared code | 4660 | * hw - Struct containing variables accessed by shared code |
4720 | *****************************************************************************/ | 4661 | *****************************************************************************/ |
4721 | static u16 | 4662 | static u16 e1000_shift_in_ee_bits(struct e1000_hw *hw, u16 count) |
4722 | e1000_shift_in_ee_bits(struct e1000_hw *hw, | ||
4723 | u16 count) | ||
4724 | { | 4663 | { |
4725 | u32 eecd; | 4664 | u32 eecd; |
4726 | u32 i; | 4665 | u32 i; |
@@ -4762,8 +4701,7 @@ e1000_shift_in_ee_bits(struct e1000_hw *hw, | |||
4762 | * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This | 4701 | * Lowers EEPROM clock. Clears input pin. Sets the chip select pin. This |
4763 | * function should be called before issuing a command to the EEPROM. | 4702 | * function should be called before issuing a command to the EEPROM. |
4764 | *****************************************************************************/ | 4703 | *****************************************************************************/ |
4765 | static s32 | 4704 | static s32 e1000_acquire_eeprom(struct e1000_hw *hw) |
4766 | e1000_acquire_eeprom(struct e1000_hw *hw) | ||
4767 | { | 4705 | { |
4768 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4706 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4769 | u32 eecd, i=0; | 4707 | u32 eecd, i=0; |
@@ -4821,8 +4759,7 @@ e1000_acquire_eeprom(struct e1000_hw *hw) | |||
4821 | * | 4759 | * |
4822 | * hw - Struct containing variables accessed by shared code | 4760 | * hw - Struct containing variables accessed by shared code |
4823 | *****************************************************************************/ | 4761 | *****************************************************************************/ |
4824 | static void | 4762 | static void e1000_standby_eeprom(struct e1000_hw *hw) |
4825 | e1000_standby_eeprom(struct e1000_hw *hw) | ||
4826 | { | 4763 | { |
4827 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4764 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4828 | u32 eecd; | 4765 | u32 eecd; |
@@ -4870,8 +4807,7 @@ e1000_standby_eeprom(struct e1000_hw *hw) | |||
4870 | * | 4807 | * |
4871 | * hw - Struct containing variables accessed by shared code | 4808 | * hw - Struct containing variables accessed by shared code |
4872 | *****************************************************************************/ | 4809 | *****************************************************************************/ |
4873 | static void | 4810 | static void e1000_release_eeprom(struct e1000_hw *hw) |
4874 | e1000_release_eeprom(struct e1000_hw *hw) | ||
4875 | { | 4811 | { |
4876 | u32 eecd; | 4812 | u32 eecd; |
4877 | 4813 | ||
@@ -4921,8 +4857,7 @@ e1000_release_eeprom(struct e1000_hw *hw) | |||
4921 | * | 4857 | * |
4922 | * hw - Struct containing variables accessed by shared code | 4858 | * hw - Struct containing variables accessed by shared code |
4923 | *****************************************************************************/ | 4859 | *****************************************************************************/ |
4924 | static s32 | 4860 | static s32 e1000_spi_eeprom_ready(struct e1000_hw *hw) |
4925 | e1000_spi_eeprom_ready(struct e1000_hw *hw) | ||
4926 | { | 4861 | { |
4927 | u16 retry_count = 0; | 4862 | u16 retry_count = 0; |
4928 | u8 spi_stat_reg; | 4863 | u8 spi_stat_reg; |
@@ -4967,11 +4902,7 @@ e1000_spi_eeprom_ready(struct e1000_hw *hw) | |||
4967 | * data - word read from the EEPROM | 4902 | * data - word read from the EEPROM |
4968 | * words - number of words to read | 4903 | * words - number of words to read |
4969 | *****************************************************************************/ | 4904 | *****************************************************************************/ |
4970 | s32 | 4905 | s32 e1000_read_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
4971 | e1000_read_eeprom(struct e1000_hw *hw, | ||
4972 | u16 offset, | ||
4973 | u16 words, | ||
4974 | u16 *data) | ||
4975 | { | 4906 | { |
4976 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 4907 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
4977 | u32 i = 0; | 4908 | u32 i = 0; |
@@ -5068,11 +4999,8 @@ e1000_read_eeprom(struct e1000_hw *hw, | |||
5068 | * data - word read from the EEPROM | 4999 | * data - word read from the EEPROM |
5069 | * words - number of words to read | 5000 | * words - number of words to read |
5070 | *****************************************************************************/ | 5001 | *****************************************************************************/ |
5071 | static s32 | 5002 | static s32 e1000_read_eeprom_eerd(struct e1000_hw *hw, u16 offset, u16 words, |
5072 | e1000_read_eeprom_eerd(struct e1000_hw *hw, | 5003 | u16 *data) |
5073 | u16 offset, | ||
5074 | u16 words, | ||
5075 | u16 *data) | ||
5076 | { | 5004 | { |
5077 | u32 i, eerd = 0; | 5005 | u32 i, eerd = 0; |
5078 | s32 error = 0; | 5006 | s32 error = 0; |
@@ -5102,11 +5030,8 @@ e1000_read_eeprom_eerd(struct e1000_hw *hw, | |||
5102 | * data - word read from the EEPROM | 5030 | * data - word read from the EEPROM |
5103 | * words - number of words to read | 5031 | * words - number of words to read |
5104 | *****************************************************************************/ | 5032 | *****************************************************************************/ |
5105 | static s32 | 5033 | static s32 e1000_write_eeprom_eewr(struct e1000_hw *hw, u16 offset, u16 words, |
5106 | e1000_write_eeprom_eewr(struct e1000_hw *hw, | 5034 | u16 *data) |
5107 | u16 offset, | ||
5108 | u16 words, | ||
5109 | u16 *data) | ||
5110 | { | 5035 | { |
5111 | u32 register_value = 0; | 5036 | u32 register_value = 0; |
5112 | u32 i = 0; | 5037 | u32 i = 0; |
@@ -5143,8 +5068,7 @@ e1000_write_eeprom_eewr(struct e1000_hw *hw, | |||
5143 | * | 5068 | * |
5144 | * hw - Struct containing variables accessed by shared code | 5069 | * hw - Struct containing variables accessed by shared code |
5145 | *****************************************************************************/ | 5070 | *****************************************************************************/ |
5146 | static s32 | 5071 | static s32 e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) |
5147 | e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) | ||
5148 | { | 5072 | { |
5149 | u32 attempts = 100000; | 5073 | u32 attempts = 100000; |
5150 | u32 i, reg = 0; | 5074 | u32 i, reg = 0; |
@@ -5171,8 +5095,7 @@ e1000_poll_eerd_eewr_done(struct e1000_hw *hw, int eerd) | |||
5171 | * | 5095 | * |
5172 | * hw - Struct containing variables accessed by shared code | 5096 | * hw - Struct containing variables accessed by shared code |
5173 | ****************************************************************************/ | 5097 | ****************************************************************************/ |
5174 | static bool | 5098 | static bool e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) |
5175 | e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) | ||
5176 | { | 5099 | { |
5177 | u32 eecd = 0; | 5100 | u32 eecd = 0; |
5178 | 5101 | ||
@@ -5204,8 +5127,7 @@ e1000_is_onboard_nvm_eeprom(struct e1000_hw *hw) | |||
5204 | * If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is | 5127 | * If the the sum of the 64 16 bit words is 0xBABA, the EEPROM's checksum is |
5205 | * valid. | 5128 | * valid. |
5206 | *****************************************************************************/ | 5129 | *****************************************************************************/ |
5207 | s32 | 5130 | s32 e1000_validate_eeprom_checksum(struct e1000_hw *hw) |
5208 | e1000_validate_eeprom_checksum(struct e1000_hw *hw) | ||
5209 | { | 5131 | { |
5210 | u16 checksum = 0; | 5132 | u16 checksum = 0; |
5211 | u16 i, eeprom_data; | 5133 | u16 i, eeprom_data; |
@@ -5268,8 +5190,7 @@ e1000_validate_eeprom_checksum(struct e1000_hw *hw) | |||
5268 | * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. | 5190 | * Sums the first 63 16 bit words of the EEPROM. Subtracts the sum from 0xBABA. |
5269 | * Writes the difference to word offset 63 of the EEPROM. | 5191 | * Writes the difference to word offset 63 of the EEPROM. |
5270 | *****************************************************************************/ | 5192 | *****************************************************************************/ |
5271 | s32 | 5193 | s32 e1000_update_eeprom_checksum(struct e1000_hw *hw) |
5272 | e1000_update_eeprom_checksum(struct e1000_hw *hw) | ||
5273 | { | 5194 | { |
5274 | u32 ctrl_ext; | 5195 | u32 ctrl_ext; |
5275 | u16 checksum = 0; | 5196 | u16 checksum = 0; |
@@ -5313,11 +5234,7 @@ e1000_update_eeprom_checksum(struct e1000_hw *hw) | |||
5313 | * If e1000_update_eeprom_checksum is not called after this function, the | 5234 | * If e1000_update_eeprom_checksum is not called after this function, the |
5314 | * EEPROM will most likely contain an invalid checksum. | 5235 | * EEPROM will most likely contain an invalid checksum. |
5315 | *****************************************************************************/ | 5236 | *****************************************************************************/ |
5316 | s32 | 5237 | s32 e1000_write_eeprom(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
5317 | e1000_write_eeprom(struct e1000_hw *hw, | ||
5318 | u16 offset, | ||
5319 | u16 words, | ||
5320 | u16 *data) | ||
5321 | { | 5238 | { |
5322 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5239 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5323 | s32 status = 0; | 5240 | s32 status = 0; |
@@ -5370,11 +5287,8 @@ e1000_write_eeprom(struct e1000_hw *hw, | |||
5370 | * data - pointer to array of 8 bit words to be written to the EEPROM | 5287 | * data - pointer to array of 8 bit words to be written to the EEPROM |
5371 | * | 5288 | * |
5372 | *****************************************************************************/ | 5289 | *****************************************************************************/ |
5373 | static s32 | 5290 | static s32 e1000_write_eeprom_spi(struct e1000_hw *hw, u16 offset, u16 words, |
5374 | e1000_write_eeprom_spi(struct e1000_hw *hw, | 5291 | u16 *data) |
5375 | u16 offset, | ||
5376 | u16 words, | ||
5377 | u16 *data) | ||
5378 | { | 5292 | { |
5379 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5293 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5380 | u16 widx = 0; | 5294 | u16 widx = 0; |
@@ -5436,11 +5350,8 @@ e1000_write_eeprom_spi(struct e1000_hw *hw, | |||
5436 | * data - pointer to array of 16 bit words to be written to the EEPROM | 5350 | * data - pointer to array of 16 bit words to be written to the EEPROM |
5437 | * | 5351 | * |
5438 | *****************************************************************************/ | 5352 | *****************************************************************************/ |
5439 | static s32 | 5353 | static s32 e1000_write_eeprom_microwire(struct e1000_hw *hw, u16 offset, |
5440 | e1000_write_eeprom_microwire(struct e1000_hw *hw, | 5354 | u16 words, u16 *data) |
5441 | u16 offset, | ||
5442 | u16 words, | ||
5443 | u16 *data) | ||
5444 | { | 5355 | { |
5445 | struct e1000_eeprom_info *eeprom = &hw->eeprom; | 5356 | struct e1000_eeprom_info *eeprom = &hw->eeprom; |
5446 | u32 eecd; | 5357 | u32 eecd; |
@@ -5523,8 +5434,7 @@ e1000_write_eeprom_microwire(struct e1000_hw *hw, | |||
5523 | * data - word read from the EEPROM | 5434 | * data - word read from the EEPROM |
5524 | * words - number of words to read | 5435 | * words - number of words to read |
5525 | *****************************************************************************/ | 5436 | *****************************************************************************/ |
5526 | static s32 | 5437 | static s32 e1000_commit_shadow_ram(struct e1000_hw *hw) |
5527 | e1000_commit_shadow_ram(struct e1000_hw *hw) | ||
5528 | { | 5438 | { |
5529 | u32 attempts = 100000; | 5439 | u32 attempts = 100000; |
5530 | u32 eecd = 0; | 5440 | u32 eecd = 0; |
@@ -5687,8 +5597,7 @@ e1000_commit_shadow_ram(struct e1000_hw *hw) | |||
5687 | * | 5597 | * |
5688 | * hw - Struct containing variables accessed by shared code | 5598 | * hw - Struct containing variables accessed by shared code |
5689 | *****************************************************************************/ | 5599 | *****************************************************************************/ |
5690 | s32 | 5600 | s32 e1000_read_mac_addr(struct e1000_hw *hw) |
5691 | e1000_read_mac_addr(struct e1000_hw * hw) | ||
5692 | { | 5601 | { |
5693 | u16 offset; | 5602 | u16 offset; |
5694 | u16 eeprom_data, i; | 5603 | u16 eeprom_data, i; |
@@ -5731,8 +5640,7 @@ e1000_read_mac_addr(struct e1000_hw * hw) | |||
5731 | * of the receive addresss registers. Clears the multicast table. Assumes | 5640 | * of the receive addresss registers. Clears the multicast table. Assumes |
5732 | * the receiver is in reset when the routine is called. | 5641 | * the receiver is in reset when the routine is called. |
5733 | *****************************************************************************/ | 5642 | *****************************************************************************/ |
5734 | static void | 5643 | static void e1000_init_rx_addrs(struct e1000_hw *hw) |
5735 | e1000_init_rx_addrs(struct e1000_hw *hw) | ||
5736 | { | 5644 | { |
5737 | u32 i; | 5645 | u32 i; |
5738 | u32 rar_num; | 5646 | u32 rar_num; |
@@ -5770,9 +5678,7 @@ e1000_init_rx_addrs(struct e1000_hw *hw) | |||
5770 | * hw - Struct containing variables accessed by shared code | 5678 | * hw - Struct containing variables accessed by shared code |
5771 | * mc_addr - the multicast address to hash | 5679 | * mc_addr - the multicast address to hash |
5772 | *****************************************************************************/ | 5680 | *****************************************************************************/ |
5773 | u32 | 5681 | u32 e1000_hash_mc_addr(struct e1000_hw *hw, u8 *mc_addr) |
5774 | e1000_hash_mc_addr(struct e1000_hw *hw, | ||
5775 | u8 *mc_addr) | ||
5776 | { | 5682 | { |
5777 | u32 hash_value = 0; | 5683 | u32 hash_value = 0; |
5778 | 5684 | ||
@@ -5835,9 +5741,7 @@ e1000_hash_mc_addr(struct e1000_hw *hw, | |||
5835 | * hw - Struct containing variables accessed by shared code | 5741 | * hw - Struct containing variables accessed by shared code |
5836 | * hash_value - Multicast address hash value | 5742 | * hash_value - Multicast address hash value |
5837 | *****************************************************************************/ | 5743 | *****************************************************************************/ |
5838 | void | 5744 | void e1000_mta_set(struct e1000_hw *hw, u32 hash_value) |
5839 | e1000_mta_set(struct e1000_hw *hw, | ||
5840 | u32 hash_value) | ||
5841 | { | 5745 | { |
5842 | u32 hash_bit, hash_reg; | 5746 | u32 hash_bit, hash_reg; |
5843 | u32 mta; | 5747 | u32 mta; |
@@ -5884,10 +5788,7 @@ e1000_mta_set(struct e1000_hw *hw, | |||
5884 | * addr - Address to put into receive address register | 5788 | * addr - Address to put into receive address register |
5885 | * index - Receive address register to write | 5789 | * index - Receive address register to write |
5886 | *****************************************************************************/ | 5790 | *****************************************************************************/ |
5887 | void | 5791 | void e1000_rar_set(struct e1000_hw *hw, u8 *addr, u32 index) |
5888 | e1000_rar_set(struct e1000_hw *hw, | ||
5889 | u8 *addr, | ||
5890 | u32 index) | ||
5891 | { | 5792 | { |
5892 | u32 rar_low, rar_high; | 5793 | u32 rar_low, rar_high; |
5893 | 5794 | ||
@@ -5942,10 +5843,7 @@ e1000_rar_set(struct e1000_hw *hw, | |||
5942 | * offset - Offset in VLAN filer table to write | 5843 | * offset - Offset in VLAN filer table to write |
5943 | * value - Value to write into VLAN filter table | 5844 | * value - Value to write into VLAN filter table |
5944 | *****************************************************************************/ | 5845 | *****************************************************************************/ |
5945 | void | 5846 | void e1000_write_vfta(struct e1000_hw *hw, u32 offset, u32 value) |
5946 | e1000_write_vfta(struct e1000_hw *hw, | ||
5947 | u32 offset, | ||
5948 | u32 value) | ||
5949 | { | 5847 | { |
5950 | u32 temp; | 5848 | u32 temp; |
5951 | 5849 | ||
@@ -5969,8 +5867,7 @@ e1000_write_vfta(struct e1000_hw *hw, | |||
5969 | * | 5867 | * |
5970 | * hw - Struct containing variables accessed by shared code | 5868 | * hw - Struct containing variables accessed by shared code |
5971 | *****************************************************************************/ | 5869 | *****************************************************************************/ |
5972 | static void | 5870 | static void e1000_clear_vfta(struct e1000_hw *hw) |
5973 | e1000_clear_vfta(struct e1000_hw *hw) | ||
5974 | { | 5871 | { |
5975 | u32 offset; | 5872 | u32 offset; |
5976 | u32 vfta_value = 0; | 5873 | u32 vfta_value = 0; |
@@ -6003,8 +5900,7 @@ e1000_clear_vfta(struct e1000_hw *hw) | |||
6003 | } | 5900 | } |
6004 | } | 5901 | } |
6005 | 5902 | ||
6006 | static s32 | 5903 | static s32 e1000_id_led_init(struct e1000_hw *hw) |
6007 | e1000_id_led_init(struct e1000_hw * hw) | ||
6008 | { | 5904 | { |
6009 | u32 ledctl; | 5905 | u32 ledctl; |
6010 | const u32 ledctl_mask = 0x000000FF; | 5906 | const u32 ledctl_mask = 0x000000FF; |
@@ -6086,8 +5982,7 @@ e1000_id_led_init(struct e1000_hw * hw) | |||
6086 | * | 5982 | * |
6087 | * hw - Struct containing variables accessed by shared code | 5983 | * hw - Struct containing variables accessed by shared code |
6088 | *****************************************************************************/ | 5984 | *****************************************************************************/ |
6089 | s32 | 5985 | s32 e1000_setup_led(struct e1000_hw *hw) |
6090 | e1000_setup_led(struct e1000_hw *hw) | ||
6091 | { | 5986 | { |
6092 | u32 ledctl; | 5987 | u32 ledctl; |
6093 | s32 ret_val = E1000_SUCCESS; | 5988 | s32 ret_val = E1000_SUCCESS; |
@@ -6145,8 +6040,7 @@ e1000_setup_led(struct e1000_hw *hw) | |||
6145 | * | 6040 | * |
6146 | * hw - Struct containing variables accessed by shared code | 6041 | * hw - Struct containing variables accessed by shared code |
6147 | *****************************************************************************/ | 6042 | *****************************************************************************/ |
6148 | s32 | 6043 | s32 e1000_blink_led_start(struct e1000_hw *hw) |
6149 | e1000_blink_led_start(struct e1000_hw *hw) | ||
6150 | { | 6044 | { |
6151 | s16 i; | 6045 | s16 i; |
6152 | u32 ledctl_blink = 0; | 6046 | u32 ledctl_blink = 0; |
@@ -6180,8 +6074,7 @@ e1000_blink_led_start(struct e1000_hw *hw) | |||
6180 | * | 6074 | * |
6181 | * hw - Struct containing variables accessed by shared code | 6075 | * hw - Struct containing variables accessed by shared code |
6182 | *****************************************************************************/ | 6076 | *****************************************************************************/ |
6183 | s32 | 6077 | s32 e1000_cleanup_led(struct e1000_hw *hw) |
6184 | e1000_cleanup_led(struct e1000_hw *hw) | ||
6185 | { | 6078 | { |
6186 | s32 ret_val = E1000_SUCCESS; | 6079 | s32 ret_val = E1000_SUCCESS; |
6187 | 6080 | ||
@@ -6222,8 +6115,7 @@ e1000_cleanup_led(struct e1000_hw *hw) | |||
6222 | * | 6115 | * |
6223 | * hw - Struct containing variables accessed by shared code | 6116 | * hw - Struct containing variables accessed by shared code |
6224 | *****************************************************************************/ | 6117 | *****************************************************************************/ |
6225 | s32 | 6118 | s32 e1000_led_on(struct e1000_hw *hw) |
6226 | e1000_led_on(struct e1000_hw *hw) | ||
6227 | { | 6119 | { |
6228 | u32 ctrl = E1000_READ_REG(hw, CTRL); | 6120 | u32 ctrl = E1000_READ_REG(hw, CTRL); |
6229 | 6121 | ||
@@ -6273,8 +6165,7 @@ e1000_led_on(struct e1000_hw *hw) | |||
6273 | * | 6165 | * |
6274 | * hw - Struct containing variables accessed by shared code | 6166 | * hw - Struct containing variables accessed by shared code |
6275 | *****************************************************************************/ | 6167 | *****************************************************************************/ |
6276 | s32 | 6168 | s32 e1000_led_off(struct e1000_hw *hw) |
6277 | e1000_led_off(struct e1000_hw *hw) | ||
6278 | { | 6169 | { |
6279 | u32 ctrl = E1000_READ_REG(hw, CTRL); | 6170 | u32 ctrl = E1000_READ_REG(hw, CTRL); |
6280 | 6171 | ||
@@ -6324,8 +6215,7 @@ e1000_led_off(struct e1000_hw *hw) | |||
6324 | * | 6215 | * |
6325 | * hw - Struct containing variables accessed by shared code | 6216 | * hw - Struct containing variables accessed by shared code |
6326 | *****************************************************************************/ | 6217 | *****************************************************************************/ |
6327 | static void | 6218 | static void e1000_clear_hw_cntrs(struct e1000_hw *hw) |
6328 | e1000_clear_hw_cntrs(struct e1000_hw *hw) | ||
6329 | { | 6219 | { |
6330 | volatile u32 temp; | 6220 | volatile u32 temp; |
6331 | 6221 | ||
@@ -6428,8 +6318,7 @@ e1000_clear_hw_cntrs(struct e1000_hw *hw) | |||
6428 | * current_ifs_val, ifs_min_val, ifs_max_val, ifs_step_size, and ifs_ratio | 6318 | * current_ifs_val, ifs_min_val, ifs_max_val, ifs_step_size, and ifs_ratio |
6429 | * before calling this function. | 6319 | * before calling this function. |
6430 | *****************************************************************************/ | 6320 | *****************************************************************************/ |
6431 | void | 6321 | void e1000_reset_adaptive(struct e1000_hw *hw) |
6432 | e1000_reset_adaptive(struct e1000_hw *hw) | ||
6433 | { | 6322 | { |
6434 | DEBUGFUNC("e1000_reset_adaptive"); | 6323 | DEBUGFUNC("e1000_reset_adaptive"); |
6435 | 6324 | ||
@@ -6456,8 +6345,7 @@ e1000_reset_adaptive(struct e1000_hw *hw) | |||
6456 | * tx_packets - Number of transmits since last callback | 6345 | * tx_packets - Number of transmits since last callback |
6457 | * total_collisions - Number of collisions since last callback | 6346 | * total_collisions - Number of collisions since last callback |
6458 | *****************************************************************************/ | 6347 | *****************************************************************************/ |
6459 | void | 6348 | void e1000_update_adaptive(struct e1000_hw *hw) |
6460 | e1000_update_adaptive(struct e1000_hw *hw) | ||
6461 | { | 6349 | { |
6462 | DEBUGFUNC("e1000_update_adaptive"); | 6350 | DEBUGFUNC("e1000_update_adaptive"); |
6463 | 6351 | ||
@@ -6492,11 +6380,8 @@ e1000_update_adaptive(struct e1000_hw *hw) | |||
6492 | * frame_len - The length of the frame in question | 6380 | * frame_len - The length of the frame in question |
6493 | * mac_addr - The Ethernet destination address of the frame in question | 6381 | * mac_addr - The Ethernet destination address of the frame in question |
6494 | *****************************************************************************/ | 6382 | *****************************************************************************/ |
6495 | void | 6383 | void e1000_tbi_adjust_stats(struct e1000_hw *hw, struct e1000_hw_stats *stats, |
6496 | e1000_tbi_adjust_stats(struct e1000_hw *hw, | 6384 | u32 frame_len, u8 *mac_addr) |
6497 | struct e1000_hw_stats *stats, | ||
6498 | u32 frame_len, | ||
6499 | u8 *mac_addr) | ||
6500 | { | 6385 | { |
6501 | u64 carry_bit; | 6386 | u64 carry_bit; |
6502 | 6387 | ||
@@ -6570,8 +6455,7 @@ e1000_tbi_adjust_stats(struct e1000_hw *hw, | |||
6570 | * | 6455 | * |
6571 | * hw - Struct containing variables accessed by shared code | 6456 | * hw - Struct containing variables accessed by shared code |
6572 | *****************************************************************************/ | 6457 | *****************************************************************************/ |
6573 | void | 6458 | void e1000_get_bus_info(struct e1000_hw *hw) |
6574 | e1000_get_bus_info(struct e1000_hw *hw) | ||
6575 | { | 6459 | { |
6576 | s32 ret_val; | 6460 | s32 ret_val; |
6577 | u16 pci_ex_link_status; | 6461 | u16 pci_ex_link_status; |
@@ -6645,10 +6529,7 @@ e1000_get_bus_info(struct e1000_hw *hw) | |||
6645 | * offset - offset to write to | 6529 | * offset - offset to write to |
6646 | * value - value to write | 6530 | * value - value to write |
6647 | *****************************************************************************/ | 6531 | *****************************************************************************/ |
6648 | static void | 6532 | static void e1000_write_reg_io(struct e1000_hw *hw, u32 offset, u32 value) |
6649 | e1000_write_reg_io(struct e1000_hw *hw, | ||
6650 | u32 offset, | ||
6651 | u32 value) | ||
6652 | { | 6533 | { |
6653 | unsigned long io_addr = hw->io_base; | 6534 | unsigned long io_addr = hw->io_base; |
6654 | unsigned long io_data = hw->io_base + 4; | 6535 | unsigned long io_data = hw->io_base + 4; |
@@ -6672,10 +6553,8 @@ e1000_write_reg_io(struct e1000_hw *hw, | |||
6672 | * register to the minimum and maximum range. | 6553 | * register to the minimum and maximum range. |
6673 | * For IGP phy's, the function calculates the range by the AGC registers. | 6554 | * For IGP phy's, the function calculates the range by the AGC registers. |
6674 | *****************************************************************************/ | 6555 | *****************************************************************************/ |
6675 | static s32 | 6556 | static s32 e1000_get_cable_length(struct e1000_hw *hw, u16 *min_length, |
6676 | e1000_get_cable_length(struct e1000_hw *hw, | 6557 | u16 *max_length) |
6677 | u16 *min_length, | ||
6678 | u16 *max_length) | ||
6679 | { | 6558 | { |
6680 | s32 ret_val; | 6559 | s32 ret_val; |
6681 | u16 agc_value = 0; | 6560 | u16 agc_value = 0; |
@@ -6863,9 +6742,8 @@ e1000_get_cable_length(struct e1000_hw *hw, | |||
6863 | * return 0. If the link speed is 1000 Mbps the polarity status is in the | 6742 | * return 0. If the link speed is 1000 Mbps the polarity status is in the |
6864 | * IGP01E1000_PHY_PCS_INIT_REG. | 6743 | * IGP01E1000_PHY_PCS_INIT_REG. |
6865 | *****************************************************************************/ | 6744 | *****************************************************************************/ |
6866 | static s32 | 6745 | static s32 e1000_check_polarity(struct e1000_hw *hw, |
6867 | e1000_check_polarity(struct e1000_hw *hw, | 6746 | e1000_rev_polarity *polarity) |
6868 | e1000_rev_polarity *polarity) | ||
6869 | { | 6747 | { |
6870 | s32 ret_val; | 6748 | s32 ret_val; |
6871 | u16 phy_data; | 6749 | u16 phy_data; |
@@ -6939,8 +6817,7 @@ e1000_check_polarity(struct e1000_hw *hw, | |||
6939 | * Link Health register. In IGP this bit is latched high, so the driver must | 6817 | * Link Health register. In IGP this bit is latched high, so the driver must |
6940 | * read it immediately after link is established. | 6818 | * read it immediately after link is established. |
6941 | *****************************************************************************/ | 6819 | *****************************************************************************/ |
6942 | static s32 | 6820 | static s32 e1000_check_downshift(struct e1000_hw *hw) |
6943 | e1000_check_downshift(struct e1000_hw *hw) | ||
6944 | { | 6821 | { |
6945 | s32 ret_val; | 6822 | s32 ret_val; |
6946 | u16 phy_data; | 6823 | u16 phy_data; |
@@ -6985,9 +6862,7 @@ e1000_check_downshift(struct e1000_hw *hw) | |||
6985 | * | 6862 | * |
6986 | ****************************************************************************/ | 6863 | ****************************************************************************/ |
6987 | 6864 | ||
6988 | static s32 | 6865 | static s32 e1000_config_dsp_after_link_change(struct e1000_hw *hw, bool link_up) |
6989 | e1000_config_dsp_after_link_change(struct e1000_hw *hw, | ||
6990 | bool link_up) | ||
6991 | { | 6866 | { |
6992 | s32 ret_val; | 6867 | s32 ret_val; |
6993 | u16 phy_data, phy_saved_data, speed, duplex, i; | 6868 | u16 phy_data, phy_saved_data, speed, duplex, i; |
@@ -7173,8 +7048,7 @@ e1000_config_dsp_after_link_change(struct e1000_hw *hw, | |||
7173 | * | 7048 | * |
7174 | * hw - Struct containing variables accessed by shared code | 7049 | * hw - Struct containing variables accessed by shared code |
7175 | ****************************************************************************/ | 7050 | ****************************************************************************/ |
7176 | static s32 | 7051 | static s32 e1000_set_phy_mode(struct e1000_hw *hw) |
7177 | e1000_set_phy_mode(struct e1000_hw *hw) | ||
7178 | { | 7052 | { |
7179 | s32 ret_val; | 7053 | s32 ret_val; |
7180 | u16 eeprom_data; | 7054 | u16 eeprom_data; |
@@ -7218,9 +7092,7 @@ e1000_set_phy_mode(struct e1000_hw *hw) | |||
7218 | * | 7092 | * |
7219 | ****************************************************************************/ | 7093 | ****************************************************************************/ |
7220 | 7094 | ||
7221 | static s32 | 7095 | static s32 e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active) |
7222 | e1000_set_d3_lplu_state(struct e1000_hw *hw, | ||
7223 | bool active) | ||
7224 | { | 7096 | { |
7225 | u32 phy_ctrl = 0; | 7097 | u32 phy_ctrl = 0; |
7226 | s32 ret_val; | 7098 | s32 ret_val; |
@@ -7348,9 +7220,7 @@ e1000_set_d3_lplu_state(struct e1000_hw *hw, | |||
7348 | * | 7220 | * |
7349 | ****************************************************************************/ | 7221 | ****************************************************************************/ |
7350 | 7222 | ||
7351 | static s32 | 7223 | static s32 e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active) |
7352 | e1000_set_d0_lplu_state(struct e1000_hw *hw, | ||
7353 | bool active) | ||
7354 | { | 7224 | { |
7355 | u32 phy_ctrl = 0; | 7225 | u32 phy_ctrl = 0; |
7356 | s32 ret_val; | 7226 | s32 ret_val; |
@@ -7439,8 +7309,7 @@ e1000_set_d0_lplu_state(struct e1000_hw *hw, | |||
7439 | * | 7309 | * |
7440 | * hw - Struct containing variables accessed by shared code | 7310 | * hw - Struct containing variables accessed by shared code |
7441 | *****************************************************************************/ | 7311 | *****************************************************************************/ |
7442 | static s32 | 7312 | static s32 e1000_set_vco_speed(struct e1000_hw *hw) |
7443 | e1000_set_vco_speed(struct e1000_hw *hw) | ||
7444 | { | 7313 | { |
7445 | s32 ret_val; | 7314 | s32 ret_val; |
7446 | u16 default_page = 0; | 7315 | u16 default_page = 0; |
@@ -7503,8 +7372,7 @@ e1000_set_vco_speed(struct e1000_hw *hw) | |||
7503 | * | 7372 | * |
7504 | * returns: - E1000_SUCCESS . | 7373 | * returns: - E1000_SUCCESS . |
7505 | ****************************************************************************/ | 7374 | ****************************************************************************/ |
7506 | static s32 | 7375 | static s32 e1000_host_if_read_cookie(struct e1000_hw *hw, u8 *buffer) |
7507 | e1000_host_if_read_cookie(struct e1000_hw * hw, u8 *buffer) | ||
7508 | { | 7376 | { |
7509 | u8 i; | 7377 | u8 i; |
7510 | u32 offset = E1000_MNG_DHCP_COOKIE_OFFSET; | 7378 | u32 offset = E1000_MNG_DHCP_COOKIE_OFFSET; |
@@ -7530,8 +7398,7 @@ e1000_host_if_read_cookie(struct e1000_hw * hw, u8 *buffer) | |||
7530 | * timeout | 7398 | * timeout |
7531 | * - E1000_SUCCESS for success. | 7399 | * - E1000_SUCCESS for success. |
7532 | ****************************************************************************/ | 7400 | ****************************************************************************/ |
7533 | static s32 | 7401 | static s32 e1000_mng_enable_host_if(struct e1000_hw *hw) |
7534 | e1000_mng_enable_host_if(struct e1000_hw * hw) | ||
7535 | { | 7402 | { |
7536 | u32 hicr; | 7403 | u32 hicr; |
7537 | u8 i; | 7404 | u8 i; |
@@ -7564,9 +7431,8 @@ e1000_mng_enable_host_if(struct e1000_hw * hw) | |||
7564 | * | 7431 | * |
7565 | * returns - E1000_SUCCESS for success. | 7432 | * returns - E1000_SUCCESS for success. |
7566 | ****************************************************************************/ | 7433 | ****************************************************************************/ |
7567 | static s32 | 7434 | static s32 e1000_mng_host_if_write(struct e1000_hw *hw, u8 *buffer, u16 length, |
7568 | e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, | 7435 | u16 offset, u8 *sum) |
7569 | u16 length, u16 offset, u8 *sum) | ||
7570 | { | 7436 | { |
7571 | u8 *tmp; | 7437 | u8 *tmp; |
7572 | u8 *bufptr = buffer; | 7438 | u8 *bufptr = buffer; |
@@ -7632,9 +7498,8 @@ e1000_mng_host_if_write(struct e1000_hw * hw, u8 *buffer, | |||
7632 | * | 7498 | * |
7633 | * returns - E1000_SUCCESS for success. | 7499 | * returns - E1000_SUCCESS for success. |
7634 | ****************************************************************************/ | 7500 | ****************************************************************************/ |
7635 | static s32 | 7501 | static s32 e1000_mng_write_cmd_header(struct e1000_hw *hw, |
7636 | e1000_mng_write_cmd_header(struct e1000_hw * hw, | 7502 | struct e1000_host_mng_command_header *hdr) |
7637 | struct e1000_host_mng_command_header * hdr) | ||
7638 | { | 7503 | { |
7639 | u16 i; | 7504 | u16 i; |
7640 | u8 sum; | 7505 | u8 sum; |
@@ -7672,8 +7537,7 @@ e1000_mng_write_cmd_header(struct e1000_hw * hw, | |||
7672 | * | 7537 | * |
7673 | * returns - E1000_SUCCESS for success. | 7538 | * returns - E1000_SUCCESS for success. |
7674 | ****************************************************************************/ | 7539 | ****************************************************************************/ |
7675 | static s32 | 7540 | static s32 e1000_mng_write_commit(struct e1000_hw *hw) |
7676 | e1000_mng_write_commit(struct e1000_hw * hw) | ||
7677 | { | 7541 | { |
7678 | u32 hicr; | 7542 | u32 hicr; |
7679 | 7543 | ||
@@ -7690,8 +7554,7 @@ e1000_mng_write_commit(struct e1000_hw * hw) | |||
7690 | * | 7554 | * |
7691 | * returns - true when the mode is IAMT or false. | 7555 | * returns - true when the mode is IAMT or false. |
7692 | ****************************************************************************/ | 7556 | ****************************************************************************/ |
7693 | bool | 7557 | bool e1000_check_mng_mode(struct e1000_hw *hw) |
7694 | e1000_check_mng_mode(struct e1000_hw *hw) | ||
7695 | { | 7558 | { |
7696 | u32 fwsm; | 7559 | u32 fwsm; |
7697 | 7560 | ||
@@ -7712,9 +7575,7 @@ e1000_check_mng_mode(struct e1000_hw *hw) | |||
7712 | /***************************************************************************** | 7575 | /***************************************************************************** |
7713 | * This function writes the dhcp info . | 7576 | * This function writes the dhcp info . |
7714 | ****************************************************************************/ | 7577 | ****************************************************************************/ |
7715 | s32 | 7578 | s32 e1000_mng_write_dhcp_info(struct e1000_hw *hw, u8 *buffer, u16 length) |
7716 | e1000_mng_write_dhcp_info(struct e1000_hw * hw, u8 *buffer, | ||
7717 | u16 length) | ||
7718 | { | 7579 | { |
7719 | s32 ret_val; | 7580 | s32 ret_val; |
7720 | struct e1000_host_mng_command_header hdr; | 7581 | struct e1000_host_mng_command_header hdr; |
@@ -7744,8 +7605,7 @@ e1000_mng_write_dhcp_info(struct e1000_hw * hw, u8 *buffer, | |||
7744 | * | 7605 | * |
7745 | * returns - checksum of buffer contents. | 7606 | * returns - checksum of buffer contents. |
7746 | ****************************************************************************/ | 7607 | ****************************************************************************/ |
7747 | static u8 | 7608 | static u8 e1000_calculate_mng_checksum(char *buffer, u32 length) |
7748 | e1000_calculate_mng_checksum(char *buffer, u32 length) | ||
7749 | { | 7609 | { |
7750 | u8 sum = 0; | 7610 | u8 sum = 0; |
7751 | u32 i; | 7611 | u32 i; |
@@ -7764,8 +7624,7 @@ e1000_calculate_mng_checksum(char *buffer, u32 length) | |||
7764 | * | 7624 | * |
7765 | * returns - true for packet filtering or false. | 7625 | * returns - true for packet filtering or false. |
7766 | ****************************************************************************/ | 7626 | ****************************************************************************/ |
7767 | bool | 7627 | bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) |
7768 | e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) | ||
7769 | { | 7628 | { |
7770 | /* called in init as well as watchdog timer functions */ | 7629 | /* called in init as well as watchdog timer functions */ |
7771 | 7630 | ||
@@ -7806,8 +7665,7 @@ e1000_enable_tx_pkt_filtering(struct e1000_hw *hw) | |||
7806 | * returns: - true/false | 7665 | * returns: - true/false |
7807 | * | 7666 | * |
7808 | *****************************************************************************/ | 7667 | *****************************************************************************/ |
7809 | u32 | 7668 | u32 e1000_enable_mng_pass_thru(struct e1000_hw *hw) |
7810 | e1000_enable_mng_pass_thru(struct e1000_hw *hw) | ||
7811 | { | 7669 | { |
7812 | u32 manc; | 7670 | u32 manc; |
7813 | u32 fwsm, factps; | 7671 | u32 fwsm, factps; |
@@ -7832,8 +7690,7 @@ e1000_enable_mng_pass_thru(struct e1000_hw *hw) | |||
7832 | return false; | 7690 | return false; |
7833 | } | 7691 | } |
7834 | 7692 | ||
7835 | static s32 | 7693 | static s32 e1000_polarity_reversal_workaround(struct e1000_hw *hw) |
7836 | e1000_polarity_reversal_workaround(struct e1000_hw *hw) | ||
7837 | { | 7694 | { |
7838 | s32 ret_val; | 7695 | s32 ret_val; |
7839 | u16 mii_status_reg; | 7696 | u16 mii_status_reg; |
@@ -7926,8 +7783,7 @@ e1000_polarity_reversal_workaround(struct e1000_hw *hw) | |||
7926 | * returns: - none. | 7783 | * returns: - none. |
7927 | * | 7784 | * |
7928 | ***************************************************************************/ | 7785 | ***************************************************************************/ |
7929 | static void | 7786 | static void e1000_set_pci_express_master_disable(struct e1000_hw *hw) |
7930 | e1000_set_pci_express_master_disable(struct e1000_hw *hw) | ||
7931 | { | 7787 | { |
7932 | u32 ctrl; | 7788 | u32 ctrl; |
7933 | 7789 | ||
@@ -7952,8 +7808,7 @@ e1000_set_pci_express_master_disable(struct e1000_hw *hw) | |||
7952 | * E1000_SUCCESS master requests disabled. | 7808 | * E1000_SUCCESS master requests disabled. |
7953 | * | 7809 | * |
7954 | ******************************************************************************/ | 7810 | ******************************************************************************/ |
7955 | s32 | 7811 | s32 e1000_disable_pciex_master(struct e1000_hw *hw) |
7956 | e1000_disable_pciex_master(struct e1000_hw *hw) | ||
7957 | { | 7812 | { |
7958 | s32 timeout = MASTER_DISABLE_TIMEOUT; /* 80ms */ | 7813 | s32 timeout = MASTER_DISABLE_TIMEOUT; /* 80ms */ |
7959 | 7814 | ||
@@ -7990,8 +7845,7 @@ e1000_disable_pciex_master(struct e1000_hw *hw) | |||
7990 | * E1000_SUCCESS at any other case. | 7845 | * E1000_SUCCESS at any other case. |
7991 | * | 7846 | * |
7992 | ******************************************************************************/ | 7847 | ******************************************************************************/ |
7993 | static s32 | 7848 | static s32 e1000_get_auto_rd_done(struct e1000_hw *hw) |
7994 | e1000_get_auto_rd_done(struct e1000_hw *hw) | ||
7995 | { | 7849 | { |
7996 | s32 timeout = AUTO_READ_DONE_TIMEOUT; | 7850 | s32 timeout = AUTO_READ_DONE_TIMEOUT; |
7997 | 7851 | ||
@@ -8038,8 +7892,7 @@ e1000_get_auto_rd_done(struct e1000_hw *hw) | |||
8038 | * E1000_SUCCESS at any other case. | 7892 | * E1000_SUCCESS at any other case. |
8039 | * | 7893 | * |
8040 | ***************************************************************************/ | 7894 | ***************************************************************************/ |
8041 | static s32 | 7895 | static s32 e1000_get_phy_cfg_done(struct e1000_hw *hw) |
8042 | e1000_get_phy_cfg_done(struct e1000_hw *hw) | ||
8043 | { | 7896 | { |
8044 | s32 timeout = PHY_CFG_TIMEOUT; | 7897 | s32 timeout = PHY_CFG_TIMEOUT; |
8045 | u32 cfg_mask = E1000_EEPROM_CFG_DONE; | 7898 | u32 cfg_mask = E1000_EEPROM_CFG_DONE; |
@@ -8085,8 +7938,7 @@ e1000_get_phy_cfg_done(struct e1000_hw *hw) | |||
8085 | * E1000_SUCCESS at any other case. | 7938 | * E1000_SUCCESS at any other case. |
8086 | * | 7939 | * |
8087 | ***************************************************************************/ | 7940 | ***************************************************************************/ |
8088 | static s32 | 7941 | static s32 e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) |
8089 | e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) | ||
8090 | { | 7942 | { |
8091 | s32 timeout; | 7943 | s32 timeout; |
8092 | u32 swsm; | 7944 | u32 swsm; |
@@ -8135,8 +7987,7 @@ e1000_get_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
8135 | * returns: - None. | 7987 | * returns: - None. |
8136 | * | 7988 | * |
8137 | ***************************************************************************/ | 7989 | ***************************************************************************/ |
8138 | static void | 7990 | static void e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) |
8139 | e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) | ||
8140 | { | 7991 | { |
8141 | u32 swsm; | 7992 | u32 swsm; |
8142 | 7993 | ||
@@ -8164,8 +8015,7 @@ e1000_put_hw_eeprom_semaphore(struct e1000_hw *hw) | |||
8164 | * E1000_SUCCESS at any other case. | 8015 | * E1000_SUCCESS at any other case. |
8165 | * | 8016 | * |
8166 | ***************************************************************************/ | 8017 | ***************************************************************************/ |
8167 | static s32 | 8018 | static s32 e1000_get_software_semaphore(struct e1000_hw *hw) |
8168 | e1000_get_software_semaphore(struct e1000_hw *hw) | ||
8169 | { | 8019 | { |
8170 | s32 timeout = hw->eeprom.word_size + 1; | 8020 | s32 timeout = hw->eeprom.word_size + 1; |
8171 | u32 swsm; | 8021 | u32 swsm; |
@@ -8200,8 +8050,7 @@ e1000_get_software_semaphore(struct e1000_hw *hw) | |||
8200 | * hw: Struct containing variables accessed by shared code | 8050 | * hw: Struct containing variables accessed by shared code |
8201 | * | 8051 | * |
8202 | ***************************************************************************/ | 8052 | ***************************************************************************/ |
8203 | static void | 8053 | static void e1000_release_software_semaphore(struct e1000_hw *hw) |
8204 | e1000_release_software_semaphore(struct e1000_hw *hw) | ||
8205 | { | 8054 | { |
8206 | u32 swsm; | 8055 | u32 swsm; |
8207 | 8056 | ||
@@ -8228,8 +8077,7 @@ e1000_release_software_semaphore(struct e1000_hw *hw) | |||
8228 | * E1000_SUCCESS | 8077 | * E1000_SUCCESS |
8229 | * | 8078 | * |
8230 | *****************************************************************************/ | 8079 | *****************************************************************************/ |
8231 | s32 | 8080 | s32 e1000_check_phy_reset_block(struct e1000_hw *hw) |
8232 | e1000_check_phy_reset_block(struct e1000_hw *hw) | ||
8233 | { | 8081 | { |
8234 | u32 manc = 0; | 8082 | u32 manc = 0; |
8235 | u32 fwsm = 0; | 8083 | u32 fwsm = 0; |
@@ -8246,8 +8094,7 @@ e1000_check_phy_reset_block(struct e1000_hw *hw) | |||
8246 | E1000_BLK_PHY_RESET : E1000_SUCCESS; | 8094 | E1000_BLK_PHY_RESET : E1000_SUCCESS; |
8247 | } | 8095 | } |
8248 | 8096 | ||
8249 | static u8 | 8097 | static u8 e1000_arc_subsystem_valid(struct e1000_hw *hw) |
8250 | e1000_arc_subsystem_valid(struct e1000_hw *hw) | ||
8251 | { | 8098 | { |
8252 | u32 fwsm; | 8099 | u32 fwsm; |
8253 | 8100 | ||
@@ -8283,8 +8130,7 @@ e1000_arc_subsystem_valid(struct e1000_hw *hw) | |||
8283 | * returns: E1000_SUCCESS | 8130 | * returns: E1000_SUCCESS |
8284 | * | 8131 | * |
8285 | *****************************************************************************/ | 8132 | *****************************************************************************/ |
8286 | static s32 | 8133 | static s32 e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) |
8287 | e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) | ||
8288 | { | 8134 | { |
8289 | u32 gcr_reg = 0; | 8135 | u32 gcr_reg = 0; |
8290 | 8136 | ||
@@ -8324,8 +8170,7 @@ e1000_set_pci_ex_no_snoop(struct e1000_hw *hw, u32 no_snoop) | |||
8324 | * hw: Struct containing variables accessed by shared code | 8170 | * hw: Struct containing variables accessed by shared code |
8325 | * | 8171 | * |
8326 | ***************************************************************************/ | 8172 | ***************************************************************************/ |
8327 | static s32 | 8173 | static s32 e1000_get_software_flag(struct e1000_hw *hw) |
8328 | e1000_get_software_flag(struct e1000_hw *hw) | ||
8329 | { | 8174 | { |
8330 | s32 timeout = PHY_CFG_TIMEOUT; | 8175 | s32 timeout = PHY_CFG_TIMEOUT; |
8331 | u32 extcnf_ctrl; | 8176 | u32 extcnf_ctrl; |
@@ -8363,8 +8208,7 @@ e1000_get_software_flag(struct e1000_hw *hw) | |||
8363 | * hw: Struct containing variables accessed by shared code | 8208 | * hw: Struct containing variables accessed by shared code |
8364 | * | 8209 | * |
8365 | ***************************************************************************/ | 8210 | ***************************************************************************/ |
8366 | static void | 8211 | static void e1000_release_software_flag(struct e1000_hw *hw) |
8367 | e1000_release_software_flag(struct e1000_hw *hw) | ||
8368 | { | 8212 | { |
8369 | u32 extcnf_ctrl; | 8213 | u32 extcnf_ctrl; |
8370 | 8214 | ||
@@ -8388,9 +8232,8 @@ e1000_release_software_flag(struct e1000_hw *hw) | |||
8388 | * data - word read from the EEPROM | 8232 | * data - word read from the EEPROM |
8389 | * words - number of words to read | 8233 | * words - number of words to read |
8390 | *****************************************************************************/ | 8234 | *****************************************************************************/ |
8391 | static s32 | 8235 | static s32 e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, |
8392 | e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | 8236 | u16 *data) |
8393 | u16 *data) | ||
8394 | { | 8237 | { |
8395 | s32 error = E1000_SUCCESS; | 8238 | s32 error = E1000_SUCCESS; |
8396 | u32 flash_bank = 0; | 8239 | u32 flash_bank = 0; |
@@ -8444,9 +8287,8 @@ e1000_read_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | |||
8444 | * words - number of words to write | 8287 | * words - number of words to write |
8445 | * data - words to write to the EEPROM | 8288 | * data - words to write to the EEPROM |
8446 | *****************************************************************************/ | 8289 | *****************************************************************************/ |
8447 | static s32 | 8290 | static s32 e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, |
8448 | e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | 8291 | u16 *data) |
8449 | u16 *data) | ||
8450 | { | 8292 | { |
8451 | u32 i = 0; | 8293 | u32 i = 0; |
8452 | s32 error = E1000_SUCCESS; | 8294 | s32 error = E1000_SUCCESS; |
@@ -8491,8 +8333,7 @@ e1000_write_eeprom_ich8(struct e1000_hw *hw, u16 offset, u16 words, | |||
8491 | * | 8333 | * |
8492 | * hw - The pointer to the hw structure | 8334 | * hw - The pointer to the hw structure |
8493 | ****************************************************************************/ | 8335 | ****************************************************************************/ |
8494 | static s32 | 8336 | static s32 e1000_ich8_cycle_init(struct e1000_hw *hw) |
8495 | e1000_ich8_cycle_init(struct e1000_hw *hw) | ||
8496 | { | 8337 | { |
8497 | union ich8_hws_flash_status hsfsts; | 8338 | union ich8_hws_flash_status hsfsts; |
8498 | s32 error = E1000_ERR_EEPROM; | 8339 | s32 error = E1000_ERR_EEPROM; |
@@ -8558,8 +8399,7 @@ e1000_ich8_cycle_init(struct e1000_hw *hw) | |||
8558 | * | 8399 | * |
8559 | * hw - The pointer to the hw structure | 8400 | * hw - The pointer to the hw structure |
8560 | ****************************************************************************/ | 8401 | ****************************************************************************/ |
8561 | static s32 | 8402 | static s32 e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) |
8562 | e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) | ||
8563 | { | 8403 | { |
8564 | union ich8_hws_flash_ctrl hsflctl; | 8404 | union ich8_hws_flash_ctrl hsflctl; |
8565 | union ich8_hws_flash_status hsfsts; | 8405 | union ich8_hws_flash_status hsfsts; |
@@ -8593,9 +8433,8 @@ e1000_ich8_flash_cycle(struct e1000_hw *hw, u32 timeout) | |||
8593 | * size - Size of data to read, 1=byte 2=word | 8433 | * size - Size of data to read, 1=byte 2=word |
8594 | * data - Pointer to the word to store the value read. | 8434 | * data - Pointer to the word to store the value read. |
8595 | *****************************************************************************/ | 8435 | *****************************************************************************/ |
8596 | static s32 | 8436 | static s32 e1000_read_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
8597 | e1000_read_ich8_data(struct e1000_hw *hw, u32 index, | 8437 | u16 *data) |
8598 | u32 size, u16* data) | ||
8599 | { | 8438 | { |
8600 | union ich8_hws_flash_status hsfsts; | 8439 | union ich8_hws_flash_status hsfsts; |
8601 | union ich8_hws_flash_ctrl hsflctl; | 8440 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8672,9 +8511,8 @@ e1000_read_ich8_data(struct e1000_hw *hw, u32 index, | |||
8672 | * size - Size of data to read, 1=byte 2=word | 8511 | * size - Size of data to read, 1=byte 2=word |
8673 | * data - The byte(s) to write to the NVM. | 8512 | * data - The byte(s) to write to the NVM. |
8674 | *****************************************************************************/ | 8513 | *****************************************************************************/ |
8675 | static s32 | 8514 | static s32 e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, |
8676 | e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, | 8515 | u16 data) |
8677 | u16 data) | ||
8678 | { | 8516 | { |
8679 | union ich8_hws_flash_status hsfsts; | 8517 | union ich8_hws_flash_status hsfsts; |
8680 | union ich8_hws_flash_ctrl hsflctl; | 8518 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8747,8 +8585,7 @@ e1000_write_ich8_data(struct e1000_hw *hw, u32 index, u32 size, | |||
8747 | * index - The index of the byte to read. | 8585 | * index - The index of the byte to read. |
8748 | * data - Pointer to a byte to store the value read. | 8586 | * data - Pointer to a byte to store the value read. |
8749 | *****************************************************************************/ | 8587 | *****************************************************************************/ |
8750 | static s32 | 8588 | static s32 e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8 *data) |
8751 | e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8* data) | ||
8752 | { | 8589 | { |
8753 | s32 status = E1000_SUCCESS; | 8590 | s32 status = E1000_SUCCESS; |
8754 | u16 word = 0; | 8591 | u16 word = 0; |
@@ -8770,8 +8607,7 @@ e1000_read_ich8_byte(struct e1000_hw *hw, u32 index, u8* data) | |||
8770 | * index - The index of the byte to write. | 8607 | * index - The index of the byte to write. |
8771 | * byte - The byte to write to the NVM. | 8608 | * byte - The byte to write to the NVM. |
8772 | *****************************************************************************/ | 8609 | *****************************************************************************/ |
8773 | static s32 | 8610 | static s32 e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) |
8774 | e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) | ||
8775 | { | 8611 | { |
8776 | s32 error = E1000_SUCCESS; | 8612 | s32 error = E1000_SUCCESS; |
8777 | s32 program_retries = 0; | 8613 | s32 program_retries = 0; |
@@ -8803,8 +8639,7 @@ e1000_verify_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 byte) | |||
8803 | * index - The index of the byte to read. | 8639 | * index - The index of the byte to read. |
8804 | * data - The byte to write to the NVM. | 8640 | * data - The byte to write to the NVM. |
8805 | *****************************************************************************/ | 8641 | *****************************************************************************/ |
8806 | static s32 | 8642 | static s32 e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) |
8807 | e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) | ||
8808 | { | 8643 | { |
8809 | s32 status = E1000_SUCCESS; | 8644 | s32 status = E1000_SUCCESS; |
8810 | u16 word = (u16)data; | 8645 | u16 word = (u16)data; |
@@ -8821,8 +8656,7 @@ e1000_write_ich8_byte(struct e1000_hw *hw, u32 index, u8 data) | |||
8821 | * index - The starting byte index of the word to read. | 8656 | * index - The starting byte index of the word to read. |
8822 | * data - Pointer to a word to store the value read. | 8657 | * data - Pointer to a word to store the value read. |
8823 | *****************************************************************************/ | 8658 | *****************************************************************************/ |
8824 | static s32 | 8659 | static s32 e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) |
8825 | e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) | ||
8826 | { | 8660 | { |
8827 | s32 status = E1000_SUCCESS; | 8661 | s32 status = E1000_SUCCESS; |
8828 | status = e1000_read_ich8_data(hw, index, 2, data); | 8662 | status = e1000_read_ich8_data(hw, index, 2, data); |
@@ -8840,8 +8674,7 @@ e1000_read_ich8_word(struct e1000_hw *hw, u32 index, u16 *data) | |||
8840 | * amount of NVM used in each bank is a *minimum* of 4 KBytes, but in fact the | 8674 | * amount of NVM used in each bank is a *minimum* of 4 KBytes, but in fact the |
8841 | * bank size may be 4, 8 or 64 KBytes | 8675 | * bank size may be 4, 8 or 64 KBytes |
8842 | *****************************************************************************/ | 8676 | *****************************************************************************/ |
8843 | static s32 | 8677 | static s32 e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) |
8844 | e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) | ||
8845 | { | 8678 | { |
8846 | union ich8_hws_flash_status hsfsts; | 8679 | union ich8_hws_flash_status hsfsts; |
8847 | union ich8_hws_flash_ctrl hsflctl; | 8680 | union ich8_hws_flash_ctrl hsflctl; |
@@ -8930,9 +8763,9 @@ e1000_erase_ich8_4k_segment(struct e1000_hw *hw, u32 bank) | |||
8930 | return error; | 8763 | return error; |
8931 | } | 8764 | } |
8932 | 8765 | ||
8933 | static s32 | 8766 | static s32 e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, |
8934 | e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, | 8767 | u32 cnf_base_addr, |
8935 | u32 cnf_base_addr, u32 cnf_size) | 8768 | u32 cnf_size) |
8936 | { | 8769 | { |
8937 | u32 ret_val = E1000_SUCCESS; | 8770 | u32 ret_val = E1000_SUCCESS; |
8938 | u16 word_addr, reg_data, reg_addr; | 8771 | u16 word_addr, reg_data, reg_addr; |
@@ -8972,8 +8805,7 @@ e1000_init_lcd_from_nvm_config_region(struct e1000_hw *hw, | |||
8972 | * | 8805 | * |
8973 | * hw: Struct containing variables accessed by shared code | 8806 | * hw: Struct containing variables accessed by shared code |
8974 | *****************************************************************************/ | 8807 | *****************************************************************************/ |
8975 | static s32 | 8808 | static s32 e1000_init_lcd_from_nvm(struct e1000_hw *hw) |
8976 | e1000_init_lcd_from_nvm(struct e1000_hw *hw) | ||
8977 | { | 8809 | { |
8978 | u32 reg_data, cnf_base_addr, cnf_size, ret_val, loop; | 8810 | u32 reg_data, cnf_base_addr, cnf_size, ret_val, loop; |
8979 | 8811 | ||