* [linux-arm:cex7 102/102] drivers/net/phy/sfp-bus.c:121:5: error: redefinition of 'sfp_parse_port'
@ 2020-02-11 19:10 kbuild test robot
0 siblings, 0 replies; only message in thread
From: kbuild test robot @ 2020-02-11 19:10 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 26584 bytes --]
Hi Russell,
First bad commit (maybe != root cause):
tree: git://git.armlinux.org.uk/~rmk/linux-arm cex7
head: 9ce6b3da01bfaf78f5529746945d93c5688d3ed7
commit: 9ce6b3da01bfaf78f5529746945d93c5688d3ed7 [102/102] net: add qsfp support [*experimental*]
config: x86_64-randconfig-c002-20200212 (attached as .config)
compiler: gcc-7 (Debian 7.5.0-4) 7.5.0
reproduce:
git checkout 9ce6b3da01bfaf78f5529746945d93c5688d3ed7
# save the attached .config to linux build tree
make ARCH=x86_64
If you fix the issue, kindly add following tag
Reported-by: kbuild test robot <lkp@intel.com>
All errors (new ones prefixed by >>):
>> drivers/net/phy/sfp-bus.c:121:5: error: redefinition of 'sfp_parse_port'
int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
^~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:663:19: note: previous definition of 'sfp_parse_port' was here
static inline int sfp_parse_port(struct sfp_bus *bus,
^~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:190:6: error: redefinition of 'sfp_may_have_phy'
bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id)
^~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:670:20: note: previous definition of 'sfp_may_have_phy' was here
static inline bool sfp_may_have_phy(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:218:6: error: redefinition of 'sfp_parse_support'
void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
^~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:676:20: note: previous definition of 'sfp_parse_support' was here
static inline void sfp_parse_support(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:367:17: error: redefinition of 'sfp_select_interface'
phy_interface_t sfp_select_interface(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:682:31: note: previous definition of 'sfp_select_interface' was here
static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:449:6: error: redefinition of 'sfp_bus_put'
void sfp_bus_put(struct sfp_bus *bus)
^~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:708:20: note: previous definition of 'sfp_bus_put' was here
static inline void sfp_bus_put(struct sfp_bus *bus)
^~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:503:5: error: redefinition of 'sfp_get_module_info'
int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:688:19: note: previous definition of 'sfp_get_module_info' was here
static inline int sfp_get_module_info(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:520:5: error: redefinition of 'sfp_get_module_eeprom'
int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
^~~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:694:19: note: previous definition of 'sfp_get_module_eeprom' was here
static inline int sfp_get_module_eeprom(struct sfp_bus *bus,
^~~~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:536:6: error: redefinition of 'sfp_upstream_start'
void sfp_upstream_start(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:700:20: note: previous definition of 'sfp_upstream_start' was here
static inline void sfp_upstream_start(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:553:6: error: redefinition of 'sfp_upstream_stop'
void sfp_upstream_stop(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:704:20: note: previous definition of 'sfp_upstream_stop' was here
static inline void sfp_upstream_stop(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:583:17: error: redefinition of 'sfp_bus_find_fwnode'
struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
^~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:712:31: note: previous definition of 'sfp_bus_find_fwnode' was here
static inline struct sfp_bus *sfp_bus_find_fwnode(struct fwnode_handle *fwnode)
^~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:623:5: error: redefinition of 'sfp_bus_add_upstream'
int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:717:19: note: previous definition of 'sfp_bus_add_upstream' was here
static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
^~~~~~~~~~~~~~~~~~~~
>> drivers/net/phy/sfp-bus.c:660:6: error: redefinition of 'sfp_bus_del_upstream'
void sfp_bus_del_upstream(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~~~~
In file included from drivers/net/phy/sfp.h:5:0,
from drivers/net/phy/sfp-bus.c:11:
include/linux/sfp.h:723:20: note: previous definition of 'sfp_bus_del_upstream' was here
static inline void sfp_bus_del_upstream(struct sfp_bus *bus)
^~~~~~~~~~~~~~~~~~~~
vim +/sfp_parse_port +121 drivers/net/phy/sfp-bus.c
949e063b3cd9d8 Russell King 2019-11-21 106
0a6fcd3fc14d39 Russell King 2017-12-01 107 /**
0a6fcd3fc14d39 Russell King 2017-12-01 108 * sfp_parse_port() - Parse the EEPROM base ID, setting the port type
0a6fcd3fc14d39 Russell King 2017-12-01 109 * @bus: a pointer to the &struct sfp_bus structure for the sfp module
0a6fcd3fc14d39 Russell King 2017-12-01 110 * @id: a pointer to the module's &struct sfp_eeprom_id
0a6fcd3fc14d39 Russell King 2017-12-01 111 * @support: optional pointer to an array of unsigned long for the
0a6fcd3fc14d39 Russell King 2017-12-01 112 * ethtool support mask
0a6fcd3fc14d39 Russell King 2017-12-01 113 *
0a6fcd3fc14d39 Russell King 2017-12-01 114 * Parse the EEPROM identification given in @id, and return one of
0a6fcd3fc14d39 Russell King 2017-12-01 115 * %PORT_TP, %PORT_FIBRE or %PORT_OTHER. If @support is non-%NULL,
0a6fcd3fc14d39 Russell King 2017-12-01 116 * also set the ethtool %ETHTOOL_LINK_MODE_xxx_BIT corresponding with
0a6fcd3fc14d39 Russell King 2017-12-01 117 * the connector type.
0a6fcd3fc14d39 Russell King 2017-12-01 118 *
0a6fcd3fc14d39 Russell King 2017-12-01 119 * If the port type is not known, returns %PORT_OTHER.
0a6fcd3fc14d39 Russell King 2017-12-01 120 */
ce0aa27ff3f68e Russell King 2017-07-25 @121 int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
ce0aa27ff3f68e Russell King 2017-07-25 122 unsigned long *support)
ce0aa27ff3f68e Russell King 2017-07-25 123 {
ce0aa27ff3f68e Russell King 2017-07-25 124 int port;
ce0aa27ff3f68e Russell King 2017-07-25 125
ce0aa27ff3f68e Russell King 2017-07-25 126 /* port is the physical connector, set this from the connector field. */
ce0aa27ff3f68e Russell King 2017-07-25 127 switch (id->base.connector) {
c83f8d2fce3488 Russell King 2019-09-26 128 case SFF8024_CONNECTOR_SC:
c83f8d2fce3488 Russell King 2019-09-26 129 case SFF8024_CONNECTOR_FIBERJACK:
c83f8d2fce3488 Russell King 2019-09-26 130 case SFF8024_CONNECTOR_LC:
c83f8d2fce3488 Russell King 2019-09-26 131 case SFF8024_CONNECTOR_MT_RJ:
c83f8d2fce3488 Russell King 2019-09-26 132 case SFF8024_CONNECTOR_MU:
c83f8d2fce3488 Russell King 2019-09-26 133 case SFF8024_CONNECTOR_OPTICAL_PIGTAIL:
c83f8d2fce3488 Russell King 2019-09-26 134 case SFF8024_CONNECTOR_MPO_1X12:
c83f8d2fce3488 Russell King 2019-09-26 135 case SFF8024_CONNECTOR_MPO_2X16:
ce0aa27ff3f68e Russell King 2017-07-25 136 port = PORT_FIBRE;
ce0aa27ff3f68e Russell King 2017-07-25 137 break;
ce0aa27ff3f68e Russell King 2017-07-25 138
c83f8d2fce3488 Russell King 2019-09-26 139 case SFF8024_CONNECTOR_RJ45:
ce0aa27ff3f68e Russell King 2017-07-25 140 port = PORT_TP;
ce0aa27ff3f68e Russell King 2017-07-25 141 break;
ce0aa27ff3f68e Russell King 2017-07-25 142
c83f8d2fce3488 Russell King 2019-09-26 143 case SFF8024_CONNECTOR_COPPER_PIGTAIL:
f10fcbcf91006a Russell King 2017-12-29 144 port = PORT_DA;
f10fcbcf91006a Russell King 2017-12-29 145 break;
f10fcbcf91006a Russell King 2017-12-29 146
c83f8d2fce3488 Russell King 2019-09-26 147 case SFF8024_CONNECTOR_UNSPEC:
ce0aa27ff3f68e Russell King 2017-07-25 148 if (id->base.e1000_base_t) {
ce0aa27ff3f68e Russell King 2017-07-25 149 port = PORT_TP;
ce0aa27ff3f68e Russell King 2017-07-25 150 break;
ce0aa27ff3f68e Russell King 2017-07-25 151 }
ce0aa27ff3f68e Russell King 2017-07-25 152 /* fallthrough */
c83f8d2fce3488 Russell King 2019-09-26 153 case SFF8024_CONNECTOR_SG: /* guess */
c83f8d2fce3488 Russell King 2019-09-26 154 case SFF8024_CONNECTOR_HSSDC_II:
c83f8d2fce3488 Russell King 2019-09-26 155 case SFF8024_CONNECTOR_NOSEPARATE:
c83f8d2fce3488 Russell King 2019-09-26 156 case SFF8024_CONNECTOR_MXC_2X16:
ce0aa27ff3f68e Russell King 2017-07-25 157 port = PORT_OTHER;
ce0aa27ff3f68e Russell King 2017-07-25 158 break;
ce0aa27ff3f68e Russell King 2017-07-25 159 default:
ce0aa27ff3f68e Russell King 2017-07-25 160 dev_warn(bus->sfp_dev, "SFP: unknown connector id 0x%02x\n",
ce0aa27ff3f68e Russell King 2017-07-25 161 id->base.connector);
ce0aa27ff3f68e Russell King 2017-07-25 162 port = PORT_OTHER;
ce0aa27ff3f68e Russell King 2017-07-25 163 break;
ce0aa27ff3f68e Russell King 2017-07-25 164 }
ce0aa27ff3f68e Russell King 2017-07-25 165
f10fcbcf91006a Russell King 2017-12-29 166 if (support) {
f10fcbcf91006a Russell King 2017-12-29 167 switch (port) {
f10fcbcf91006a Russell King 2017-12-29 168 case PORT_FIBRE:
f10fcbcf91006a Russell King 2017-12-29 169 phylink_set(support, FIBRE);
f10fcbcf91006a Russell King 2017-12-29 170 break;
f10fcbcf91006a Russell King 2017-12-29 171
f10fcbcf91006a Russell King 2017-12-29 172 case PORT_TP:
f10fcbcf91006a Russell King 2017-12-29 173 phylink_set(support, TP);
f10fcbcf91006a Russell King 2017-12-29 174 break;
f10fcbcf91006a Russell King 2017-12-29 175 }
f10fcbcf91006a Russell King 2017-12-29 176 }
f10fcbcf91006a Russell King 2017-12-29 177
ce0aa27ff3f68e Russell King 2017-07-25 178 return port;
ce0aa27ff3f68e Russell King 2017-07-25 179 }
ce0aa27ff3f68e Russell King 2017-07-25 180 EXPORT_SYMBOL_GPL(sfp_parse_port);
ce0aa27ff3f68e Russell King 2017-07-25 181
949e063b3cd9d8 Russell King 2019-11-21 182 /**
949e063b3cd9d8 Russell King 2019-11-21 183 * sfp_may_have_phy() - indicate whether the module may have a PHY
949e063b3cd9d8 Russell King 2019-11-21 184 * @bus: a pointer to the &struct sfp_bus structure for the sfp module
949e063b3cd9d8 Russell King 2019-11-21 185 * @id: a pointer to the module's &struct sfp_eeprom_id
949e063b3cd9d8 Russell King 2019-11-21 186 *
949e063b3cd9d8 Russell King 2019-11-21 187 * Parse the EEPROM identification given in @id, and return whether
949e063b3cd9d8 Russell King 2019-11-21 188 * this module may have a PHY.
949e063b3cd9d8 Russell King 2019-11-21 189 */
949e063b3cd9d8 Russell King 2019-11-21 @190 bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id)
949e063b3cd9d8 Russell King 2019-11-21 191 {
949e063b3cd9d8 Russell King 2019-11-21 192 if (id->base.e1000_base_t)
949e063b3cd9d8 Russell King 2019-11-21 193 return true;
949e063b3cd9d8 Russell King 2019-11-21 194
949e063b3cd9d8 Russell King 2019-11-21 195 if (id->base.phys_id != SFF8024_ID_DWDM_SFP) {
949e063b3cd9d8 Russell King 2019-11-21 196 switch (id->base.extended_cc) {
949e063b3cd9d8 Russell King 2019-11-21 197 case SFF8024_ECC_10GBASE_T_SFI:
949e063b3cd9d8 Russell King 2019-11-21 198 case SFF8024_ECC_10GBASE_T_SR:
949e063b3cd9d8 Russell King 2019-11-21 199 case SFF8024_ECC_5GBASE_T:
949e063b3cd9d8 Russell King 2019-11-21 200 case SFF8024_ECC_2_5GBASE_T:
949e063b3cd9d8 Russell King 2019-11-21 201 return true;
949e063b3cd9d8 Russell King 2019-11-21 202 }
949e063b3cd9d8 Russell King 2019-11-21 203 }
949e063b3cd9d8 Russell King 2019-11-21 204
949e063b3cd9d8 Russell King 2019-11-21 205 return false;
949e063b3cd9d8 Russell King 2019-11-21 206 }
949e063b3cd9d8 Russell King 2019-11-21 207 EXPORT_SYMBOL_GPL(sfp_may_have_phy);
949e063b3cd9d8 Russell King 2019-11-21 208
0a6fcd3fc14d39 Russell King 2017-12-01 209 /**
0a6fcd3fc14d39 Russell King 2017-12-01 210 * sfp_parse_support() - Parse the eeprom id for supported link modes
0a6fcd3fc14d39 Russell King 2017-12-01 211 * @bus: a pointer to the &struct sfp_bus structure for the sfp module
0a6fcd3fc14d39 Russell King 2017-12-01 212 * @id: a pointer to the module's &struct sfp_eeprom_id
0a6fcd3fc14d39 Russell King 2017-12-01 213 * @support: pointer to an array of unsigned long for the ethtool support mask
0a6fcd3fc14d39 Russell King 2017-12-01 214 *
0a6fcd3fc14d39 Russell King 2017-12-01 215 * Parse the EEPROM identification information and derive the supported
0a6fcd3fc14d39 Russell King 2017-12-01 216 * ethtool link modes for the module.
0a6fcd3fc14d39 Russell King 2017-12-01 217 */
ce0aa27ff3f68e Russell King 2017-07-25 @218 void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
ce0aa27ff3f68e Russell King 2017-07-25 219 unsigned long *support)
ce0aa27ff3f68e Russell King 2017-07-25 220 {
9962acf7fb8c5c Russell King 2017-12-29 221 unsigned int br_min, br_nom, br_max;
03145864bd0fca Russell King 2018-02-27 222 __ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, };
ce0aa27ff3f68e Russell King 2017-07-25 223
9962acf7fb8c5c Russell King 2017-12-29 224 /* Decode the bitrate information to MBd */
9962acf7fb8c5c Russell King 2017-12-29 225 br_min = br_nom = br_max = 0;
9962acf7fb8c5c Russell King 2017-12-29 226 if (id->base.br_nominal) {
9962acf7fb8c5c Russell King 2017-12-29 227 if (id->base.br_nominal != 255) {
9962acf7fb8c5c Russell King 2017-12-29 228 br_nom = id->base.br_nominal * 100;
52c5cd1bf0cecf Antoine Tenart 2018-05-04 229 br_min = br_nom - id->base.br_nominal * id->ext.br_min;
9962acf7fb8c5c Russell King 2017-12-29 230 br_max = br_nom + id->base.br_nominal * id->ext.br_max;
9962acf7fb8c5c Russell King 2017-12-29 231 } else if (id->ext.br_max) {
9962acf7fb8c5c Russell King 2017-12-29 232 br_nom = 250 * id->ext.br_max;
9962acf7fb8c5c Russell King 2017-12-29 233 br_max = br_nom + br_nom * id->ext.br_min / 100;
9962acf7fb8c5c Russell King 2017-12-29 234 br_min = br_nom - br_nom * id->ext.br_min / 100;
9962acf7fb8c5c Russell King 2017-12-29 235 }
2b999ba899059e Antoine Tenart 2018-05-04 236
2b999ba899059e Antoine Tenart 2018-05-04 237 /* When using passive cables, in case neither BR,min nor BR,max
2b999ba899059e Antoine Tenart 2018-05-04 238 * are specified, set br_min to 0 as the nominal value is then
2b999ba899059e Antoine Tenart 2018-05-04 239 * used as the maximum.
2b999ba899059e Antoine Tenart 2018-05-04 240 */
2b999ba899059e Antoine Tenart 2018-05-04 241 if (br_min == br_max && id->base.sfp_ct_passive)
2b999ba899059e Antoine Tenart 2018-05-04 242 br_min = 0;
9962acf7fb8c5c Russell King 2017-12-29 243 }
9962acf7fb8c5c Russell King 2017-12-29 244
ce0aa27ff3f68e Russell King 2017-07-25 245 /* Set ethtool support from the compliance fields. */
ce0aa27ff3f68e Russell King 2017-07-25 246 if (id->base.e10g_base_sr)
03145864bd0fca Russell King 2018-02-27 247 phylink_set(modes, 10000baseSR_Full);
ce0aa27ff3f68e Russell King 2017-07-25 248 if (id->base.e10g_base_lr)
03145864bd0fca Russell King 2018-02-27 249 phylink_set(modes, 10000baseLR_Full);
ce0aa27ff3f68e Russell King 2017-07-25 250 if (id->base.e10g_base_lrm)
03145864bd0fca Russell King 2018-02-27 251 phylink_set(modes, 10000baseLRM_Full);
ce0aa27ff3f68e Russell King 2017-07-25 252 if (id->base.e10g_base_er)
03145864bd0fca Russell King 2018-02-27 253 phylink_set(modes, 10000baseER_Full);
ce0aa27ff3f68e Russell King 2017-07-25 254 if (id->base.e1000_base_sx ||
ce0aa27ff3f68e Russell King 2017-07-25 255 id->base.e1000_base_lx ||
ce0aa27ff3f68e Russell King 2017-07-25 256 id->base.e1000_base_cx)
03145864bd0fca Russell King 2018-02-27 257 phylink_set(modes, 1000baseX_Full);
ce0aa27ff3f68e Russell King 2017-07-25 258 if (id->base.e1000_base_t) {
03145864bd0fca Russell King 2018-02-27 259 phylink_set(modes, 1000baseT_Half);
03145864bd0fca Russell King 2018-02-27 260 phylink_set(modes, 1000baseT_Full);
ce0aa27ff3f68e Russell King 2017-07-25 261 }
ce0aa27ff3f68e Russell King 2017-07-25 262
9962acf7fb8c5c Russell King 2017-12-29 263 /* 1000Base-PX or 1000Base-BX10 */
9962acf7fb8c5c Russell King 2017-12-29 264 if ((id->base.e_base_px || id->base.e_base_bx10) &&
9962acf7fb8c5c Russell King 2017-12-29 265 br_min <= 1300 && br_max >= 1200)
d7f7e0018b96fd Baruch Siach 2018-11-29 266 phylink_set(modes, 1000baseX_Full);
9962acf7fb8c5c Russell King 2017-12-29 267
f10fcbcf91006a Russell King 2017-12-29 268 /* For active or passive cables, select the link modes
f10fcbcf91006a Russell King 2017-12-29 269 * based on the bit rates and the cable compliance bytes.
f10fcbcf91006a Russell King 2017-12-29 270 */
f10fcbcf91006a Russell King 2017-12-29 271 if ((id->base.sfp_ct_passive || id->base.sfp_ct_active) && br_nom) {
f10fcbcf91006a Russell King 2017-12-29 272 /* This may look odd, but some manufacturers use 12000MBd */
f10fcbcf91006a Russell King 2017-12-29 273 if (br_min <= 12000 && br_max >= 10300)
03145864bd0fca Russell King 2018-02-27 274 phylink_set(modes, 10000baseCR_Full);
f10fcbcf91006a Russell King 2017-12-29 275 if (br_min <= 3200 && br_max >= 3100)
03145864bd0fca Russell King 2018-02-27 276 phylink_set(modes, 2500baseX_Full);
f10fcbcf91006a Russell King 2017-12-29 277 if (br_min <= 1300 && br_max >= 1200)
03145864bd0fca Russell King 2018-02-27 278 phylink_set(modes, 1000baseX_Full);
f10fcbcf91006a Russell King 2017-12-29 279 }
f10fcbcf91006a Russell King 2017-12-29 280 if (id->base.sfp_ct_passive) {
f10fcbcf91006a Russell King 2017-12-29 281 if (id->base.passive.sff8431_app_e)
03145864bd0fca Russell King 2018-02-27 282 phylink_set(modes, 10000baseCR_Full);
f10fcbcf91006a Russell King 2017-12-29 283 }
f10fcbcf91006a Russell King 2017-12-29 284 if (id->base.sfp_ct_active) {
f10fcbcf91006a Russell King 2017-12-29 285 if (id->base.active.sff8431_app_e ||
f10fcbcf91006a Russell King 2017-12-29 286 id->base.active.sff8431_lim) {
03145864bd0fca Russell King 2018-02-27 287 phylink_set(modes, 10000baseCR_Full);
f10fcbcf91006a Russell King 2017-12-29 288 }
f10fcbcf91006a Russell King 2017-12-29 289 }
f10fcbcf91006a Russell King 2017-12-29 290
ce0aa27ff3f68e Russell King 2017-07-25 291 switch (id->base.extended_cc) {
c83f8d2fce3488 Russell King 2019-09-26 292 case SFF8024_ECC_UNSPEC:
ce0aa27ff3f68e Russell King 2017-07-25 293 break;
c83f8d2fce3488 Russell King 2019-09-26 294 case SFF8024_ECC_100GBASE_SR4_25GBASE_SR:
03145864bd0fca Russell King 2018-02-27 295 phylink_set(modes, 100000baseSR4_Full);
03145864bd0fca Russell King 2018-02-27 296 phylink_set(modes, 25000baseSR_Full);
ce0aa27ff3f68e Russell King 2017-07-25 297 break;
c83f8d2fce3488 Russell King 2019-09-26 298 case SFF8024_ECC_100GBASE_LR4_25GBASE_LR:
c83f8d2fce3488 Russell King 2019-09-26 299 case SFF8024_ECC_100GBASE_ER4_25GBASE_ER:
03145864bd0fca Russell King 2018-02-27 300 phylink_set(modes, 100000baseLR4_ER4_Full);
ce0aa27ff3f68e Russell King 2017-07-25 301 break;
c83f8d2fce3488 Russell King 2019-09-26 302 case SFF8024_ECC_100GBASE_CR4:
03145864bd0fca Russell King 2018-02-27 303 phylink_set(modes, 100000baseCR4_Full);
c83f8d2fce3488 Russell King 2019-09-26 304 /* fallthrough */
c83f8d2fce3488 Russell King 2019-09-26 305 case SFF8024_ECC_25GBASE_CR_S:
c83f8d2fce3488 Russell King 2019-09-26 306 case SFF8024_ECC_25GBASE_CR_N:
03145864bd0fca Russell King 2018-02-27 307 phylink_set(modes, 25000baseCR_Full);
ce0aa27ff3f68e Russell King 2017-07-25 308 break;
c83f8d2fce3488 Russell King 2019-09-26 309 case SFF8024_ECC_10GBASE_T_SFI:
c83f8d2fce3488 Russell King 2019-09-26 310 case SFF8024_ECC_10GBASE_T_SR:
c83f8d2fce3488 Russell King 2019-09-26 311 phylink_set(modes, 10000baseT_Full);
c83f8d2fce3488 Russell King 2019-09-26 312 break;
c83f8d2fce3488 Russell King 2019-09-26 313 case SFF8024_ECC_5GBASE_T:
c83f8d2fce3488 Russell King 2019-09-26 314 phylink_set(modes, 5000baseT_Full);
c83f8d2fce3488 Russell King 2019-09-26 315 break;
c83f8d2fce3488 Russell King 2019-09-26 316 case SFF8024_ECC_2_5GBASE_T:
c83f8d2fce3488 Russell King 2019-09-26 317 phylink_set(modes, 2500baseT_Full);
c83f8d2fce3488 Russell King 2019-09-26 318 break;
ce0aa27ff3f68e Russell King 2017-07-25 319 default:
ce0aa27ff3f68e Russell King 2017-07-25 320 dev_warn(bus->sfp_dev,
ce0aa27ff3f68e Russell King 2017-07-25 321 "Unknown/unsupported extended compliance code: 0x%02x\n",
ce0aa27ff3f68e Russell King 2017-07-25 322 id->base.extended_cc);
ce0aa27ff3f68e Russell King 2017-07-25 323 break;
ce0aa27ff3f68e Russell King 2017-07-25 324 }
ce0aa27ff3f68e Russell King 2017-07-25 325
ce0aa27ff3f68e Russell King 2017-07-25 326 /* For fibre channel SFP, derive possible BaseX modes */
ce0aa27ff3f68e Russell King 2017-07-25 327 if (id->base.fc_speed_100 ||
ce0aa27ff3f68e Russell King 2017-07-25 328 id->base.fc_speed_200 ||
ce0aa27ff3f68e Russell King 2017-07-25 329 id->base.fc_speed_400) {
ce0aa27ff3f68e Russell King 2017-07-25 330 if (id->base.br_nominal >= 31)
03145864bd0fca Russell King 2018-02-27 331 phylink_set(modes, 2500baseX_Full);
ce0aa27ff3f68e Russell King 2017-07-25 332 if (id->base.br_nominal >= 12)
03145864bd0fca Russell King 2018-02-27 333 phylink_set(modes, 1000baseX_Full);
03145864bd0fca Russell King 2018-02-27 334 }
03145864bd0fca Russell King 2018-02-27 335
03145864bd0fca Russell King 2018-02-27 336 /* If we haven't discovered any modes that this module supports, try
03145864bd0fca Russell King 2018-02-27 337 * the encoding and bitrate to determine supported modes. Some BiDi
03145864bd0fca Russell King 2018-02-27 338 * modules (eg, 1310nm/1550nm) are not 1000BASE-BX compliant due to
03145864bd0fca Russell King 2018-02-27 339 * the differing wavelengths, so do not set any transceiver bits.
03145864bd0fca Russell King 2018-02-27 340 */
03145864bd0fca Russell King 2018-02-27 341 if (bitmap_empty(modes, __ETHTOOL_LINK_MODE_MASK_NBITS)) {
03145864bd0fca Russell King 2018-02-27 342 /* If the encoding and bit rate allows 1000baseX */
c83f8d2fce3488 Russell King 2019-09-26 343 if (id->base.encoding == SFF8024_ENCODING_8B10B && br_nom &&
03145864bd0fca Russell King 2018-02-27 344 br_min <= 1300 && br_max >= 1200)
03145864bd0fca Russell King 2018-02-27 345 phylink_set(modes, 1000baseX_Full);
ce0aa27ff3f68e Russell King 2017-07-25 346 }
03145864bd0fca Russell King 2018-02-27 347
b34bb2cb5b62c7 Russell King 2019-11-20 348 if (bus->sfp_quirk)
b34bb2cb5b62c7 Russell King 2019-11-20 349 bus->sfp_quirk->modes(id, modes);
b34bb2cb5b62c7 Russell King 2019-11-20 350
03145864bd0fca Russell King 2018-02-27 351 bitmap_or(support, support, modes, __ETHTOOL_LINK_MODE_MASK_NBITS);
03145864bd0fca Russell King 2018-02-27 352
03145864bd0fca Russell King 2018-02-27 353 phylink_set(support, Autoneg);
03145864bd0fca Russell King 2018-02-27 354 phylink_set(support, Pause);
03145864bd0fca Russell King 2018-02-27 355 phylink_set(support, Asym_Pause);
ce0aa27ff3f68e Russell King 2017-07-25 356 }
ce0aa27ff3f68e Russell King 2017-07-25 357 EXPORT_SYMBOL_GPL(sfp_parse_support);
ce0aa27ff3f68e Russell King 2017-07-25 358
:::::: The code at line 121 was first introduced by commit
:::::: ce0aa27ff3f68ed4ea1631d33797e573b3508bfa sfp: add sfp-bus to bridge between network devices and sfp cages
:::::: TO: Russell King <rmk+kernel@armlinux.org.uk>
:::::: CC: David S. Miller <davem@davemloft.net>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 33865 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2020-02-11 19:10 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 19:10 [linux-arm:cex7 102/102] drivers/net/phy/sfp-bus.c:121:5: error: redefinition of 'sfp_parse_port' kbuild test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.