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,
287e4f91936SDanielle Ratson SFF8024_ID_QSFP_DD = 0x18,
288e4f91936SDanielle Ratson SFF8024_ID_OSFP = 0x19,
289e4f91936SDanielle Ratson SFF8024_ID_DSFP = 0x1B,
290e4f91936SDanielle Ratson SFF8024_ID_QSFP_PLUS_CMIS = 0x1E,
291e4f91936SDanielle Ratson SFF8024_ID_SFP_DD_CMIS = 0x1F,
292e4f91936SDanielle Ratson SFF8024_ID_SFP_PLUS_CMIS = 0x20,
2930fbd26a9SRussell King
2940fbd26a9SRussell King SFF8024_ENCODING_UNSPEC = 0x00,
2950fbd26a9SRussell King SFF8024_ENCODING_8B10B = 0x01,
2960fbd26a9SRussell King SFF8024_ENCODING_4B5B = 0x02,
2970fbd26a9SRussell King SFF8024_ENCODING_NRZ = 0x03,
2980fbd26a9SRussell King SFF8024_ENCODING_8472_MANCHESTER= 0x04,
2990fbd26a9SRussell King SFF8024_ENCODING_8472_SONET = 0x05,
3000fbd26a9SRussell King SFF8024_ENCODING_8472_64B66B = 0x06,
3010fbd26a9SRussell King SFF8024_ENCODING_8436_MANCHESTER= 0x06,
3020fbd26a9SRussell King SFF8024_ENCODING_8436_SONET = 0x04,
3030fbd26a9SRussell King SFF8024_ENCODING_8436_64B66B = 0x05,
3040fbd26a9SRussell King SFF8024_ENCODING_256B257B = 0x07,
3050fbd26a9SRussell King SFF8024_ENCODING_PAM4 = 0x08,
3060fbd26a9SRussell King
3070fbd26a9SRussell King SFF8024_CONNECTOR_UNSPEC = 0x00,
3080fbd26a9SRussell King /* codes 01-05 not supportable on SFP, but some modules have single SC */
3090fbd26a9SRussell King SFF8024_CONNECTOR_SC = 0x01,
3100fbd26a9SRussell King SFF8024_CONNECTOR_FIBERJACK = 0x06,
3110fbd26a9SRussell King SFF8024_CONNECTOR_LC = 0x07,
3120fbd26a9SRussell King SFF8024_CONNECTOR_MT_RJ = 0x08,
3130fbd26a9SRussell King SFF8024_CONNECTOR_MU = 0x09,
3140fbd26a9SRussell King SFF8024_CONNECTOR_SG = 0x0a,
3150fbd26a9SRussell King SFF8024_CONNECTOR_OPTICAL_PIGTAIL= 0x0b,
3160fbd26a9SRussell King SFF8024_CONNECTOR_MPO_1X12 = 0x0c,
3170fbd26a9SRussell King SFF8024_CONNECTOR_MPO_2X16 = 0x0d,
3180fbd26a9SRussell King SFF8024_CONNECTOR_HSSDC_II = 0x20,
3190fbd26a9SRussell King SFF8024_CONNECTOR_COPPER_PIGTAIL= 0x21,
3200fbd26a9SRussell King SFF8024_CONNECTOR_RJ45 = 0x22,
3210fbd26a9SRussell King SFF8024_CONNECTOR_NOSEPARATE = 0x23,
3220fbd26a9SRussell King SFF8024_CONNECTOR_MXC_2X16 = 0x24,
3230fbd26a9SRussell King
3240fbd26a9SRussell King SFF8024_ECC_UNSPEC = 0x00,
3250fbd26a9SRussell King SFF8024_ECC_100G_25GAUI_C2M_AOC = 0x01,
3260fbd26a9SRussell King SFF8024_ECC_100GBASE_SR4_25GBASE_SR = 0x02,
3270fbd26a9SRussell King SFF8024_ECC_100GBASE_LR4_25GBASE_LR = 0x03,
3280fbd26a9SRussell King SFF8024_ECC_100GBASE_ER4_25GBASE_ER = 0x04,
3290fbd26a9SRussell King SFF8024_ECC_100GBASE_SR10 = 0x05,
3300fbd26a9SRussell King SFF8024_ECC_100GBASE_CR4 = 0x0b,
3310fbd26a9SRussell King SFF8024_ECC_25GBASE_CR_S = 0x0c,
3320fbd26a9SRussell King SFF8024_ECC_25GBASE_CR_N = 0x0d,
3330fbd26a9SRussell King SFF8024_ECC_10GBASE_T_SFI = 0x16,
3340fbd26a9SRussell King SFF8024_ECC_10GBASE_T_SR = 0x1c,
3350fbd26a9SRussell King SFF8024_ECC_5GBASE_T = 0x1d,
3360fbd26a9SRussell King SFF8024_ECC_2_5GBASE_T = 0x1e,
3370fbd26a9SRussell King };
3380fbd26a9SRussell King
339ce0aa27fSRussell King /* SFP EEPROM registers */
340ce0aa27fSRussell King enum {
34117dd3611SRussell King (Oracle) SFP_PHYS_ID = 0,
342d83845d2SRussell King (Oracle)
34317dd3611SRussell King (Oracle) SFP_PHYS_EXT_ID = 1,
344d83845d2SRussell King (Oracle) SFP_PHYS_EXT_ID_SFP = 0x04,
345d83845d2SRussell King (Oracle)
34617dd3611SRussell King (Oracle) SFP_CONNECTOR = 2,
34717dd3611SRussell King (Oracle) SFP_COMPLIANCE = 3,
34817dd3611SRussell King (Oracle) SFP_ENCODING = 11,
34917dd3611SRussell King (Oracle) SFP_BR_NOMINAL = 12,
35017dd3611SRussell King (Oracle) SFP_RATE_ID = 13,
351fc082b39SRussell King (Oracle) SFF_RID_8079 = 0x01,
352fc082b39SRussell King (Oracle) SFF_RID_8431_RX_ONLY = 0x02,
353fc082b39SRussell King (Oracle) SFF_RID_8431_TX_ONLY = 0x04,
354fc082b39SRussell King (Oracle) SFF_RID_8431 = 0x06,
355fc082b39SRussell King (Oracle) SFF_RID_10G8G = 0x0e,
356fc082b39SRussell King (Oracle)
35717dd3611SRussell King (Oracle) SFP_LINK_LEN_SM_KM = 14,
35817dd3611SRussell King (Oracle) SFP_LINK_LEN_SM_100M = 15,
35917dd3611SRussell King (Oracle) SFP_LINK_LEN_50UM_OM2_10M = 16,
36017dd3611SRussell King (Oracle) SFP_LINK_LEN_62_5UM_OM1_10M = 17,
36117dd3611SRussell King (Oracle) SFP_LINK_LEN_COPPER_1M = 18,
36217dd3611SRussell King (Oracle) SFP_LINK_LEN_50UM_OM4_10M = 18,
36317dd3611SRussell King (Oracle) SFP_LINK_LEN_50UM_OM3_10M = 19,
36417dd3611SRussell King (Oracle) SFP_VENDOR_NAME = 20,
36517dd3611SRussell King (Oracle) SFP_VENDOR_OUI = 37,
36617dd3611SRussell King (Oracle) SFP_VENDOR_PN = 40,
36717dd3611SRussell King (Oracle) SFP_VENDOR_REV = 56,
36817dd3611SRussell King (Oracle) SFP_OPTICAL_WAVELENGTH_MSB = 60,
36917dd3611SRussell King (Oracle) SFP_OPTICAL_WAVELENGTH_LSB = 61,
37017dd3611SRussell King (Oracle) SFP_CABLE_SPEC = 60,
37117dd3611SRussell King (Oracle) SFP_CC_BASE = 63,
372ce0aa27fSRussell King
373d83845d2SRussell King (Oracle) SFP_OPTIONS = 64, /* 2 bytes, MSB, LSB */
374ce0aa27fSRussell King SFP_OPTIONS_HIGH_POWER_LEVEL = BIT(13),
375ce0aa27fSRussell King SFP_OPTIONS_PAGING_A2 = BIT(12),
376ce0aa27fSRussell King SFP_OPTIONS_RETIMER = BIT(11),
377ce0aa27fSRussell King SFP_OPTIONS_COOLED_XCVR = BIT(10),
378ce0aa27fSRussell King SFP_OPTIONS_POWER_DECL = BIT(9),
379ce0aa27fSRussell King SFP_OPTIONS_RX_LINEAR_OUT = BIT(8),
380ce0aa27fSRussell King SFP_OPTIONS_RX_DECISION_THRESH = BIT(7),
381ce0aa27fSRussell King SFP_OPTIONS_TUNABLE_TX = BIT(6),
382ce0aa27fSRussell King SFP_OPTIONS_RATE_SELECT = BIT(5),
383ce0aa27fSRussell King SFP_OPTIONS_TX_DISABLE = BIT(4),
384ce0aa27fSRussell King SFP_OPTIONS_TX_FAULT = BIT(3),
385ce0aa27fSRussell King SFP_OPTIONS_LOS_INVERTED = BIT(2),
386ce0aa27fSRussell King SFP_OPTIONS_LOS_NORMAL = BIT(1),
387d83845d2SRussell King (Oracle)
388d83845d2SRussell King (Oracle) SFP_BR_MAX = 66,
389d83845d2SRussell King (Oracle) SFP_BR_MIN = 67,
390d83845d2SRussell King (Oracle) SFP_VENDOR_SN = 68,
391d83845d2SRussell King (Oracle) SFP_DATECODE = 84,
392d83845d2SRussell King (Oracle)
393d83845d2SRussell King (Oracle) SFP_DIAGMON = 92,
394ce0aa27fSRussell King SFP_DIAGMON_DDM = BIT(6),
395ce0aa27fSRussell King SFP_DIAGMON_INT_CAL = BIT(5),
396ce0aa27fSRussell King SFP_DIAGMON_EXT_CAL = BIT(4),
397ce0aa27fSRussell King SFP_DIAGMON_RXPWR_AVG = BIT(3),
398ce0aa27fSRussell King SFP_DIAGMON_ADDRMODE = BIT(2),
399d83845d2SRussell King (Oracle)
400d83845d2SRussell King (Oracle) SFP_ENHOPTS = 93,
401ce0aa27fSRussell King SFP_ENHOPTS_ALARMWARN = BIT(7),
402ce0aa27fSRussell King SFP_ENHOPTS_SOFT_TX_DISABLE = BIT(6),
403ce0aa27fSRussell King SFP_ENHOPTS_SOFT_TX_FAULT = BIT(5),
404ce0aa27fSRussell King SFP_ENHOPTS_SOFT_RX_LOS = BIT(4),
405ce0aa27fSRussell King SFP_ENHOPTS_SOFT_RATE_SELECT = BIT(3),
406ce0aa27fSRussell King SFP_ENHOPTS_APP_SELECT_SFF8079 = BIT(2),
407ce0aa27fSRussell King SFP_ENHOPTS_SOFT_RATE_SFF8431 = BIT(1),
408d83845d2SRussell King (Oracle)
409d83845d2SRussell King (Oracle) SFP_SFF8472_COMPLIANCE = 94,
410ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_NONE = 0x00,
411ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV9_3 = 0x01,
412ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV9_5 = 0x02,
413ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV10_2 = 0x03,
414ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV10_4 = 0x04,
415ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV11_0 = 0x05,
416ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV11_3 = 0x06,
417ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV11_4 = 0x07,
418ce0aa27fSRussell King SFP_SFF8472_COMPLIANCE_REV12_0 = 0x08,
419d83845d2SRussell King (Oracle)
420d83845d2SRussell King (Oracle) SFP_CC_EXT = 95,
421ce0aa27fSRussell King };
422ce0aa27fSRussell King
423ce0aa27fSRussell King /* SFP Diagnostics */
424ce0aa27fSRussell King enum {
425ce0aa27fSRussell King /* Alarm and warnings stored MSB at lower address then LSB */
42617dd3611SRussell King (Oracle) SFP_TEMP_HIGH_ALARM = 0,
42717dd3611SRussell King (Oracle) SFP_TEMP_LOW_ALARM = 2,
42817dd3611SRussell King (Oracle) SFP_TEMP_HIGH_WARN = 4,
42917dd3611SRussell King (Oracle) SFP_TEMP_LOW_WARN = 6,
43017dd3611SRussell King (Oracle) SFP_VOLT_HIGH_ALARM = 8,
43117dd3611SRussell King (Oracle) SFP_VOLT_LOW_ALARM = 10,
43217dd3611SRussell King (Oracle) SFP_VOLT_HIGH_WARN = 12,
43317dd3611SRussell King (Oracle) SFP_VOLT_LOW_WARN = 14,
43417dd3611SRussell King (Oracle) SFP_BIAS_HIGH_ALARM = 16,
43517dd3611SRussell King (Oracle) SFP_BIAS_LOW_ALARM = 18,
43617dd3611SRussell King (Oracle) SFP_BIAS_HIGH_WARN = 20,
43717dd3611SRussell King (Oracle) SFP_BIAS_LOW_WARN = 22,
43817dd3611SRussell King (Oracle) SFP_TXPWR_HIGH_ALARM = 24,
43917dd3611SRussell King (Oracle) SFP_TXPWR_LOW_ALARM = 26,
44017dd3611SRussell King (Oracle) SFP_TXPWR_HIGH_WARN = 28,
44117dd3611SRussell King (Oracle) SFP_TXPWR_LOW_WARN = 30,
44217dd3611SRussell King (Oracle) SFP_RXPWR_HIGH_ALARM = 32,
44317dd3611SRussell King (Oracle) SFP_RXPWR_LOW_ALARM = 34,
44417dd3611SRussell King (Oracle) SFP_RXPWR_HIGH_WARN = 36,
44517dd3611SRussell King (Oracle) SFP_RXPWR_LOW_WARN = 38,
44617dd3611SRussell King (Oracle) SFP_LASER_TEMP_HIGH_ALARM = 40,
44717dd3611SRussell King (Oracle) SFP_LASER_TEMP_LOW_ALARM = 42,
44817dd3611SRussell King (Oracle) SFP_LASER_TEMP_HIGH_WARN = 44,
44917dd3611SRussell King (Oracle) SFP_LASER_TEMP_LOW_WARN = 46,
45017dd3611SRussell King (Oracle) SFP_TEC_CUR_HIGH_ALARM = 48,
45117dd3611SRussell King (Oracle) SFP_TEC_CUR_LOW_ALARM = 50,
45217dd3611SRussell King (Oracle) SFP_TEC_CUR_HIGH_WARN = 52,
45317dd3611SRussell King (Oracle) SFP_TEC_CUR_LOW_WARN = 54,
45417dd3611SRussell King (Oracle) SFP_CAL_RXPWR4 = 56,
45517dd3611SRussell King (Oracle) SFP_CAL_RXPWR3 = 60,
45617dd3611SRussell King (Oracle) SFP_CAL_RXPWR2 = 64,
45717dd3611SRussell King (Oracle) SFP_CAL_RXPWR1 = 68,
45817dd3611SRussell King (Oracle) SFP_CAL_RXPWR0 = 72,
45917dd3611SRussell King (Oracle) SFP_CAL_TXI_SLOPE = 76,
46017dd3611SRussell King (Oracle) SFP_CAL_TXI_OFFSET = 78,
46117dd3611SRussell King (Oracle) SFP_CAL_TXPWR_SLOPE = 80,
46217dd3611SRussell King (Oracle) SFP_CAL_TXPWR_OFFSET = 82,
46317dd3611SRussell King (Oracle) SFP_CAL_T_SLOPE = 84,
46417dd3611SRussell King (Oracle) SFP_CAL_T_OFFSET = 86,
46517dd3611SRussell King (Oracle) SFP_CAL_V_SLOPE = 88,
46617dd3611SRussell King (Oracle) SFP_CAL_V_OFFSET = 90,
46717dd3611SRussell King (Oracle) SFP_CHKSUM = 95,
468ce0aa27fSRussell King
46917dd3611SRussell King (Oracle) SFP_TEMP = 96,
47017dd3611SRussell King (Oracle) SFP_VCC = 98,
47117dd3611SRussell King (Oracle) SFP_TX_BIAS = 100,
47217dd3611SRussell King (Oracle) SFP_TX_POWER = 102,
47317dd3611SRussell King (Oracle) SFP_RX_POWER = 104,
47417dd3611SRussell King (Oracle) SFP_LASER_TEMP = 106,
47517dd3611SRussell King (Oracle) SFP_TEC_CUR = 108,
476ce0aa27fSRussell King
47717dd3611SRussell King (Oracle) SFP_STATUS = 110,
478f3c9a666SRussell King SFP_STATUS_TX_DISABLE = BIT(7),
479f3c9a666SRussell King SFP_STATUS_TX_DISABLE_FORCE = BIT(6),
480fc082b39SRussell King (Oracle) SFP_STATUS_RS0_SELECT = BIT(3),
481f3c9a666SRussell King SFP_STATUS_TX_FAULT = BIT(2),
482f3c9a666SRussell King SFP_STATUS_RX_LOS = BIT(1),
48317dd3611SRussell King (Oracle) SFP_ALARM0 = 112,
4841323061aSAndrew Lunn SFP_ALARM0_TEMP_HIGH = BIT(7),
4851323061aSAndrew Lunn SFP_ALARM0_TEMP_LOW = BIT(6),
4861323061aSAndrew Lunn SFP_ALARM0_VCC_HIGH = BIT(5),
4871323061aSAndrew Lunn SFP_ALARM0_VCC_LOW = BIT(4),
4881323061aSAndrew Lunn SFP_ALARM0_TX_BIAS_HIGH = BIT(3),
4891323061aSAndrew Lunn SFP_ALARM0_TX_BIAS_LOW = BIT(2),
4901323061aSAndrew Lunn SFP_ALARM0_TXPWR_HIGH = BIT(1),
4911323061aSAndrew Lunn SFP_ALARM0_TXPWR_LOW = BIT(0),
4921323061aSAndrew Lunn
49317dd3611SRussell King (Oracle) SFP_ALARM1 = 113,
4941323061aSAndrew Lunn SFP_ALARM1_RXPWR_HIGH = BIT(7),
4951323061aSAndrew Lunn SFP_ALARM1_RXPWR_LOW = BIT(6),
4961323061aSAndrew Lunn
49717dd3611SRussell King (Oracle) SFP_WARN0 = 116,
4981323061aSAndrew Lunn SFP_WARN0_TEMP_HIGH = BIT(7),
4991323061aSAndrew Lunn SFP_WARN0_TEMP_LOW = BIT(6),
5001323061aSAndrew Lunn SFP_WARN0_VCC_HIGH = BIT(5),
5011323061aSAndrew Lunn SFP_WARN0_VCC_LOW = BIT(4),
5021323061aSAndrew Lunn SFP_WARN0_TX_BIAS_HIGH = BIT(3),
5031323061aSAndrew Lunn SFP_WARN0_TX_BIAS_LOW = BIT(2),
5041323061aSAndrew Lunn SFP_WARN0_TXPWR_HIGH = BIT(1),
5051323061aSAndrew Lunn SFP_WARN0_TXPWR_LOW = BIT(0),
5061323061aSAndrew Lunn
50717dd3611SRussell King (Oracle) SFP_WARN1 = 117,
5081323061aSAndrew Lunn SFP_WARN1_RXPWR_HIGH = BIT(7),
5091323061aSAndrew Lunn SFP_WARN1_RXPWR_LOW = BIT(6),
510ce0aa27fSRussell King
51117dd3611SRussell King (Oracle) SFP_EXT_STATUS = 118,
512fc082b39SRussell King (Oracle) SFP_EXT_STATUS_RS1_SELECT = BIT(3),
51339890049SRussell King (Oracle) SFP_EXT_STATUS_PWRLVL_SELECT = BIT(0),
51439890049SRussell King (Oracle)
51517dd3611SRussell King (Oracle) SFP_VSL = 120,
51617dd3611SRussell King (Oracle) SFP_PAGE = 127,
517ce0aa27fSRussell King };
518ce0aa27fSRussell King
519c19bb000SRussell King struct fwnode_handle;
520ce0aa27fSRussell King struct ethtool_eeprom;
521ce0aa27fSRussell King struct ethtool_modinfo;
522ce0aa27fSRussell King struct sfp_bus;
523ce0aa27fSRussell King
5240a6fcd3fSRussell King /**
5250a6fcd3fSRussell King * struct sfp_upstream_ops - upstream operations structure
526320587e6SRussell King * @attach: called when the sfp socket driver is bound to the upstream
527320587e6SRussell King * (mandatory).
528320587e6SRussell King * @detach: called when the sfp socket driver is unbound from the upstream
529320587e6SRussell King * (mandatory).
5300a6fcd3fSRussell King * @module_insert: called after a module has been detected to determine
5310a6fcd3fSRussell King * whether the module is supported for the upstream device.
5320a6fcd3fSRussell King * @module_remove: called after the module has been removed.
53374c551caSRussell King * @module_start: called after the PHY probe step
53474c551caSRussell King * @module_stop: called before the PHY is removed
5350a6fcd3fSRussell King * @link_down: called when the link is non-operational for whatever
5360a6fcd3fSRussell King * reason.
5370a6fcd3fSRussell King * @link_up: called when the link is operational.
5380a6fcd3fSRussell King * @connect_phy: called when an I2C accessible PHY has been detected
5390a6fcd3fSRussell King * on the module.
5400a6fcd3fSRussell King * @disconnect_phy: called when a module with an I2C accessible PHY has
5410a6fcd3fSRussell King * been removed.
5420a6fcd3fSRussell King */
543ce0aa27fSRussell King struct sfp_upstream_ops {
544320587e6SRussell King void (*attach)(void *priv, struct sfp_bus *bus);
545320587e6SRussell King void (*detach)(void *priv, struct sfp_bus *bus);
5460a6fcd3fSRussell King int (*module_insert)(void *priv, const struct sfp_eeprom_id *id);
5470a6fcd3fSRussell King void (*module_remove)(void *priv);
54874c551caSRussell King int (*module_start)(void *priv);
54974c551caSRussell King void (*module_stop)(void *priv);
5500a6fcd3fSRussell King void (*link_down)(void *priv);
5510a6fcd3fSRussell King void (*link_up)(void *priv);
5520a6fcd3fSRussell King int (*connect_phy)(void *priv, struct phy_device *);
5534d76f115SMaxime Chevallier void (*disconnect_phy)(void *priv, struct phy_device *);
554ce0aa27fSRussell King };
555ce0aa27fSRussell King
556ce0aa27fSRussell King #if IS_ENABLED(CONFIG_SFP)
557ce0aa27fSRussell King int sfp_parse_port(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
558ce0aa27fSRussell King unsigned long *support);
55952c95600SRussell King bool sfp_may_have_phy(struct sfp_bus *bus, const struct sfp_eeprom_id *id);
560ce0aa27fSRussell King void sfp_parse_support(struct sfp_bus *bus, const struct sfp_eeprom_id *id,
561fd580c98SRussell King unsigned long *support, unsigned long *interfaces);
562a9c79364SRussell King phy_interface_t sfp_select_interface(struct sfp_bus *bus,
5635cd9fac3SRussell King (Oracle) const unsigned long *link_modes);
564ce0aa27fSRussell King
565ce0aa27fSRussell King int sfp_get_module_info(struct sfp_bus *bus, struct ethtool_modinfo *modinfo);
566ce0aa27fSRussell King int sfp_get_module_eeprom(struct sfp_bus *bus, struct ethtool_eeprom *ee,
567ce0aa27fSRussell King u8 *data);
568d740513fSAndrew Lunn int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
569d740513fSAndrew Lunn const struct ethtool_module_eeprom *page,
570d740513fSAndrew Lunn struct netlink_ext_ack *extack);
571ce0aa27fSRussell King void sfp_upstream_start(struct sfp_bus *bus);
572ce0aa27fSRussell King void sfp_upstream_stop(struct sfp_bus *bus);
573dc185822SRussell King (Oracle) void sfp_upstream_set_signal_rate(struct sfp_bus *bus, unsigned int rate_kbd);
574727b3668SRussell King void sfp_bus_put(struct sfp_bus *bus);
575a90ac762SRussell King (Oracle) struct sfp_bus *sfp_bus_find_fwnode(const struct fwnode_handle *fwnode);
576727b3668SRussell King int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
577ce0aa27fSRussell King const struct sfp_upstream_ops *ops);
578727b3668SRussell King void sfp_bus_del_upstream(struct sfp_bus *bus);
579*0a2f7de0SMaxime Chevallier const char *sfp_get_name(struct sfp_bus *bus);
580ce0aa27fSRussell King #else
sfp_parse_port(struct sfp_bus * bus,const struct sfp_eeprom_id * id,unsigned long * support)581ce0aa27fSRussell King static inline int sfp_parse_port(struct sfp_bus *bus,
582ce0aa27fSRussell King const struct sfp_eeprom_id *id,
583ce0aa27fSRussell King unsigned long *support)
584ce0aa27fSRussell King {
585ce0aa27fSRussell King return PORT_OTHER;
586ce0aa27fSRussell King }
587ce0aa27fSRussell King
sfp_may_have_phy(struct sfp_bus * bus,const struct sfp_eeprom_id * id)58852c95600SRussell King static inline bool sfp_may_have_phy(struct sfp_bus *bus,
58952c95600SRussell King const struct sfp_eeprom_id *id)
59052c95600SRussell King {
59152c95600SRussell King return false;
59252c95600SRussell King }
59352c95600SRussell King
sfp_parse_support(struct sfp_bus * bus,const struct sfp_eeprom_id * id,unsigned long * support,unsigned long * interfaces)594ce0aa27fSRussell King static inline void sfp_parse_support(struct sfp_bus *bus,
595ce0aa27fSRussell King const struct sfp_eeprom_id *id,
596fd580c98SRussell King unsigned long *support,
597fd580c98SRussell King unsigned long *interfaces)
598ce0aa27fSRussell King {
599ce0aa27fSRussell King }
600ce0aa27fSRussell King
sfp_select_interface(struct sfp_bus * bus,const unsigned long * link_modes)601a9c79364SRussell King static inline phy_interface_t sfp_select_interface(struct sfp_bus *bus,
6025cd9fac3SRussell King (Oracle) const unsigned long *link_modes)
603a9c79364SRussell King {
604a9c79364SRussell King return PHY_INTERFACE_MODE_NA;
605a9c79364SRussell King }
606a9c79364SRussell King
sfp_get_module_info(struct sfp_bus * bus,struct ethtool_modinfo * modinfo)607ce0aa27fSRussell King static inline int sfp_get_module_info(struct sfp_bus *bus,
608ce0aa27fSRussell King struct ethtool_modinfo *modinfo)
609ce0aa27fSRussell King {
610ce0aa27fSRussell King return -EOPNOTSUPP;
611ce0aa27fSRussell King }
612ce0aa27fSRussell King
sfp_get_module_eeprom(struct sfp_bus * bus,struct ethtool_eeprom * ee,u8 * data)613ce0aa27fSRussell King static inline int sfp_get_module_eeprom(struct sfp_bus *bus,
614ce0aa27fSRussell King struct ethtool_eeprom *ee, u8 *data)
615ce0aa27fSRussell King {
616ce0aa27fSRussell King return -EOPNOTSUPP;
617ce0aa27fSRussell King }
618ce0aa27fSRussell King
sfp_get_module_eeprom_by_page(struct sfp_bus * bus,const struct ethtool_module_eeprom * page,struct netlink_ext_ack * extack)619d740513fSAndrew Lunn static inline int sfp_get_module_eeprom_by_page(struct sfp_bus *bus,
620d740513fSAndrew Lunn const struct ethtool_module_eeprom *page,
621d740513fSAndrew Lunn struct netlink_ext_ack *extack)
622d740513fSAndrew Lunn {
623d740513fSAndrew Lunn return -EOPNOTSUPP;
624d740513fSAndrew Lunn }
625d740513fSAndrew Lunn
sfp_upstream_start(struct sfp_bus * bus)626ce0aa27fSRussell King static inline void sfp_upstream_start(struct sfp_bus *bus)
627ce0aa27fSRussell King {
628ce0aa27fSRussell King }
629ce0aa27fSRussell King
sfp_upstream_stop(struct sfp_bus * bus)630ce0aa27fSRussell King static inline void sfp_upstream_stop(struct sfp_bus *bus)
631ce0aa27fSRussell King {
632ce0aa27fSRussell King }
633ce0aa27fSRussell King
sfp_upstream_set_signal_rate(struct sfp_bus * bus,unsigned int rate_kbd)634dc185822SRussell King (Oracle) static inline void sfp_upstream_set_signal_rate(struct sfp_bus *bus,
635dc185822SRussell King (Oracle) unsigned int rate_kbd)
636dc185822SRussell King (Oracle) {
637dc185822SRussell King (Oracle) }
638dc185822SRussell King (Oracle)
sfp_bus_put(struct sfp_bus * bus)639727b3668SRussell King static inline void sfp_bus_put(struct sfp_bus *bus)
640727b3668SRussell King {
641727b3668SRussell King }
642727b3668SRussell King
643a90ac762SRussell King (Oracle) static inline struct sfp_bus *
sfp_bus_find_fwnode(const struct fwnode_handle * fwnode)644a90ac762SRussell King (Oracle) sfp_bus_find_fwnode(const struct fwnode_handle *fwnode)
645ce0aa27fSRussell King {
6462203cbf2SRussell King return NULL;
647ce0aa27fSRussell King }
648ce0aa27fSRussell King
sfp_bus_add_upstream(struct sfp_bus * bus,void * upstream,const struct sfp_upstream_ops * ops)6496c086702SRussell King static inline int sfp_bus_add_upstream(struct sfp_bus *bus, void *upstream,
650727b3668SRussell King const struct sfp_upstream_ops *ops)
651727b3668SRussell King {
652727b3668SRussell King return 0;
653727b3668SRussell King }
654727b3668SRussell King
sfp_bus_del_upstream(struct sfp_bus * bus)655727b3668SRussell King static inline void sfp_bus_del_upstream(struct sfp_bus *bus)
656ce0aa27fSRussell King {
657ce0aa27fSRussell King }
658*0a2f7de0SMaxime Chevallier
sfp_get_name(struct sfp_bus * bus)659*0a2f7de0SMaxime Chevallier static inline const char *sfp_get_name(struct sfp_bus *bus)
660*0a2f7de0SMaxime Chevallier {
661*0a2f7de0SMaxime Chevallier return NULL;
662*0a2f7de0SMaxime Chevallier }
663ce0aa27fSRussell King #endif
664ce0aa27fSRussell King
665ce0aa27fSRussell King #endif
666