Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'net-rework-sfp-capability-parsing-and-quirks'

Russell King says:

====================
net: rework SFP capability parsing and quirks

The original SPF module parsing was implemented prior to gaining any
quirks, and was designed such that the upstream calls the parsing
functions to get the translated capabilities of the module.

SFP quirks were then added to cope with modules that didn't correctly
fill out their ID EEPROM. The quirk function was called from
sfp_parse_support() to allow quirks to modify the ethtool link mode
masks.

Using just ethtool link mode masks eventually lead to difficulties
determining the correct phy_interface_t mode, so a bitmap of these
modes were added - needing both the upstream API and quirks to be
updated.

We have had significantly more SFP module quirks added since, some
which are modifying the ID EEPROM as a way of influencing the data
we provide to the upstream - for example, sfp_fixup_10gbaset_30m()
changes id.base.connector so we report PORT_TP. This could be done
more cleanly if the quirks had access to the parsed SFP port.

In order to improve flexibility, and to simplify some of the upstream
code, we group all module capabilities into a single structure that
the upstream can access via sfp_module_get_caps(). This will allow
the module capabilities to be expanded if required without reworking
all the infrastructure and upstreams again.

In this series, we rework the SFP code to use the capability structure
and then rework all the upstream implementations, finally removing the
old kernel internal APIs.
====================

