Merge tag 'kvmarm-fixes-6.8-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmar...
[linux-block.git] / drivers / net / phy / sfp.h
CommitLineData
ce0aa27f
RK
1#ifndef SFP_H
2#define SFP_H
3
4#include <linux/ethtool.h>
5#include <linux/sfp.h>
6
7struct sfp;
8
23571c7b
RKO
9struct sfp_quirk {
10 const char *vendor;
11 const char *part;
fd580c98
RK
12 void (*modes)(const struct sfp_eeprom_id *id, unsigned long *modes,
13 unsigned long *interfaces);
27541675 14 void (*fixup)(struct sfp *sfp);
23571c7b
RKO
15};
16
ce0aa27f 17struct sfp_socket_ops {
b5bfc21a
RK
18 void (*attach)(struct sfp *sfp);
19 void (*detach)(struct sfp *sfp);
ce0aa27f
RK
20 void (*start)(struct sfp *sfp);
21 void (*stop)(struct sfp *sfp);
dc185822 22 void (*set_signal_rate)(struct sfp *sfp, unsigned int rate_kbd);
ce0aa27f
RK
23 int (*module_info)(struct sfp *sfp, struct ethtool_modinfo *modinfo);
24 int (*module_eeprom)(struct sfp *sfp, struct ethtool_eeprom *ee,
25 u8 *data);
d740513f
AL
26 int (*module_eeprom_by_page)(struct sfp *sfp,
27 const struct ethtool_module_eeprom *page,
28 struct netlink_ext_ack *extack);
ce0aa27f
RK
29};
30
31int sfp_add_phy(struct sfp_bus *bus, struct phy_device *phydev);
32void sfp_remove_phy(struct sfp_bus *bus);
33void sfp_link_up(struct sfp_bus *bus);
34void sfp_link_down(struct sfp_bus *bus);
23571c7b
RKO
35int sfp_module_insert(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
36 const struct sfp_quirk *quirk);
ce0aa27f 37void sfp_module_remove(struct sfp_bus *bus);
74c551ca
RK
38int sfp_module_start(struct sfp_bus *bus);
39void sfp_module_stop(struct sfp_bus *bus);
ce0aa27f
RK
40struct sfp_bus *sfp_register_socket(struct device *dev, struct sfp *sfp,
41 const struct sfp_socket_ops *ops);
42void sfp_unregister_socket(struct sfp_bus *bus);
43
44#endif