Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-src
Path: blob/main/sys/net/cmis.h
266460 views
1
/*-
2
* Copyright (c) 2026 Netflix Inc.
3
*
4
* SPDX-License-Identifier: BSD-2-Clause
5
*/
6
7
/*
8
* The following set of constants are from the OIF Common Management
9
* Interface Specification (CMIS) revision 5.3, September 2024.
10
*
11
* CMIS defines a 256-byte addressable memory with lower (0-127) and
12
* upper (128-255) regions. Lower memory is always accessible.
13
* Upper memory is paged via byte 127 (page select) and byte 126
14
* (bank select).
15
*
16
* All values are read across an I2C bus at address 0xA0.
17
*/
18
19
#ifndef _NET_CMIS_H_
20
#define _NET_CMIS_H_
21
22
#define CMIS_BASE 0xA0 /* Base I2C address for all requests */
23
24
/* CMIS Module Types (SFF-8024 Identifier, byte 0) */
25
#define CMIS_ID_QSFP_DD 0x18 /* QSFP-DD */
26
#define CMIS_ID_QSFP8X 0x19 /* QSFP 8X (OSFP) */
27
#define CMIS_ID_SFP_DD 0x1A /* SFP-DD */
28
#define CMIS_ID_DSFP 0x1B /* DSFP */
29
#define CMIS_ID_QSFP_CMIS 0x1E /* QSFP+ with CMIS */
30
31
/* Table 8-4: Lower Memory Map (bytes 0x00-0x7F) */
32
enum {
33
/* Table 8-5: Management Characteristics (bytes 0-2) */
34
CMIS_ID = 0, /* SFF-8024 Identifier */
35
CMIS_REV = 1, /* CMIS revision (major.minor) */
36
CMIS_MODULE_TYPE = 2, /* Memory model, config options */
37
38
/* Table 8-6: Global Status (byte 3) */
39
CMIS_MODULE_STATE = 3, /* Module state, interrupt status */
40
41
/* Table 8-8: Flags Summary (bytes 4-7) */
42
CMIS_FLAGS_BANK0 = 4, /* Flags summary, bank 0 */
43
CMIS_FLAGS_BANK1 = 5, /* Flags summary, bank 1 */
44
CMIS_FLAGS_BANK2 = 6, /* Flags summary, bank 2 */
45
CMIS_FLAGS_BANK3 = 7, /* Flags summary, bank 3 */
46
47
/* Table 8-9: Module-Level Flags (bytes 8-13) */
48
CMIS_MOD_FLAGS_START = 8, /* Module firmware/state flags */
49
CMIS_MOD_FLAGS_TEMP_VCC = 9, /* Temp/VCC alarm/warning flags */
50
CMIS_MOD_FLAGS_AUX = 10, /* Aux monitor alarm/warning flags */
51
CMIS_MOD_FLAGS_CUSTOM = 11, /* Custom/Aux3 monitor flags */
52
CMIS_MOD_FLAGS_RSVD = 12, /* Reserved */
53
CMIS_MOD_FLAGS_VENDOR = 13, /* Custom module-level flags */
54
55
/* Table 8-10: Module-Level Monitor Values (bytes 14-25) */
56
CMIS_TEMP = 14, /* S16 Temperature (1/256 deg C) */
57
CMIS_VCC = 16, /* U16 Supply Voltage (100 uV) */
58
CMIS_AUX1 = 18, /* S16 Aux1 Monitor */
59
CMIS_AUX2 = 20, /* S16 Aux2 Monitor */
60
CMIS_AUX3 = 22, /* S16 Aux3 Monitor */
61
CMIS_CUSTOM_MON = 24, /* S16/U16 Custom Monitor */
62
63
/* Table 8-11: Module Global Controls (bytes 26-30) */
64
CMIS_MOD_CTRL = 26, /* Global control bits */
65
CMIS_MOD_CTRL2 = 27, /* Global control bits (cont.) */
66
CMIS_MOD_CTRL3 = 28, /* Global control bits (cont.) */
67
CMIS_MOD_CTRL4 = 29, /* Global control bits (cont.) */
68
CMIS_MOD_CTRL5 = 30, /* Global control bits (cont.) */
69
70
/* Table 8-12: Module Level Masks (bytes 31-36) */
71
CMIS_MOD_MASKS_START = 31, /* Module-level masks start */
72
CMIS_MOD_MASKS_END = 36, /* Module-level masks end */
73
74
/* Table 8-13: CDB Command Status (bytes 37-38) */
75
CMIS_CDB_STATUS1 = 37, /* CDB instance 1 status */
76
CMIS_CDB_STATUS2 = 38, /* CDB instance 2 status */
77
78
/* Table 8-15: Module Active Firmware Version (bytes 39-40) */
79
CMIS_FW_VER_MAJOR = 39, /* Active firmware major version */
80
CMIS_FW_VER_MINOR = 40, /* Active firmware minor version */
81
82
/* Table 8-16: Fault Information (byte 41) */
83
CMIS_FAULT_CAUSE = 41, /* Fault cause for ModuleFault */
84
85
/* Table 8-17: Miscellaneous Status (bytes 42-45) */
86
CMIS_MISC_STATUS_START = 42, /* Password status, etc. */
87
CMIS_MISC_STATUS_END = 45,
88
89
/* Table 8-18: Extended Module Information (bytes 56-63) */
90
CMIS_EXT_MOD_INFO_START = 56,
91
CMIS_EXT_MOD_INFO_END = 63,
92
93
/* Table 8-21: Media Type (byte 85) */
94
CMIS_MEDIA_TYPE = 85, /* MediaType encoding */
95
96
/* Table 8-23: Application Descriptors (bytes 86-117) */
97
CMIS_APP_DESC_START = 86, /* First Application Descriptor */
98
CMIS_APP_DESC1 = 86, /* AppDescriptor 1 (AppSel 1) */
99
CMIS_APP_DESC2 = 90, /* AppDescriptor 2 (AppSel 2) */
100
CMIS_APP_DESC3 = 94, /* AppDescriptor 3 (AppSel 3) */
101
CMIS_APP_DESC4 = 98, /* AppDescriptor 4 (AppSel 4) */
102
CMIS_APP_DESC5 = 102, /* AppDescriptor 5 (AppSel 5) */
103
CMIS_APP_DESC6 = 106, /* AppDescriptor 6 (AppSel 6) */
104
CMIS_APP_DESC7 = 110, /* AppDescriptor 7 (AppSel 7) */
105
CMIS_APP_DESC8 = 114, /* AppDescriptor 8 (AppSel 8) */
106
107
/* Table 8-24: Password (bytes 118-125) */
108
CMIS_PASSWORD_CHANGE = 118, /* Password change entry (4 bytes) */
109
CMIS_PASSWORD_ENTRY = 122, /* Password entry area (4 bytes) */
110
111
/* Table 8-25: Page Mapping (bytes 126-127) */
112
CMIS_BANK_SEL = 126, /* Bank select */
113
CMIS_PAGE_SEL = 127, /* Page select */
114
};
115
116
/*
117
* Byte 2 (CMIS_MODULE_TYPE) bit definitions (Table 8-5)
118
*/
119
#define CMIS_MODULE_TYPE_FLAT (1 << 7) /* MemoryModel: 1=flat, 0=paged */
120
#define CMIS_MODULE_TYPE_STEPPED (1 << 6) /* SteppedConfigOnly */
121
#define CMIS_MODULE_TYPE_MCISPEED_MASK 0x3C /* MciMaxSpeed, bits 5:2 */
122
#define CMIS_MODULE_TYPE_MCISPEED_SHIFT 2
123
#define CMIS_MODULE_TYPE_AUTOCOM_MASK 0x03 /* AutoCommissioning, bits 1:0 */
124
125
/* MciMaxSpeed values (I2CMCI) */
126
#define CMIS_MCISPEED_400KHZ 0 /* Up to 400 kHz */
127
#define CMIS_MCISPEED_1MHZ 1 /* Up to 1 MHz */
128
#define CMIS_MCISPEED_3_4MHZ 2 /* Up to 3.4 MHz */
129
130
/* AutoCommissioning values (when SteppedConfigOnly=1) */
131
#define CMIS_AUTOCOM_NONE 0x00 /* Neither regular nor hot */
132
#define CMIS_AUTOCOM_REGULAR 0x01 /* Only regular (ApplyDPInit) */
133
#define CMIS_AUTOCOM_HOT 0x02 /* Only hot (ApplyImmediate) */
134
135
/*
136
* Byte 3 (CMIS_MODULE_STATE) bit definitions (Table 8-6)
137
*/
138
#define CMIS_MODULE_STATE_MASK 0x0E /* ModuleState, bits 3:1 */
139
#define CMIS_MODULE_STATE_SHIFT 1
140
#define CMIS_MODULE_STATE_INTL 0x01 /* InterruptDeasserted (bit 0) */
141
142
/* Table 8-7: Module State Encodings (bits 3:1 of byte 3) */
143
#define CMIS_STATE_LOWPWR 1 /* ModuleLowPwr */
144
#define CMIS_STATE_PWRUP 2 /* ModulePwrUp */
145
#define CMIS_STATE_READY 3 /* ModuleReady */
146
#define CMIS_STATE_PWRDN 4 /* ModulePwrDn */
147
#define CMIS_STATE_FAULT 5 /* ModuleFault */
148
149
/*
150
* Bytes 4-7 (CMIS_FLAGS_BANKn) bit definitions (Table 8-8)
151
* Same layout for all 4 bank bytes.
152
*/
153
#define CMIS_FLAGS_PAGE2CH (1 << 3) /* Flags on Page 2Ch */
154
#define CMIS_FLAGS_PAGE14H (1 << 2) /* Flags on Page 14h */
155
#define CMIS_FLAGS_PAGE12H (1 << 1) /* Flags on Page 12h */
156
#define CMIS_FLAGS_PAGE11H (1 << 0) /* Flags on Page 11h */
157
158
/*
159
* Byte 8 (CMIS_MOD_FLAGS_START) bit definitions (Table 8-9)
160
*/
161
#define CMIS_FLAG_CDB_COMPLETE2 (1 << 7) /* CdbCmdCompleteFlag2 */
162
#define CMIS_FLAG_CDB_COMPLETE1 (1 << 6) /* CdbCmdCompleteFlag1 */
163
#define CMIS_FLAG_DP_FW_ERROR (1 << 2) /* DataPathFirmwareErrorFlag */
164
#define CMIS_FLAG_MOD_FW_ERROR (1 << 1) /* ModuleFirmwareErrorFlag */
165
#define CMIS_FLAG_STATE_CHANGED (1 << 0) /* ModuleStateChangedFlag */
166
167
/*
168
* Byte 9 (CMIS_MOD_FLAGS_TEMP_VCC) bit definitions (Table 8-9)
169
*/
170
#define CMIS_FLAG_VCC_LOW_WARN (1 << 7) /* VccMonLowWarningFlag */
171
#define CMIS_FLAG_VCC_HIGH_WARN (1 << 6) /* VccMonHighWarningFlag */
172
#define CMIS_FLAG_VCC_LOW_ALM (1 << 5) /* VccMonLowAlarmFlag */
173
#define CMIS_FLAG_VCC_HIGH_ALM (1 << 4) /* VccMonHighAlarmFlag */
174
#define CMIS_FLAG_TEMP_LOW_WARN (1 << 3) /* TempMonLowWarningFlag */
175
#define CMIS_FLAG_TEMP_HIGH_WARN (1 << 2) /* TempMonHighWarningFlag */
176
#define CMIS_FLAG_TEMP_LOW_ALM (1 << 1) /* TempMonLowAlarmFlag */
177
#define CMIS_FLAG_TEMP_HIGH_ALM (1 << 0) /* TempMonHighAlarmFlag */
178
179
/*
180
* Byte 10 (CMIS_MOD_FLAGS_AUX) bit definitions (Table 8-9)
181
*/
182
#define CMIS_FLAG_AUX2_LOW_WARN (1 << 7)
183
#define CMIS_FLAG_AUX2_HIGH_WARN (1 << 6)
184
#define CMIS_FLAG_AUX2_LOW_ALM (1 << 5)
185
#define CMIS_FLAG_AUX2_HIGH_ALM (1 << 4)
186
#define CMIS_FLAG_AUX1_LOW_WARN (1 << 3)
187
#define CMIS_FLAG_AUX1_HIGH_WARN (1 << 2)
188
#define CMIS_FLAG_AUX1_LOW_ALM (1 << 1)
189
#define CMIS_FLAG_AUX1_HIGH_ALM (1 << 0)
190
191
/*
192
* Byte 11 (CMIS_MOD_FLAGS_CUSTOM) bit definitions (Table 8-9)
193
*/
194
#define CMIS_FLAG_CUST_LOW_WARN (1 << 7)
195
#define CMIS_FLAG_CUST_HIGH_WARN (1 << 6)
196
#define CMIS_FLAG_CUST_LOW_ALM (1 << 5)
197
#define CMIS_FLAG_CUST_HIGH_ALM (1 << 4)
198
#define CMIS_FLAG_AUX3_LOW_WARN (1 << 3)
199
#define CMIS_FLAG_AUX3_HIGH_WARN (1 << 2)
200
#define CMIS_FLAG_AUX3_LOW_ALM (1 << 1)
201
#define CMIS_FLAG_AUX3_HIGH_ALM (1 << 0)
202
203
/*
204
* Byte 26 (CMIS_MOD_CTRL) bit definitions (Table 8-11)
205
*/
206
#define CMIS_CTRL_BANK_BCAST (1 << 7) /* BankBroadcastEnable */
207
#define CMIS_CTRL_LOWPWR_HW (1 << 6) /* LowPwrAllowRequestHW */
208
#define CMIS_CTRL_SQUELCH_METHOD (1 << 5) /* SquelchMethodSelect */
209
#define CMIS_CTRL_LOWPWR_SW (1 << 4) /* LowPwrRequestSW */
210
#define CMIS_CTRL_SW_RESET (1 << 3) /* SoftwareReset */
211
212
/*
213
* Byte 27 (CMIS_MOD_CTRL2) bit definitions (Table 8-11)
214
*/
215
#define CMIS_CTRL2_MCISPEED_MASK 0x0F /* MciSpeedConfiguration, bits 3:0 */
216
217
/*
218
* Bytes 31-36 mask bits mirror bytes 8-13 flag bits (Table 8-12)
219
* Use the same bit positions as CMIS_FLAG_* above.
220
*/
221
222
/*
223
* Bytes 37-38 (CDB Status) bit definitions (Table 8-14)
224
*/
225
#define CMIS_CDB_BUSY (1 << 7) /* CdbIsBusy */
226
#define CMIS_CDB_FAILED (1 << 6) /* CdbHasFailed */
227
#define CMIS_CDB_RESULT_MASK 0x3F /* CdbCommandResult, bits 5:0 */
228
229
/* Table 8-20: Media Type Encodings */
230
#define CMIS_MEDIA_TYPE_UNDEF 0x00 /* Undefined */
231
#define CMIS_MEDIA_TYPE_MMF 0x01 /* Optical: MMF */
232
#define CMIS_MEDIA_TYPE_SMF 0x02 /* Optical: SMF */
233
#define CMIS_MEDIA_TYPE_COPPER 0x03 /* Passive/Active Copper */
234
#define CMIS_MEDIA_TYPE_ACTIVE 0x04 /* Active Cable */
235
#define CMIS_MEDIA_TYPE_BASET 0x05 /* BASE-T */
236
237
/* Application Descriptor constants */
238
#define CMIS_APP_DESC_SIZE 4 /* Bytes per descriptor */
239
#define CMIS_MAX_APP_DESC 8 /* Max descriptors in lower memory */
240
241
/* Table 8-22: Offsets within an Application Descriptor */
242
#define CMIS_APP_HOST_IF_ID 0 /* HostInterfaceID */
243
#define CMIS_APP_MEDIA_IF_ID 1 /* MediaInterfaceID */
244
#define CMIS_APP_LANE_COUNT 2 /* Host[7:4], Media[3:0] */
245
#define CMIS_APP_HOST_ASSIGN 3 /* HostLaneAssignment */
246
#define CMIS_APP_HOST_LANES_MASK 0xF0 /* HostLaneCount, bits 7:4 */
247
#define CMIS_APP_HOST_LANES_SHIFT 4
248
#define CMIS_APP_MEDIA_LANES_MASK 0x0F /* MediaLaneCount, bits 3:0 */
249
250
/*
251
* Table 8-26: Page 00h - Administrative Information
252
* Accessed with page=0x00, bank=0.
253
*/
254
enum {
255
CMIS_P0_ID = 128, /* SFF-8024 Identifier copy */
256
CMIS_P0_VENDOR_NAME = 129, /* Vendor name (16 bytes, ASCII) */
257
CMIS_P0_VENDOR_OUI = 145, /* Vendor IEEE OUI (3 bytes) */
258
CMIS_P0_VENDOR_PN = 148, /* Part number (16 bytes, ASCII) */
259
CMIS_P0_VENDOR_REV = 164, /* Vendor revision (2 bytes) */
260
CMIS_P0_VENDOR_SN = 166, /* Serial number (16 bytes, ASCII) */
261
CMIS_P0_DATE_CODE = 182, /* Date code (8 bytes: YYMMDDLL) */
262
CMIS_P0_CLEI = 190, /* CLEI code (10 bytes, ASCII) */
263
CMIS_P0_MOD_POWER = 200, /* Module power class */
264
CMIS_P0_MAX_POWER = 201, /* Max power (multiples of 0.25W) */
265
CMIS_P0_CABLE_LEN = 202, /* Cable assembly link length */
266
CMIS_P0_CONNECTOR = 203, /* Connector type (SFF-8024) */
267
CMIS_P0_COPPER_ATTEN = 204, /* Copper cable attenuation (6 bytes) */
268
CMIS_P0_MEDIA_LANE_INFO = 210, /* Supported near end media lanes */
269
CMIS_P0_CABLE_ASM_INFO = 211, /* Far end breakout info */
270
CMIS_P0_MEDIA_TECH = 212, /* Media interface technology */
271
CMIS_P0_MCI_ADVERT = 213, /* MCI advertisement (2 bytes) */
272
CMIS_P0_PAGE_CKSUM = 222, /* Page checksum (bytes 128-221) */
273
CMIS_P0_CUSTOM = 223, /* Custom (33 bytes) */
274
};
275
276
/*
277
* Table 8-82: Page 11h - Lane Status and Data Path Status
278
* Accessed with page=0x11, bank=0 (lanes 1-8).
279
*/
280
enum {
281
/* Table 8-83: Data Path States (bytes 128-131) */
282
CMIS_P11_DPSTATE_12 = 128, /* DPState for host lanes 1-2 */
283
CMIS_P11_DPSTATE_34 = 129, /* DPState for host lanes 3-4 */
284
CMIS_P11_DPSTATE_56 = 130, /* DPState for host lanes 5-6 */
285
CMIS_P11_DPSTATE_78 = 131, /* DPState for host lanes 7-8 */
286
287
/* Table 8-85: Lane Output Status (bytes 132-133) */
288
CMIS_P11_OUTPUT_RX = 132, /* OutputStatusRx per lane */
289
CMIS_P11_OUTPUT_TX = 133, /* OutputStatusTx per lane */
290
291
/* Table 8-86: State Changed Flags (bytes 134-135) */
292
CMIS_P11_DPSTATE_CHGD = 134, /* DPStateChanged flags */
293
CMIS_P11_OUTPUT_CHGD_TX = 135, /* OutputStatusChangedTx flags*/
294
295
/* Table 8-87: Lane-Specific Tx Flags (bytes 136-141) */
296
CMIS_P11_TX_FAULT = 136, /* TxFault per lane */
297
CMIS_P11_TX_LOS = 137, /* TxLOS per lane */
298
CMIS_P11_TX_CDR_LOL = 138, /* TxCDRLOL per lane */
299
CMIS_P11_TX_ADPT_EQ_FAIL = 139, /* TxAdaptEqFail per lane */
300
CMIS_P11_TX_PWR_HIGH_ALM = 140, /* TxPowerHighAlarm per lane */
301
CMIS_P11_TX_PWR_LOW_ALM = 141, /* TxPowerLowAlarm per lane */
302
CMIS_P11_TX_BIAS_HIGH_ALM = 142, /* TxBiasHighAlarm per lane */
303
CMIS_P11_TX_BIAS_LOW_ALM = 143, /* TxBiasLowAlarm per lane */
304
CMIS_P11_TX_PWR_HIGH_WARN = 144, /* TxPowerHighWarning per lane*/
305
CMIS_P11_TX_PWR_LOW_WARN = 145, /* TxPowerLowWarning per lane */
306
CMIS_P11_TX_BIAS_HIGH_WARN = 146, /* TxBiasHighWarning per lane */
307
CMIS_P11_TX_BIAS_LOW_WARN = 147, /* TxBiasLowWarning per lane */
308
309
/* Table 8-88: Rx Flags (bytes 148-153) */
310
CMIS_P11_RX_LOS = 148, /* RxLOS per lane */
311
CMIS_P11_RX_CDR_LOL = 149, /* RxCDRLOL per lane */
312
CMIS_P11_RX_PWR_HIGH_ALM = 150, /* RxPowerHighAlarm per lane */
313
CMIS_P11_RX_PWR_LOW_ALM = 151, /* RxPowerLowAlarm per lane */
314
CMIS_P11_RX_PWR_HIGH_WARN = 152, /* RxPowerHighWarning per lane*/
315
CMIS_P11_RX_PWR_LOW_WARN = 153, /* RxPowerLowWarning per lane */
316
317
/* Table 8-89: Lane-Specific Monitors (bytes 154-201) */
318
CMIS_P11_TX_PWR_1 = 154, /* U16 Tx optical pwr, lane 1 */
319
CMIS_P11_TX_PWR_2 = 156, /* (0.1 uW increments) */
320
CMIS_P11_TX_PWR_3 = 158,
321
CMIS_P11_TX_PWR_4 = 160,
322
CMIS_P11_TX_PWR_5 = 162,
323
CMIS_P11_TX_PWR_6 = 164,
324
CMIS_P11_TX_PWR_7 = 166,
325
CMIS_P11_TX_PWR_8 = 168,
326
CMIS_P11_TX_BIAS_1 = 170, /* U16 Tx bias current, lane 1*/
327
CMIS_P11_TX_BIAS_2 = 172, /* (2 uA increments) */
328
CMIS_P11_TX_BIAS_3 = 174,
329
CMIS_P11_TX_BIAS_4 = 176,
330
CMIS_P11_TX_BIAS_5 = 178,
331
CMIS_P11_TX_BIAS_6 = 180,
332
CMIS_P11_TX_BIAS_7 = 182,
333
CMIS_P11_TX_BIAS_8 = 184,
334
CMIS_P11_RX_PWR_1 = 186, /* U16 Rx input power, lane 1 */
335
CMIS_P11_RX_PWR_2 = 188, /* (0.1 uW increments) */
336
CMIS_P11_RX_PWR_3 = 190,
337
CMIS_P11_RX_PWR_4 = 192,
338
CMIS_P11_RX_PWR_5 = 194,
339
CMIS_P11_RX_PWR_6 = 196,
340
CMIS_P11_RX_PWR_7 = 198,
341
CMIS_P11_RX_PWR_8 = 200,
342
343
/* Table 8-90: Config Command Status (bytes 202-205) */
344
CMIS_P11_CONFIG_STAT_12 = 202, /* ConfigStatus lanes 1-2 */
345
CMIS_P11_CONFIG_STAT_34 = 203, /* ConfigStatus lanes 3-4 */
346
CMIS_P11_CONFIG_STAT_56 = 204, /* ConfigStatus lanes 5-6 */
347
CMIS_P11_CONFIG_STAT_78 = 205, /* ConfigStatus lanes 7-8 */
348
349
/* Table 8-93: Active Control Set (bytes 206-234) */
350
CMIS_P11_ACS_DPCONFIG1 = 206, /* DPConfigLane1 (AppSel[7:4])*/
351
CMIS_P11_ACS_DPCONFIG2 = 207, /* DPConfigLane2 */
352
CMIS_P11_ACS_DPCONFIG3 = 208, /* DPConfigLane3 */
353
CMIS_P11_ACS_DPCONFIG4 = 209, /* DPConfigLane4 */
354
CMIS_P11_ACS_DPCONFIG5 = 210, /* DPConfigLane5 */
355
CMIS_P11_ACS_DPCONFIG6 = 211, /* DPConfigLane6 */
356
CMIS_P11_ACS_DPCONFIG7 = 212, /* DPConfigLane7 */
357
CMIS_P11_ACS_DPCONFIG8 = 213, /* DPConfigLane8 */
358
CMIS_P11_ACS_TX_START = 214, /* Provisioned Tx Controls */
359
CMIS_P11_ACS_TX_END = 225,
360
CMIS_P11_ACS_RX_START = 226, /* Provisioned Rx Controls */
361
CMIS_P11_ACS_RX_END = 234,
362
363
/* Table 8-96: Data Path Conditions (bytes 235-239) */
364
CMIS_P11_DP_COND_START = 235,
365
CMIS_P11_DP_COND_END = 239,
366
367
/* Table 8-97: Media Lane Mapping (bytes 240-255) */
368
CMIS_P11_MEDIA_MAP_START = 240,
369
CMIS_P11_MEDIA_MAP_END = 255,
370
};
371
372
/*
373
* Per-lane bit positions for Page 11h flag/status registers.
374
* Bytes 132-153 use bit N for lane N+1 (bit 7 = lane 8, bit 0 = lane 1).
375
*/
376
#define CMIS_LANE8 (1 << 7)
377
#define CMIS_LANE7 (1 << 6)
378
#define CMIS_LANE6 (1 << 5)
379
#define CMIS_LANE5 (1 << 4)
380
#define CMIS_LANE4 (1 << 3)
381
#define CMIS_LANE3 (1 << 2)
382
#define CMIS_LANE2 (1 << 1)
383
#define CMIS_LANE1 (1 << 0)
384
385
/*
386
* DPState encoding within bytes 128-131 (Table 8-83).
387
* Each byte holds two 4-bit DPState fields:
388
* bits 7:4 = even lane, bits 3:0 = odd lane.
389
*/
390
#define CMIS_DPSTATE_HI_MASK 0xF0 /* Upper nibble (even lane) */
391
#define CMIS_DPSTATE_HI_SHIFT 4
392
#define CMIS_DPSTATE_LO_MASK 0x0F /* Lower nibble (odd lane) */
393
394
/* Table 8-84: Data Path State Encoding */
395
#define CMIS_DPSTATE_DEACTIVATED 1 /* DPDeactivated (or unused) */
396
#define CMIS_DPSTATE_INIT 2 /* DPInit */
397
#define CMIS_DPSTATE_DEINIT 3 /* DPDeinit */
398
#define CMIS_DPSTATE_ACTIVATED 4 /* DPActivated */
399
#define CMIS_DPSTATE_TXTURNON 5 /* DPTxTurnOn */
400
#define CMIS_DPSTATE_TXTURNOFF 6 /* DPTxTurnOff */
401
#define CMIS_DPSTATE_INITIALIZED 7 /* DPInitialized */
402
403
/*
404
* ConfigStatus encoding within bytes 202-205 (Table 8-90/91).
405
* Each byte holds two 4-bit status fields, same nibble layout as DPState.
406
*/
407
#define CMIS_CFGSTAT_UNDEFINED 0x0 /* Undefined */
408
#define CMIS_CFGSTAT_SUCCESS 0x1 /* ConfigSuccess */
409
#define CMIS_CFGSTAT_REJECTED 0x2 /* ConfigRejected */
410
#define CMIS_CFGSTAT_REJECTEDINV 0x3 /* ConfigRejectedInvalidAppSel*/
411
#define CMIS_CFGSTAT_INPROGRESS 0x4 /* ConfigInProgress */
412
#define CMIS_CFGSTAT_REJECTEDLANE 0x5 /* ConfigRejectedInvalidLane */
413
#define CMIS_CFGSTAT_REJECTEDEQ 0x6 /* ConfigRejectedInvalidEq */
414
415
/* DPConfigLane (CMIS_P11_ACS_DPCONFIGn) bit definitions (Table 8-92/93) */
416
#define CMIS_ACS_APPSEL_MASK 0xF0 /* AppSel code, bits 7:4 */
417
#define CMIS_ACS_APPSEL_SHIFT 4
418
#define CMIS_ACS_DATAPATH_MASK 0x0F /* DataPathID, bits 3:0 */
419
420
/*
421
* Page 00h bit definitions
422
*/
423
424
/* Byte 200 (CMIS_P0_MOD_POWER) bit definitions (Table 8-31) */
425
#define CMIS_POWER_CLASS_MASK 0xE0 /* ModulePowerClass, bits 7:5 */
426
#define CMIS_POWER_CLASS_SHIFT 5
427
#define CMIS_POWER_CLASS_1 0 /* <=1.5W */
428
#define CMIS_POWER_CLASS_2 1 /* <=3.5W */
429
#define CMIS_POWER_CLASS_3 2 /* <=7.0W */
430
#define CMIS_POWER_CLASS_4 3 /* <=8.0W */
431
#define CMIS_POWER_CLASS_5 4 /* <=10.0W */
432
#define CMIS_POWER_CLASS_6 5 /* <=12.0W */
433
#define CMIS_POWER_CLASS_7 6 /* <=14.0W */
434
#define CMIS_POWER_CLASS_8 7 /* >14.0W, see MaxPower byte */
435
#define CMIS_POWER_MAX_IN_BYTE (1 << 4) /* MaxPowerOverride: byte 201*/
436
437
/* Byte 202 (CMIS_P0_CABLE_LEN) bit definitions (Table 8-32) */
438
#define CMIS_CABLE_LEN_MULT_MASK 0xC0 /* LengthMultiplier, bits 7:6 */
439
#define CMIS_CABLE_LEN_MULT_SHIFT 6
440
#define CMIS_CABLE_LEN_VAL_MASK 0x3F /* Length value, bits 5:0 */
441
#define CMIS_CABLE_LEN_MULT_01 0 /* x 0.1m */
442
#define CMIS_CABLE_LEN_MULT_1 1 /* x 1m */
443
#define CMIS_CABLE_LEN_MULT_10 2 /* x 10m */
444
#define CMIS_CABLE_LEN_MULT_100 3 /* x 100m */
445
446
/* Lane monitor stride (each monitor is U16 = 2 bytes per lane) */
447
#define CMIS_LANE_MON_SIZE 2
448
#define CMIS_MAX_LANES 8
449
450
#endif /* !_NET_CMIS_H_ */
451
452