Link: https://patch.msgid.link/aMnaoPjIuzEAsESZ@shell.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+128 -144
+6 -7
drivers/net/phy/marvell-88x2222.c
··· 475 475 476 476 static int mv2222_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) 477 477 { 478 - DECLARE_PHY_INTERFACE_MASK(interfaces); 479 478 struct phy_device *phydev = upstream; 479 + const struct sfp_module_caps *caps; 480 480 phy_interface_t sfp_interface; 481 481 struct mv2222_data *priv; 482 482 struct device *dev; 483 483 int ret; 484 484 485 - __ETHTOOL_DECLARE_LINK_MODE_MASK(sfp_supported) = { 0, }; 486 - 487 485 priv = phydev->priv; 488 486 dev = &phydev->mdio.dev; 489 487 490 - sfp_parse_support(phydev->sfp_bus, id, sfp_supported, interfaces); 491 - phydev->port = sfp_parse_port(phydev->sfp_bus, id, sfp_supported); 492 - sfp_interface = sfp_select_interface(phydev->sfp_bus, sfp_supported); 488 + caps = sfp_get_module_caps(phydev->sfp_bus); 489 + 490 + phydev->port = caps->port; 491 + sfp_interface = sfp_select_interface(phydev->sfp_bus, caps->link_modes); 493 492 494 493 dev_info(dev, "%s SFP module inserted\n", phy_modes(sfp_interface)); 495 494 ··· 501 502 } 502 503 503 504 priv->line_interface = sfp_interface; 504 - linkmode_and(priv->supported, phydev->supported, sfp_supported); 505 + linkmode_and(priv->supported, phydev->supported, caps->link_modes); 505 506 506 507 ret = mv2222_config_line(phydev); 507 508 if (ret < 0)
+3 -5
drivers/net/phy/marvell.c
··· 3600 3600 3601 3601 static int m88e1510_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) 3602 3602 { 3603 - DECLARE_PHY_INTERFACE_MASK(interfaces); 3604 3603 struct phy_device *phydev = upstream; 3604 + const struct sfp_module_caps *caps; 3605 3605 phy_interface_t interface; 3606 3606 struct device *dev; 3607 3607 int oldpage; 3608 3608 int ret = 0; 3609 3609 u16 mode; 3610 3610 3611 - __ETHTOOL_DECLARE_LINK_MODE_MASK(supported) = { 0, }; 3612 - 3613 3611 dev = &phydev->mdio.dev; 3614 3612 3615 - sfp_parse_support(phydev->sfp_bus, id, supported, interfaces); 3616 - interface = sfp_select_interface(phydev->sfp_bus, supported); 3613 + caps = sfp_get_module_caps(phydev->sfp_bus); 3614 + interface = sfp_select_interface(phydev->sfp_bus, caps->link_modes); 3617 3615 3618 3616 dev_info(dev, "%s SFP module inserted\n", phy_modes(interface)); 3619 3617
+3 -4
drivers/net/phy/marvell10g.c
··· 466 466 static int mv3310_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) 467 467 { 468 468 struct phy_device *phydev = upstream; 469 - __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, }; 470 - DECLARE_PHY_INTERFACE_MASK(interfaces); 469 + const struct sfp_module_caps *caps; 471 470 phy_interface_t iface; 472 471 473 - sfp_parse_support(phydev->sfp_bus, id, support, interfaces); 474 - iface = sfp_select_interface(phydev->sfp_bus, support); 472 + caps = sfp_get_module_caps(phydev->sfp_bus); 473 + iface = sfp_select_interface(phydev->sfp_bus, caps->link_modes); 475 474 476 475 if (iface != PHY_INTERFACE_MODE_10GBASER) { 477 476 dev_err(&phydev->mdio.dev, "incompatible SFP module inserted\n");
+6 -5
drivers/net/phy/phylink.c
··· 3750 3750 static int phylink_sfp_module_insert(void *upstream, 3751 3751 const struct sfp_eeprom_id *id) 3752 3752 { 3753 + const struct sfp_module_caps *caps; 3753 3754 struct phylink *pl = upstream; 3754 3755 3755 3756 ASSERT_RTNL(); 3756 3757 3757 - linkmode_zero(pl->sfp_support); 3758 - phy_interface_zero(pl->sfp_interfaces); 3759 - sfp_parse_support(pl->sfp_bus, id, pl->sfp_support, pl->sfp_interfaces); 3760 - pl->sfp_port = sfp_parse_port(pl->sfp_bus, id, pl->sfp_support); 3758 + caps = sfp_get_module_caps(pl->sfp_bus); 3759 + phy_interface_copy(pl->sfp_interfaces, caps->interfaces); 3760 + linkmode_copy(pl->sfp_support, caps->link_modes); 3761 + pl->sfp_may_have_phy = caps->may_have_phy; 3762 + pl->sfp_port = caps->port; 3761 3763 3762 3764 /* If this module may have a PHY connecting later, defer until later */ 3763 - pl->sfp_may_have_phy = sfp_may_have_phy(pl->sfp_bus, id); 3764 3765 if (pl->sfp_may_have_phy) 3765 3766 return 0; 3766 3767
+4 -5
drivers/net/phy/qcom/at803x.c
··· 771 771 772 772 static int at8031_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) 773 773 { 774 - struct phy_device *phydev = upstream; 775 774 __ETHTOOL_DECLARE_LINK_MODE_MASK(phy_support); 776 775 __ETHTOOL_DECLARE_LINK_MODE_MASK(sfp_support); 777 - DECLARE_PHY_INTERFACE_MASK(interfaces); 776 + struct phy_device *phydev = upstream; 777 + const struct sfp_module_caps *caps; 778 778 phy_interface_t iface; 779 779 780 780 linkmode_zero(phy_support); ··· 784 784 phylink_set(phy_support, Pause); 785 785 phylink_set(phy_support, Asym_Pause); 786 786 787 - linkmode_zero(sfp_support); 788 - sfp_parse_support(phydev->sfp_bus, id, sfp_support, interfaces); 787 + caps = sfp_get_module_caps(phydev->sfp_bus); 789 788 /* Some modules support 10G modes as well as others we support. 790 789 * Mask out non-supported modes so the correct interface is picked. 791 790 */ 792 - linkmode_and(sfp_support, phy_support, sfp_support); 791 + linkmode_and(sfp_support, phy_support, caps->link_modes); 793 792 794 793 if (linkmode_empty(sfp_support)) { 795 794 dev_err(&phydev->mdio.dev, "incompatible SFP module inserted\n");
+3 -4
drivers/net/phy/qcom/qca807x.c
··· 646 646 static int qca807x_sfp_insert(void *upstream, const struct sfp_eeprom_id *id) 647 647 { 648 648 struct phy_device *phydev = upstream; 649 - __ETHTOOL_DECLARE_LINK_MODE_MASK(support) = { 0, }; 649 + const struct sfp_module_caps *caps; 650 650 phy_interface_t iface; 651 651 int ret; 652 - DECLARE_PHY_INTERFACE_MASK(interfaces); 653 652 654 - sfp_parse_support(phydev->sfp_bus, id, support, interfaces); 655 - iface = sfp_select_interface(phydev->sfp_bus, support); 653 + caps = sfp_get_module_caps(phydev->sfp_bus); 654 + iface = sfp_select_interface(phydev->sfp_bus, caps->link_modes); 656 655 657 656 dev_info(&phydev->mdio.dev, "%s SFP module inserted\n", phy_modes(iface)); 658 657
+46 -65
drivers/net/phy/sfp-bus.c
··· 22 22 const struct sfp_socket_ops *socket_ops; 23 23 struct device *sfp_dev; 24 24 struct sfp *sfp; 25 - const struct sfp_quirk *sfp_quirk; 26 25 27 26 const struct sfp_upstream_ops *upstream_ops; 28 27 void *upstream; ··· 29 30 30 31 bool registered; 31 32 bool started; 33 + 34 + struct sfp_module_caps caps; 32 35 }; 33 36 34 - /** 35 - * sfp_parse_port() - Parse the EEPROM base ID, setting the port type 36 - * @bus: a pointer to the &struct sfp_bus structure for the sfp module 37 - * @id: a pointer to the module's &struct sfp_eeprom_id 38 - * @support: optional pointer to an array of unsigned long for the 39 - * ethtool support mask 40 - * 41 - * Parse the EEPROM identification given in @id, and return one of 42 - * %PORT_TP, %PORT_FIBRE or %PORT_OTHER. If @support is non-%NULL, 43 - * also set the ethtool %ETHTOOL_LINK_MODE_xxx_BIT corresponding with 44 - * the connector type. 45 - * 46 - * If the port type is not known, returns %PORT_OTHER. 47 - */ 48 - int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id, 49 - unsigned long *support) 37 + const struct sfp_module_caps *sfp_get_module_caps(struct sfp_bus *bus) 38 + { 39 + return &bus->caps; 40 + } 41 + EXPORT_SYMBOL_GPL(sfp_get_module_caps); 42 + 43 + static void sfp_module_parse_port(struct sfp_bus *bus, 44 + const struct sfp_eeprom_id *id) 50 45 { 51 46 int port; 52 47 ··· 84 91 break; 85 92 } 86 93 87 - if (support) { 88 - switch (port) { 89 - case PORT_FIBRE: 90 - phylink_set(support, FIBRE); 91 - break; 94 + switch (port) { 95 + case PORT_FIBRE: 96 + phylink_set(bus->caps.link_modes, FIBRE); 97 + break; 92 98 93 - case PORT_TP: 94 - phylink_set(support, TP); 95 - break; 96 - } 99 + case PORT_TP: 100 + phylink_set(bus->caps.link_modes, TP); 101 + break; 97 102 } 98 103 99 - return port; 104 + bus->caps.port = port; 100 105 } 101 - EXPORT_SYMBOL_GPL(sfp_parse_port); 102 106 103 - /** 104 - * sfp_may_have_phy() - indicate whether the module may have a PHY 105 - * @bus: a pointer to the &struct sfp_bus structure for the sfp module 106 - * @id: a pointer to the module's &struct sfp_eeprom_id 107 - * 108 - * Parse the EEPROM identification given in @id, and return whether 109 - * this module may have a PHY. 110 - */ 111 - bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id) 107 + static void sfp_module_parse_may_have_phy(struct sfp_bus *bus, 108 + const struct sfp_eeprom_id *id) 112 109 { 113 - if (id->base.e1000_base_t) 114 - return true; 110 + if (id->base.e1000_base_t) { 111 + bus->caps.may_have_phy = true; 112 + return; 113 + } 115 114 116 115 if (id->base.phys_id != SFF8024_ID_DWDM_SFP) { 117 116 switch (id->base.extended_cc) { ··· 111 126 case SFF8024_ECC_10GBASE_T_SR: 112 127 case SFF8024_ECC_5GBASE_T: 113 128 case SFF8024_ECC_2_5GBASE_T: 114 - return true; 129 + bus->caps.may_have_phy = true; 130 + return; 115 131 } 116 132 } 117 133 118 - return false; 134 + bus->caps.may_have_phy = false; 119 135 } 120 - EXPORT_SYMBOL_GPL(sfp_may_have_phy); 121 136 122 - /** 123 - * sfp_parse_support() - Parse the eeprom id for supported link modes 124 - * @bus: a pointer to the &struct sfp_bus structure for the sfp module 125 - * @id: a pointer to the module's &struct sfp_eeprom_id 126 - * @support: pointer to an array of unsigned long for the ethtool support mask 127 - * @interfaces: pointer to an array of unsigned long for phy interface modes 128 - * mask 129 - * 130 - * Parse the EEPROM identification information and derive the supported 131 - * ethtool link modes for the module. 132 - */ 133 - void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, 134 - unsigned long *support, unsigned long *interfaces) 137 + static void sfp_module_parse_support(struct sfp_bus *bus, 138 + const struct sfp_eeprom_id *id) 135 139 { 140 + unsigned long *interfaces = bus->caps.interfaces; 141 + unsigned long *modes = bus->caps.link_modes; 136 142 unsigned int br_min, br_nom, br_max; 137 - __ETHTOOL_DECLARE_LINK_MODE_MASK(modes) = { 0, }; 138 143 139 144 /* Decode the bitrate information to MBd */ 140 145 br_min = br_nom = br_max = 0; ··· 313 338 phylink_set(modes, Autoneg); 314 339 phylink_set(modes, Pause); 315 340 phylink_set(modes, Asym_Pause); 316 - 317 - if (bus->sfp_quirk && bus->sfp_quirk->modes) 318 - bus->sfp_quirk->modes(id, modes, interfaces); 319 - 320 - linkmode_or(support, support, modes); 321 341 } 322 - EXPORT_SYMBOL_GPL(sfp_parse_support); 342 + 343 + static void sfp_init_module(struct sfp_bus *bus, 344 + const struct sfp_eeprom_id *id, 345 + const struct sfp_quirk *quirk) 346 + { 347 + memset(&bus->caps, 0, sizeof(bus->caps)); 348 + 349 + sfp_module_parse_support(bus, id); 350 + sfp_module_parse_port(bus, id); 351 + sfp_module_parse_may_have_phy(bus, id); 352 + 353 + if (quirk && quirk->support) 354 + quirk->support(id, &bus->caps); 355 + } 323 356 324 357 /** 325 358 * sfp_select_interface() - Select appropriate phy_interface_t mode ··· 777 794 const struct sfp_upstream_ops *ops = sfp_get_upstream_ops(bus); 778 795 int ret = 0; 779 796 780 - bus->sfp_quirk = quirk; 797 + sfp_init_module(bus, id, quirk); 781 798 782 799 if (ops && ops->module_insert) 783 800 ret = ops->module_insert(bus->upstream, id); ··· 792 809 793 810 if (ops && ops->module_remove) 794 811 ops->module_remove(bus->upstream); 795 - 796 - bus->sfp_quirk = NULL; 797 812 } 798 813 EXPORT_SYMBOL_GPL(sfp_module_remove); 799 814
+24 -25
drivers/net/phy/sfp.c
··· 440 440 } 441 441 442 442 static void sfp_quirk_2500basex(const struct sfp_eeprom_id *id, 443 - unsigned long *modes, 444 - unsigned long *interfaces) 443 + struct sfp_module_caps *caps) 445 444 { 446 - linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, modes); 447 - __set_bit(PHY_INTERFACE_MODE_2500BASEX, interfaces); 445 + linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseX_Full_BIT, 446 + caps->link_modes); 447 + __set_bit(PHY_INTERFACE_MODE_2500BASEX, caps->interfaces); 448 448 } 449 449 450 450 static void sfp_quirk_disable_autoneg(const struct sfp_eeprom_id *id, 451 - unsigned long *modes, 452 - unsigned long *interfaces) 451 + struct sfp_module_caps *caps) 453 452 { 454 - linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, modes); 453 + linkmode_clear_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, caps->link_modes); 455 454 } 456 455 457 456 static void sfp_quirk_oem_2_5g(const struct sfp_eeprom_id *id, 458 - unsigned long *modes, 459 - unsigned long *interfaces) 457 + struct sfp_module_caps *caps) 460 458 { 461 459 /* Copper 2.5G SFP */ 462 - linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, modes); 463 - __set_bit(PHY_INTERFACE_MODE_2500BASEX, interfaces); 464 - sfp_quirk_disable_autoneg(id, modes, interfaces); 460 + linkmode_set_bit(ETHTOOL_LINK_MODE_2500baseT_Full_BIT, 461 + caps->link_modes); 462 + __set_bit(PHY_INTERFACE_MODE_2500BASEX, caps->interfaces); 463 + sfp_quirk_disable_autoneg(id, caps); 465 464 } 466 465 467 466 static void sfp_quirk_ubnt_uf_instant(const struct sfp_eeprom_id *id, 468 - unsigned long *modes, 469 - unsigned long *interfaces) 467 + struct sfp_module_caps *caps) 470 468 { 471 469 /* Ubiquiti U-Fiber Instant module claims that support all transceiver 472 470 * types including 10G Ethernet which is not truth. So clear all claimed 473 471 * modes and set only one mode which module supports: 1000baseX_Full. 474 472 */ 475 - linkmode_zero(modes); 476 - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, modes); 473 + linkmode_zero(caps->link_modes); 474 + linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseX_Full_BIT, 475 + caps->link_modes); 477 476 } 478 477 479 - #define SFP_QUIRK(_v, _p, _m, _f) \ 480 - { .vendor = _v, .part = _p, .modes = _m, .fixup = _f, } 481 - #define SFP_QUIRK_M(_v, _p, _m) SFP_QUIRK(_v, _p, _m, NULL) 478 + #define SFP_QUIRK(_v, _p, _s, _f) \ 479 + { .vendor = _v, .part = _p, .support = _s, .fixup = _f, } 480 + #define SFP_QUIRK_S(_v, _p, _s) SFP_QUIRK(_v, _p, _s, NULL) 482 481 #define SFP_QUIRK_F(_v, _p, _f) SFP_QUIRK(_v, _p, NULL, _f) 483 482 484 483 static const struct sfp_quirk sfp_quirks[] = { ··· 513 514 514 515 // HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports 515 516 // 2600MBd in their EERPOM 516 - SFP_QUIRK_M("HG GENUINE", "MXPD-483II", sfp_quirk_2500basex), 517 + SFP_QUIRK_S("HG GENUINE", "MXPD-483II", sfp_quirk_2500basex), 517 518 518 519 // Huawei MA5671A can operate at 2500base-X, but report 1.2GBd NRZ in 519 520 // their EEPROM ··· 522 523 523 524 // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report 524 525 // 2500MBd NRZ in their EEPROM 525 - SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex), 526 + SFP_QUIRK_S("Lantech", "8330-262D-E", sfp_quirk_2500basex), 526 527 527 - SFP_QUIRK_M("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant), 528 + SFP_QUIRK_S("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant), 528 529 529 530 // Walsun HXSX-ATR[CI]-1 don't identify as copper, and use the 530 531 // Rollball protocol to talk to the PHY. ··· 537 538 SFP_QUIRK_F("OEM", "SFP-GE-T", sfp_fixup_ignore_tx_fault), 538 539 539 540 SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc), 540 - SFP_QUIRK_M("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g), 541 - SFP_QUIRK_M("OEM", "SFP-2.5G-BX10-D", sfp_quirk_2500basex), 542 - SFP_QUIRK_M("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex), 541 + SFP_QUIRK_S("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g), 542 + SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-D", sfp_quirk_2500basex), 543 + SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex), 543 544 SFP_QUIRK_F("OEM", "RTSFP-10", sfp_fixup_rollball_cc), 544 545 SFP_QUIRK_F("OEM", "RTSFP-10G", sfp_fixup_rollball_cc), 545 546 SFP_QUIRK_F("Turris", "RTSFP-2.5G", sfp_fixup_rollball),
+2 -2
drivers/net/phy/sfp.h
··· 9 9 struct sfp_quirk { 10 10 const char *vendor; 11 11 const char *part; 12 - void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes, 13 - unsigned long *interfaces); 12 + void (*support)(const struct sfp_eeprom_id *id, 13 + struct sfp_module_caps *caps); 14 14 void (*fixup)(struct sfp *sfp); 15 15 }; 16 16
+5
include/linux/phy.h
··· 169 169 return bitmap_empty(intf, PHY_INTERFACE_MODE_MAX); 170 170 } 171 171 172 + static inline void phy_interface_copy(unsigned long *d, const unsigned long *s) 173 + { 174 + bitmap_copy(d, s, PHY_INTERFACE_MODE_MAX); 175 + } 176 + 172 177 static inline unsigned int phy_interface_weight(const unsigned long *intf) 173 178 { 174 179 return bitmap_weight(intf, PHY_INTERFACE_MODE_MAX);
+26 -22
include/linux/sfp.h
··· 522 522 struct sfp_bus; 523 523 524 524 /** 525 + * struct sfp_module_caps - sfp module capabilities 526 + * @interfaces: bitmap of interfaces that the module may support 527 + * @link_modes: bitmap of ethtool link modes that the module may support 528 + */ 529 + struct sfp_module_caps { 530 + DECLARE_PHY_INTERFACE_MASK(interfaces); 531 + __ETHTOOL_DECLARE_LINK_MODE_MASK(link_modes); 532 + /** 533 + * @may_have_phy: indicate whether the module may have an ethernet PHY 534 + * There is no way to be sure that a module has a PHY as the EEPROM 535 + * doesn't contain this information. When set, this does not mean that 536 + * the module definitely has a PHY. 537 + */ 538 + bool may_have_phy; 539 + /** 540 + * @port: one of ethtool %PORT_* definitions, parsed from the module 541 + * EEPROM, or %PORT_OTHER if the port type is not known. 542 + */ 543 + u8 port; 544 + }; 545 + 546 + /** 525 547 * struct sfp_upstream_ops - upstream operations structure 526 548 * @attach: called when the sfp socket driver is bound to the upstream 527 549 * (mandatory). ··· 576 554 }; 577 555 578 556 #if IS_ENABLED(CONFIG_SFP) 579 - int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id, 580 - unsigned long *support); 581 - bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id); 582 - void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id, 583 - unsigned long *support, unsigned long *interfaces); 557 + const struct sfp_module_caps *sfp_get_module_caps(struct sfp_bus *bus); 584 558 phy_interface_t sfp_select_interface(struct sfp_bus *bus, 585 559 const unsigned long *link_modes); 586 560 ··· 596 578 void sfp_bus_del_upstream(struct sfp_bus *bus); 597 579 const char *sfp_get_name(struct sfp_bus *bus); 598 580 #else 599 - static inline int sfp_parse_port(struct sfp_bus *bus, 600 - const struct sfp_eeprom_id *id, 601 - unsigned long *support) 581 + static inline const struct sfp_module_caps * 582 + sfp_get_module_caps(struct sfp_bus *bus) 602 583 { 603 - return PORT_OTHER; 604 - } 605 - 606 - static inline bool sfp_may_have_phy(struct sfp_bus *bus, 607 - const struct sfp_eeprom_id *id) 608 - { 609 - return false; 610 - } 611 - 612 - static inline void sfp_parse_support(struct sfp_bus *bus, 613 - const struct sfp_eeprom_id *id, 614 - unsigned long *support, 615 - unsigned long *interfaces) 616 - { 584 + return NULL; 617 585 } 618 586 619 587 static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,