Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
45 lines
1.4 KiB
C
45 lines
1.4 KiB
C
#ifndef SFP_H
|
|
#define SFP_H
|
|
|
|
#include <linux/ethtool.h>
|
|
#include <linux/sfp.h>
|
|
|
|
struct sfp;
|
|
|
|
struct sfp_quirk {
|
|
const char *vendor;
|
|
const char *part;
|
|
void (*support)(const struct sfp_eeprom_id *id,
|
|
struct sfp_module_caps *caps);
|
|
void (*fixup)(struct sfp *sfp);
|
|
};
|
|
|
|
struct sfp_socket_ops {
|
|
void (*attach)(struct sfp *sfp);
|
|
void (*detach)(struct sfp *sfp);
|
|
void (*start)(struct sfp *sfp);
|
|
void (*stop)(struct sfp *sfp);
|
|
void (*set_signal_rate)(struct sfp *sfp, unsigned int rate_kbd);
|
|
int (*module_info)(struct sfp *sfp, struct ethtool_modinfo *modinfo);
|
|
int (*module_eeprom)(struct sfp *sfp, struct ethtool_eeprom *ee,
|
|
u8 *data);
|
|
int (*module_eeprom_by_page)(struct sfp *sfp,
|
|
const struct ethtool_module_eeprom *page,
|
|
struct netlink_ext_ack *extack);
|
|
};
|
|
|
|
int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev);
|
|
void sfp_remove_phy(struct sfp_bus *bus);
|
|
void sfp_link_up(struct sfp_bus *bus);
|
|
void sfp_link_down(struct sfp_bus *bus);
|
|
int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
|
|
const struct sfp_quirk *quirk);
|
|
void sfp_module_remove(struct sfp_bus *bus);
|
|
int sfp_module_start(struct sfp_bus *bus);
|
|
void sfp_module_stop(struct sfp_bus *bus);
|
|
struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp,
|
|
const struct sfp_socket_ops *ops);
|
|
void sfp_unregister_socket(struct sfp_bus *bus);
|
|
|
|
#endif
|