Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [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 { |
David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 10 | void (*attach)(struct sfp *sfp); |
| 11 | void (*detach)(struct sfp *sfp); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [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); |
| 17 | }; |
| 18 | |
| 19 | int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev); |
| 20 | void sfp_remove_phy(struct sfp_bus *bus); |
| 21 | void sfp_link_up(struct sfp_bus *bus); |
| 22 | void sfp_link_down(struct sfp_bus *bus); |
| 23 | int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id); |
| 24 | void sfp_module_remove(struct sfp_bus *bus); |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 25 | int sfp_module_start(struct sfp_bus *bus); |
| 26 | void sfp_module_stop(struct sfp_bus *bus); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 27 | int sfp_link_configure(struct sfp_bus *bus, const struct sfp_eeprom_id *id); |
| 28 | struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp, |
| 29 | const struct sfp_socket_ops *ops); |
| 30 | void sfp_unregister_socket(struct sfp_bus *bus); |
| 31 | |
| 32 | #endif |