1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121 #ifndef __LINUX__WIMAX__I2400M_H__
122 #define __LINUX__WIMAX__I2400M_H__
123
124 #include <linux/types.h>
125 #include <linux/if_ether.h>
126
127
128
129
130
131
132
133
134 struct i2400m_bcf_hdr {
135 __le32 module_type;
136 __le32 header_len;
137 __le32 header_version;
138 __le32 module_id;
139 __le32 module_vendor;
140 __le32 date;
141 __le32 size;
142 __le32 key_size;
143 __le32 modulus_size;
144 __le32 exponent_size;
145 __u8 reserved[88];
146 } __attribute__ ((packed));
147
148
149 enum i2400m_brh_opcode {
150 I2400M_BRH_READ = 1,
151 I2400M_BRH_WRITE = 2,
152 I2400M_BRH_JUMP = 3,
153 I2400M_BRH_SIGNED_JUMP = 8,
154 I2400M_BRH_HASH_PAYLOAD_ONLY = 9,
155 };
156
157
158 enum i2400m_brh {
159 I2400M_BRH_SIGNATURE = 0xcbbc0000,
160 I2400M_BRH_SIGNATURE_MASK = 0xffff0000,
161 I2400M_BRH_SIGNATURE_SHIFT = 16,
162 I2400M_BRH_OPCODE_MASK = 0x0000000f,
163 I2400M_BRH_RESPONSE_MASK = 0x000000f0,
164 I2400M_BRH_RESPONSE_SHIFT = 4,
165 I2400M_BRH_DIRECT_ACCESS = 0x00000400,
166 I2400M_BRH_RESPONSE_REQUIRED = 0x00000200,
167 I2400M_BRH_USE_CHECKSUM = 0x00000100,
168 };
169
170
171
172
173
174
175
176
177
178
179
180 struct i2400m_bootrom_header {
181 __le32 command;
182 __le32 target_addr;
183 __le32 data_size;
184 __le32 block_checksum;
185 char payload[0];
186 } __attribute__ ((packed));
187
188
189
190
191
192
193
194 enum i2400m_pt {
195 I2400M_PT_DATA = 0,
196 I2400M_PT_CTRL,
197 I2400M_PT_TRACE,
198 I2400M_PT_RESET_WARM,
199 I2400M_PT_RESET_COLD,
200 I2400M_PT_EDATA,
201 I2400M_PT_ILLEGAL
202 };
203
204
205
206
207
208
209
210 struct i2400m_pl_data_hdr {
211 __le32 reserved;
212 } __attribute__((packed));
213
214
215
216
217
218
219
220
221
222
223
224
225
226 struct i2400m_pl_edata_hdr {
227 __le32 reorder;
228 __u8 cs;
229 __u8 reserved[11];
230 } __attribute__((packed));
231
232 enum i2400m_cs {
233 I2400M_CS_IPV4_0 = 0,
234 I2400M_CS_IPV4 = 2,
235 };
236
237 enum i2400m_ro {
238 I2400M_RO_NEEDED = 0x01,
239 I2400M_RO_TYPE = 0x03,
240 I2400M_RO_TYPE_SHIFT = 1,
241 I2400M_RO_CIN = 0x0f,
242 I2400M_RO_CIN_SHIFT = 4,
243 I2400M_RO_FBN = 0x07ff,
244 I2400M_RO_FBN_SHIFT = 8,
245 I2400M_RO_SN = 0x07ff,
246 I2400M_RO_SN_SHIFT = 21,
247 };
248
249 enum i2400m_ro_type {
250 I2400M_RO_TYPE_RESET = 0,
251 I2400M_RO_TYPE_PACKET,
252 I2400M_RO_TYPE_WS,
253 I2400M_RO_TYPE_PACKET_WS,
254 };
255
256
257
258 enum {
259 I2400M_PL_ALIGN = 16,
260 I2400M_PL_SIZE_MAX = 0x3EFF,
261 I2400M_MAX_PLS_IN_MSG = 60,
262
263
264 I2400M_H2D_PREVIEW_BARKER = 0xcafe900d,
265 I2400M_COLD_RESET_BARKER = 0xc01dc01d,
266 I2400M_WARM_RESET_BARKER = 0x50f750f7,
267 I2400M_NBOOT_BARKER = 0xdeadbeef,
268 I2400M_SBOOT_BARKER = 0x0ff1c1a1,
269 I2400M_SBOOT_BARKER_6050 = 0x80000001,
270 I2400M_ACK_BARKER = 0xfeedbabe,
271 I2400M_D2H_MSG_BARKER = 0xbeefbabe,
272 };
273
274
275
276
277
278
279
280
281
282 struct i2400m_pld {
283 __le32 val;
284 } __attribute__ ((packed));
285
286 #define I2400M_PLD_SIZE_MASK 0x00003fff
287 #define I2400M_PLD_TYPE_SHIFT 16
288 #define I2400M_PLD_TYPE_MASK 0x000f0000
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309 struct i2400m_msg_hdr {
310 union {
311 __le32 barker;
312 __u32 size;
313 };
314 union {
315 __le32 sequence;
316 __u32 offset;
317 };
318 __le16 num_pls;
319 __le16 rsv1;
320 __le16 padding;
321 __le16 rsv2;
322 struct i2400m_pld pld[0];
323 } __attribute__ ((packed));
324
325
326
327
328
329
330
331 enum {
332
333 I2400M_L3L4_VERSION = 0x0100,
334 };
335
336
337 enum i2400m_mt {
338 I2400M_MT_RESERVED = 0x0000,
339 I2400M_MT_INVALID = 0xffff,
340 I2400M_MT_REPORT_MASK = 0x8000,
341
342 I2400M_MT_GET_SCAN_RESULT = 0x4202,
343 I2400M_MT_SET_SCAN_PARAM = 0x4402,
344 I2400M_MT_CMD_RF_CONTROL = 0x4602,
345 I2400M_MT_CMD_SCAN = 0x4603,
346 I2400M_MT_CMD_CONNECT = 0x4604,
347 I2400M_MT_CMD_DISCONNECT = 0x4605,
348 I2400M_MT_CMD_EXIT_IDLE = 0x4606,
349 I2400M_MT_GET_LM_VERSION = 0x5201,
350 I2400M_MT_GET_DEVICE_INFO = 0x5202,
351 I2400M_MT_GET_LINK_STATUS = 0x5203,
352 I2400M_MT_GET_STATISTICS = 0x5204,
353 I2400M_MT_GET_STATE = 0x5205,
354 I2400M_MT_GET_MEDIA_STATUS = 0x5206,
355 I2400M_MT_SET_INIT_CONFIG = 0x5404,
356 I2400M_MT_CMD_INIT = 0x5601,
357 I2400M_MT_CMD_TERMINATE = 0x5602,
358 I2400M_MT_CMD_MODE_OF_OP = 0x5603,
359 I2400M_MT_CMD_RESET_DEVICE = 0x5604,
360 I2400M_MT_CMD_MONITOR_CONTROL = 0x5605,
361 I2400M_MT_CMD_ENTER_POWERSAVE = 0x5606,
362 I2400M_MT_GET_TLS_OPERATION_RESULT = 0x6201,
363 I2400M_MT_SET_EAP_SUCCESS = 0x6402,
364 I2400M_MT_SET_EAP_FAIL = 0x6403,
365 I2400M_MT_SET_EAP_KEY = 0x6404,
366 I2400M_MT_CMD_SEND_EAP_RESPONSE = 0x6602,
367 I2400M_MT_REPORT_SCAN_RESULT = 0xc002,
368 I2400M_MT_REPORT_STATE = 0xd002,
369 I2400M_MT_REPORT_POWERSAVE_READY = 0xd005,
370 I2400M_MT_REPORT_EAP_REQUEST = 0xe002,
371 I2400M_MT_REPORT_EAP_RESTART = 0xe003,
372 I2400M_MT_REPORT_ALT_ACCEPT = 0xe004,
373 I2400M_MT_REPORT_KEY_REQUEST = 0xe005,
374 };
375
376
377
378
379
380
381
382 enum i2400m_ms {
383 I2400M_MS_DONE_OK = 0,
384 I2400M_MS_DONE_IN_PROGRESS = 1,
385 I2400M_MS_INVALID_OP = 2,
386 I2400M_MS_BAD_STATE = 3,
387 I2400M_MS_ILLEGAL_VALUE = 4,
388 I2400M_MS_MISSING_PARAMS = 5,
389 I2400M_MS_VERSION_ERROR = 6,
390 I2400M_MS_ACCESSIBILITY_ERROR = 7,
391 I2400M_MS_BUSY = 8,
392 I2400M_MS_CORRUPTED_TLV = 9,
393 I2400M_MS_UNINITIALIZED = 10,
394 I2400M_MS_UNKNOWN_ERROR = 11,
395 I2400M_MS_PRODUCTION_ERROR = 12,
396 I2400M_MS_NO_RF = 13,
397 I2400M_MS_NOT_READY_FOR_POWERSAVE = 14,
398 I2400M_MS_THERMAL_CRITICAL = 15,
399 I2400M_MS_MAX
400 };
401
402
403
404
405
406
407
408
409
410 enum i2400m_tlv {
411 I2400M_TLV_L4_MESSAGE_VERSIONS = 129,
412 I2400M_TLV_SYSTEM_STATE = 141,
413 I2400M_TLV_MEDIA_STATUS = 161,
414 I2400M_TLV_RF_OPERATION = 162,
415 I2400M_TLV_RF_STATUS = 163,
416 I2400M_TLV_DEVICE_RESET_TYPE = 132,
417 I2400M_TLV_CONFIG_IDLE_PARAMETERS = 601,
418 I2400M_TLV_CONFIG_IDLE_TIMEOUT = 611,
419 I2400M_TLV_CONFIG_D2H_DATA_FORMAT = 614,
420 I2400M_TLV_CONFIG_DL_HOST_REORDER = 615,
421 };
422
423
424 struct i2400m_tlv_hdr {
425 __le16 type;
426 __le16 length;
427 __u8 pl[0];
428 } __attribute__((packed));
429
430
431 struct i2400m_l3l4_hdr {
432 __le16 type;
433 __le16 length;
434 __le16 version;
435 __le16 resv1;
436 __le16 status;
437 __le16 resv2;
438 struct i2400m_tlv_hdr pl[0];
439 } __attribute__((packed));
440
441
442
443
444
445 enum i2400m_system_state {
446 I2400M_SS_UNINITIALIZED = 1,
447 I2400M_SS_INIT,
448 I2400M_SS_READY,
449 I2400M_SS_SCAN,
450 I2400M_SS_STANDBY,
451 I2400M_SS_CONNECTING,
452 I2400M_SS_WIMAX_CONNECTED,
453 I2400M_SS_DATA_PATH_CONNECTED,
454 I2400M_SS_IDLE,
455 I2400M_SS_DISCONNECTING,
456 I2400M_SS_OUT_OF_ZONE,
457 I2400M_SS_SLEEPACTIVE,
458 I2400M_SS_PRODUCTION,
459 I2400M_SS_CONFIG,
460 I2400M_SS_RF_OFF,
461 I2400M_SS_RF_SHUTDOWN,
462 I2400M_SS_DEVICE_DISCONNECT,
463 I2400M_SS_MAX,
464 };
465
466
467
468
469
470
471
472 struct i2400m_tlv_system_state {
473 struct i2400m_tlv_hdr hdr;
474 __le32 state;
475 } __attribute__((packed));
476
477
478 struct i2400m_tlv_l4_message_versions {
479 struct i2400m_tlv_hdr hdr;
480 __le16 major;
481 __le16 minor;
482 __le16 branch;
483 __le16 reserved;
484 } __attribute__((packed));
485
486
487 struct i2400m_tlv_detailed_device_info {
488 struct i2400m_tlv_hdr hdr;
489 __u8 reserved1[400];
490 __u8 mac_address[ETH_ALEN];
491 __u8 reserved2[2];
492 } __attribute__((packed));
493
494
495 enum i2400m_rf_switch_status {
496 I2400M_RF_SWITCH_ON = 1,
497 I2400M_RF_SWITCH_OFF = 2,
498 };
499
500 struct i2400m_tlv_rf_switches_status {
501 struct i2400m_tlv_hdr hdr;
502 __u8 sw_rf_switch;
503 __u8 hw_rf_switch;
504 __u8 reserved[2];
505 } __attribute__((packed));
506
507
508 enum {
509 i2400m_rf_operation_on = 1,
510 i2400m_rf_operation_off = 2
511 };
512
513 struct i2400m_tlv_rf_operation {
514 struct i2400m_tlv_hdr hdr;
515 __le32 status;
516 } __attribute__((packed));
517
518
519 enum i2400m_tlv_reset_type {
520 I2400M_RESET_TYPE_COLD = 1,
521 I2400M_RESET_TYPE_WARM
522 };
523
524 struct i2400m_tlv_device_reset_type {
525 struct i2400m_tlv_hdr hdr;
526 __le32 reset_type;
527 } __attribute__((packed));
528
529
530 struct i2400m_tlv_config_idle_parameters {
531 struct i2400m_tlv_hdr hdr;
532 __le32 idle_timeout;
533
534 __le32 idle_paging_interval;
535 } __attribute__((packed));
536
537
538 enum i2400m_media_status {
539 I2400M_MEDIA_STATUS_LINK_UP = 1,
540 I2400M_MEDIA_STATUS_LINK_DOWN,
541 I2400M_MEDIA_STATUS_LINK_RENEW,
542 };
543
544 struct i2400m_tlv_media_status {
545 struct i2400m_tlv_hdr hdr;
546 __le32 media_status;
547 } __attribute__((packed));
548
549
550
551 struct i2400m_tlv_config_idle_timeout {
552 struct i2400m_tlv_hdr hdr;
553 __le32 timeout;
554
555 } __attribute__((packed));
556
557
558 struct i2400m_tlv_config_d2h_data_format {
559 struct i2400m_tlv_hdr hdr;
560 __u8 format;
561 __u8 reserved[3];
562 } __attribute__((packed));
563
564
565 struct i2400m_tlv_config_dl_host_reorder {
566 struct i2400m_tlv_hdr hdr;
567 __u8 reorder;
568 __u8 reserved[3];
569 } __attribute__((packed));
570
571
572 #endif