Russell King | ce0aa27 | 2017-07-25 15:03:18 +0100 | [diff] [blame] | 1 | #ifndef SFP_H |
| 2 | #define SFP_H |
| 3 | |
| 4 | #include <linux/ethtool.h> |
| 5 | #include <linux/sfp.h> |
| 6 | |
| 7 | struct sfp; |
| 8 | |
| 9 | struct sfp_socket_ops { |
Russell King | b5bfc21 | 2019-02-06 10:52:30 +0000 | [diff] [blame] | 10 | void (*attach)(struct sfp *sfp); |
| 11 | void (*detach)(struct sfp *sfp); |
Russell King | ce0aa27 | 2017-07-25 15:03:18 +0100 | [diff] [blame] | 12 | void (*start)(struct sfp *sfp); |
| 13 | void (*stop)(struct sfp *sfp); |
| 14 | int (*module_info)(struct sfp *sfp, struct ethtool_modinfo *modinfo); |
| 15 | int (*module_eeprom)(struct sfp *sfp, struct ethtool_eeprom *ee, |
| 16 | u8 *data); |
Andrew Lunn | d740513 | 2021-04-09 11:06:40 +0300 | [diff] [blame] | 17 | int (*module_eeprom_by_page)(struct sfp *sfp, |
| 18 | const struct ethtool_module_eeprom *page, |
| 19 | struct netlink_ext_ack *extack); |
Russell King | ce0aa27 | 2017-07-25 15:03:18 +0100 | [diff] [blame] | 20 | }; |
| 21 | |
| 22 | int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev); |
| 23 | void sfp_remove_phy(struct sfp_bus *bus); |
| 24 | void sfp_link_up(struct sfp_bus *bus); |
| 25 | void sfp_link_down(struct sfp_bus *bus); |
| 26 | int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id); |
| 27 | void sfp_module_remove(struct sfp_bus *bus); |
Russell King | 74c551c | 2019-12-11 10:56:09 +0000 | [diff] [blame] | 28 | int sfp_module_start(struct sfp_bus *bus); |
| 29 | void sfp_module_stop(struct sfp_bus *bus); |
Russell King | ce0aa27 | 2017-07-25 15:03:18 +0100 | [diff] [blame] | 30 | int sfp_link_configure(struct sfp_bus *bus, const struct sfp_eeprom_id *id); |
| 31 | struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp, |
| 32 | const struct sfp_socket_ops *ops); |
| 33 | void sfp_unregister_socket(struct sfp_bus *bus); |
| 34 | |
| 35 | #endif |