aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2013-04-18 15:00:59 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-18 15:00:59 -0400
commitc1cb0d3b569b1d21ada8666efb42dfd437617a09 (patch)
treeaec20516721412a8d0b802605ac9f6e163ef1023
parent0e280af026a5662ffd57c4e623b822df1f7f47ff (diff)
parent8c5afd6d7ba6516985ed69076927b01d2882e346 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/jkirsher/net-next
Jeff Kirsher says: ==================== This series contains updates to ixgbe only. v2- Dropped the following 2 patches from the series: ixgbe: Support using build_skb in the case that jumbo frames are disabled ixgbe: walk pci-e bus to find minimum width Ben Hutchings found a bug with Alex's patch, so that patch was dropped permanently. Jacob's "walk PCIe bus" patch is being re-worked for a more generic solution so that other drivers can benefit. In the remaining patches... Alex provides a fix where we were incorrectly checking the entire frag_off field when we only wanted the fragment offset. Alex also cleans up the check for PAGE_SIZE, since the default configuration allocates 32K for all buffers. Emil provides a change to the calculation of eerd so that it is consistent between the read and write functions by using | instead of +. Jacob adds support for displaying PCIe Gen3 link speed, which was previously missing from the ixgbe driver. He also provides a patch to clean up ixgbe_get_bus_info_generic to call some conversion functions, which are used also in another patch provided by Jacob. Jacob modifies the driver to enable certain devices (which have an internal switch) to read from the physical slot rather than reading data from the internal switch. Don provides a couple of fixes (which are more appropriate for net-next), one of which resolves an issue where ixgbe was only turning on the laser when the adapter was up which caused issues for those who wanted to access the MNG firmware while the port was in a down state. The other fix is for WoL when currently linked at 1G. Lastly Don bumps the driver version keep the in-kernel driver up to date with the current functionality. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c1
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c51
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.c63
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_common.h2
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c76
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_type.h13
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c1
7 files changed, 162 insertions, 45 deletions
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
index d0113fc97b6f..4a5bfb6b3af0 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c
@@ -1305,6 +1305,7 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
1305 .release_swfw_sync = &ixgbe_release_swfw_sync, 1305 .release_swfw_sync = &ixgbe_release_swfw_sync,
1306 .get_thermal_sensor_data = NULL, 1306 .get_thermal_sensor_data = NULL,
1307 .init_thermal_sensor_thresh = NULL, 1307 .init_thermal_sensor_thresh = NULL,
1308 .mng_fw_enabled = NULL,
1308}; 1309};
1309 1310
1310static struct ixgbe_eeprom_operations eeprom_ops_82598 = { 1311static struct ixgbe_eeprom_operations eeprom_ops_82598 = {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
index 203a00c24330..7946da94b228 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c
@@ -59,12 +59,34 @@ static s32 ixgbe_setup_copper_link_82599(struct ixgbe_hw *hw,
59 bool autoneg_wait_to_complete); 59 bool autoneg_wait_to_complete);
60static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw); 60static s32 ixgbe_verify_fw_version_82599(struct ixgbe_hw *hw);
61 61
62static bool ixgbe_mng_enabled(struct ixgbe_hw *hw)
63{
64 u32 fwsm, manc, factps;
65
66 fwsm = IXGBE_READ_REG(hw, IXGBE_FWSM);
67 if ((fwsm & IXGBE_FWSM_MODE_MASK) != IXGBE_FWSM_FW_MODE_PT)
68 return false;
69
70 manc = IXGBE_READ_REG(hw, IXGBE_MANC);
71 if (!(manc & IXGBE_MANC_RCV_TCO_EN))
72 return false;
73
74 factps = IXGBE_READ_REG(hw, IXGBE_FACTPS);
75 if (factps & IXGBE_FACTPS_MNGCG)
76 return false;
77
78 return true;
79}
80
62static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) 81static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
63{ 82{
64 struct ixgbe_mac_info *mac = &hw->mac; 83 struct ixgbe_mac_info *mac = &hw->mac;
65 84
66 /* enable the laser control functions for SFP+ fiber */ 85 /* enable the laser control functions for SFP+ fiber
67 if (mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) { 86 * and MNG not enabled
87 */
88 if ((mac->ops.get_media_type(hw) == ixgbe_media_type_fiber) &&
89 !hw->mng_fw_enabled) {
68 mac->ops.disable_tx_laser = 90 mac->ops.disable_tx_laser =
69 &ixgbe_disable_tx_laser_multispeed_fiber; 91 &ixgbe_disable_tx_laser_multispeed_fiber;
70 mac->ops.enable_tx_laser = 92 mac->ops.enable_tx_laser =
@@ -563,7 +585,8 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
563 return status; 585 return status;
564 586
565 /* Flap the tx laser if it has not already been done */ 587 /* Flap the tx laser if it has not already been done */
566 hw->mac.ops.flap_tx_laser(hw); 588 if (hw->mac.ops.flap_tx_laser)
589 hw->mac.ops.flap_tx_laser(hw);
567 590
568 /* 591 /*
569 * Wait for the controller to acquire link. Per IEEE 802.3ap, 592 * Wait for the controller to acquire link. Per IEEE 802.3ap,
@@ -615,7 +638,8 @@ static s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
615 return status; 638 return status;
616 639
617 /* Flap the tx laser if it has not already been done */ 640 /* Flap the tx laser if it has not already been done */
618 hw->mac.ops.flap_tx_laser(hw); 641 if (hw->mac.ops.flap_tx_laser)
642 hw->mac.ops.flap_tx_laser(hw);
619 643
620 /* Wait for the link partner to also set speed */ 644 /* Wait for the link partner to also set speed */
621 msleep(100); 645 msleep(100);
@@ -933,6 +957,7 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
933 ixgbe_link_speed link_speed; 957 ixgbe_link_speed link_speed;
934 s32 status; 958 s32 status;
935 u32 ctrl, i, autoc, autoc2; 959 u32 ctrl, i, autoc, autoc2;
960 u32 curr_lms;
936 bool link_up = false; 961 bool link_up = false;
937 962
938 /* Call adapter stop to disable tx/rx and clear interrupts */ 963 /* Call adapter stop to disable tx/rx and clear interrupts */
@@ -964,6 +989,9 @@ static s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw)
964 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL) 989 if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL)
965 hw->phy.ops.reset(hw); 990 hw->phy.ops.reset(hw);
966 991
992 /* remember AUTOC LMS from before we reset */
993 curr_lms = IXGBE_READ_REG(hw, IXGBE_AUTOC) & IXGBE_AUTOC_LMS_MASK;
994
967mac_reset_top: 995mac_reset_top:
968 /* 996 /*
969 * Issue global reset to the MAC. Needs to be SW reset if link is up. 997 * Issue global reset to the MAC. Needs to be SW reset if link is up.
@@ -1019,6 +1047,19 @@ mac_reset_top:
1019 hw->mac.orig_autoc2 = autoc2; 1047 hw->mac.orig_autoc2 = autoc2;
1020 hw->mac.orig_link_settings_stored = true; 1048 hw->mac.orig_link_settings_stored = true;
1021 } else { 1049 } else {
1050
1051 /* If MNG FW is running on a multi-speed device that
1052 * doesn't autoneg with out driver support we need to
1053 * leave LMS in the state it was before we MAC reset.
1054 * Likewise if we support WoL we don't want change the
1055 * LMS state either.
1056 */
1057 if ((hw->phy.multispeed_fiber && hw->mng_fw_enabled) ||
1058 hw->wol_supported)
1059 hw->mac.orig_autoc =
1060 (hw->mac.orig_autoc & ~IXGBE_AUTOC_LMS_MASK) |
1061 curr_lms;
1062
1022 if (autoc != hw->mac.orig_autoc) { 1063 if (autoc != hw->mac.orig_autoc) {
1023 /* Need SW/FW semaphore around AUTOC writes if LESM is 1064 /* Need SW/FW semaphore around AUTOC writes if LESM is
1024 * on, likewise reset_pipeline requires us to hold 1065 * on, likewise reset_pipeline requires us to hold
@@ -2216,7 +2257,7 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
2216 .release_swfw_sync = &ixgbe_release_swfw_sync, 2257 .release_swfw_sync = &ixgbe_release_swfw_sync,
2217 .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic, 2258 .get_thermal_sensor_data = &ixgbe_get_thermal_sensor_data_generic,
2218 .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic, 2259 .init_thermal_sensor_thresh = &ixgbe_init_thermal_sensor_thresh_generic,
2219 2260 .mng_fw_enabled = &ixgbe_mng_enabled,
2220}; 2261};
2221 2262
2222static struct ixgbe_eeprom_operations eeprom_ops_82599 = { 2263static struct ixgbe_eeprom_operations eeprom_ops_82599 = {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
index 99e472ebaa75..9bcdeb89af5a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
@@ -592,6 +592,36 @@ s32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr)
592 return 0; 592 return 0;
593} 593}
594 594
595enum ixgbe_bus_width ixgbe_convert_bus_width(u16 link_status)
596{
597 switch (link_status & IXGBE_PCI_LINK_WIDTH) {
598 case IXGBE_PCI_LINK_WIDTH_1:
599 return ixgbe_bus_width_pcie_x1;
600 case IXGBE_PCI_LINK_WIDTH_2:
601 return ixgbe_bus_width_pcie_x2;
602 case IXGBE_PCI_LINK_WIDTH_4:
603 return ixgbe_bus_width_pcie_x4;
604 case IXGBE_PCI_LINK_WIDTH_8:
605 return ixgbe_bus_width_pcie_x8;
606 default:
607 return ixgbe_bus_width_unknown;
608 }
609}
610
611enum ixgbe_bus_speed ixgbe_convert_bus_speed(u16 link_status)
612{
613 switch (link_status & IXGBE_PCI_LINK_SPEED) {
614 case IXGBE_PCI_LINK_SPEED_2500:
615 return ixgbe_bus_speed_2500;
616 case IXGBE_PCI_LINK_SPEED_5000:
617 return ixgbe_bus_speed_5000;
618 case IXGBE_PCI_LINK_SPEED_8000:
619 return ixgbe_bus_speed_8000;
620 default:
621 return ixgbe_bus_speed_unknown;
622 }
623}
624
595/** 625/**
596 * ixgbe_get_bus_info_generic - Generic set PCI bus info 626 * ixgbe_get_bus_info_generic - Generic set PCI bus info
597 * @hw: pointer to hardware structure 627 * @hw: pointer to hardware structure
@@ -610,35 +640,8 @@ s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw)
610 pci_read_config_word(adapter->pdev, IXGBE_PCI_LINK_STATUS, 640 pci_read_config_word(adapter->pdev, IXGBE_PCI_LINK_STATUS,
611 &link_status); 641 &link_status);
612 642
613 switch (link_status & IXGBE_PCI_LINK_WIDTH) { 643 hw->bus.width = ixgbe_convert_bus_width(link_status);
614 case IXGBE_PCI_LINK_WIDTH_1: 644 hw->bus.speed = ixgbe_convert_bus_speed(link_status);
615 hw->bus.width = ixgbe_bus_width_pcie_x1;
616 break;
617 case IXGBE_PCI_LINK_WIDTH_2:
618 hw->bus.width = ixgbe_bus_width_pcie_x2;
619 break;
620 case IXGBE_PCI_LINK_WIDTH_4:
621 hw->bus.width = ixgbe_bus_width_pcie_x4;
622 break;
623 case IXGBE_PCI_LINK_WIDTH_8:
624 hw->bus.width = ixgbe_bus_width_pcie_x8;
625 break;
626 default:
627 hw->bus.width = ixgbe_bus_width_unknown;
628 break;
629 }
630
631 switch (link_status & IXGBE_PCI_LINK_SPEED) {
632 case IXGBE_PCI_LINK_SPEED_2500:
633 hw->bus.speed = ixgbe_bus_speed_2500;
634 break;
635 case IXGBE_PCI_LINK_SPEED_5000:
636 hw->bus.speed = ixgbe_bus_speed_5000;
637 break;
638 default:
639 hw->bus.speed = ixgbe_bus_speed_unknown;
640 break;
641 }
642 645
643 mac->ops.set_lan_id(hw); 646 mac->ops.set_lan_id(hw);
644 647
@@ -1125,7 +1128,7 @@ s32 ixgbe_read_eerd_buffer_generic(struct ixgbe_hw *hw, u16 offset,
1125 } 1128 }
1126 1129
1127 for (i = 0; i < words; i++) { 1130 for (i = 0; i < words; i++) {
1128 eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) + 1131 eerd = ((offset + i) << IXGBE_EEPROM_RW_ADDR_SHIFT) |
1129 IXGBE_EEPROM_RW_REG_START; 1132 IXGBE_EEPROM_RW_REG_START;
1130 1133
1131 IXGBE_WRITE_REG(hw, IXGBE_EERD, eerd); 1134 IXGBE_WRITE_REG(hw, IXGBE_EERD, eerd);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
index bc3948ead6e0..22eee38868f1 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.h
@@ -40,6 +40,8 @@ s32 ixgbe_clear_hw_cntrs_generic(struct ixgbe_hw *hw);
40s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num, 40s32 ixgbe_read_pba_string_generic(struct ixgbe_hw *hw, u8 *pba_num,
41 u32 pba_num_size); 41 u32 pba_num_size);
42s32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr); 42s32 ixgbe_get_mac_addr_generic(struct ixgbe_hw *hw, u8 *mac_addr);
43enum ixgbe_bus_width ixgbe_convert_bus_width(u16 link_status);
44enum ixgbe_bus_speed ixgbe_convert_bus_speed(u16 link_status);
43s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw); 45s32 ixgbe_get_bus_info_generic(struct ixgbe_hw *hw);
44void ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw); 46void ixgbe_set_lan_id_multi_port_pcie(struct ixgbe_hw *hw);
45s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw); 47s32 ixgbe_stop_adapter_generic(struct ixgbe_hw *hw);
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index 1339932f59b1..6bd1dd13682c 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -63,7 +63,7 @@ char ixgbe_default_device_descr[] =
63static char ixgbe_default_device_descr[] = 63static char ixgbe_default_device_descr[] =
64 "Intel(R) 10 Gigabit Network Connection"; 64 "Intel(R) 10 Gigabit Network Connection";
65#endif 65#endif
66#define DRV_VERSION "3.11.33-k" 66#define DRV_VERSION "3.13.10-k"
67const char ixgbe_driver_version[] = DRV_VERSION; 67const char ixgbe_driver_version[] = DRV_VERSION;
68static const char ixgbe_copyright[] = 68static const char ixgbe_copyright[] =
69 "Copyright (c) 1999-2013 Intel Corporation."; 69 "Copyright (c) 1999-2013 Intel Corporation.";
@@ -149,6 +149,52 @@ MODULE_DESCRIPTION("Intel(R) 10 Gigabit PCI Express Network Driver");
149MODULE_LICENSE("GPL"); 149MODULE_LICENSE("GPL");
150MODULE_VERSION(DRV_VERSION); 150MODULE_VERSION(DRV_VERSION);
151 151
152static int ixgbe_read_pci_cfg_word_parent(struct ixgbe_adapter *adapter,
153 u32 reg, u16 *value)
154{
155 int pos = 0;
156 struct pci_dev *parent_dev;
157 struct pci_bus *parent_bus;
158
159 parent_bus = adapter->pdev->bus->parent;
160 if (!parent_bus)
161 return -1;
162
163 parent_dev = parent_bus->self;
164 if (!parent_dev)
165 return -1;
166
167 pos = pci_find_capability(parent_dev, PCI_CAP_ID_EXP);
168 if (!pos)
169 return -1;
170
171 pci_read_config_word(parent_dev, pos + reg, value);
172 return 0;
173}
174
175static s32 ixgbe_get_parent_bus_info(struct ixgbe_adapter *adapter)
176{
177 struct ixgbe_hw *hw = &adapter->hw;
178 u16 link_status = 0;
179 int err;
180
181 hw->bus.type = ixgbe_bus_type_pci_express;
182
183 /* Get the negotiated link width and speed from PCI config space of the
184 * parent, as this device is behind a switch
185 */
186 err = ixgbe_read_pci_cfg_word_parent(adapter, 18, &link_status);
187
188 /* assume caller will handle error case */
189 if (err)
190 return err;
191
192 hw->bus.width = ixgbe_convert_bus_width(link_status);
193 hw->bus.speed = ixgbe_convert_bus_speed(link_status);
194
195 return 0;
196}
197
152static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter) 198static void ixgbe_service_event_schedule(struct ixgbe_adapter *adapter)
153{ 199{
154 if (!test_bit(__IXGBE_DOWN, &adapter->state) && 200 if (!test_bit(__IXGBE_DOWN, &adapter->state) &&
@@ -1337,7 +1383,7 @@ static unsigned int ixgbe_get_headlen(unsigned char *data,
1337 return hdr.network - data; 1383 return hdr.network - data;
1338 1384
1339 /* record next protocol if header is present */ 1385 /* record next protocol if header is present */
1340 if (!hdr.ipv4->frag_off) 1386 if (!(hdr.ipv4->frag_off & htons(IP_OFFSET)))
1341 nexthdr = hdr.ipv4->protocol; 1387 nexthdr = hdr.ipv4->protocol;
1342 } else if (protocol == __constant_htons(ETH_P_IPV6)) { 1388 } else if (protocol == __constant_htons(ETH_P_IPV6)) {
1343 if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr))) 1389 if ((hdr.network - data) > (max_len - sizeof(struct ipv6hdr)))
@@ -6425,9 +6471,7 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6425 struct ixgbe_tx_buffer *first; 6471 struct ixgbe_tx_buffer *first;
6426 int tso; 6472 int tso;
6427 u32 tx_flags = 0; 6473 u32 tx_flags = 0;
6428#if PAGE_SIZE > IXGBE_MAX_DATA_PER_TXD
6429 unsigned short f; 6474 unsigned short f;
6430#endif
6431 u16 count = TXD_USE_COUNT(skb_headlen(skb)); 6475 u16 count = TXD_USE_COUNT(skb_headlen(skb));
6432 __be16 protocol = skb->protocol; 6476 __be16 protocol = skb->protocol;
6433 u8 hdr_len = 0; 6477 u8 hdr_len = 0;
@@ -6439,12 +6483,9 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
6439 * + 1 desc for context descriptor, 6483 * + 1 desc for context descriptor,
6440 * otherwise try next time 6484 * otherwise try next time
6441 */ 6485 */
6442#if PAGE_SIZE > IXGBE_MAX_DATA_PER_TXD
6443 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++) 6486 for (f = 0; f < skb_shinfo(skb)->nr_frags; f++)
6444 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size); 6487 count += TXD_USE_COUNT(skb_shinfo(skb)->frags[f].size);
6445#else 6488
6446 count += skb_shinfo(skb)->nr_frags;
6447#endif
6448 if (ixgbe_maybe_stop_tx(tx_ring, count + 3)) { 6489 if (ixgbe_maybe_stop_tx(tx_ring, count + 3)) {
6449 tx_ring->tx_stats.tx_busy++; 6490 tx_ring->tx_stats.tx_busy++;
6450 return NETDEV_TX_BUSY; 6491 return NETDEV_TX_BUSY;
@@ -7329,6 +7370,10 @@ static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
7329 if (err) 7370 if (err)
7330 goto err_sw_init; 7371 goto err_sw_init;
7331 7372
7373 /* Cache if MNG FW is up so we don't have to read the REG later */
7374 if (hw->mac.ops.mng_fw_enabled)
7375 hw->mng_fw_enabled = hw->mac.ops.mng_fw_enabled(hw);
7376
7332 /* Make it possible the adapter to be woken up via WOL */ 7377 /* Make it possible the adapter to be woken up via WOL */
7333 switch (adapter->hw.mac.type) { 7378 switch (adapter->hw.mac.type) {
7334 case ixgbe_mac_82599EB: 7379 case ixgbe_mac_82599EB:
@@ -7481,7 +7526,9 @@ skip_sriov:
7481 /* WOL not supported for all devices */ 7526 /* WOL not supported for all devices */
7482 adapter->wol = 0; 7527 adapter->wol = 0;
7483 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap); 7528 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);
7484 if (ixgbe_wol_supported(adapter, pdev->device, pdev->subsystem_device)) 7529 hw->wol_supported = ixgbe_wol_supported(adapter, pdev->device,
7530 pdev->subsystem_device);
7531 if (hw->wol_supported)
7485 adapter->wol = IXGBE_WUFC_MAG; 7532 adapter->wol = IXGBE_WUFC_MAG;
7486 7533
7487 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol); 7534 device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);
@@ -7492,10 +7539,13 @@ skip_sriov:
7492 7539
7493 /* pick up the PCI bus settings for reporting later */ 7540 /* pick up the PCI bus settings for reporting later */
7494 hw->mac.ops.get_bus_info(hw); 7541 hw->mac.ops.get_bus_info(hw);
7542 if (hw->device_id == IXGBE_DEV_ID_82599_SFP_SF_QP)
7543 ixgbe_get_parent_bus_info(adapter);
7495 7544
7496 /* print bus type/speed/width info */ 7545 /* print bus type/speed/width info */
7497 e_dev_info("(PCI Express:%s:%s) %pM\n", 7546 e_dev_info("(PCI Express:%s:%s) %pM\n",
7498 (hw->bus.speed == ixgbe_bus_speed_5000 ? "5.0GT/s" : 7547 (hw->bus.speed == ixgbe_bus_speed_8000 ? "8.0GT/s" :
7548 hw->bus.speed == ixgbe_bus_speed_5000 ? "5.0GT/s" :
7499 hw->bus.speed == ixgbe_bus_speed_2500 ? "2.5GT/s" : 7549 hw->bus.speed == ixgbe_bus_speed_2500 ? "2.5GT/s" :
7500 "Unknown"), 7550 "Unknown"),
7501 (hw->bus.width == ixgbe_bus_width_pcie_x8 ? "Width x8" : 7551 (hw->bus.width == ixgbe_bus_width_pcie_x8 ? "Width x8" :
@@ -7579,6 +7629,12 @@ skip_sriov:
7579 ixgbe_dbg_adapter_init(adapter); 7629 ixgbe_dbg_adapter_init(adapter);
7580#endif /* CONFIG_DEBUG_FS */ 7630#endif /* CONFIG_DEBUG_FS */
7581 7631
7632 /* Need link setup for MNG FW, else wait for IXGBE_UP */
7633 if (hw->mng_fw_enabled && hw->mac.ops.setup_link)
7634 hw->mac.ops.setup_link(hw,
7635 IXGBE_LINK_SPEED_10GB_FULL | IXGBE_LINK_SPEED_1GB_FULL,
7636 true);
7637
7582 return 0; 7638 return 0;
7583 7639
7584err_register: 7640err_register:
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
index 6652e96c352d..155a793705be 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
@@ -729,6 +729,13 @@ struct ixgbe_thermal_sensor_data {
729#define IXGBE_MDEF_EXT(_i) (0x05160 + ((_i) * 4)) /* 8 of these (0-7) */ 729#define IXGBE_MDEF_EXT(_i) (0x05160 + ((_i) * 4)) /* 8 of these (0-7) */
730#define IXGBE_LSWFW 0x15014 730#define IXGBE_LSWFW 0x15014
731 731
732/* Management Bit Fields and Masks */
733#define IXGBE_MANC_RCV_TCO_EN 0x00020000 /* Rcv TCO packet enable */
734
735/* Firmware Semaphore Register */
736#define IXGBE_FWSM_MODE_MASK 0xE
737#define IXGBE_FWSM_FW_MODE_PT 0x4
738
732/* ARC Subsystem registers */ 739/* ARC Subsystem registers */
733#define IXGBE_HICR 0x15F00 740#define IXGBE_HICR 0x15F00
734#define IXGBE_FWSTS 0x15F0C 741#define IXGBE_FWSTS 0x15F0C
@@ -1019,6 +1026,7 @@ struct ixgbe_thermal_sensor_data {
1019#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST) 1026#define IXGBE_CTRL_RST_MASK (IXGBE_CTRL_LNK_RST | IXGBE_CTRL_RST)
1020 1027
1021/* FACTPS */ 1028/* FACTPS */
1029#define IXGBE_FACTPS_MNGCG 0x20000000 /* Manageblility Clock Gated */
1022#define IXGBE_FACTPS_LFS 0x40000000 /* LAN Function Select */ 1030#define IXGBE_FACTPS_LFS 0x40000000 /* LAN Function Select */
1023 1031
1024/* MHADD Bit Masks */ 1032/* MHADD Bit Masks */
@@ -1827,6 +1835,7 @@ enum {
1827#define IXGBE_PCI_LINK_SPEED 0xF 1835#define IXGBE_PCI_LINK_SPEED 0xF
1828#define IXGBE_PCI_LINK_SPEED_2500 0x1 1836#define IXGBE_PCI_LINK_SPEED_2500 0x1
1829#define IXGBE_PCI_LINK_SPEED_5000 0x2 1837#define IXGBE_PCI_LINK_SPEED_5000 0x2
1838#define IXGBE_PCI_LINK_SPEED_8000 0x3
1830#define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E 1839#define IXGBE_PCI_HEADER_TYPE_REGISTER 0x0E
1831#define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80 1840#define IXGBE_PCI_HEADER_TYPE_MULTIFUNC 0x80
1832#define IXGBE_PCI_DEVICE_CONTROL2_16ms 0x0005 1841#define IXGBE_PCI_DEVICE_CONTROL2_16ms 0x0005
@@ -2650,6 +2659,7 @@ enum ixgbe_bus_speed {
2650 ixgbe_bus_speed_133 = 133, 2659 ixgbe_bus_speed_133 = 133,
2651 ixgbe_bus_speed_2500 = 2500, 2660 ixgbe_bus_speed_2500 = 2500,
2652 ixgbe_bus_speed_5000 = 5000, 2661 ixgbe_bus_speed_5000 = 5000,
2662 ixgbe_bus_speed_8000 = 8000,
2653 ixgbe_bus_speed_reserved 2663 ixgbe_bus_speed_reserved
2654}; 2664};
2655 2665
@@ -2859,6 +2869,7 @@ struct ixgbe_mac_operations {
2859 s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8); 2869 s32 (*set_fw_drv_ver)(struct ixgbe_hw *, u8, u8, u8, u8);
2860 s32 (*get_thermal_sensor_data)(struct ixgbe_hw *); 2870 s32 (*get_thermal_sensor_data)(struct ixgbe_hw *);
2861 s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw); 2871 s32 (*init_thermal_sensor_thresh)(struct ixgbe_hw *hw);
2872 bool (*mng_fw_enabled)(struct ixgbe_hw *hw);
2862}; 2873};
2863 2874
2864struct ixgbe_phy_operations { 2875struct ixgbe_phy_operations {
@@ -2986,6 +2997,8 @@ struct ixgbe_hw {
2986 bool adapter_stopped; 2997 bool adapter_stopped;
2987 bool force_full_reset; 2998 bool force_full_reset;
2988 bool allow_unsupported_sfp; 2999 bool allow_unsupported_sfp;
3000 bool mng_fw_enabled;
3001 bool wol_supported;
2989}; 3002};
2990 3003
2991struct ixgbe_info { 3004struct ixgbe_info {
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
index 66c5e946284e..389324f5929a 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c
@@ -854,6 +854,7 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
854 .enable_rx_buff = &ixgbe_enable_rx_buff_generic, 854 .enable_rx_buff = &ixgbe_enable_rx_buff_generic,
855 .get_thermal_sensor_data = NULL, 855 .get_thermal_sensor_data = NULL,
856 .init_thermal_sensor_thresh = NULL, 856 .init_thermal_sensor_thresh = NULL,
857 .mng_fw_enabled = NULL,
857}; 858};
858 859
859static struct ixgbe_eeprom_operations eeprom_ops_X540 = { 860static struct ixgbe_eeprom_operations eeprom_ops_X540 = {