xref: /openbmc/linux/include/linux/sfp.h (revision fc082b39)
1ce0aa27fSRussell King #ifndef LINUX_SFP_H
2ce0aa27fSRussell King #define LINUX_SFP_H
3ce0aa27fSRussell King 
4ce0aa27fSRussell King #include <linux/phy.h>
5ce0aa27fSRussell King 
60a6fcd3fSRussell King struct sfp_eeprom_base {
7ce0aa27fSRussell King 	u8 phys_id;
8ce0aa27fSRussell King 	u8 phys_ext_id;
9ce0aa27fSRussell King 	u8 connector;
10ce0aa27fSRussell King #if defined __BIG_ENDIAN_BITFIELD
11ce0aa27fSRussell King 	u8 e10g_base_er:1;
12ce0aa27fSRussell King 	u8 e10g_base_lrm:1;
13ce0aa27fSRussell King 	u8 e10g_base_lr:1;
14ce0aa27fSRussell King 	u8 e10g_base_sr:1;
15ce0aa27fSRussell King 	u8 if_1x_sx:1;
16ce0aa27fSRussell King 	u8 if_1x_lx:1;
17ce0aa27fSRussell King 	u8 if_1x_copper_active:1;
18ce0aa27fSRussell King 	u8 if_1x_copper_passive:1;
19ce0aa27fSRussell King 
20ce0aa27fSRussell King 	u8 escon_mmf_1310_led:1;
21ce0aa27fSRussell King 	u8 escon_smf_1310_laser:1;
22ce0aa27fSRussell King 	u8 sonet_oc192_short_reach:1;
23ce0aa27fSRussell King 	u8 sonet_reach_bit1:1;
24ce0aa27fSRussell King 	u8 sonet_reach_bit2:1;
25ce0aa27fSRussell King 	u8 sonet_oc48_long_reach:1;
26ce0aa27fSRussell King 	u8 sonet_oc48_intermediate_reach:1;
27ce0aa27fSRussell King 	u8 sonet_oc48_short_reach:1;
28ce0aa27fSRussell King 
29ce0aa27fSRussell King 	u8 unallocated_5_7:1;
30ce0aa27fSRussell King 	u8 sonet_oc12_smf_long_reach:1;
31ce0aa27fSRussell King 	u8 sonet_oc12_smf_intermediate_reach:1;
32ce0aa27fSRussell King 	u8 sonet_oc12_short_reach:1;
33ce0aa27fSRussell King 	u8 unallocated_5_3:1;
34ce0aa27fSRussell King 	u8 sonet_oc3_smf_long_reach:1;
35ce0aa27fSRussell King 	u8 sonet_oc3_smf_intermediate_reach:1;
36ce0aa27fSRussell King 	u8 sonet_oc3_short_reach:1;
37ce0aa27fSRussell King 
38ce0aa27fSRussell King 	u8 e_base_px:1;
39ce0aa27fSRussell King 	u8 e_base_bx10:1;
40ce0aa27fSRussell King 	u8 e100_base_fx:1;
41ce0aa27fSRussell King 	u8 e100_base_lx:1;
42ce0aa27fSRussell King 	u8 e1000_base_t:1;
43ce0aa27fSRussell King 	u8 e1000_base_cx:1;
44ce0aa27fSRussell King 	u8 e1000_base_lx:1;
45ce0aa27fSRussell King 	u8 e1000_base_sx:1;
46ce0aa27fSRussell King 
47ce0aa27fSRussell King 	u8 fc_ll_v:1;
48ce0aa27fSRussell King 	u8 fc_ll_s:1;
49ce0aa27fSRussell King 	u8 fc_ll_i:1;
50ce0aa27fSRussell King 	u8 fc_ll_l:1;
51ce0aa27fSRussell King 	u8 fc_ll_m:1;
52ce0aa27fSRussell King 	u8 fc_tech_sa:1;
53ce0aa27fSRussell King 	u8 fc_tech_lc:1;
54ce0aa27fSRussell King 	u8 fc_tech_electrical_inter_enclosure:1;
55ce0aa27fSRussell King 
56ce0aa27fSRussell King 	u8 fc_tech_electrical_intra_enclosure:1;
57ce0aa27fSRussell King 	u8 fc_tech_sn:1;
58ce0aa27fSRussell King 	u8 fc_tech_sl:1;
59ce0aa27fSRussell King 	u8 fc_tech_ll:1;
60ce0aa27fSRussell King 	u8 sfp_ct_active:1;
61ce0aa27fSRussell King 	u8 sfp_ct_passive:1;
62ce0aa27fSRussell King 	u8 unallocated_8_1:1;
63ce0aa27fSRussell King 	u8 unallocated_8_0:1;
64ce0aa27fSRussell King 
65ce0aa27fSRussell King 	u8 fc_media_tw:1;
66ce0aa27fSRussell King 	u8 fc_media_tp:1;
67ce0aa27fSRussell King 	u8 fc_media_mi:1;
68ce0aa27fSRussell King 	u8 fc_media_tv:1;
69ce0aa27fSRussell King 	u8 fc_media_m6:1;
70ce0aa27fSRussell King 	u8 fc_media_m5:1;
71ce0aa27fSRussell King 	u8 unallocated_9_1:1;
72ce0aa27fSRussell King 	u8 fc_media_sm:1;
73ce0aa27fSRussell King 
74ce0aa27fSRussell King 	u8 fc_speed_1200:1;
75ce0aa27fSRussell King 	u8 fc_speed_800:1;
76ce0aa27fSRussell King 	u8 fc_speed_1600:1;
77ce0aa27fSRussell King 	u8 fc_speed_400:1;
78ce0aa27fSRussell King 	u8 fc_speed_3200:1;
79ce0aa27fSRussell King 	u8 fc_speed_200:1;
80ce0aa27fSRussell King 	u8 unallocated_10_1:1;
81ce0aa27fSRussell King 	u8 fc_speed_100:1;
82ce0aa27fSRussell King #elif defined __LITTLE_ENDIAN_BITFIELD
83ce0aa27fSRussell King 	u8 if_1x_copper_passive:1;
84ce0aa27fSRussell King 	u8 if_1x_copper_active:1;
85ce0aa27fSRussell King 	u8 if_1x_lx:1;
86ce0aa27fSRussell King 	u8 if_1x_sx:1;
87ce0aa27fSRussell King 	u8 e10g_base_sr:1;
88ce0aa27fSRussell King 	u8 e10g_base_lr:1;
89ce0aa27fSRussell King 	u8 e10g_base_lrm:1;
90ce0aa27fSRussell King 	u8 e10g_base_er:1;
91ce0aa27fSRussell King 
92ce0aa27fSRussell King 	u8 sonet_oc3_short_reach:1;
93ce0aa27fSRussell King 	u8 sonet_oc3_smf_intermediate_reach:1;
94ce0aa27fSRussell King 	u8 sonet_oc3_smf_long_reach:1;
95ce0aa27fSRussell King 	u8 unallocated_5_3:1;
96ce0aa27fSRussell King 	u8 sonet_oc12_short_reach:1;
97ce0aa27fSRussell King 	u8 sonet_oc12_smf_intermediate_reach:1;
98ce0aa27fSRussell King 	u8 sonet_oc12_smf_long_reach:1;
99ce0aa27fSRussell King 	u8 unallocated_5_7:1;
100ce0aa27fSRussell King 
101ce0aa27fSRussell King 	u8 sonet_oc48_short_reach:1;
102ce0aa27fSRussell King 	u8 sonet_oc48_intermediate_reach:1;
103ce0aa27fSRussell King 	u8 sonet_oc48_long_reach:1;
104ce0aa27fSRussell King 	u8 sonet_reach_bit2:1;
105ce0aa27fSRussell King 	u8 sonet_reach_bit1:1;
106ce0aa27fSRussell King 	u8 sonet_oc192_short_reach:1;
107ce0aa27fSRussell King 	u8 escon_smf_1310_laser:1;
108ce0aa27fSRussell King 	u8 escon_mmf_1310_led:1;
109ce0aa27fSRussell King 
110ce0aa27fSRussell King 	u8 e1000_base_sx:1;
111ce0aa27fSRussell King 	u8 e1000_base_lx:1;
112ce0aa27fSRussell King 	u8 e1000_base_cx:1;
113ce0aa27fSRussell King 	u8 e1000_base_t:1;
114ce0aa27fSRussell King 	u8 e100_base_lx:1;
115ce0aa27fSRussell King 	u8 e100_base_fx:1;
116ce0aa27fSRussell King 	u8 e_base_bx10:1;
117ce0aa27fSRussell King 	u8 e_base_px:1;
118ce0aa27fSRussell King 
119ce0aa27fSRussell King 	u8 fc_tech_electrical_inter_enclosure:1;
120ce0aa27fSRussell King 	u8 fc_tech_lc:1;
121ce0aa27fSRussell King 	u8 fc_tech_sa:1;
122ce0aa27fSRussell King 	u8 fc_ll_m:1;
123ce0aa27fSRussell King 	u8 fc_ll_l:1;
124ce0aa27fSRussell King 	u8 fc_ll_i:1;
125ce0aa27fSRussell King 	u8 fc_ll_s:1;
126ce0aa27fSRussell King 	u8 fc_ll_v:1;
127ce0aa27fSRussell King 
128ce0aa27fSRussell King 	u8 unallocated_8_0:1;
129ce0aa27fSRussell King 	u8 unallocated_8_1:1;
130ce0aa27fSRussell King 	u8 sfp_ct_passive:1;
131ce0aa27fSRussell King 	u8 sfp_ct_active:1;
132ce0aa27fSRussell King 	u8 fc_tech_ll:1;
133ce0aa27fSRussell King 	u8 fc_tech_sl:1;
134ce0aa27fSRussell King 	u8 fc_tech_sn:1;
135ce0aa27fSRussell King 	u8 fc_tech_electrical_intra_enclosure:1;
136ce0aa27fSRussell King 
137ce0aa27fSRussell King 	u8 fc_media_sm:1;
138ce0aa27fSRussell King 	u8 unallocated_9_1:1;
139ce0aa27fSRussell King 	u8 fc_media_m5:1;
140ce0aa27fSRussell King 	u8 fc_media_m6:1;
141ce0aa27fSRussell King 	u8 fc_media_tv:1;
142ce0aa27fSRussell King 	u8 fc_media_mi:1;
143ce0aa27fSRussell King 	u8 fc_media_tp:1;
144ce0aa27fSRussell King 	u8 fc_media_tw:1;
145ce0aa27fSRussell King 
146ce0aa27fSRussell King 	u8 fc_speed_100:1;
147ce0aa27fSRussell King 	u8 unallocated_10_1:1;
148ce0aa27fSRussell King 	u8 fc_speed_200:1;
149ce0aa27fSRussell King 	u8 fc_speed_3200:1;
150ce0aa27fSRussell King 	u8 fc_speed_400:1;
151ce0aa27fSRussell King 	u8 fc_speed_1600:1;
152ce0aa27fSRussell King 	u8 fc_speed_800:1;
153ce0aa27fSRussell King 	u8 fc_speed_1200:1;
154ce0aa27fSRussell King #else
155ce0aa27fSRussell King #error Unknown Endian
156ce0aa27fSRussell King #endif
157ce0aa27fSRussell King 	u8 encoding;
158ce0aa27fSRussell King 	u8 br_nominal;
159ce0aa27fSRussell King 	u8 rate_id;
160ce0aa27fSRussell King 	u8 link_len[6];
161ce0aa27fSRussell King 	char vendor_name[16];
162ce0aa27fSRussell King 	u8 extended_cc;
163ce0aa27fSRussell King 	char vendor_oui[3];
164ce0aa27fSRussell King 	char vendor_pn[16];
165ce0aa27fSRussell King 	char vendor_rev[4];
166ce0aa27fSRussell King 	union {
167ce0aa27fSRussell King 		__be16 optical_wavelength;
168f10fcbcfSRussell King 		__be16 cable_compliance;
169f10fcbcfSRussell King 		struct {
170f10fcbcfSRussell King #if defined __BIG_ENDIAN_BITFIELD
171f10fcbcfSRussell King 			u8 reserved60_2:6;
172f10fcbcfSRussell King 			u8 fc_pi_4_app_h:1;
173f10fcbcfSRussell King 			u8 sff8431_app_e:1;
174f10fcbcfSRussell King 			u8 reserved61:8;
175f10fcbcfSRussell King #elif defined __LITTLE_ENDIAN_BITFIELD
176f10fcbcfSRussell King 			u8 sff8431_app_e:1;
177f10fcbcfSRussell King 			u8 fc_pi_4_app_h:1;
178f10fcbcfSRussell King 			u8 reserved60_2:6;
179f10fcbcfSRussell King 			u8 reserved61:8;
180f10fcbcfSRussell King #else
181f10fcbcfSRussell King #error Unknown Endian
182f10fcbcfSRussell King #endif
183f10fcbcfSRussell King 		} __packed passive;
184f10fcbcfSRussell King 		struct {
185f10fcbcfSRussell King #if defined __BIG_ENDIAN_BITFIELD
186f10fcbcfSRussell King 			u8 reserved60_4:4;
187f10fcbcfSRussell King 			u8 fc_pi_4_lim:1;
188f10fcbcfSRussell King 			u8 sff8431_lim:1;
189f10fcbcfSRussell King 			u8 fc_pi_4_app_h:1;
190f10fcbcfSRussell King 			u8 sff8431_app_e:1;
191f10fcbcfSRussell King 			u8 reserved61:8;
192f10fcbcfSRussell King #elif defined __LITTLE_ENDIAN_BITFIELD
193f10fcbcfSRussell King 			u8 sff8431_app_e:1;
194f10fcbcfSRussell King 			u8 fc_pi_4_app_h:1;
195f10fcbcfSRussell King 			u8 sff8431_lim:1;
196f10fcbcfSRussell King 			u8 fc_pi_4_lim:1;
197f10fcbcfSRussell King 			u8 reserved60_4:4;
198f10fcbcfSRussell King 			u8 reserved61:8;
199f10fcbcfSRussell King #else
200f10fcbcfSRussell King #error Unknown Endian
201f10fcbcfSRussell King #endif
202f10fcbcfSRussell King 		} __packed active;
2030a6fcd3fSRussell King 	} __packed;
204ce0aa27fSRussell King 	u8 reserved62;
205ce0aa27fSRussell King 	u8 cc_base;
2060a6fcd3fSRussell King } __packed;
207ce0aa27fSRussell King 
2080a6fcd3fSRussell King struct sfp_eeprom_ext {
209ce0aa27fSRussell King 	__be16 options;
210ce0aa27fSRussell King 	u8 br_max;
211ce0aa27fSRussell King 	u8 br_min;
212ce0aa27fSRussell King 	char vendor_sn[16];
213ce0aa27fSRussell King 	char datecode[8];
214ce0aa27fSRussell King 	u8 diagmon;
215ce0aa27fSRussell King 	u8 enhopts;
216ce0aa27fSRussell King 	u8 sff8472_compliance;
217ce0aa27fSRussell King 	u8 cc_ext;
2180a6fcd3fSRussell King } __packed;
219ce0aa27fSRussell King 
2200a6fcd3fSRussell King /**
2210a6fcd3fSRussell King  * struct sfp_eeprom_id - raw SFP module identification information
2220a6fcd3fSRussell King  * @base: base SFP module identification structure
2230a6fcd3fSRussell King  * @ext: extended SFP module identification structure
2240a6fcd3fSRussell King  *
2250a6fcd3fSRussell King  * See the SFF-8472 specification and related documents for the definition
2260a6fcd3fSRussell King  * of these structure members. This can be obtained from
22790230968SBaruch Siach  * https://www.snia.org/technology-communities/sff/specifications
2280a6fcd3fSRussell King  */
2290a6fcd3fSRussell King struct sfp_eeprom_id {
230ce0aa27fSRussell King 	struct sfp_eeprom_base base;
231ce0aa27fSRussell King 	struct sfp_eeprom_ext ext;
2320a6fcd3fSRussell King } __packed;
233ce0aa27fSRussell King 
2341323061aSAndrew Lunn struct sfp_diag {
2351323061aSAndrew Lunn 	__be16 temp_high_alarm;
2361323061aSAndrew Lunn 	__be16 temp_low_alarm;
2371323061aSAndrew Lunn 	__be16 temp_high_warn;
2381323061aSAndrew Lunn 	__be16 temp_low_warn;
2391323061aSAndrew Lunn 	__be16 volt_high_alarm;
2401323061aSAndrew Lunn 	__be16 volt_low_alarm;
2411323061aSAndrew Lunn 	__be16 volt_high_warn;
2421323061aSAndrew Lunn 	__be16 volt_low_warn;
2431323061aSAndrew Lunn 	__be16 bias_high_alarm;
2441323061aSAndrew Lunn 	__be16 bias_low_alarm;
2451323061aSAndrew Lunn 	__be16 bias_high_warn;
2461323061aSAndrew Lunn 	__be16 bias_low_warn;
2471323061aSAndrew Lunn 	__be16 txpwr_high_alarm;
2481323061aSAndrew Lunn 	__be16 txpwr_low_alarm;
2491323061aSAndrew Lunn 	__be16 txpwr_high_warn;
2501323061aSAndrew Lunn 	__be16 txpwr_low_warn;
2511323061aSAndrew Lunn 	__be16 rxpwr_high_alarm;
2521323061aSAndrew Lunn 	__be16 rxpwr_low_alarm;
2531323061aSAndrew Lunn 	__be16 rxpwr_high_warn;
2541323061aSAndrew Lunn 	__be16 rxpwr_low_warn;
2551323061aSAndrew Lunn 	__be16 laser_temp_high_alarm;
2561323061aSAndrew Lunn 	__be16 laser_temp_low_alarm;
2571323061aSAndrew Lunn 	__be16 laser_temp_high_warn;
2581323061aSAndrew Lunn 	__be16 laser_temp_low_warn;
2591323061aSAndrew Lunn 	__be16 tec_cur_high_alarm;
2601323061aSAndrew Lunn 	__be16 tec_cur_low_alarm;
2611323061aSAndrew Lunn 	__be16 tec_cur_high_warn;
2621323061aSAndrew Lunn 	__be16 tec_cur_low_warn;
2631323061aSAndrew Lunn 	__be32 cal_rxpwr4;
2641323061aSAndrew Lunn 	__be32 cal_rxpwr3;
2651323061aSAndrew Lunn 	__be32 cal_rxpwr2;
2661323061aSAndrew Lunn 	__be32 cal_rxpwr1;
2671323061aSAndrew Lunn 	__be32 cal_rxpwr0;
2681323061aSAndrew Lunn 	__be16 cal_txi_slope;
2691323061aSAndrew Lunn 	__be16 cal_txi_offset;
2701323061aSAndrew Lunn 	__be16 cal_txpwr_slope;
2711323061aSAndrew Lunn 	__be16 cal_txpwr_offset;
2721323061aSAndrew Lunn 	__be16 cal_t_slope;
2731323061aSAndrew Lunn 	__be16 cal_t_offset;
2741323061aSAndrew Lunn 	__be16 cal_v_slope;
2751323061aSAndrew Lunn 	__be16 cal_v_offset;
2761323061aSAndrew Lunn } __packed;
2771323061aSAndrew Lunn 
2780fbd26a9SRussell King /* SFF8024 defined constants */
2790fbd26a9SRussell King enum {
2800fbd26a9SRussell King 	SFF8024_ID_UNK			= 0x00,
2810fbd26a9SRussell King 	SFF8024_ID_SFF_8472		= 0x02,
2820fbd26a9SRussell King 	SFF8024_ID_SFP			= 0x03,
2830fbd26a9SRussell King 	SFF8024_ID_DWDM_SFP		= 0x0b,
2840fbd26a9SRussell King 	SFF8024_ID_QSFP_8438		= 0x0c,
2850fbd26a9SRussell King 	SFF8024_ID_QSFP_8436_8636	= 0x0d,
2860fbd26a9SRussell King 	SFF8024_ID_QSFP28_8636		= 0x11,
2870fbd26a9SRussell King 
2880fbd26a9SRussell King 	SFF8024_ENCODING_UNSPEC		= 0x00,
2890fbd26a9SRussell King 	SFF8024_ENCODING_8B10B		= 0x01,
2900fbd26a9SRussell King 	SFF8024_ENCODING_4B5B		= 0x02,
2910fbd26a9SRussell King 	SFF8024_ENCODING_NRZ		= 0x03,
2920fbd26a9SRussell King 	SFF8024_ENCODING_8472_MANCHESTER= 0x04,
2930fbd26a9SRussell King 	SFF8024_ENCODING_8472_SONET	= 0x05,
2940fbd26a9SRussell King 	SFF8024_ENCODING_8472_64B66B	= 0x06,
2950fbd26a9SRussell King 	SFF8024_ENCODING_8436_MANCHESTER= 0x06,
2960fbd26a9SRussell King 	SFF8024_ENCODING_8436_SONET	= 0x04,
2970fbd26a9SRussell King 	SFF8024_ENCODING_8436_64B66B	= 0x05,
2980fbd26a9SRussell King 	SFF8024_ENCODING_256B257B	= 0x07,
2990fbd26a9SRussell King 	SFF8024_ENCODING_PAM4		= 0x08,
3000fbd26a9SRussell King 
3010fbd26a9SRussell King 	SFF8024_CONNECTOR_UNSPEC	= 0x00,
3020fbd26a9SRussell King 	/* codes 01-05 not supportable on SFP, but some modules have single SC */
3030fbd26a9SRussell King 	SFF8024_CONNECTOR_SC		= 0x01,
3040fbd26a9SRussell King 	SFF8024_CONNECTOR_FIBERJACK	= 0x06,
3050fbd26a9SRussell King 	SFF8024_CONNECTOR_LC		= 0x07,
3060fbd26a9SRussell King 	SFF8024_CONNECTOR_MT_RJ		= 0x08,
3070fbd26a9SRussell King 	SFF8024_CONNECTOR_MU		= 0x09,
3080fbd26a9SRussell King 	SFF8024_CONNECTOR_SG		= 0x0a,
3090fbd26a9SRussell King 	SFF8024_CONNECTOR_OPTICAL_PIGTAIL= 0x0b,
3100fbd26a9SRussell King 	SFF8024_CONNECTOR_MPO_1X12	= 0x0c,
3110fbd26a9SRussell King 	SFF8024_CONNECTOR_MPO_2X16	= 0x0d,
3120fbd26a9SRussell King 	SFF8024_CONNECTOR_HSSDC_II	= 0x20,
3130fbd26a9SRussell King 	SFF8024_CONNECTOR_COPPER_PIGTAIL= 0x21,
3140fbd26a9SRussell King 	SFF8024_CONNECTOR_RJ45		= 0x22,
3150fbd26a9SRussell King 	SFF8024_CONNECTOR_NOSEPARATE	= 0x23,
3160fbd26a9SRussell King 	SFF8024_CONNECTOR_MXC_2X16	= 0x24,
3170fbd26a9SRussell King 
3180fbd26a9SRussell King 	SFF8024_ECC_UNSPEC		= 0x00,
3190fbd26a9SRussell King 	SFF8024_ECC_100G_25GAUI_C2M_AOC	= 0x01,
3200fbd26a9SRussell King 	SFF8024_ECC_100GBASE_SR4_25GBASE_SR = 0x02,
3210fbd26a9SRussell King 	SFF8024_ECC_100GBASE_LR4_25GBASE_LR = 0x03,
3220fbd26a9SRussell King 	SFF8024_ECC_100GBASE_ER4_25GBASE_ER = 0x04,
3230fbd26a9SRussell King 	SFF8024_ECC_100GBASE_SR10	= 0x05,
3240fbd26a9SRussell King 	SFF8024_ECC_100GBASE_CR4	= 0x0b,
3250fbd26a9SRussell King 	SFF8024_ECC_25GBASE_CR_S	= 0x0c,
3260fbd26a9SRussell King 	SFF8024_ECC_25GBASE_CR_N	= 0x0d,
3270fbd26a9SRussell King 	SFF8024_ECC_10GBASE_T_SFI	= 0x16,
3280fbd26a9SRussell King 	SFF8024_ECC_10GBASE_T_SR	= 0x1c,
3290fbd26a9SRussell King 	SFF8024_ECC_5GBASE_T		= 0x1d,
3300fbd26a9SRussell King 	SFF8024_ECC_2_5GBASE_T		= 0x1e,
3310fbd26a9SRussell King };
3320fbd26a9SRussell King 
333ce0aa27fSRussell King /* SFP EEPROM registers */
334ce0aa27fSRussell King enum {
33517dd3611SRussell King (Oracle) 	SFP_PHYS_ID			= 0,
336d83845d2SRussell King (Oracle) 
33717dd3611SRussell King (Oracle) 	SFP_PHYS_EXT_ID			= 1,
338d83845d2SRussell King (Oracle) 	SFP_PHYS_EXT_ID_SFP		= 0x04,
339d83845d2SRussell King (Oracle) 
34017dd3611SRussell King (Oracle) 	SFP_CONNECTOR			= 2,
34117dd3611SRussell King (Oracle) 	SFP_COMPLIANCE			= 3,
34217dd3611SRussell King (Oracle) 	SFP_ENCODING			= 11,
34317dd3611SRussell King (Oracle) 	SFP_BR_NOMINAL			= 12,
34417dd3611SRussell King (Oracle) 	SFP_RATE_ID			= 13,
345*fc082b39SRussell King (Oracle) 	SFF_RID_8079			= 0x01,
346*fc082b39SRussell King (Oracle) 	SFF_RID_8431_RX_ONLY		= 0x02,
347*fc082b39SRussell King (Oracle) 	SFF_RID_8431_TX_ONLY		= 0x04,
348*fc082b39SRussell King (Oracle) 	SFF_RID_8431			= 0x06,
349*fc082b39SRussell King (Oracle) 	SFF_RID_10G8G			= 0x0e,
350*fc082b39SRussell King (Oracle) 
35117dd3611SRussell King (Oracle) 	SFP_LINK_LEN_SM_KM		= 14,
35217dd3611SRussell King (Oracle) 	SFP_LINK_LEN_SM_100M		= 15,
35317dd3611SRussell King (Oracle) 	SFP_LINK_LEN_50UM_OM2_10M	= 16,
35417dd3611SRussell King (Oracle) 	SFP_LINK_LEN_62_5UM_OM1_10M	= 17,
35517dd3611SRussell King (Oracle) 	SFP_LINK_LEN_COPPER_1M		= 18,
35617dd3611SRussell King (Oracle) 	SFP_LINK_LEN_50UM_OM4_10M	= 18,
35717dd3611SRussell King (Oracle) 	SFP_LINK_LEN_50UM_OM3_10M	= 19,
35817dd3611SRussell King (Oracle) 	SFP_VENDOR_NAME			= 20,
35917dd3611SRussell King (Oracle) 	SFP_VENDOR_OUI			= 37,
36017dd3611SRussell King (Oracle) 	SFP_VENDOR_PN			= 40,
36117dd3611SRussell King (Oracle) 	SFP_VENDOR_REV			= 56,
36217dd3611SRussell King (Oracle) 	SFP_OPTICAL_WAVELENGTH_MSB	= 60,
36317dd3611SRussell King (Oracle) 	SFP_OPTICAL_WAVELENGTH_LSB	= 61,
36417dd3611SRussell King (Oracle) 	SFP_CABLE_SPEC			= 60,
36517dd3611SRussell King (Oracle) 	SFP_CC_BASE			= 63,
366ce0aa27fSRussell King 
367d83845d2SRussell King (Oracle) 	SFP_OPTIONS			= 64,	/* 2 bytes, MSB, LSB */
368ce0aa27fSRussell King 	SFP_OPTIONS_HIGH_POWER_LEVEL	= BIT(13),
369ce0aa27fSRussell King 	SFP_OPTIONS_PAGING_A2		= BIT(12),
370ce0aa27fSRussell King 	SFP_OPTIONS_RETIMER		= BIT(11),
371ce0aa27fSRussell King 	SFP_OPTIONS_COOLED_XCVR		= BIT(10),
372ce0aa27fSRussell King 	SFP_OPTIONS_POWER_DECL		= BIT(9),
373ce0aa27fSRussell King 	SFP_OPTIONS_RX_LINEAR_OUT	= BIT(8),
374ce0aa27fSRussell King 	SFP_OPTIONS_RX_DECISION_THRESH	= BIT(7),
375ce0aa27fSRussell King 	SFP_OPTIONS_TUNABLE_TX		= BIT(6),
376ce0aa27fSRussell King 	SFP_OPTIONS_RATE_SELECT		= BIT(5),
377ce0aa27fSRussell King 	SFP_OPTIONS_TX_DISABLE		= BIT(4),
378ce0aa27fSRussell King 	SFP_OPTIONS_TX_FAULT		= BIT(3),
379ce0aa27fSRussell King 	SFP_OPTIONS_LOS_INVERTED	= BIT(2),
380ce0aa27fSRussell King 	SFP_OPTIONS_LOS_NORMAL		= BIT(1),
381d83845d2SRussell King (Oracle) 
382d83845d2SRussell King (Oracle) 	SFP_BR_MAX			= 66,
383d83845d2SRussell King (Oracle) 	SFP_BR_MIN			= 67,
384d83845d2SRussell King (Oracle) 	SFP_VENDOR_SN			= 68,
385d83845d2SRussell King (Oracle) 	SFP_DATECODE			= 84,
386d83845d2SRussell King (Oracle) 
387d83845d2SRussell King (Oracle) 	SFP_DIAGMON			= 92,
388ce0aa27fSRussell King 	SFP_DIAGMON_DDM			= BIT(6),
389ce0aa27fSRussell King 	SFP_DIAGMON_INT_CAL		= BIT(5),
390ce0aa27fSRussell King 	SFP_DIAGMON_EXT_CAL		= BIT(4),
391ce0aa27fSRussell King 	SFP_DIAGMON_RXPWR_AVG		= BIT(3),
392ce0aa27fSRussell King 	SFP_DIAGMON_ADDRMODE		= BIT(2),
393d83845d2SRussell King (Oracle) 
394d83845d2SRussell King (Oracle) 	SFP_ENHOPTS			= 93,
395ce0aa27fSRussell King 	SFP_ENHOPTS_ALARMWARN		= BIT(7),
396ce0aa27fSRussell King 	SFP_ENHOPTS_SOFT_TX_DISABLE	= BIT(6),
397ce0aa27fSRussell King 	SFP_ENHOPTS_SOFT_TX_FAULT	= BIT(5),
398ce0aa27fSRussell King 	SFP_ENHOPTS_SOFT_RX_LOS		= BIT(4),
399ce0aa27fSRussell King 	SFP_ENHOPTS_SOFT_RATE_SELECT	= BIT(3),
400ce0aa27fSRussell King 	SFP_ENHOPTS_APP_SELECT_SFF8079	= BIT(2),
401ce0aa27fSRussell King 	SFP_ENHOPTS_SOFT_RATE_SFF8431	= BIT(1),
402d83845d2SRussell King (Oracle) 
403d83845d2SRussell King (Oracle) 	SFP_SFF8472_COMPLIANCE		= 94,
404ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_NONE	= 0x00,
405ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV9_3	= 0x01,
406ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV9_5	= 0x02,
407ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV10_2	= 0x03,
408ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV10_4	= 0x04,
409ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV11_0	= 0x05,
410ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV11_3	= 0x06,
411ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV11_4	= 0x07,
412ce0aa27fSRussell King 	SFP_SFF8472_COMPLIANCE_REV12_0	= 0x08,
413d83845d2SRussell King (Oracle) 
414d83845d2SRussell King (Oracle) 	SFP_CC_EXT			= 95,
415ce0aa27fSRussell King };
416ce0aa27fSRussell King 
417ce0aa27fSRussell King /* SFP Diagnostics */
418ce0aa27fSRussell King enum {
419ce0aa27fSRussell King 	/* Alarm and warnings stored MSB at lower address then LSB */
42017dd3611SRussell King (Oracle) 	SFP_TEMP_HIGH_ALARM		= 0,
42117dd3611SRussell King (Oracle) 	SFP_TEMP_LOW_ALARM		= 2,
42217dd3611SRussell King (Oracle) 	SFP_TEMP_HIGH_WARN		= 4,
42317dd3611SRussell King (Oracle) 	SFP_TEMP_LOW_WARN		= 6,
42417dd3611SRussell King (Oracle) 	SFP_VOLT_HIGH_ALARM		= 8,
42517dd3611SRussell King (Oracle) 	SFP_VOLT_LOW_ALARM		= 10,
42617dd3611SRussell King (Oracle) 	SFP_VOLT_HIGH_WARN		= 12,
42717dd3611SRussell King (Oracle) 	SFP_VOLT_LOW_WARN		= 14,
42817dd3611SRussell King (Oracle) 	SFP_BIAS_HIGH_ALARM		= 16,
42917dd3611SRussell King (Oracle) 	SFP_BIAS_LOW_ALARM		= 18,
43017dd3611SRussell King (Oracle) 	SFP_BIAS_HIGH_WARN		= 20,
43117dd3611SRussell King (Oracle) 	SFP_BIAS_LOW_WARN		= 22,
43217dd3611SRussell King (Oracle) 	SFP_TXPWR_HIGH_ALARM		= 24,
43317dd3611SRussell King (Oracle) 	SFP_TXPWR_LOW_ALARM		= 26,
43417dd3611SRussell King (Oracle) 	SFP_TXPWR_HIGH_WARN		= 28,
43517dd3611SRussell King (Oracle) 	SFP_TXPWR_LOW_WARN		= 30,
43617dd3611SRussell King (Oracle) 	SFP_RXPWR_HIGH_ALARM		= 32,
43717dd3611SRussell King (Oracle) 	SFP_RXPWR_LOW_ALARM		= 34,
43817dd3611SRussell King (Oracle) 	SFP_RXPWR_HIGH_WARN		= 36,
43917dd3611SRussell King (Oracle) 	SFP_RXPWR_LOW_WARN		= 38,
44017dd3611SRussell King (Oracle) 	SFP_LASER_TEMP_HIGH_ALARM	= 40,
44117dd3611SRussell King (Oracle) 	SFP_LASER_TEMP_LOW_ALARM	= 42,
44217dd3611SRussell King (Oracle) 	SFP_LASER_TEMP_HIGH_WARN	= 44,
44317dd3611SRussell King (Oracle) 	SFP_LASER_TEMP_LOW_WARN		= 46,
44417dd3611SRussell King (Oracle) 	SFP_TEC_CUR_HIGH_ALARM		= 48,
44517dd3611SRussell King (Oracle) 	SFP_TEC_CUR_LOW_ALARM		= 50,
44617dd3611SRussell King (Oracle) 	SFP_TEC_CUR_HIGH_WARN		= 52,
44717dd3611SRussell King (Oracle) 	SFP_TEC_CUR_LOW_WARN		= 54,
44817dd3611SRussell King (Oracle) 	SFP_CAL_RXPWR4			= 56,
44917dd3611SRussell King (Oracle) 	SFP_CAL_RXPWR3			= 60,
45017dd3611SRussell King (Oracle) 	SFP_CAL_RXPWR2			= 64,
45117dd3611SRussell King (Oracle) 	SFP_CAL_RXPWR1			= 68,
45217dd3611SRussell King (Oracle) 	SFP_CAL_RXPWR0			= 72,
45317dd3611SRussell King (Oracle) 	SFP_CAL_TXI_SLOPE		= 76,
45417dd3611SRussell King (Oracle) 	SFP_CAL_TXI_OFFSET		= 78,
45517dd3611SRussell King (Oracle) 	SFP_CAL_TXPWR_SLOPE		= 80,
45617dd3611SRussell King (Oracle) 	SFP_CAL_TXPWR_OFFSET		= 82,
45717dd3611SRussell King (Oracle) 	SFP_CAL_T_SLOPE			= 84,
45817dd3611SRussell King (Oracle) 	SFP_CAL_T_OFFSET		= 86,
45917dd3611SRussell King (Oracle) 	SFP_CAL_V_SLOPE			= 88,
46017dd3611SRussell King (Oracle) 	SFP_CAL_V_OFFSET		= 90,
46117dd3611SRussell King (Oracle) 	SFP_CHKSUM			= 95,
462ce0aa27fSRussell King 
46317dd3611SRussell King (Oracle) 	SFP_TEMP			= 96,
46417dd3611SRussell King (Oracle) 	SFP_VCC				= 98,
46517dd3611SRussell King (Oracle) 	SFP_TX_BIAS			= 100,
46617dd3611SRussell King (Oracle) 	SFP_TX_POWER			= 102,
46717dd3611SRussell King (Oracle) 	SFP_RX_POWER			= 104,
46817dd3611SRussell King (Oracle) 	SFP_LASER_TEMP			= 106,
46917dd3611SRussell King (Oracle) 	SFP_TEC_CUR			= 108,
470ce0aa27fSRussell King 
47117dd3611SRussell King (Oracle) 	SFP_STATUS			= 110,
472f3c9a666SRussell King 	SFP_STATUS_TX_DISABLE		= BIT(7),
473f3c9a666SRussell King 	SFP_STATUS_TX_DISABLE_FORCE	= BIT(6),
474*fc082b39SRussell King (Oracle) 	SFP_STATUS_RS0_SELECT		= BIT(3),
475f3c9a666SRussell King 	SFP_STATUS_TX_FAULT		= BIT(2),
476f3c9a666SRussell King 	SFP_STATUS_RX_LOS		= BIT(1),
47717dd3611SRussell King (Oracle) 	SFP_ALARM0			= 112,
4781323061aSAndrew Lunn 	SFP_ALARM0_TEMP_HIGH		= BIT(7),
4791323061aSAndrew Lunn 	SFP_ALARM0_TEMP_LOW		= BIT(6),
4801323061aSAndrew Lunn 	SFP_ALARM0_VCC_HIGH		= BIT(5),
4811323061aSAndrew Lunn 	SFP_ALARM0_VCC_LOW		= BIT(4),
4821323061aSAndrew Lunn 	SFP_ALARM0_TX_BIAS_HIGH		= BIT(3),
4831323061aSAndrew Lunn 	SFP_ALARM0_TX_BIAS_LOW		= BIT(2),
4841323061aSAndrew Lunn 	SFP_ALARM0_TXPWR_HIGH		= BIT(1),
4851323061aSAndrew Lunn 	SFP_ALARM0_TXPWR_LOW		= BIT(0),
4861323061aSAndrew Lunn 
48717dd3611SRussell King (Oracle) 	SFP_ALARM1			= 113,
4881323061aSAndrew Lunn 	SFP_ALARM1_RXPWR_HIGH		= BIT(7),
4891323061aSAndrew Lunn 	SFP_ALARM1_RXPWR_LOW		= BIT(6),
4901323061aSAndrew Lunn 
49117dd3611SRussell King (Oracle) 	SFP_WARN0			= 116,
4921323061aSAndrew Lunn 	SFP_WARN0_TEMP_HIGH		= BIT(7),
4931323061aSAndrew Lunn 	SFP_WARN0_TEMP_LOW		= BIT(6),
4941323061aSAndrew Lunn 	SFP_WARN0_VCC_HIGH		= BIT(5),
4951323061aSAndrew Lunn 	SFP_WARN0_VCC_LOW		= BIT(4),
4961323061aSAndrew Lunn 	SFP_WARN0_TX_BIAS_HIGH		= BIT(3),
4971323061aSAndrew Lunn 	SFP_WARN0_TX_BIAS_LOW		= BIT(2),
4981323061aSAndrew Lunn 	SFP_WARN0_TXPWR_HIGH		= BIT(1),
4991323061aSAndrew Lunn 	SFP_WARN0_TXPWR_LOW		= BIT(0),
5001323061aSAndrew Lunn 
50117dd3611SRussell King (Oracle) 	SFP_WARN1			= 117,
5021323061aSAndrew Lunn 	SFP_WARN1_RXPWR_HIGH		= BIT(7),
5031323061aSAndrew Lunn 	SFP_WARN1_RXPWR_LOW		= BIT(6),
504ce0aa27fSRussell King 
50517dd3611SRussell King (Oracle) 	SFP_EXT_STATUS			= 118,
506*fc082b39SRussell King (Oracle) 	SFP_EXT_STATUS_RS1_SELECT	= BIT(3),
50739890049SRussell King (Oracle) 	SFP_EXT_STATUS_PWRLVL_SELECT	= BIT(0),
50839890049SRussell King (Oracle) 
50917dd3611SRussell King (Oracle) 	SFP_VSL				= 120,
51017dd3611SRussell King (Oracle) 	SFP_PAGE			= 127,
511ce0aa27fSRussell King };
512ce0aa27fSRussell King 
513c19bb000SRussell King struct fwnode_handle;
514ce0aa27fSRussell King struct ethtool_eeprom;
515ce0aa27fSRussell King struct ethtool_modinfo;
516ce0aa27fSRussell King struct sfp_bus;
517ce0aa27fSRussell King 
5180a6fcd3fSRussell King /**
5190a6fcd3fSRussell King  * struct sfp_upstream_ops - upstream operations structure
520320587e6SRussell King  * @attach: called when the sfp socket driver is bound to the upstream
521320587e6SRussell King  *   (mandatory).
522320587e6SRussell King  * @detach: called when the sfp socket driver is unbound from the upstream
523320587e6SRussell King  *   (mandatory).
5240a6fcd3fSRussell King  * @module_insert: called after a module has been detected to determine
5250a6fcd3fSRussell King  *   whether the module is supported for the upstream device.
5260a6fcd3fSRussell King  * @module_remove: called after the module has been removed.
52774c551caSRussell King  * @module_start: called after the PHY probe step
52874c551caSRussell King  * @module_stop: called before the PHY is removed
5290a6fcd3fSRussell King  * @link_down: called when the link is non-operational for whatever
5300a6fcd3fSRussell King  *   reason.
5310a6fcd3fSRussell King  * @link_up: called when the link is operational.
5320a6fcd3fSRussell King  * @connect_phy: called when an I2C accessible PHY has been detected
5330a6fcd3fSRussell King  *   on the module.
5340a6fcd3fSRussell King  * @disconnect_phy: called when a module with an I2C accessible PHY has
5350a6fcd3fSRussell King  *   been removed.
5360a6fcd3fSRussell King  */
537ce0aa27fSRussell King struct sfp_upstream_ops {
538320587e6SRussell King 	void (*attach)(void *priv, struct sfp_bus *bus);
539320587e6SRussell King 	void (*detach)(void *priv, struct sfp_bus *bus);
5400a6fcd3fSRussell King 	int (*module_insert)(void *priv, const struct sfp_eeprom_id *id);
5410a6fcd3fSRussell King 	void (*module_remove)(void *priv);
54274c551caSRussell King 	int (*module_start)(void *priv);
54374c551caSRussell King 	void (*module_stop)(void *priv);
5440a6fcd3fSRussell King 	void (*link_down)(void *priv);
5450a6fcd3fSRussell King 	void (*link_up)(void *priv);
5460a6fcd3fSRussell King 	int (*connect_phy)(void *priv, struct phy_device *);
5470a6fcd3fSRussell King 	void (*disconnect_phy)(void *priv);
548ce0aa27fSRussell King };
549ce0aa27fSRussell King 
550ce0aa27fSRussell King #if IS_ENABLED(CONFIG_SFP)
551ce0aa27fSRussell King int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
552ce0aa27fSRussell King 		   unsigned long *support);
55352c95600SRussell King bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
554ce0aa27fSRussell King void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
555fd580c98SRussell King 		       unsigned long *support, unsigned long *interfaces);
556a9c79364SRussell King phy_interface_t sfp_select_interface(struct sfp_bus *bus,
557a9c79364SRussell King 				     unsigned long *link_modes);
558ce0aa27fSRussell King 
559ce0aa27fSRussell King int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo);
560ce0aa27fSRussell King int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
561ce0aa27fSRussell King 			  u8 *data);
562d740513fSAndrew Lunn int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
563d740513fSAndrew Lunn 				  const struct ethtool_module_eeprom *page,
564d740513fSAndrew Lunn 				  struct netlink_ext_ack *extack);
565ce0aa27fSRussell King void sfp_upstream_start(struct sfp_bus *bus);
566ce0aa27fSRussell King void sfp_upstream_stop(struct sfp_bus *bus);
567dc185822SRussell King (Oracle) void sfp_upstream_set_signal_rate(struct sfp_bus *bus, unsigned int rate_kbd);
568727b3668SRussell King void sfp_bus_put(struct sfp_bus *bus);
569a90ac762SRussell King (Oracle) struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
570727b3668SRussell King int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
571ce0aa27fSRussell King 			 const struct sfp_upstream_ops *ops);
572727b3668SRussell King void sfp_bus_del_upstream(struct sfp_bus *bus);
573ce0aa27fSRussell King #else
sfp_parse_port(struct sfp_bus * bus,const struct sfp_eeprom_id * id,unsigned long * support)574ce0aa27fSRussell King static inline int sfp_parse_port(struct sfp_bus *bus,
575ce0aa27fSRussell King 				 const struct sfp_eeprom_id *id,
576ce0aa27fSRussell King 				 unsigned long *support)
577ce0aa27fSRussell King {
578ce0aa27fSRussell King 	return PORT_OTHER;
579ce0aa27fSRussell King }
580ce0aa27fSRussell King 
sfp_may_have_phy(struct sfp_bus * bus,const struct sfp_eeprom_id * id)58152c95600SRussell King static inline bool sfp_may_have_phy(struct sfp_bus *bus,
58252c95600SRussell King 				    const struct sfp_eeprom_id *id)
58352c95600SRussell King {
58452c95600SRussell King 	return false;
58552c95600SRussell King }
58652c95600SRussell King 
sfp_parse_support(struct sfp_bus * bus,const struct sfp_eeprom_id * id,unsigned long * support,unsigned long * interfaces)587ce0aa27fSRussell King static inline void sfp_parse_support(struct sfp_bus *bus,
588ce0aa27fSRussell King 				     const struct sfp_eeprom_id *id,
589fd580c98SRussell King 				     unsigned long *support,
590fd580c98SRussell King 				     unsigned long *interfaces)
591ce0aa27fSRussell King {
592ce0aa27fSRussell King }
593ce0aa27fSRussell King 
sfp_select_interface(struct sfp_bus * bus,unsigned long * link_modes)594a9c79364SRussell King static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,
595a9c79364SRussell King 						   unsigned long *link_modes)
596a9c79364SRussell King {
597a9c79364SRussell King 	return PHY_INTERFACE_MODE_NA;
598a9c79364SRussell King }
599a9c79364SRussell King 
sfp_get_module_info(struct sfp_bus * bus,struct ethtool_modinfo * modinfo)600ce0aa27fSRussell King static inline int sfp_get_module_info(struct sfp_bus *bus,
601ce0aa27fSRussell King 				      struct ethtool_modinfo *modinfo)
602ce0aa27fSRussell King {
603ce0aa27fSRussell King 	return -EOPNOTSUPP;
604ce0aa27fSRussell King }
605ce0aa27fSRussell King 
sfp_get_module_eeprom(struct sfp_bus * bus,struct ethtool_eeprom * ee,u8 * data)606ce0aa27fSRussell King static inline int sfp_get_module_eeprom(struct sfp_bus *bus,
607ce0aa27fSRussell King 					struct ethtool_eeprom *ee, u8 *data)
608ce0aa27fSRussell King {
609ce0aa27fSRussell King 	return -EOPNOTSUPP;
610ce0aa27fSRussell King }
611ce0aa27fSRussell King 
sfp_get_module_eeprom_by_page(struct sfp_bus * bus,const struct ethtool_module_eeprom * page,struct netlink_ext_ack * extack)612d740513fSAndrew Lunn static inline int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
613d740513fSAndrew Lunn 						const struct ethtool_module_eeprom *page,
614d740513fSAndrew Lunn 						struct netlink_ext_ack *extack)
615d740513fSAndrew Lunn {
616d740513fSAndrew Lunn 	return -EOPNOTSUPP;
617d740513fSAndrew Lunn }
618d740513fSAndrew Lunn 
sfp_upstream_start(struct sfp_bus * bus)619ce0aa27fSRussell King static inline void sfp_upstream_start(struct sfp_bus *bus)
620ce0aa27fSRussell King {
621ce0aa27fSRussell King }
622ce0aa27fSRussell King 
sfp_upstream_stop(struct sfp_bus * bus)623ce0aa27fSRussell King static inline void sfp_upstream_stop(struct sfp_bus *bus)
624ce0aa27fSRussell King {
625ce0aa27fSRussell King }
626ce0aa27fSRussell King 
sfp_upstream_set_signal_rate(struct sfp_bus * bus,unsigned int rate_kbd)627dc185822SRussell King (Oracle) static inline void sfp_upstream_set_signal_rate(struct sfp_bus *bus,
628dc185822SRussell King (Oracle) 						unsigned int rate_kbd)
629dc185822SRussell King (Oracle) {
630dc185822SRussell King (Oracle) }
631dc185822SRussell King (Oracle) 
sfp_bus_put(struct sfp_bus * bus)632727b3668SRussell King static inline void sfp_bus_put(struct sfp_bus *bus)
633727b3668SRussell King {
634727b3668SRussell King }
635727b3668SRussell King 
636a90ac762SRussell King (Oracle) static inline struct sfp_bus *
sfp_bus_find_fwnode(const struct fwnode_handle * fwnode)637a90ac762SRussell King (Oracle) sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
638ce0aa27fSRussell King {
6392203cbf2SRussell King 	return NULL;
640ce0aa27fSRussell King }
641ce0aa27fSRussell King 
sfp_bus_add_upstream(struct sfp_bus * bus,void * upstream,const struct sfp_upstream_ops * ops)6426c086702SRussell King static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
643727b3668SRussell King 				       const struct sfp_upstream_ops *ops)
644727b3668SRussell King {
645727b3668SRussell King 	return 0;
646727b3668SRussell King }
647727b3668SRussell King 
sfp_bus_del_upstream(struct sfp_bus * bus)648727b3668SRussell King static inline void sfp_bus_del_upstream(struct sfp_bus *bus)
649ce0aa27fSRussell King {
650ce0aa27fSRussell King }
651ce0aa27fSRussell King #endif
652ce0aa27fSRussell King 
653ce0aa27fSRussell King #endif
654