Skip to content

Commit f0ff353

Browse files
mdrustadJeff Kirsher
authored andcommitted
ixgbe: Delete a bunch of dead code
All of the code involved with returning the supported physical layer is actually unused, so delete it. Signed-off-by: Mark Rustad <[email protected]> Tested-by: Phil Schmitt <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 4e86281 commit f0ff353

File tree

4 files changed

+0
-275
lines changed

4 files changed

+0
-275
lines changed

drivers/net/ethernet/intel/ixgbe/ixgbe_82598.c

Lines changed: 0 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1108,106 +1108,6 @@ static s32 ixgbe_read_i2c_sff8472_82598(struct ixgbe_hw *hw, u8 byte_offset,
11081108
byte_offset, sff8472_data);
11091109
}
11101110

1111-
/**
1112-
* ixgbe_get_supported_physical_layer_82598 - Returns physical layer type
1113-
* @hw: pointer to hardware structure
1114-
*
1115-
* Determines physical layer capabilities of the current configuration.
1116-
**/
1117-
static u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw)
1118-
{
1119-
u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1120-
u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
1121-
u32 pma_pmd_10g = autoc & IXGBE_AUTOC_10G_PMA_PMD_MASK;
1122-
u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
1123-
u16 ext_ability = 0;
1124-
1125-
hw->phy.ops.identify(hw);
1126-
1127-
/* Copper PHY must be checked before AUTOC LMS to determine correct
1128-
* physical layer because 10GBase-T PHYs use LMS = KX4/KX */
1129-
switch (hw->phy.type) {
1130-
case ixgbe_phy_tn:
1131-
case ixgbe_phy_cu_unknown:
1132-
hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE,
1133-
MDIO_MMD_PMAPMD, &ext_ability);
1134-
if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
1135-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
1136-
if (ext_ability & MDIO_PMA_EXTABLE_1000BT)
1137-
physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
1138-
if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
1139-
physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
1140-
goto out;
1141-
default:
1142-
break;
1143-
}
1144-
1145-
switch (autoc & IXGBE_AUTOC_LMS_MASK) {
1146-
case IXGBE_AUTOC_LMS_1G_AN:
1147-
case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
1148-
if (pma_pmd_1g == IXGBE_AUTOC_1G_KX)
1149-
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX;
1150-
else
1151-
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_BX;
1152-
break;
1153-
case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
1154-
if (pma_pmd_10g == IXGBE_AUTOC_10G_CX4)
1155-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
1156-
else if (pma_pmd_10g == IXGBE_AUTOC_10G_KX4)
1157-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
1158-
else /* XAUI */
1159-
physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1160-
break;
1161-
case IXGBE_AUTOC_LMS_KX4_AN:
1162-
case IXGBE_AUTOC_LMS_KX4_AN_1G_AN:
1163-
if (autoc & IXGBE_AUTOC_KX_SUPP)
1164-
physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_KX;
1165-
if (autoc & IXGBE_AUTOC_KX4_SUPP)
1166-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
1167-
break;
1168-
default:
1169-
break;
1170-
}
1171-
1172-
if (hw->phy.type == ixgbe_phy_nl) {
1173-
hw->phy.ops.identify_sfp(hw);
1174-
1175-
switch (hw->phy.sfp_type) {
1176-
case ixgbe_sfp_type_da_cu:
1177-
physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
1178-
break;
1179-
case ixgbe_sfp_type_sr:
1180-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
1181-
break;
1182-
case ixgbe_sfp_type_lr:
1183-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
1184-
break;
1185-
default:
1186-
physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1187-
break;
1188-
}
1189-
}
1190-
1191-
switch (hw->device_id) {
1192-
case IXGBE_DEV_ID_82598_DA_DUAL_PORT:
1193-
physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
1194-
break;
1195-
case IXGBE_DEV_ID_82598AF_DUAL_PORT:
1196-
case IXGBE_DEV_ID_82598AF_SINGLE_PORT:
1197-
case IXGBE_DEV_ID_82598_SR_DUAL_PORT_EM:
1198-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
1199-
break;
1200-
case IXGBE_DEV_ID_82598EB_XF_LR:
1201-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
1202-
break;
1203-
default:
1204-
break;
1205-
}
1206-
1207-
out:
1208-
return physical_layer;
1209-
}
1210-
12111111
/**
12121112
* ixgbe_set_lan_id_multi_port_pcie_82598 - Set LAN id for PCIe multiple
12131113
* port devices.
@@ -1285,7 +1185,6 @@ static struct ixgbe_mac_operations mac_ops_82598 = {
12851185
.start_hw = &ixgbe_start_hw_82598,
12861186
.clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
12871187
.get_media_type = &ixgbe_get_media_type_82598,
1288-
.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82598,
12891188
.enable_rx_dma = &ixgbe_enable_rx_dma_generic,
12901189
.get_mac_addr = &ixgbe_get_mac_addr_generic,
12911190
.stop_adapter = &ixgbe_stop_adapter_generic,

drivers/net/ethernet/intel/ixgbe/ixgbe_82599.c

Lines changed: 0 additions & 127 deletions
Original file line numberDiff line numberDiff line change
@@ -1979,132 +1979,6 @@ static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
19791979
return status;
19801980
}
19811981

1982-
/**
1983-
* ixgbe_get_supported_physical_layer_82599 - Returns physical layer type
1984-
* @hw: pointer to hardware structure
1985-
*
1986-
* Determines physical layer capabilities of the current configuration.
1987-
**/
1988-
static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
1989-
{
1990-
u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
1991-
u32 autoc = IXGBE_READ_REG(hw, IXGBE_AUTOC);
1992-
u32 autoc2 = IXGBE_READ_REG(hw, IXGBE_AUTOC2);
1993-
u32 pma_pmd_10g_serial = autoc2 & IXGBE_AUTOC2_10G_SERIAL_PMA_PMD_MASK;
1994-
u32 pma_pmd_10g_parallel = autoc & IXGBE_AUTOC_10G_PMA_PMD_MASK;
1995-
u32 pma_pmd_1g = autoc & IXGBE_AUTOC_1G_PMA_PMD_MASK;
1996-
u16 ext_ability = 0;
1997-
u8 comp_codes_10g = 0;
1998-
u8 comp_codes_1g = 0;
1999-
2000-
hw->phy.ops.identify(hw);
2001-
2002-
switch (hw->phy.type) {
2003-
case ixgbe_phy_tn:
2004-
case ixgbe_phy_cu_unknown:
2005-
hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD,
2006-
&ext_ability);
2007-
if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
2008-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
2009-
if (ext_ability & MDIO_PMA_EXTABLE_1000BT)
2010-
physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
2011-
if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
2012-
physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
2013-
goto out;
2014-
default:
2015-
break;
2016-
}
2017-
2018-
switch (autoc & IXGBE_AUTOC_LMS_MASK) {
2019-
case IXGBE_AUTOC_LMS_1G_AN:
2020-
case IXGBE_AUTOC_LMS_1G_LINK_NO_AN:
2021-
if (pma_pmd_1g == IXGBE_AUTOC_1G_KX_BX) {
2022-
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_KX |
2023-
IXGBE_PHYSICAL_LAYER_1000BASE_BX;
2024-
goto out;
2025-
} else
2026-
/* SFI mode so read SFP module */
2027-
goto sfp_check;
2028-
break;
2029-
case IXGBE_AUTOC_LMS_10G_LINK_NO_AN:
2030-
if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_CX4)
2031-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_CX4;
2032-
else if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_KX4)
2033-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
2034-
else if (pma_pmd_10g_parallel == IXGBE_AUTOC_10G_XAUI)
2035-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_XAUI;
2036-
goto out;
2037-
case IXGBE_AUTOC_LMS_10G_SERIAL:
2038-
if (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_KR) {
2039-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_KR;
2040-
goto out;
2041-
} else if (pma_pmd_10g_serial == IXGBE_AUTOC2_10G_SFI)
2042-
goto sfp_check;
2043-
break;
2044-
case IXGBE_AUTOC_LMS_KX4_KX_KR:
2045-
case IXGBE_AUTOC_LMS_KX4_KX_KR_1G_AN:
2046-
if (autoc & IXGBE_AUTOC_KX_SUPP)
2047-
physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_KX;
2048-
if (autoc & IXGBE_AUTOC_KX4_SUPP)
2049-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KX4;
2050-
if (autoc & IXGBE_AUTOC_KR_SUPP)
2051-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_KR;
2052-
goto out;
2053-
default:
2054-
goto out;
2055-
}
2056-
2057-
sfp_check:
2058-
/* SFP check must be done last since DA modules are sometimes used to
2059-
* test KR mode - we need to id KR mode correctly before SFP module.
2060-
* Call identify_sfp because the pluggable module may have changed */
2061-
hw->phy.ops.identify_sfp(hw);
2062-
if (hw->phy.sfp_type == ixgbe_sfp_type_not_present)
2063-
goto out;
2064-
2065-
switch (hw->phy.type) {
2066-
case ixgbe_phy_sfp_passive_tyco:
2067-
case ixgbe_phy_sfp_passive_unknown:
2068-
case ixgbe_phy_qsfp_passive_unknown:
2069-
physical_layer = IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU;
2070-
break;
2071-
case ixgbe_phy_sfp_ftl_active:
2072-
case ixgbe_phy_sfp_active_unknown:
2073-
case ixgbe_phy_qsfp_active_unknown:
2074-
physical_layer = IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA;
2075-
break;
2076-
case ixgbe_phy_sfp_avago:
2077-
case ixgbe_phy_sfp_ftl:
2078-
case ixgbe_phy_sfp_intel:
2079-
case ixgbe_phy_sfp_unknown:
2080-
hw->phy.ops.read_i2c_eeprom(hw,
2081-
IXGBE_SFF_1GBE_COMP_CODES, &comp_codes_1g);
2082-
hw->phy.ops.read_i2c_eeprom(hw,
2083-
IXGBE_SFF_10GBE_COMP_CODES, &comp_codes_10g);
2084-
if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
2085-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
2086-
else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)
2087-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
2088-
else if (comp_codes_1g & IXGBE_SFF_1GBASET_CAPABLE)
2089-
physical_layer = IXGBE_PHYSICAL_LAYER_1000BASE_T;
2090-
break;
2091-
case ixgbe_phy_qsfp_intel:
2092-
case ixgbe_phy_qsfp_unknown:
2093-
hw->phy.ops.read_i2c_eeprom(hw,
2094-
IXGBE_SFF_QSFP_10GBE_COMP, &comp_codes_10g);
2095-
if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
2096-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_SR;
2097-
else if (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE)
2098-
physical_layer = IXGBE_PHYSICAL_LAYER_10GBASE_LR;
2099-
break;
2100-
default:
2101-
break;
2102-
}
2103-
2104-
out:
2105-
return physical_layer;
2106-
}
2107-
21081982
/**
21091983
* ixgbe_enable_rx_dma_82599 - Enable the Rx DMA unit on 82599
21101984
* @hw: pointer to hardware structure
@@ -2454,7 +2328,6 @@ static struct ixgbe_mac_operations mac_ops_82599 = {
24542328
.start_hw = &ixgbe_start_hw_82599,
24552329
.clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
24562330
.get_media_type = &ixgbe_get_media_type_82599,
2457-
.get_supported_physical_layer = &ixgbe_get_supported_physical_layer_82599,
24582331
.enable_rx_dma = &ixgbe_enable_rx_dma_82599,
24592332
.disable_rx_buff = &ixgbe_disable_rx_buff_generic,
24602333
.enable_rx_buff = &ixgbe_enable_rx_buff_generic,

drivers/net/ethernet/intel/ixgbe/ixgbe_type.h

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,25 +2440,6 @@ typedef u32 ixgbe_link_speed;
24402440
IXGBE_LINK_SPEED_1GB_FULL | \
24412441
IXGBE_LINK_SPEED_10GB_FULL)
24422442

2443-
2444-
/* Physical layer type */
2445-
typedef u32 ixgbe_physical_layer;
2446-
#define IXGBE_PHYSICAL_LAYER_UNKNOWN 0
2447-
#define IXGBE_PHYSICAL_LAYER_10GBASE_T 0x0001
2448-
#define IXGBE_PHYSICAL_LAYER_1000BASE_T 0x0002
2449-
#define IXGBE_PHYSICAL_LAYER_100BASE_TX 0x0004
2450-
#define IXGBE_PHYSICAL_LAYER_SFP_PLUS_CU 0x0008
2451-
#define IXGBE_PHYSICAL_LAYER_10GBASE_LR 0x0010
2452-
#define IXGBE_PHYSICAL_LAYER_10GBASE_LRM 0x0020
2453-
#define IXGBE_PHYSICAL_LAYER_10GBASE_SR 0x0040
2454-
#define IXGBE_PHYSICAL_LAYER_10GBASE_KX4 0x0080
2455-
#define IXGBE_PHYSICAL_LAYER_10GBASE_CX4 0x0100
2456-
#define IXGBE_PHYSICAL_LAYER_1000BASE_KX 0x0200
2457-
#define IXGBE_PHYSICAL_LAYER_1000BASE_BX 0x0400
2458-
#define IXGBE_PHYSICAL_LAYER_10GBASE_KR 0x0800
2459-
#define IXGBE_PHYSICAL_LAYER_10GBASE_XAUI 0x1000
2460-
#define IXGBE_PHYSICAL_LAYER_SFP_ACTIVE_DA 0x2000
2461-
24622443
/* Flow Control Data Sheet defined values
24632444
* Calculation and defines taken from 802.1bb Annex O
24642445
*/
@@ -2860,7 +2841,6 @@ struct ixgbe_mac_operations {
28602841
s32 (*start_hw)(struct ixgbe_hw *);
28612842
s32 (*clear_hw_cntrs)(struct ixgbe_hw *);
28622843
enum ixgbe_media_type (*get_media_type)(struct ixgbe_hw *);
2863-
u32 (*get_supported_physical_layer)(struct ixgbe_hw *);
28642844
s32 (*get_mac_addr)(struct ixgbe_hw *, u8 *);
28652845
s32 (*get_san_mac_addr)(struct ixgbe_hw *, u8 *);
28662846
s32 (*get_device_caps)(struct ixgbe_hw *, u16 *);

drivers/net/ethernet/intel/ixgbe/ixgbe_x540.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -193,31 +193,6 @@ static s32 ixgbe_start_hw_X540(struct ixgbe_hw *hw)
193193
return ret_val;
194194
}
195195

