blob: b83f705262705bbd9a61f187b46397da6a967578 [file] [log] [blame]
Russell Kingce0aa272017-07-25 15:03:18 +01001#ifndef SFP_H
2#define SFP_H
3
4#include <linux/ethtool.h>
5#include <linux/sfp.h>
6
7struct sfp;
8
9struct sfp_socket_ops {
Russell Kingb5bfc212019-02-06 10:52:30 +000010 void (*attach)(struct sfp *sfp);
11 void (*detach)(struct sfp *sfp);
Russell Kingce0aa272017-07-25 15:03:18 +010012 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
19int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev);
20void sfp_remove_phy(struct sfp_bus *bus);
21void sfp_link_up(struct sfp_bus *bus);
22void sfp_link_down(struct sfp_bus *bus);
23int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
24void sfp_module_remove(struct sfp_bus *bus);
Russell King74c551c2019-12-11 10:56:09 +000025int sfp_module_start(struct sfp_bus *bus);
26void sfp_module_stop(struct sfp_bus *bus);
Russell Kingce0aa272017-07-25 15:03:18 +010027int sfp_link_configure(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
28struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp,
29 const struct sfp_socket_ops *ops);
30void sfp_unregister_socket(struct sfp_bus *bus);
31
32#endif