• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef __LINUX__WIMAX__I2400M_H__
20 #define __LINUX__WIMAX__I2400M_H__
21 #include <linux/types.h>
22 #include <linux/if_ether.h>
23 struct i2400m_bcf_hdr {
24   __le32 module_type;
25   __le32 header_len;
26   __le32 header_version;
27   __le32 module_id;
28   __le32 module_vendor;
29   __le32 date;
30   __le32 size;
31   __le32 key_size;
32   __le32 modulus_size;
33   __le32 exponent_size;
34   __u8 reserved[88];
35 } __attribute__((packed));
36 enum i2400m_brh_opcode {
37   I2400M_BRH_READ = 1,
38   I2400M_BRH_WRITE = 2,
39   I2400M_BRH_JUMP = 3,
40   I2400M_BRH_SIGNED_JUMP = 8,
41   I2400M_BRH_HASH_PAYLOAD_ONLY = 9,
42 };
43 enum i2400m_brh {
44   I2400M_BRH_SIGNATURE = 0xcbbc0000,
45   I2400M_BRH_SIGNATURE_MASK = 0xffff0000,
46   I2400M_BRH_SIGNATURE_SHIFT = 16,
47   I2400M_BRH_OPCODE_MASK = 0x0000000f,
48   I2400M_BRH_RESPONSE_MASK = 0x000000f0,
49   I2400M_BRH_RESPONSE_SHIFT = 4,
50   I2400M_BRH_DIRECT_ACCESS = 0x00000400,
51   I2400M_BRH_RESPONSE_REQUIRED = 0x00000200,
52   I2400M_BRH_USE_CHECKSUM = 0x00000100,
53 };
54 struct i2400m_bootrom_header {
55   __le32 command;
56   __le32 target_addr;
57   __le32 data_size;
58   __le32 block_checksum;
59   char payload[0];
60 } __attribute__((packed));
61 enum i2400m_pt {
62   I2400M_PT_DATA = 0,
63   I2400M_PT_CTRL,
64   I2400M_PT_TRACE,
65   I2400M_PT_RESET_WARM,
66   I2400M_PT_RESET_COLD,
67   I2400M_PT_EDATA,
68   I2400M_PT_ILLEGAL
69 };
70 struct i2400m_pl_data_hdr {
71   __le32 reserved;
72 } __attribute__((packed));
73 struct i2400m_pl_edata_hdr {
74   __le32 reorder;
75   __u8 cs;
76   __u8 reserved[11];
77 } __attribute__((packed));
78 enum i2400m_cs {
79   I2400M_CS_IPV4_0 = 0,
80   I2400M_CS_IPV4 = 2,
81 };
82 enum i2400m_ro {
83   I2400M_RO_NEEDED = 0x01,
84   I2400M_RO_TYPE = 0x03,
85   I2400M_RO_TYPE_SHIFT = 1,
86   I2400M_RO_CIN = 0x0f,
87   I2400M_RO_CIN_SHIFT = 4,
88   I2400M_RO_FBN = 0x07ff,
89   I2400M_RO_FBN_SHIFT = 8,
90   I2400M_RO_SN = 0x07ff,
91   I2400M_RO_SN_SHIFT = 21,
92 };
93 enum i2400m_ro_type {
94   I2400M_RO_TYPE_RESET = 0,
95   I2400M_RO_TYPE_PACKET,
96   I2400M_RO_TYPE_WS,
97   I2400M_RO_TYPE_PACKET_WS,
98 };
99 enum {
100   I2400M_PL_ALIGN = 16,
101   I2400M_PL_SIZE_MAX = 0x3EFF,
102   I2400M_MAX_PLS_IN_MSG = 60,
103   I2400M_H2D_PREVIEW_BARKER = 0xcafe900d,
104   I2400M_COLD_RESET_BARKER = 0xc01dc01d,
105   I2400M_WARM_RESET_BARKER = 0x50f750f7,
106   I2400M_NBOOT_BARKER = 0xdeadbeef,
107   I2400M_SBOOT_BARKER = 0x0ff1c1a1,
108   I2400M_SBOOT_BARKER_6050 = 0x80000001,
109   I2400M_ACK_BARKER = 0xfeedbabe,
110   I2400M_D2H_MSG_BARKER = 0xbeefbabe,
111 };
112 struct i2400m_pld {
113   __le32 val;
114 } __attribute__((packed));
115 #define I2400M_PLD_SIZE_MASK 0x00003fff
116 #define I2400M_PLD_TYPE_SHIFT 16
117 #define I2400M_PLD_TYPE_MASK 0x000f0000
118 struct i2400m_msg_hdr {
119   union {
120     __le32 barker;
121     __u32 size;
122   };
123   union {
124     __le32 sequence;
125     __u32 offset;
126   };
127   __le16 num_pls;
128   __le16 rsv1;
129   __le16 padding;
130   __le16 rsv2;
131   struct i2400m_pld pld[0];
132 } __attribute__((packed));
133 enum {
134   I2400M_L3L4_VERSION = 0x0100,
135 };
136 enum i2400m_mt {
137   I2400M_MT_RESERVED = 0x0000,
138   I2400M_MT_INVALID = 0xffff,
139   I2400M_MT_REPORT_MASK = 0x8000,
140   I2400M_MT_GET_SCAN_RESULT = 0x4202,
141   I2400M_MT_SET_SCAN_PARAM = 0x4402,
142   I2400M_MT_CMD_RF_CONTROL = 0x4602,
143   I2400M_MT_CMD_SCAN = 0x4603,
144   I2400M_MT_CMD_CONNECT = 0x4604,
145   I2400M_MT_CMD_DISCONNECT = 0x4605,
146   I2400M_MT_CMD_EXIT_IDLE = 0x4606,
147   I2400M_MT_GET_LM_VERSION = 0x5201,
148   I2400M_MT_GET_DEVICE_INFO = 0x5202,
149   I2400M_MT_GET_LINK_STATUS = 0x5203,
150   I2400M_MT_GET_STATISTICS = 0x5204,
151   I2400M_MT_GET_STATE = 0x5205,
152   I2400M_MT_GET_MEDIA_STATUS = 0x5206,
153   I2400M_MT_SET_INIT_CONFIG = 0x5404,
154   I2400M_MT_CMD_INIT = 0x5601,
155   I2400M_MT_CMD_TERMINATE = 0x5602,
156   I2400M_MT_CMD_MODE_OF_OP = 0x5603,
157   I2400M_MT_CMD_RESET_DEVICE = 0x5604,
158   I2400M_MT_CMD_MONITOR_CONTROL = 0x5605,
159   I2400M_MT_CMD_ENTER_POWERSAVE = 0x5606,
160   I2400M_MT_GET_TLS_OPERATION_RESULT = 0x6201,
161   I2400M_MT_SET_EAP_SUCCESS = 0x6402,
162   I2400M_MT_SET_EAP_FAIL = 0x6403,
163   I2400M_MT_SET_EAP_KEY = 0x6404,
164   I2400M_MT_CMD_SEND_EAP_RESPONSE = 0x6602,
165   I2400M_MT_REPORT_SCAN_RESULT = 0xc002,
166   I2400M_MT_REPORT_STATE = 0xd002,
167   I2400M_MT_REPORT_POWERSAVE_READY = 0xd005,
168   I2400M_MT_REPORT_EAP_REQUEST = 0xe002,
169   I2400M_MT_REPORT_EAP_RESTART = 0xe003,
170   I2400M_MT_REPORT_ALT_ACCEPT = 0xe004,
171   I2400M_MT_REPORT_KEY_REQUEST = 0xe005,
172 };
173 enum i2400m_ms {
174   I2400M_MS_DONE_OK = 0,
175   I2400M_MS_DONE_IN_PROGRESS = 1,
176   I2400M_MS_INVALID_OP = 2,
177   I2400M_MS_BAD_STATE = 3,
178   I2400M_MS_ILLEGAL_VALUE = 4,
179   I2400M_MS_MISSING_PARAMS = 5,
180   I2400M_MS_VERSION_ERROR = 6,
181   I2400M_MS_ACCESSIBILITY_ERROR = 7,
182   I2400M_MS_BUSY = 8,
183   I2400M_MS_CORRUPTED_TLV = 9,
184   I2400M_MS_UNINITIALIZED = 10,
185   I2400M_MS_UNKNOWN_ERROR = 11,
186   I2400M_MS_PRODUCTION_ERROR = 12,
187   I2400M_MS_NO_RF = 13,
188   I2400M_MS_NOT_READY_FOR_POWERSAVE = 14,
189   I2400M_MS_THERMAL_CRITICAL = 15,
190   I2400M_MS_MAX
191 };
192 enum i2400m_tlv {
193   I2400M_TLV_L4_MESSAGE_VERSIONS = 129,
194   I2400M_TLV_SYSTEM_STATE = 141,
195   I2400M_TLV_MEDIA_STATUS = 161,
196   I2400M_TLV_RF_OPERATION = 162,
197   I2400M_TLV_RF_STATUS = 163,
198   I2400M_TLV_DEVICE_RESET_TYPE = 132,
199   I2400M_TLV_CONFIG_IDLE_PARAMETERS = 601,
200   I2400M_TLV_CONFIG_IDLE_TIMEOUT = 611,
201   I2400M_TLV_CONFIG_D2H_DATA_FORMAT = 614,
202   I2400M_TLV_CONFIG_DL_HOST_REORDER = 615,
203 };
204 struct i2400m_tlv_hdr {
205   __le16 type;
206   __le16 length;
207   __u8 pl[0];
208 } __attribute__((packed));
209 struct i2400m_l3l4_hdr {
210   __le16 type;
211   __le16 length;
212   __le16 version;
213   __le16 resv1;
214   __le16 status;
215   __le16 resv2;
216   struct i2400m_tlv_hdr pl[0];
217 } __attribute__((packed));
218 enum i2400m_system_state {
219   I2400M_SS_UNINITIALIZED = 1,
220   I2400M_SS_INIT,
221   I2400M_SS_READY,
222   I2400M_SS_SCAN,
223   I2400M_SS_STANDBY,
224   I2400M_SS_CONNECTING,
225   I2400M_SS_WIMAX_CONNECTED,
226   I2400M_SS_DATA_PATH_CONNECTED,
227   I2400M_SS_IDLE,
228   I2400M_SS_DISCONNECTING,
229   I2400M_SS_OUT_OF_ZONE,
230   I2400M_SS_SLEEPACTIVE,
231   I2400M_SS_PRODUCTION,
232   I2400M_SS_CONFIG,
233   I2400M_SS_RF_OFF,
234   I2400M_SS_RF_SHUTDOWN,
235   I2400M_SS_DEVICE_DISCONNECT,
236   I2400M_SS_MAX,
237 };
238 struct i2400m_tlv_system_state {
239   struct i2400m_tlv_hdr hdr;
240   __le32 state;
241 } __attribute__((packed));
242 struct i2400m_tlv_l4_message_versions {
243   struct i2400m_tlv_hdr hdr;
244   __le16 major;
245   __le16 minor;
246   __le16 branch;
247   __le16 reserved;
248 } __attribute__((packed));
249 struct i2400m_tlv_detailed_device_info {
250   struct i2400m_tlv_hdr hdr;
251   __u8 reserved1[400];
252   __u8 mac_address[ETH_ALEN];
253   __u8 reserved2[2];
254 } __attribute__((packed));
255 enum i2400m_rf_switch_status {
256   I2400M_RF_SWITCH_ON = 1,
257   I2400M_RF_SWITCH_OFF = 2,
258 };
259 struct i2400m_tlv_rf_switches_status {
260   struct i2400m_tlv_hdr hdr;
261   __u8 sw_rf_switch;
262   __u8 hw_rf_switch;
263   __u8 reserved[2];
264 } __attribute__((packed));
265 enum {
266   i2400m_rf_operation_on = 1,
267   i2400m_rf_operation_off = 2
268 };
269 struct i2400m_tlv_rf_operation {
270   struct i2400m_tlv_hdr hdr;
271   __le32 status;
272 } __attribute__((packed));
273 enum i2400m_tlv_reset_type {
274   I2400M_RESET_TYPE_COLD = 1,
275   I2400M_RESET_TYPE_WARM
276 };
277 struct i2400m_tlv_device_reset_type {
278   struct i2400m_tlv_hdr hdr;
279   __le32 reset_type;
280 } __attribute__((packed));
281 struct i2400m_tlv_config_idle_parameters {
282   struct i2400m_tlv_hdr hdr;
283   __le32 idle_timeout;
284   __le32 idle_paging_interval;
285 } __attribute__((packed));
286 enum i2400m_media_status {
287   I2400M_MEDIA_STATUS_LINK_UP = 1,
288   I2400M_MEDIA_STATUS_LINK_DOWN,
289   I2400M_MEDIA_STATUS_LINK_RENEW,
290 };
291 struct i2400m_tlv_media_status {
292   struct i2400m_tlv_hdr hdr;
293   __le32 media_status;
294 } __attribute__((packed));
295 struct i2400m_tlv_config_idle_timeout {
296   struct i2400m_tlv_hdr hdr;
297   __le32 timeout;
298 } __attribute__((packed));
299 struct i2400m_tlv_config_d2h_data_format {
300   struct i2400m_tlv_hdr hdr;
301   __u8 format;
302   __u8 reserved[3];
303 } __attribute__((packed));
304 struct i2400m_tlv_config_dl_host_reorder {
305   struct i2400m_tlv_hdr hdr;
306   __u8 reorder;
307   __u8 reserved[3];
308 } __attribute__((packed));
309 #endif
310