196-
/**
197-
* ixgbe_get_supported_physical_layer_X540 - Returns physical layer type
198-
* @hw: pointer to hardware structure
199-
*
200-
* Determines physical layer capabilities of the current configuration.
201-
**/
202-
static u32 ixgbe_get_supported_physical_layer_X540(struct ixgbe_hw *hw)
203-
{
204-
u32 physical_layer = IXGBE_PHYSICAL_LAYER_UNKNOWN;
205-
u16 ext_ability = 0;
206-
207-
hw->phy.ops.identify(hw);
208-
209-
hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD,
210-
&ext_ability);
211-
if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
212-
physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
213-
if (ext_ability & MDIO_PMA_EXTABLE_1000BT)
214-
physical_layer |= IXGBE_PHYSICAL_LAYER_1000BASE_T;
215-
if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
216-
physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
217-
218-
return physical_layer;
219-
}
220-
221196
/**
222197
* ixgbe_init_eeprom_params_X540 - Initialize EEPROM params
223198
* @hw: pointer to hardware structure
@@ -792,8 +767,6 @@ static struct ixgbe_mac_operations mac_ops_X540 = {
792767
.start_hw = &ixgbe_start_hw_X540,
793768
.clear_hw_cntrs = &ixgbe_clear_hw_cntrs_generic,
794769
.get_media_type = &ixgbe_get_media_type_X540,
795-
.get_supported_physical_layer =
796-
&ixgbe_get_supported_physical_layer_X540,
797770
.enable_rx_dma = &ixgbe_enable_rx_dma_generic,
798771
.get_mac_addr = &ixgbe_get_mac_addr_generic,
799772
.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic,

0 commit comments

Comments
 (0)