aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c62
-rw-r--r--drivers/net/ixgbe/ixgbe_ethtool.c1
-rw-r--r--drivers/net/ixgbe/ixgbe_fcoe.c1
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c23
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h2
5 files changed, 65 insertions, 24 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index b405a00817c6..12fc0e7ba2ca 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -39,6 +39,8 @@
39#define IXGBE_82599_MC_TBL_SIZE 128 39#define IXGBE_82599_MC_TBL_SIZE 128
40#define IXGBE_82599_VFT_TBL_SIZE 128 40#define IXGBE_82599_VFT_TBL_SIZE 128
41 41
42void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
43void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
42void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); 44void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
43s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, 45s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
44 ixgbe_link_speed speed, 46 ixgbe_link_speed speed,
@@ -69,8 +71,14 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw)
69 if (hw->phy.multispeed_fiber) { 71 if (hw->phy.multispeed_fiber) {
70 /* Set up dual speed SFP+ support */ 72 /* Set up dual speed SFP+ support */
71 mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; 73 mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber;
74 mac->ops.disable_tx_laser =
75 &ixgbe_disable_tx_laser_multispeed_fiber;
76 mac->ops.enable_tx_laser =
77 &ixgbe_enable_tx_laser_multispeed_fiber;
72 mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber; 78 mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber;
73 } else { 79 } else {
80 mac->ops.disable_tx_laser = NULL;
81 mac->ops.enable_tx_laser = NULL;
74 mac->ops.flap_tx_laser = NULL; 82 mac->ops.flap_tx_laser = NULL;
75 if ((mac->ops.get_media_type(hw) == 83 if ((mac->ops.get_media_type(hw) ==
76 ixgbe_media_type_backplane) && 84 ixgbe_media_type_backplane) &&
@@ -415,6 +423,44 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
415 return status; 423 return status;
416} 424}
417 425
426 /**
427 * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser
428 * @hw: pointer to hardware structure
429 *
430 * The base drivers may require better control over SFP+ module
431 * PHY states. This includes selectively shutting down the Tx
432 * laser on the PHY, effectively halting physical link.
433 **/
434void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
435{
436 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
437
438 /* Disable tx laser; allow 100us to go dark per spec */
439 esdp_reg |= IXGBE_ESDP_SDP3;
440 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
441 IXGBE_WRITE_FLUSH(hw);
442 udelay(100);
443}
444
445/**
446 * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser
447 * @hw: pointer to hardware structure
448 *
449 * The base drivers may require better control over SFP+ module
450 * PHY states. This includes selectively turning on the Tx
451 * laser on the PHY, effectively starting physical link.
452 **/
453void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
454{
455 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
456
457 /* Enable tx laser; allow 100ms to light up */
458 esdp_reg &= ~IXGBE_ESDP_SDP3;
459 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
460 IXGBE_WRITE_FLUSH(hw);
461 msleep(100);
462}
463
418/** 464/**
419 * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser 465 * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser
420 * @hw: pointer to hardware structure 466 * @hw: pointer to hardware structure
@@ -429,23 +475,11 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
429 **/ 475 **/
430void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) 476void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw)
431{ 477{
432 u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP);
433
434 hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n"); 478 hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n");
435 479
436 if (hw->mac.autotry_restart) { 480 if (hw->mac.autotry_restart) {
437 /* Disable tx laser; allow 100us to go dark per spec */ 481 ixgbe_disable_tx_laser_multispeed_fiber(hw);
438 esdp_reg |= IXGBE_ESDP_SDP3; 482 ixgbe_enable_tx_laser_multispeed_fiber(hw);
439 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
440 IXGBE_WRITE_FLUSH(hw);
441 udelay(100);
442
443 /* Enable tx laser; allow 100ms to light up */
444 esdp_reg &= ~IXGBE_ESDP_SDP3;
445 IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg);
446 IXGBE_WRITE_FLUSH(hw);
447 msleep(100);
448
449 hw->mac.autotry_restart = false; 483 hw->mac.autotry_restart = false;
450 } 484 }
451} 485}
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c
index 1959ef76c962..8f461d5cee77 100644
--- a/drivers/net/ixgbe/ixgbe_ethtool.c
+++ b/drivers/net/ixgbe/ixgbe_ethtool.c
@@ -29,6 +29,7 @@
29 29
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/module.h> 31#include <linux/module.h>
32#include <linux/slab.h>
32#include <linux/pci.h> 33#include <linux/pci.h>
33#include <linux/netdevice.h> 34#include <linux/netdevice.h>
34#include <linux/ethtool.h> 35#include <linux/ethtool.h>
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c
index 9276d5965b0d..6493049b663d 100644
--- a/drivers/net/ixgbe/ixgbe_fcoe.c
+++ b/drivers/net/ixgbe/ixgbe_fcoe.c
@@ -31,6 +31,7 @@
31#include "ixgbe_dcb_82599.h" 31#include "ixgbe_dcb_82599.h"
32#endif /* CONFIG_IXGBE_DCB */ 32#endif /* CONFIG_IXGBE_DCB */
33#include <linux/if_ether.h> 33#include <linux/if_ether.h>
34#include <linux/gfp.h>
34#include <scsi/scsi_cmnd.h> 35#include <scsi/scsi_cmnd.h>
35#include <scsi/scsi_device.h> 36#include <scsi/scsi_device.h>
36#include <scsi/fc/fc_fs.h> 37#include <scsi/fc/fc_fs.h>
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 0c553f6cb534..6c00ee493a3b 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -36,6 +36,7 @@
36#include <linux/tcp.h> 36#include <linux/tcp.h>
37#include <linux/pkt_sched.h> 37#include <linux/pkt_sched.h>
38#include <linux/ipv6.h> 38#include <linux/ipv6.h>
39#include <linux/slab.h>
39#include <net/checksum.h> 40#include <net/checksum.h>
40#include <net/ip6_checksum.h> 41#include <net/ip6_checksum.h>
41#include <linux/ethtool.h> 42#include <linux/ethtool.h>
@@ -2981,6 +2982,10 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
2981 else 2982 else
2982 ixgbe_configure_msi_and_legacy(adapter); 2983 ixgbe_configure_msi_and_legacy(adapter);
2983 2984
2985 /* enable the optics */
2986 if (hw->phy.multispeed_fiber)
2987 hw->mac.ops.enable_tx_laser(hw);
2988
2984 clear_bit(__IXGBE_DOWN, &adapter->state); 2989 clear_bit(__IXGBE_DOWN, &adapter->state);
2985 ixgbe_napi_enable_all(adapter); 2990 ixgbe_napi_enable_all(adapter);
2986 2991
@@ -3242,6 +3247,10 @@ void ixgbe_down(struct ixgbe_adapter *adapter)
3242 /* signal that we are down to the interrupt handler */ 3247 /* signal that we are down to the interrupt handler */
3243 set_bit(__IXGBE_DOWN, &adapter->state); 3248 set_bit(__IXGBE_DOWN, &adapter->state);
3244 3249
3250 /* power down the optics */
3251 if (hw->phy.multispeed_fiber)
3252 hw->mac.ops.disable_tx_laser(hw);
3253
3245 /* disable receive for all VFs and wait one second */ 3254 /* disable receive for all VFs and wait one second */
3246 if (adapter->num_vfs) { 3255 if (adapter->num_vfs) {
3247 /* ping all the active vfs to let them know we are going down */ 3256 /* ping all the active vfs to let them know we are going down */
@@ -6252,6 +6261,10 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
6252 goto err_eeprom; 6261 goto err_eeprom;
6253 } 6262 }
6254 6263
6264 /* power down the optics */
6265 if (hw->phy.multispeed_fiber)
6266 hw->mac.ops.disable_tx_laser(hw);
6267
6255 init_timer(&adapter->watchdog_timer); 6268 init_timer(&adapter->watchdog_timer);
6256 adapter->watchdog_timer.function = &ixgbe_watchdog; 6269 adapter->watchdog_timer.function = &ixgbe_watchdog;
6257 adapter->watchdog_timer.data = (unsigned long)adapter; 6270 adapter->watchdog_timer.data = (unsigned long)adapter;
@@ -6399,16 +6412,6 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev)
6399 del_timer_sync(&adapter->sfp_timer); 6412 del_timer_sync(&adapter->sfp_timer);
6400 cancel_work_sync(&adapter->watchdog_task); 6413 cancel_work_sync(&adapter->watchdog_task);
6401 cancel_work_sync(&adapter->sfp_task); 6414 cancel_work_sync(&adapter->sfp_task);
6402 if (adapter->hw.phy.multispeed_fiber) {
6403 struct ixgbe_hw *hw = &adapter->hw;
6404 /*
6405 * Restart clause 37 autoneg, disable and re-enable
6406 * the tx laser, to clear & alert the link partner
6407 * that it needs to restart autotry
6408 */
6409 hw->mac.autotry_restart = true;
6410 hw->mac.ops.flap_tx_laser(hw);
6411 }
6412 cancel_work_sync(&adapter->multispeed_fiber_task); 6415 cancel_work_sync(&adapter->multispeed_fiber_task);
6413 cancel_work_sync(&adapter->sfp_config_module_task); 6416 cancel_work_sync(&adapter->sfp_config_module_task);
6414 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || 6417 if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE ||
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 4ec6dc1a5b75..534affcc38ca 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -2398,6 +2398,8 @@ struct ixgbe_mac_operations {
2398 s32 (*enable_rx_dma)(struct ixgbe_hw *, u32); 2398 s32 (*enable_rx_dma)(struct ixgbe_hw *, u32);
2399 2399
2400 /* Link */ 2400 /* Link */
2401 void (*disable_tx_laser)(struct ixgbe_hw *);
2402 void (*enable_tx_laser)(struct ixgbe_hw *);
2401 void (*flap_tx_laser)(struct ixgbe_hw *); 2403 void (*flap_tx_laser)(struct ixgbe_hw *);
2402 s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool); 2404 s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool);
2403 s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); 2405 s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool);