host.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962
  1. /**
  2. * This file function prototypes, data structure
  3. * and definitions for all the host/station commands
  4. */
  5. #ifndef _LBS_HOST_H_
  6. #define _LBS_HOST_H_
  7. #include "types.h"
  8. #include "defs.h"
  9. #define DEFAULT_AD_HOC_CHANNEL 6
  10. #define CMD_OPTION_WAITFORRSP 0x0002
  11. /** Host command IDs */
  12. /* Return command are almost always the same as the host command, but with
  13. * bit 15 set high. There are a few exceptions, though...
  14. */
  15. #define CMD_RET(cmd) (0x8000 | cmd)
  16. /* Return command convention exceptions: */
  17. #define CMD_RET_802_11_ASSOCIATE 0x8012
  18. /* Command codes */
  19. #define CMD_GET_HW_SPEC 0x0003
  20. #define CMD_EEPROM_UPDATE 0x0004
  21. #define CMD_802_11_RESET 0x0005
  22. #define CMD_802_11_SCAN 0x0006
  23. #define CMD_802_11_GET_LOG 0x000b
  24. #define CMD_MAC_MULTICAST_ADR 0x0010
  25. #define CMD_802_11_AUTHENTICATE 0x0011
  26. #define CMD_802_11_EEPROM_ACCESS 0x0059
  27. #define CMD_802_11_ASSOCIATE 0x0050
  28. #define CMD_802_11_SET_WEP 0x0013
  29. #define CMD_802_11_GET_STAT 0x0014
  30. #define CMD_802_3_GET_STAT 0x0015
  31. #define CMD_802_11_SNMP_MIB 0x0016
  32. #define CMD_MAC_REG_MAP 0x0017
  33. #define CMD_BBP_REG_MAP 0x0018
  34. #define CMD_MAC_REG_ACCESS 0x0019
  35. #define CMD_BBP_REG_ACCESS 0x001a
  36. #define CMD_RF_REG_ACCESS 0x001b
  37. #define CMD_802_11_RADIO_CONTROL 0x001c
  38. #define CMD_802_11_RF_CHANNEL 0x001d
  39. #define CMD_802_11_RF_TX_POWER 0x001e
  40. #define CMD_802_11_RSSI 0x001f
  41. #define CMD_802_11_RF_ANTENNA 0x0020
  42. #define CMD_802_11_PS_MODE 0x0021
  43. #define CMD_802_11_DATA_RATE 0x0022
  44. #define CMD_RF_REG_MAP 0x0023
  45. #define CMD_802_11_DEAUTHENTICATE 0x0024
  46. #define CMD_802_11_REASSOCIATE 0x0025
  47. #define CMD_MAC_CONTROL 0x0028
  48. #define CMD_802_11_AD_HOC_START 0x002b
  49. #define CMD_802_11_AD_HOC_JOIN 0x002c
  50. #define CMD_802_11_QUERY_TKIP_REPLY_CNTRS 0x002e
  51. #define CMD_802_11_ENABLE_RSN 0x002f
  52. #define CMD_802_11_SET_AFC 0x003c
  53. #define CMD_802_11_GET_AFC 0x003d
  54. #define CMD_802_11_DEEP_SLEEP 0x003e
  55. #define CMD_802_11_AD_HOC_STOP 0x0040
  56. #define CMD_802_11_HOST_SLEEP_CFG 0x0043
  57. #define CMD_802_11_WAKEUP_CONFIRM 0x0044
  58. #define CMD_802_11_HOST_SLEEP_ACTIVATE 0x0045
  59. #define CMD_802_11_BEACON_STOP 0x0049
  60. #define CMD_802_11_MAC_ADDRESS 0x004d
  61. #define CMD_802_11_LED_GPIO_CTRL 0x004e
  62. #define CMD_802_11_EEPROM_ACCESS 0x0059
  63. #define CMD_802_11_BAND_CONFIG 0x0058
  64. #define CMD_GSPI_BUS_CONFIG 0x005a
  65. #define CMD_802_11D_DOMAIN_INFO 0x005b
  66. #define CMD_802_11_KEY_MATERIAL 0x005e
  67. #define CMD_802_11_SLEEP_PARAMS 0x0066
  68. #define CMD_802_11_INACTIVITY_TIMEOUT 0x0067
  69. #define CMD_802_11_SLEEP_PERIOD 0x0068
  70. #define CMD_802_11_TPC_CFG 0x0072
  71. #define CMD_802_11_PA_CFG 0x0073
  72. #define CMD_802_11_FW_WAKE_METHOD 0x0074
  73. #define CMD_802_11_SUBSCRIBE_EVENT 0x0075
  74. #define CMD_802_11_RATE_ADAPT_RATESET 0x0076
  75. #define CMD_802_11_TX_RATE_QUERY 0x007f
  76. #define CMD_GET_TSF 0x0080
  77. #define CMD_BT_ACCESS 0x0087
  78. #define CMD_FWT_ACCESS 0x0095
  79. #define CMD_802_11_MONITOR_MODE 0x0098
  80. #define CMD_MESH_ACCESS 0x009b
  81. #define CMD_MESH_CONFIG_OLD 0x00a3
  82. #define CMD_MESH_CONFIG 0x00ac
  83. #define CMD_SET_BOOT2_VER 0x00a5
  84. #define CMD_FUNC_INIT 0x00a9
  85. #define CMD_FUNC_SHUTDOWN 0x00aa
  86. #define CMD_802_11_BEACON_CTRL 0x00b0
  87. /* For the IEEE Power Save */
  88. #define CMD_SUBCMD_ENTER_PS 0x0030
  89. #define CMD_SUBCMD_EXIT_PS 0x0031
  90. #define CMD_SUBCMD_SLEEP_CONFIRMED 0x0034
  91. #define CMD_SUBCMD_FULL_POWERDOWN 0x0035
  92. #define CMD_SUBCMD_FULL_POWERUP 0x0036
  93. #define CMD_ENABLE_RSN 0x0001
  94. #define CMD_DISABLE_RSN 0x0000
  95. #define CMD_ACT_GET 0x0000
  96. #define CMD_ACT_SET 0x0001
  97. /* Define action or option for CMD_802_11_SET_WEP */
  98. #define CMD_ACT_ADD 0x0002
  99. #define CMD_ACT_REMOVE 0x0004
  100. #define CMD_TYPE_WEP_40_BIT 0x01
  101. #define CMD_TYPE_WEP_104_BIT 0x02
  102. #define CMD_NUM_OF_WEP_KEYS 4
  103. #define CMD_WEP_KEY_INDEX_MASK 0x3fff
  104. /* Define action or option for CMD_802_11_SCAN */
  105. #define CMD_BSS_TYPE_BSS 0x0001
  106. #define CMD_BSS_TYPE_IBSS 0x0002
  107. #define CMD_BSS_TYPE_ANY 0x0003
  108. /* Define action or option for CMD_802_11_SCAN */
  109. #define CMD_SCAN_TYPE_ACTIVE 0x0000
  110. #define CMD_SCAN_TYPE_PASSIVE 0x0001
  111. #define CMD_SCAN_RADIO_TYPE_BG 0
  112. #define CMD_SCAN_PROBE_DELAY_TIME 0
  113. /* Define action or option for CMD_MAC_CONTROL */
  114. #define CMD_ACT_MAC_RX_ON 0x0001
  115. #define CMD_ACT_MAC_TX_ON 0x0002
  116. #define CMD_ACT_MAC_LOOPBACK_ON 0x0004
  117. #define CMD_ACT_MAC_WEP_ENABLE 0x0008
  118. #define CMD_ACT_MAC_INT_ENABLE 0x0010
  119. #define CMD_ACT_MAC_MULTICAST_ENABLE 0x0020
  120. #define CMD_ACT_MAC_BROADCAST_ENABLE 0x0040
  121. #define CMD_ACT_MAC_PROMISCUOUS_ENABLE 0x0080
  122. #define CMD_ACT_MAC_ALL_MULTICAST_ENABLE 0x0100
  123. #define CMD_ACT_MAC_STRICT_PROTECTION_ENABLE 0x0400
  124. /* Event flags for CMD_802_11_SUBSCRIBE_EVENT */
  125. #define CMD_SUBSCRIBE_RSSI_LOW 0x0001
  126. #define CMD_SUBSCRIBE_SNR_LOW 0x0002
  127. #define CMD_SUBSCRIBE_FAILCOUNT 0x0004
  128. #define CMD_SUBSCRIBE_BCNMISS 0x0008
  129. #define CMD_SUBSCRIBE_RSSI_HIGH 0x0010
  130. #define CMD_SUBSCRIBE_SNR_HIGH 0x0020
  131. #define RADIO_PREAMBLE_LONG 0x00
  132. #define RADIO_PREAMBLE_SHORT 0x02
  133. #define RADIO_PREAMBLE_AUTO 0x04
  134. /* Define action or option for CMD_802_11_RF_CHANNEL */
  135. #define CMD_OPT_802_11_RF_CHANNEL_GET 0x00
  136. #define CMD_OPT_802_11_RF_CHANNEL_SET 0x01
  137. /* Define action or option for CMD_802_11_DATA_RATE */
  138. #define CMD_ACT_SET_TX_AUTO 0x0000
  139. #define CMD_ACT_SET_TX_FIX_RATE 0x0001
  140. #define CMD_ACT_GET_TX_RATE 0x0002
  141. /* Define action or option for CMD_802_11_PS_MODE */
  142. #define CMD_TYPE_CAM 0x0000
  143. #define CMD_TYPE_MAX_PSP 0x0001
  144. #define CMD_TYPE_FAST_PSP 0x0002
  145. /* Options for CMD_802_11_FW_WAKE_METHOD */
  146. #define CMD_WAKE_METHOD_UNCHANGED 0x0000
  147. #define CMD_WAKE_METHOD_COMMAND_INT 0x0001
  148. #define CMD_WAKE_METHOD_GPIO 0x0002
  149. /* Object IDs for CMD_802_11_SNMP_MIB */
  150. #define SNMP_MIB_OID_BSS_TYPE 0x0000
  151. #define SNMP_MIB_OID_OP_RATE_SET 0x0001
  152. #define SNMP_MIB_OID_BEACON_PERIOD 0x0002 /* Reserved on v9+ */
  153. #define SNMP_MIB_OID_DTIM_PERIOD 0x0003 /* Reserved on v9+ */
  154. #define SNMP_MIB_OID_ASSOC_TIMEOUT 0x0004 /* Reserved on v9+ */
  155. #define SNMP_MIB_OID_RTS_THRESHOLD 0x0005
  156. #define SNMP_MIB_OID_SHORT_RETRY_LIMIT 0x0006
  157. #define SNMP_MIB_OID_LONG_RETRY_LIMIT 0x0007
  158. #define SNMP_MIB_OID_FRAG_THRESHOLD 0x0008
  159. #define SNMP_MIB_OID_11D_ENABLE 0x0009
  160. #define SNMP_MIB_OID_11H_ENABLE 0x000A
  161. /* Define action or option for CMD_BT_ACCESS */
  162. enum cmd_bt_access_opts {
  163. /* The bt commands start at 5 instead of 1 because the old dft commands
  164. * are mapped to 1-4. These old commands are no longer maintained and
  165. * should not be called.
  166. */
  167. CMD_ACT_BT_ACCESS_ADD = 5,
  168. CMD_ACT_BT_ACCESS_DEL,
  169. CMD_ACT_BT_ACCESS_LIST,
  170. CMD_ACT_BT_ACCESS_RESET,
  171. CMD_ACT_BT_ACCESS_SET_INVERT,
  172. CMD_ACT_BT_ACCESS_GET_INVERT
  173. };
  174. /* Define action or option for CMD_FWT_ACCESS */
  175. enum cmd_fwt_access_opts {
  176. CMD_ACT_FWT_ACCESS_ADD = 1,
  177. CMD_ACT_FWT_ACCESS_DEL,
  178. CMD_ACT_FWT_ACCESS_LOOKUP,
  179. CMD_ACT_FWT_ACCESS_LIST,
  180. CMD_ACT_FWT_ACCESS_LIST_ROUTE,
  181. CMD_ACT_FWT_ACCESS_LIST_NEIGHBOR,
  182. CMD_ACT_FWT_ACCESS_RESET,
  183. CMD_ACT_FWT_ACCESS_CLEANUP,
  184. CMD_ACT_FWT_ACCESS_TIME,
  185. };
  186. /* Define action or option for CMD_802_11_HOST_SLEEP_CFG */
  187. enum cmd_wol_cfg_opts {
  188. CMD_ACT_ACTION_NONE = 0,
  189. CMD_ACT_SET_WOL_RULE,
  190. CMD_ACT_GET_WOL_RULE,
  191. CMD_ACT_RESET_WOL_RULE,
  192. };
  193. /* Define action or option for CMD_MESH_ACCESS */
  194. enum cmd_mesh_access_opts {
  195. CMD_ACT_MESH_GET_TTL = 1,
  196. CMD_ACT_MESH_SET_TTL,
  197. CMD_ACT_MESH_GET_STATS,
  198. CMD_ACT_MESH_GET_ANYCAST,
  199. CMD_ACT_MESH_SET_ANYCAST,
  200. CMD_ACT_MESH_SET_LINK_COSTS,
  201. CMD_ACT_MESH_GET_LINK_COSTS,
  202. CMD_ACT_MESH_SET_BCAST_RATE,
  203. CMD_ACT_MESH_GET_BCAST_RATE,
  204. CMD_ACT_MESH_SET_RREQ_DELAY,
  205. CMD_ACT_MESH_GET_RREQ_DELAY,
  206. CMD_ACT_MESH_SET_ROUTE_EXP,
  207. CMD_ACT_MESH_GET_ROUTE_EXP,
  208. CMD_ACT_MESH_SET_AUTOSTART_ENABLED,
  209. CMD_ACT_MESH_GET_AUTOSTART_ENABLED,
  210. CMD_ACT_MESH_SET_GET_PRB_RSP_LIMIT = 17,
  211. };
  212. /* Define actions and types for CMD_MESH_CONFIG */
  213. enum cmd_mesh_config_actions {
  214. CMD_ACT_MESH_CONFIG_STOP = 0,
  215. CMD_ACT_MESH_CONFIG_START,
  216. CMD_ACT_MESH_CONFIG_SET,
  217. CMD_ACT_MESH_CONFIG_GET,
  218. };
  219. enum cmd_mesh_config_types {
  220. CMD_TYPE_MESH_SET_BOOTFLAG = 1,
  221. CMD_TYPE_MESH_SET_BOOTTIME,
  222. CMD_TYPE_MESH_SET_DEF_CHANNEL,
  223. CMD_TYPE_MESH_SET_MESH_IE,
  224. CMD_TYPE_MESH_GET_DEFAULTS,
  225. CMD_TYPE_MESH_GET_MESH_IE, /* GET_DEFAULTS is superset of GET_MESHIE */
  226. };
  227. /** Card Event definition */
  228. #define MACREG_INT_CODE_TX_PPA_FREE 0
  229. #define MACREG_INT_CODE_TX_DMA_DONE 1
  230. #define MACREG_INT_CODE_LINK_LOST_W_SCAN 2
  231. #define MACREG_INT_CODE_LINK_LOST_NO_SCAN 3
  232. #define MACREG_INT_CODE_LINK_SENSED 4
  233. #define MACREG_INT_CODE_CMD_FINISHED 5
  234. #define MACREG_INT_CODE_MIB_CHANGED 6
  235. #define MACREG_INT_CODE_INIT_DONE 7
  236. #define MACREG_INT_CODE_DEAUTHENTICATED 8
  237. #define MACREG_INT_CODE_DISASSOCIATED 9
  238. #define MACREG_INT_CODE_PS_AWAKE 10
  239. #define MACREG_INT_CODE_PS_SLEEP 11
  240. #define MACREG_INT_CODE_MIC_ERR_MULTICAST 13
  241. #define MACREG_INT_CODE_MIC_ERR_UNICAST 14
  242. #define MACREG_INT_CODE_WM_AWAKE 15
  243. #define MACREG_INT_CODE_DEEP_SLEEP_AWAKE 16
  244. #define MACREG_INT_CODE_ADHOC_BCN_LOST 17
  245. #define MACREG_INT_CODE_HOST_AWAKE 18
  246. #define MACREG_INT_CODE_STOP_TX 19
  247. #define MACREG_INT_CODE_START_TX 20
  248. #define MACREG_INT_CODE_CHANNEL_SWITCH 21
  249. #define MACREG_INT_CODE_MEASUREMENT_RDY 22
  250. #define MACREG_INT_CODE_WMM_CHANGE 23
  251. #define MACREG_INT_CODE_BG_SCAN_REPORT 24
  252. #define MACREG_INT_CODE_RSSI_LOW 25
  253. #define MACREG_INT_CODE_SNR_LOW 26
  254. #define MACREG_INT_CODE_MAX_FAIL 27
  255. #define MACREG_INT_CODE_RSSI_HIGH 28
  256. #define MACREG_INT_CODE_SNR_HIGH 29
  257. #define MACREG_INT_CODE_MESH_AUTO_STARTED 35
  258. #define MACREG_INT_CODE_FIRMWARE_READY 48
  259. /* 802.11-related definitions */
  260. /* TxPD descriptor */
  261. struct txpd {
  262. /* union to cope up with later FW revisions */
  263. union {
  264. /* Current Tx packet status */
  265. __le32 tx_status;
  266. struct {
  267. /* BSS type: client, AP, etc. */
  268. u8 bss_type;
  269. /* BSS number */
  270. u8 bss_num;
  271. /* Reserved */
  272. __le16 reserved;
  273. } bss;
  274. } u;
  275. /* Tx control */
  276. __le32 tx_control;
  277. __le32 tx_packet_location;
  278. /* Tx packet length */
  279. __le16 tx_packet_length;
  280. /* First 2 byte of destination MAC address */
  281. u8 tx_dest_addr_high[2];
  282. /* Last 4 byte of destination MAC address */
  283. u8 tx_dest_addr_low[4];
  284. /* Pkt Priority */
  285. u8 priority;
  286. /* Pkt Trasnit Power control */
  287. u8 powermgmt;
  288. /* Amount of time the packet has been queued (units = 2ms) */
  289. u8 pktdelay_2ms;
  290. /* reserved */
  291. u8 reserved1;
  292. } __attribute__ ((packed));
  293. /* RxPD Descriptor */
  294. struct rxpd {
  295. /* union to cope up with later FW revisions */
  296. union {
  297. /* Current Rx packet status */
  298. __le16 status;
  299. struct {
  300. /* BSS type: client, AP, etc. */
  301. u8 bss_type;
  302. /* BSS number */
  303. u8 bss_num;
  304. } __attribute__ ((packed)) bss;
  305. } __attribute__ ((packed)) u;
  306. /* SNR */
  307. u8 snr;
  308. /* Tx control */
  309. u8 rx_control;
  310. /* Pkt length */
  311. __le16 pkt_len;
  312. /* Noise Floor */
  313. u8 nf;
  314. /* Rx Packet Rate */
  315. u8 rx_rate;
  316. /* Pkt addr */
  317. __le32 pkt_ptr;
  318. /* Next Rx RxPD addr */
  319. __le32 next_rxpd_ptr;
  320. /* Pkt Priority */
  321. u8 priority;
  322. u8 reserved[3];
  323. } __attribute__ ((packed));
  324. struct cmd_header {
  325. __le16 command;
  326. __le16 size;
  327. __le16 seqnum;
  328. __le16 result;
  329. } __attribute__ ((packed));
  330. /* Generic structure to hold all key types. */
  331. struct enc_key {
  332. u16 len;
  333. u16 flags; /* KEY_INFO_* from defs.h */
  334. u16 type; /* KEY_TYPE_* from defs.h */
  335. u8 key[32];
  336. };
  337. /* lbs_offset_value */
  338. struct lbs_offset_value {
  339. u32 offset;
  340. u32 value;
  341. } __attribute__ ((packed));
  342. /*
  343. * Define data structure for CMD_GET_HW_SPEC
  344. * This structure defines the response for the GET_HW_SPEC command
  345. */
  346. struct cmd_ds_get_hw_spec {
  347. struct cmd_header hdr;
  348. /* HW Interface version number */
  349. __le16 hwifversion;
  350. /* HW version number */
  351. __le16 version;
  352. /* Max number of TxPD FW can handle */
  353. __le16 nr_txpd;
  354. /* Max no of Multicast address */
  355. __le16 nr_mcast_adr;
  356. /* MAC address */
  357. u8 permanentaddr[6];
  358. /* region Code */
  359. __le16 regioncode;
  360. /* Number of antenna used */
  361. __le16 nr_antenna;
  362. /* FW release number, example 0x01030304 = 2.3.4p1 */
  363. __le32 fwrelease;
  364. /* Base Address of TxPD queue */
  365. __le32 wcb_base;
  366. /* Read Pointer of RxPd queue */
  367. __le32 rxpd_rdptr;
  368. /* Write Pointer of RxPd queue */
  369. __le32 rxpd_wrptr;
  370. /*FW/HW capability */
  371. __le32 fwcapinfo;
  372. } __attribute__ ((packed));
  373. struct cmd_ds_802_11_subscribe_event {
  374. struct cmd_header hdr;
  375. __le16 action;
  376. __le16 events;
  377. /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
  378. * number of TLVs. From the v5.1 manual, those TLVs would add up to
  379. * 40 bytes. However, future firmware might add additional TLVs, so I
  380. * bump this up a bit.
  381. */
  382. uint8_t tlv[128];
  383. } __attribute__ ((packed));
  384. /*
  385. * This scan handle Country Information IE(802.11d compliant)
  386. * Define data structure for CMD_802_11_SCAN
  387. */
  388. struct cmd_ds_802_11_scan {
  389. struct cmd_header hdr;
  390. uint8_t bsstype;
  391. uint8_t bssid[ETH_ALEN];
  392. uint8_t tlvbuffer[0];
  393. } __attribute__ ((packed));
  394. struct cmd_ds_802_11_scan_rsp {
  395. struct cmd_header hdr;
  396. __le16 bssdescriptsize;
  397. uint8_t nr_sets;
  398. uint8_t bssdesc_and_tlvbuffer[0];
  399. } __attribute__ ((packed));
  400. struct cmd_ds_802_11_get_log {
  401. struct cmd_header hdr;
  402. __le32 mcasttxframe;
  403. __le32 failed;
  404. __le32 retry;
  405. __le32 multiretry;
  406. __le32 framedup;
  407. __le32 rtssuccess;
  408. __le32 rtsfailure;
  409. __le32 ackfailure;
  410. __le32 rxfrag;
  411. __le32 mcastrxframe;
  412. __le32 fcserror;
  413. __le32 txframe;
  414. __le32 wepundecryptable;
  415. } __attribute__ ((packed));
  416. struct cmd_ds_mac_control {
  417. struct cmd_header hdr;
  418. __le16 action;
  419. u16 reserved;
  420. } __attribute__ ((packed));
  421. struct cmd_ds_mac_multicast_adr {
  422. struct cmd_header hdr;
  423. __le16 action;
  424. __le16 nr_of_adrs;
  425. u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
  426. } __attribute__ ((packed));
  427. struct cmd_ds_802_11_authenticate {
  428. struct cmd_header hdr;
  429. u8 bssid[ETH_ALEN];
  430. u8 authtype;
  431. u8 reserved[10];
  432. } __attribute__ ((packed));
  433. struct cmd_ds_802_11_deauthenticate {
  434. struct cmd_header hdr;
  435. u8 macaddr[ETH_ALEN];
  436. __le16 reasoncode;
  437. } __attribute__ ((packed));
  438. struct cmd_ds_802_11_associate {
  439. struct cmd_header hdr;
  440. u8 bssid[6];
  441. __le16 capability;
  442. __le16 listeninterval;
  443. __le16 bcnperiod;
  444. u8 dtimperiod;
  445. u8 iebuf[512]; /* Enough for required and most optional IEs */
  446. } __attribute__ ((packed));
  447. struct cmd_ds_802_11_associate_response {
  448. struct cmd_header hdr;
  449. __le16 capability;
  450. __le16 statuscode;
  451. __le16 aid;
  452. u8 iebuf[512];
  453. } __attribute__ ((packed));
  454. struct cmd_ds_802_11_set_wep {
  455. struct cmd_header hdr;
  456. /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
  457. __le16 action;
  458. /* key Index selected for Tx */
  459. __le16 keyindex;
  460. /* 40, 128bit or TXWEP */
  461. uint8_t keytype[4];
  462. uint8_t keymaterial[4][16];
  463. } __attribute__ ((packed));
  464. struct cmd_ds_802_11_snmp_mib {
  465. struct cmd_header hdr;
  466. __le16 action;
  467. __le16 oid;
  468. __le16 bufsize;
  469. u8 value[128];
  470. } __attribute__ ((packed));
  471. struct cmd_ds_mac_reg_access {
  472. __le16 action;
  473. __le16 offset;
  474. __le32 value;
  475. } __attribute__ ((packed));
  476. struct cmd_ds_bbp_reg_access {
  477. __le16 action;
  478. __le16 offset;
  479. u8 value;
  480. u8 reserved[3];
  481. } __attribute__ ((packed));
  482. struct cmd_ds_rf_reg_access {
  483. __le16 action;
  484. __le16 offset;
  485. u8 value;
  486. u8 reserved[3];
  487. } __attribute__ ((packed));
  488. struct cmd_ds_802_11_radio_control {
  489. struct cmd_header hdr;
  490. __le16 action;
  491. __le16 control;
  492. } __attribute__ ((packed));
  493. struct cmd_ds_802_11_beacon_control {
  494. __le16 action;
  495. __le16 beacon_enable;
  496. __le16 beacon_period;
  497. } __attribute__ ((packed));
  498. struct cmd_ds_802_11_sleep_params {
  499. struct cmd_header hdr;
  500. /* ACT_GET/ACT_SET */
  501. __le16 action;
  502. /* Sleep clock error in ppm */
  503. __le16 error;
  504. /* Wakeup offset in usec */
  505. __le16 offset;
  506. /* Clock stabilization time in usec */
  507. __le16 stabletime;
  508. /* control periodic calibration */
  509. uint8_t calcontrol;
  510. /* control the use of external sleep clock */
  511. uint8_t externalsleepclk;
  512. /* reserved field, should be set to zero */
  513. __le16 reserved;
  514. } __attribute__ ((packed));
  515. struct cmd_ds_802_11_rf_channel {
  516. struct cmd_header hdr;
  517. __le16 action;
  518. __le16 channel;
  519. __le16 rftype; /* unused */
  520. __le16 reserved; /* unused */
  521. u8 channellist[32]; /* unused */
  522. } __attribute__ ((packed));
  523. struct cmd_ds_802_11_rssi {
  524. /* weighting factor */
  525. __le16 N;
  526. __le16 reserved_0;
  527. __le16 reserved_1;
  528. __le16 reserved_2;
  529. } __attribute__ ((packed));
  530. struct cmd_ds_802_11_rssi_rsp {
  531. __le16 SNR;
  532. __le16 noisefloor;
  533. __le16 avgSNR;
  534. __le16 avgnoisefloor;
  535. } __attribute__ ((packed));
  536. struct cmd_ds_802_11_mac_address {
  537. struct cmd_header hdr;
  538. __le16 action;
  539. u8 macadd[ETH_ALEN];
  540. } __attribute__ ((packed));
  541. struct cmd_ds_802_11_rf_tx_power {
  542. struct cmd_header hdr;
  543. __le16 action;
  544. __le16 curlevel;
  545. s8 maxlevel;
  546. s8 minlevel;
  547. } __attribute__ ((packed));
  548. struct cmd_ds_802_11_monitor_mode {
  549. __le16 action;
  550. __le16 mode;
  551. } __attribute__ ((packed));
  552. struct cmd_ds_set_boot2_ver {
  553. struct cmd_header hdr;
  554. __le16 action;
  555. __le16 version;
  556. } __attribute__ ((packed));
  557. struct cmd_ds_802_11_fw_wake_method {
  558. struct cmd_header hdr;
  559. __le16 action;
  560. __le16 method;
  561. } __attribute__ ((packed));
  562. struct cmd_ds_802_11_ps_mode {
  563. __le16 action;
  564. __le16 nullpktinterval;
  565. __le16 multipledtim;
  566. __le16 reserved;
  567. __le16 locallisteninterval;
  568. } __attribute__ ((packed));
  569. struct cmd_confirm_sleep {
  570. struct cmd_header hdr;
  571. __le16 action;
  572. __le16 nullpktinterval;
  573. __le16 multipledtim;
  574. __le16 reserved;
  575. __le16 locallisteninterval;
  576. } __attribute__ ((packed));
  577. struct cmd_ds_802_11_data_rate {
  578. struct cmd_header hdr;
  579. __le16 action;
  580. __le16 reserved;
  581. u8 rates[MAX_RATES];
  582. } __attribute__ ((packed));
  583. struct cmd_ds_802_11_rate_adapt_rateset {
  584. struct cmd_header hdr;
  585. __le16 action;
  586. __le16 enablehwauto;
  587. __le16 bitmap;
  588. } __attribute__ ((packed));
  589. struct cmd_ds_802_11_ad_hoc_start {
  590. struct cmd_header hdr;
  591. u8 ssid[IEEE80211_MAX_SSID_LEN];
  592. u8 bsstype;
  593. __le16 beaconperiod;
  594. u8 dtimperiod; /* Reserved on v9 and later */
  595. struct ieee_ie_ibss_param_set ibss;
  596. u8 reserved1[4];
  597. struct ieee_ie_ds_param_set ds;
  598. u8 reserved2[4];
  599. __le16 probedelay; /* Reserved on v9 and later */
  600. __le16 capability;
  601. u8 rates[MAX_RATES];
  602. u8 tlv_memory_size_pad[100];
  603. } __attribute__ ((packed));
  604. struct cmd_ds_802_11_ad_hoc_result {
  605. struct cmd_header hdr;
  606. u8 pad[3];
  607. u8 bssid[ETH_ALEN];
  608. } __attribute__ ((packed));
  609. struct adhoc_bssdesc {
  610. u8 bssid[ETH_ALEN];
  611. u8 ssid[IEEE80211_MAX_SSID_LEN];
  612. u8 type;
  613. __le16 beaconperiod;
  614. u8 dtimperiod;
  615. __le64 timestamp;
  616. __le64 localtime;
  617. struct ieee_ie_ds_param_set ds;
  618. u8 reserved1[4];
  619. struct ieee_ie_ibss_param_set ibss;
  620. u8 reserved2[4];
  621. __le16 capability;
  622. u8 rates[MAX_RATES];
  623. /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
  624. * Adhoc join command and will cause a binary layout mismatch with
  625. * the firmware
  626. */
  627. } __attribute__ ((packed));
  628. struct cmd_ds_802_11_ad_hoc_join {
  629. struct cmd_header hdr;
  630. struct adhoc_bssdesc bss;
  631. __le16 failtimeout; /* Reserved on v9 and later */
  632. __le16 probedelay; /* Reserved on v9 and later */
  633. } __attribute__ ((packed));
  634. struct cmd_ds_802_11_ad_hoc_stop {
  635. struct cmd_header hdr;
  636. } __attribute__ ((packed));
  637. struct cmd_ds_802_11_enable_rsn {
  638. struct cmd_header hdr;
  639. __le16 action;
  640. __le16 enable;
  641. } __attribute__ ((packed));
  642. struct MrvlIEtype_keyParamSet {
  643. /* type ID */
  644. __le16 type;
  645. /* length of Payload */
  646. __le16 length;
  647. /* type of key: WEP=0, TKIP=1, AES=2 */
  648. __le16 keytypeid;
  649. /* key control Info specific to a keytypeid */
  650. __le16 keyinfo;
  651. /* length of key */
  652. __le16 keylen;
  653. /* key material of size keylen */
  654. u8 key[32];
  655. } __attribute__ ((packed));
  656. #define MAX_WOL_RULES 16
  657. struct host_wol_rule {
  658. uint8_t rule_no;
  659. uint8_t rule_ops;
  660. __le16 sig_offset;
  661. __le16 sig_length;
  662. __le16 reserve;
  663. __be32 sig_mask;
  664. __be32 signature;
  665. } __attribute__ ((packed));
  666. struct wol_config {
  667. uint8_t action;
  668. uint8_t pattern;
  669. uint8_t no_rules_in_cmd;
  670. uint8_t result;
  671. struct host_wol_rule rule[MAX_WOL_RULES];
  672. } __attribute__ ((packed));
  673. struct cmd_ds_host_sleep {
  674. struct cmd_header hdr;
  675. __le32 criteria;
  676. uint8_t gpio;
  677. uint16_t gap;
  678. struct wol_config wol_conf;
  679. } __attribute__ ((packed));
  680. struct cmd_ds_802_11_key_material {
  681. struct cmd_header hdr;
  682. __le16 action;
  683. struct MrvlIEtype_keyParamSet keyParamSet[2];
  684. } __attribute__ ((packed));
  685. struct cmd_ds_802_11_eeprom_access {
  686. struct cmd_header hdr;
  687. __le16 action;
  688. __le16 offset;
  689. __le16 len;
  690. /* firmware says it returns a maximum of 20 bytes */
  691. #define LBS_EEPROM_READ_LEN 20
  692. u8 value[LBS_EEPROM_READ_LEN];
  693. } __attribute__ ((packed));
  694. struct cmd_ds_802_11_tpc_cfg {
  695. struct cmd_header hdr;
  696. __le16 action;
  697. uint8_t enable;
  698. int8_t P0;
  699. int8_t P1;
  700. int8_t P2;
  701. uint8_t usesnr;
  702. } __attribute__ ((packed));
  703. struct cmd_ds_802_11_pa_cfg {
  704. struct cmd_header hdr;
  705. __le16 action;
  706. uint8_t enable;
  707. int8_t P0;
  708. int8_t P1;
  709. int8_t P2;
  710. } __attribute__ ((packed));
  711. struct cmd_ds_802_11_led_ctrl {
  712. __le16 action;
  713. __le16 numled;
  714. u8 data[256];
  715. } __attribute__ ((packed));
  716. struct cmd_ds_802_11_afc {
  717. __le16 afc_auto;
  718. union {
  719. struct {
  720. __le16 threshold;
  721. __le16 period;
  722. };
  723. struct {
  724. __le16 timing_offset; /* signed */
  725. __le16 carrier_offset; /* signed */
  726. };
  727. };
  728. } __attribute__ ((packed));
  729. struct cmd_tx_rate_query {
  730. __le16 txrate;
  731. } __attribute__ ((packed));
  732. struct cmd_ds_get_tsf {
  733. __le64 tsfvalue;
  734. } __attribute__ ((packed));
  735. struct cmd_ds_bt_access {
  736. __le16 action;
  737. __le32 id;
  738. u8 addr1[ETH_ALEN];
  739. u8 addr2[ETH_ALEN];
  740. } __attribute__ ((packed));
  741. struct cmd_ds_fwt_access {
  742. __le16 action;
  743. __le32 id;
  744. u8 valid;
  745. u8 da[ETH_ALEN];
  746. u8 dir;
  747. u8 ra[ETH_ALEN];
  748. __le32 ssn;
  749. __le32 dsn;
  750. __le32 metric;
  751. u8 rate;
  752. u8 hopcount;
  753. u8 ttl;
  754. __le32 expiration;
  755. u8 sleepmode;
  756. __le32 snr;
  757. __le32 references;
  758. u8 prec[ETH_ALEN];
  759. } __attribute__ ((packed));
  760. struct cmd_ds_mesh_config {
  761. struct cmd_header hdr;
  762. __le16 action;
  763. __le16 channel;
  764. __le16 type;
  765. __le16 length;
  766. u8 data[128]; /* last position reserved */
  767. } __attribute__ ((packed));
  768. struct cmd_ds_mesh_access {
  769. struct cmd_header hdr;
  770. __le16 action;
  771. __le32 data[32]; /* last position reserved */
  772. } __attribute__ ((packed));
  773. /* Number of stats counters returned by the firmware */
  774. #define MESH_STATS_NUM 8
  775. struct cmd_ds_command {
  776. /* command header */
  777. __le16 command;
  778. __le16 size;
  779. __le16 seqnum;
  780. __le16 result;
  781. /* command Body */
  782. union {
  783. struct cmd_ds_802_11_ps_mode psmode;
  784. struct cmd_ds_802_11_monitor_mode monitor;
  785. struct cmd_ds_802_11_rssi rssi;
  786. struct cmd_ds_802_11_rssi_rsp rssirsp;
  787. struct cmd_ds_mac_reg_access macreg;
  788. struct cmd_ds_bbp_reg_access bbpreg;
  789. struct cmd_ds_rf_reg_access rfreg;
  790. struct cmd_ds_802_11_tpc_cfg tpccfg;
  791. struct cmd_ds_802_11_afc afc;
  792. struct cmd_ds_802_11_led_ctrl ledgpio;
  793. struct cmd_ds_bt_access bt;
  794. struct cmd_ds_fwt_access fwt;
  795. struct cmd_ds_802_11_beacon_control bcn_ctrl;
  796. } params;
  797. } __attribute__ ((packed));
  798. #endif