diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_x540.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_x540.c | 43 |
1 files changed, 28 insertions, 15 deletions
diff --git a/drivers/net/ixgbe/ixgbe_x540.c b/drivers/net/ixgbe/ixgbe_x540.c index f2518b01067d..f47e93fe32be 100644 --- a/drivers/net/ixgbe/ixgbe_x540.c +++ b/drivers/net/ixgbe/ixgbe_x540.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel 10 Gigabit PCI Express Linux driver | 3 | Intel 10 Gigabit PCI Express Linux driver |
4 | Copyright(c) 1999 - 2010 Intel Corporation. | 4 | Copyright(c) 1999 - 2011 Intel Corporation. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -31,7 +31,6 @@ | |||
31 | 31 | ||
32 | #include "ixgbe.h" | 32 | #include "ixgbe.h" |
33 | #include "ixgbe_phy.h" | 33 | #include "ixgbe_phy.h" |
34 | //#include "ixgbe_mbx.h" | ||
35 | 34 | ||
36 | #define IXGBE_X540_MAX_TX_QUEUES 128 | 35 | #define IXGBE_X540_MAX_TX_QUEUES 128 |
37 | #define IXGBE_X540_MAX_RX_QUEUES 128 | 36 | #define IXGBE_X540_MAX_RX_QUEUES 128 |
@@ -110,12 +109,9 @@ static s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) | |||
110 | * Prevent the PCI-E bus from from hanging by disabling PCI-E master | 109 | * Prevent the PCI-E bus from from hanging by disabling PCI-E master |
111 | * access and verify no pending requests before reset | 110 | * access and verify no pending requests before reset |
112 | */ | 111 | */ |
113 | status = ixgbe_disable_pcie_master(hw); | 112 | ixgbe_disable_pcie_master(hw); |
114 | if (status != 0) { | ||
115 | status = IXGBE_ERR_MASTER_REQUESTS_PENDING; | ||
116 | hw_dbg(hw, "PCI-E Master disable polling has failed.\n"); | ||
117 | } | ||
118 | 113 | ||
114 | mac_reset_top: | ||
119 | /* | 115 | /* |
120 | * Issue global reset to the MAC. Needs to be SW reset if link is up. | 116 | * Issue global reset to the MAC. Needs to be SW reset if link is up. |
121 | * If link reset is used when link is up, it might reset the PHY when | 117 | * If link reset is used when link is up, it might reset the PHY when |
@@ -148,6 +144,19 @@ static s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) | |||
148 | hw_dbg(hw, "Reset polling failed to complete.\n"); | 144 | hw_dbg(hw, "Reset polling failed to complete.\n"); |
149 | } | 145 | } |
150 | 146 | ||
147 | /* | ||
148 | * Double resets are required for recovery from certain error | ||
149 | * conditions. Between resets, it is necessary to stall to allow time | ||
150 | * for any pending HW events to complete. We use 1usec since that is | ||
151 | * what is needed for ixgbe_disable_pcie_master(). The second reset | ||
152 | * then clears out any effects of those events. | ||
153 | */ | ||
154 | if (hw->mac.flags & IXGBE_FLAGS_DOUBLE_RESET_REQUIRED) { | ||
155 | hw->mac.flags &= ~IXGBE_FLAGS_DOUBLE_RESET_REQUIRED; | ||
156 | udelay(1); | ||
157 | goto mac_reset_top; | ||
158 | } | ||
159 | |||
151 | /* Clear PF Reset Done bit so PF/VF Mail Ops can work */ | 160 | /* Clear PF Reset Done bit so PF/VF Mail Ops can work */ |
152 | ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); | 161 | ctrl_ext = IXGBE_READ_REG(hw, IXGBE_CTRL_EXT); |
153 | ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD; | 162 | ctrl_ext |= IXGBE_CTRL_EXT_PFRSTD; |
@@ -191,7 +200,7 @@ static s32 ixgbe_reset_hw_X540(struct ixgbe_hw *hw) | |||
191 | * clear the multicast table. Also reset num_rar_entries to 128, | 200 | * clear the multicast table. Also reset num_rar_entries to 128, |
192 | * since we modify this value when programming the SAN MAC address. | 201 | * since we modify this value when programming the SAN MAC address. |
193 | */ | 202 | */ |
194 | hw->mac.num_rar_entries = 128; | 203 | hw->mac.num_rar_entries = IXGBE_X540_MAX_TX_QUEUES; |
195 | hw->mac.ops.init_rx_addrs(hw); | 204 | hw->mac.ops.init_rx_addrs(hw); |
196 | 205 | ||
197 | /* Store the permanent mac address */ | 206 | /* Store the permanent mac address */ |
@@ -242,8 +251,11 @@ static u32 ixgbe_get_supported_physical_layer_X540(struct ixgbe_hw *hw) | |||
242 | } | 251 | } |
243 | 252 | ||
244 | /** | 253 | /** |
245 | * ixgbe_init_eeprom_params_X540 - Initialize EEPROM params | 254 | * ixgbe_init_eeprom_params_X540 - Initialize EEPROM params |
246 | * @hw: pointer to hardware structure | 255 | * @hw: pointer to hardware structure |
256 | * | ||
257 | * Initializes the EEPROM parameters ixgbe_eeprom_info within the | ||
258 | * ixgbe_hw struct in order to set up EEPROM access. | ||
247 | **/ | 259 | **/ |
248 | static s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) | 260 | static s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) |
249 | { | 261 | { |
@@ -262,7 +274,7 @@ static s32 ixgbe_init_eeprom_params_X540(struct ixgbe_hw *hw) | |||
262 | IXGBE_EEPROM_WORD_SIZE_SHIFT); | 274 | IXGBE_EEPROM_WORD_SIZE_SHIFT); |
263 | 275 | ||
264 | hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", | 276 | hw_dbg(hw, "Eeprom params: type = %d, size = %d\n", |
265 | eeprom->type, eeprom->word_size); | 277 | eeprom->type, eeprom->word_size); |
266 | } | 278 | } |
267 | 279 | ||
268 | return 0; | 280 | return 0; |
@@ -278,7 +290,7 @@ static s32 ixgbe_read_eerd_X540(struct ixgbe_hw *hw, u16 offset, u16 *data) | |||
278 | { | 290 | { |
279 | s32 status; | 291 | s32 status; |
280 | 292 | ||
281 | if (ixgbe_acquire_swfw_sync_X540(hw, IXGBE_GSSR_EEP_SM) == 0) | 293 | if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) |
282 | status = ixgbe_read_eerd_generic(hw, offset, data); | 294 | status = ixgbe_read_eerd_generic(hw, offset, data); |
283 | else | 295 | else |
284 | status = IXGBE_ERR_SWFW_SYNC; | 296 | status = IXGBE_ERR_SWFW_SYNC; |
@@ -311,7 +323,7 @@ static s32 ixgbe_write_eewr_X540(struct ixgbe_hw *hw, u16 offset, u16 data) | |||
311 | (data << IXGBE_EEPROM_RW_REG_DATA) | | 323 | (data << IXGBE_EEPROM_RW_REG_DATA) | |
312 | IXGBE_EEPROM_RW_REG_START; | 324 | IXGBE_EEPROM_RW_REG_START; |
313 | 325 | ||
314 | if (ixgbe_acquire_swfw_sync_X540(hw, IXGBE_GSSR_EEP_SM) == 0) { | 326 | if (hw->mac.ops.acquire_swfw_sync(hw, IXGBE_GSSR_EEP_SM) == 0) { |
315 | status = ixgbe_poll_eerd_eewr_done(hw, IXGBE_NVM_POLL_WRITE); | 327 | status = ixgbe_poll_eerd_eewr_done(hw, IXGBE_NVM_POLL_WRITE); |
316 | if (status != 0) { | 328 | if (status != 0) { |
317 | hw_dbg(hw, "Eeprom write EEWR timed out\n"); | 329 | hw_dbg(hw, "Eeprom write EEWR timed out\n"); |
@@ -676,7 +688,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = { | |||
676 | .set_vmdq = &ixgbe_set_vmdq_generic, | 688 | .set_vmdq = &ixgbe_set_vmdq_generic, |
677 | .clear_vmdq = &ixgbe_clear_vmdq_generic, | 689 | .clear_vmdq = &ixgbe_clear_vmdq_generic, |
678 | .init_rx_addrs = &ixgbe_init_rx_addrs_generic, | 690 | .init_rx_addrs = &ixgbe_init_rx_addrs_generic, |
679 | .update_uc_addr_list = &ixgbe_update_uc_addr_list_generic, | ||
680 | .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic, | 691 | .update_mc_addr_list = &ixgbe_update_mc_addr_list_generic, |
681 | .enable_mc = &ixgbe_enable_mc_generic, | 692 | .enable_mc = &ixgbe_enable_mc_generic, |
682 | .disable_mc = &ixgbe_disable_mc_generic, | 693 | .disable_mc = &ixgbe_disable_mc_generic, |
@@ -687,6 +698,8 @@ static struct ixgbe_mac_operations mac_ops_X540 = { | |||
687 | .setup_sfp = NULL, | 698 | .setup_sfp = NULL, |
688 | .set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing, | 699 | .set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing, |
689 | .set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing, | 700 | .set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing, |
701 | .acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X540, | ||
702 | .release_swfw_sync = &ixgbe_release_swfw_sync_X540, | ||
690 | }; | 703 | }; |
691 | 704 | ||
692 | static struct ixgbe_eeprom_operations eeprom_ops_X540 = { | 705 | static struct ixgbe_eeprom_operations eeprom_ops_X540 = { |
@@ -702,7 +715,7 @@ static struct ixgbe_phy_operations phy_ops_X540 = { | |||
702 | .identify = &ixgbe_identify_phy_generic, | 715 | .identify = &ixgbe_identify_phy_generic, |
703 | .identify_sfp = &ixgbe_identify_sfp_module_generic, | 716 | .identify_sfp = &ixgbe_identify_sfp_module_generic, |
704 | .init = NULL, | 717 | .init = NULL, |
705 | .reset = &ixgbe_reset_phy_generic, | 718 | .reset = NULL, |
706 | .read_reg = &ixgbe_read_phy_reg_generic, | 719 | .read_reg = &ixgbe_read_phy_reg_generic, |
707 | .write_reg = &ixgbe_write_phy_reg_generic, | 720 | .write_reg = &ixgbe_write_phy_reg_generic, |
708 | .setup_link = &ixgbe_setup_phy_link_generic, | 721 | .setup_link = &ixgbe_setup_phy_link_generic, |