Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 56cec249 authored by Carolyn Wyborny's avatar Carolyn Wyborny Committed by Jeff Kirsher
Browse files

igb: Add new feature Media Auto Sense for 82580 devices only



This patch adds support for the hardware feature Media Auto Sense.  This
feature requires a custom EEPROM image provided by our customer support
team.  The feature allows hardware designed with dual PHY's, fiber and
copper to be used with either media without additional EEPROM changes.
Fiber is preferred and driver will swap and configure for fiber media if
sensed by the device at any time. Device will swap back to copper if it
is the only media detected.

Signed-off-by: default avatarCarolyn Wyborny <carolyn.wyborny@intel.com>
Tested-by: default avatarJeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 89dbefb2
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -441,6 +441,19 @@ static s32 igb_init_mac_params_82575(struct e1000_hw *hw)
			? igb_setup_copper_link_82575
			? igb_setup_copper_link_82575
			: igb_setup_serdes_link_82575;
			: igb_setup_serdes_link_82575;


	if (mac->type == e1000_82580) {
		switch (hw->device_id) {
		/* feature not supported on these id's */
		case E1000_DEV_ID_DH89XXCC_SGMII:
		case E1000_DEV_ID_DH89XXCC_SERDES:
		case E1000_DEV_ID_DH89XXCC_BACKPLANE:
		case E1000_DEV_ID_DH89XXCC_SFP:
			break;
		default:
			hw->dev_spec._82575.mas_capable = true;
			break;
		}
	}
	return 0;
	return 0;
}
}


+5 −0
Original line number Original line Diff line number Diff line
@@ -205,6 +205,11 @@
 */
 */


#define E1000_CONNSW_ENRGSRC             0x4
#define E1000_CONNSW_ENRGSRC             0x4
#define E1000_CONNSW_PHYSD		0x400
#define E1000_CONNSW_PHY_PDN		0x800
#define E1000_CONNSW_SERDESD		0x200
#define E1000_CONNSW_AUTOSENSE_CONF	0x2
#define E1000_CONNSW_AUTOSENSE_EN	0x1
#define E1000_PCS_CFG_PCS_EN             8
#define E1000_PCS_CFG_PCS_EN             8
#define E1000_PCS_LCTL_FLV_LINK_UP       1
#define E1000_PCS_LCTL_FLV_LINK_UP       1
#define E1000_PCS_LCTL_FSV_100           2
#define E1000_PCS_LCTL_FSV_100           2
+1 −0
Original line number Original line Diff line number Diff line
@@ -535,6 +535,7 @@ struct e1000_dev_spec_82575 {
	bool module_plugged;
	bool module_plugged;
	u8 media_port;
	u8 media_port;
	bool media_changed;
	bool media_changed;
	bool mas_capable;
};
};


struct e1000_hw {
struct e1000_hw {
+10 −0
Original line number Original line Diff line number Diff line
@@ -450,6 +450,8 @@ struct igb_adapter {
	u8 rss_indir_tbl[IGB_RETA_SIZE];
	u8 rss_indir_tbl[IGB_RETA_SIZE];


	unsigned long link_check_timeout;
	unsigned long link_check_timeout;
	int copper_tries;
	struct e1000_info ei;
};
};


#define IGB_FLAG_HAS_MSI		(1 << 0)
#define IGB_FLAG_HAS_MSI		(1 << 0)
@@ -463,6 +465,14 @@ struct igb_adapter {
#define IGB_FLAG_WOL_SUPPORTED		(1 << 8)
#define IGB_FLAG_WOL_SUPPORTED		(1 << 8)
#define IGB_FLAG_NEED_LINK_UPDATE	(1 << 9)
#define IGB_FLAG_NEED_LINK_UPDATE	(1 << 9)
#define IGB_FLAG_MEDIA_RESET		(1 << 10)
#define IGB_FLAG_MEDIA_RESET		(1 << 10)
#define IGB_FLAG_MAS_CAPABLE		(1 << 11)
#define IGB_FLAG_MAS_ENABLE		(1 << 12)

/* Media Auto Sense */
#define IGB_MAS_ENABLE_0		0X0001
#define IGB_MAS_ENABLE_1		0X0002
#define IGB_MAS_ENABLE_2		0X0004
#define IGB_MAS_ENABLE_3		0X0008


/* DMA Coalescing defines */
/* DMA Coalescing defines */
#define IGB_MIN_TXPBSIZE	20408
#define IGB_MIN_TXPBSIZE	20408
+4 −0
Original line number Original line Diff line number Diff line
@@ -1983,6 +1983,10 @@ static void igb_diag_test(struct net_device *netdev,
	bool if_running = netif_running(netdev);
	bool if_running = netif_running(netdev);


	set_bit(__IGB_TESTING, &adapter->state);
	set_bit(__IGB_TESTING, &adapter->state);

	/* can't do offline tests on media switching devices */
	if (adapter->hw.dev_spec._82575.mas_capable)
		eth_test->flags &= ~ETH_TEST_FL_OFFLINE;
	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
	if (eth_test->flags == ETH_TEST_FL_OFFLINE) {
		/* Offline tests */
		/* Offline tests */


Loading