host.h 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988
  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. } __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. } __packed bss;
  305. } __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. } __packed;
  324. struct cmd_header {
  325. __le16 command;
  326. __le16 size;
  327. __le16 seqnum;
  328. __le16 result;
  329. } __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. } __packed;
  342. #define MRVDRV_MAX_TRIPLET_802_11D 83
  343. #define COUNTRY_CODE_LEN 3
  344. struct mrvl_ie_domain_param_set {
  345. struct mrvl_ie_header header;
  346. u8 countrycode[COUNTRY_CODE_LEN];
  347. struct ieee80211_country_ie_triplet triplet[1];
  348. } __attribute__ ((packed));
  349. struct cmd_ds_802_11d_domain_info {
  350. __le16 action;
  351. struct mrvl_ie_domain_param_set domain;
  352. } __attribute__ ((packed));
  353. struct lbs_802_11d_domain_reg {
  354. /** Country code*/
  355. u8 country_code[COUNTRY_CODE_LEN];
  356. /** No. of triplet*/
  357. u8 no_triplet;
  358. struct ieee80211_country_ie_triplet triplet[MRVDRV_MAX_TRIPLET_802_11D];
  359. } __attribute__ ((packed));
  360. /*
  361. * Define data structure for CMD_GET_HW_SPEC
  362. * This structure defines the response for the GET_HW_SPEC command
  363. */
  364. struct cmd_ds_get_hw_spec {
  365. struct cmd_header hdr;
  366. /* HW Interface version number */
  367. __le16 hwifversion;
  368. /* HW version number */
  369. __le16 version;
  370. /* Max number of TxPD FW can handle */
  371. __le16 nr_txpd;
  372. /* Max no of Multicast address */
  373. __le16 nr_mcast_adr;
  374. /* MAC address */
  375. u8 permanentaddr[6];
  376. /* region Code */
  377. __le16 regioncode;
  378. /* Number of antenna used */
  379. __le16 nr_antenna;
  380. /* FW release number, example 0x01030304 = 2.3.4p1 */
  381. __le32 fwrelease;
  382. /* Base Address of TxPD queue */
  383. __le32 wcb_base;
  384. /* Read Pointer of RxPd queue */
  385. __le32 rxpd_rdptr;
  386. /* Write Pointer of RxPd queue */
  387. __le32 rxpd_wrptr;
  388. /*FW/HW capability */
  389. __le32 fwcapinfo;
  390. } __packed;
  391. struct cmd_ds_802_11_subscribe_event {
  392. struct cmd_header hdr;
  393. __le16 action;
  394. __le16 events;
  395. /* A TLV to the CMD_802_11_SUBSCRIBE_EVENT command can contain a
  396. * number of TLVs. From the v5.1 manual, those TLVs would add up to
  397. * 40 bytes. However, future firmware might add additional TLVs, so I
  398. * bump this up a bit.
  399. */
  400. uint8_t tlv[128];
  401. } __packed;
  402. /*
  403. * This scan handle Country Information IE(802.11d compliant)
  404. * Define data structure for CMD_802_11_SCAN
  405. */
  406. struct cmd_ds_802_11_scan {
  407. struct cmd_header hdr;
  408. uint8_t bsstype;
  409. uint8_t bssid[ETH_ALEN];
  410. uint8_t tlvbuffer[0];
  411. } __packed;
  412. struct cmd_ds_802_11_scan_rsp {
  413. struct cmd_header hdr;
  414. __le16 bssdescriptsize;
  415. uint8_t nr_sets;
  416. uint8_t bssdesc_and_tlvbuffer[0];
  417. } __packed;
  418. struct cmd_ds_802_11_get_log {
  419. struct cmd_header hdr;
  420. __le32 mcasttxframe;
  421. __le32 failed;
  422. __le32 retry;
  423. __le32 multiretry;
  424. __le32 framedup;
  425. __le32 rtssuccess;
  426. __le32 rtsfailure;
  427. __le32 ackfailure;
  428. __le32 rxfrag;
  429. __le32 mcastrxframe;
  430. __le32 fcserror;
  431. __le32 txframe;
  432. __le32 wepundecryptable;
  433. } __packed;
  434. struct cmd_ds_mac_control {
  435. struct cmd_header hdr;
  436. __le16 action;
  437. u16 reserved;
  438. } __packed;
  439. struct cmd_ds_mac_multicast_adr {
  440. struct cmd_header hdr;
  441. __le16 action;
  442. __le16 nr_of_adrs;
  443. u8 maclist[ETH_ALEN * MRVDRV_MAX_MULTICAST_LIST_SIZE];
  444. } __packed;
  445. struct cmd_ds_802_11_authenticate {
  446. struct cmd_header hdr;
  447. u8 bssid[ETH_ALEN];
  448. u8 authtype;
  449. u8 reserved[10];
  450. } __packed;
  451. struct cmd_ds_802_11_deauthenticate {
  452. struct cmd_header hdr;
  453. u8 macaddr[ETH_ALEN];
  454. __le16 reasoncode;
  455. } __packed;
  456. struct cmd_ds_802_11_associate {
  457. struct cmd_header hdr;
  458. u8 bssid[6];
  459. __le16 capability;
  460. __le16 listeninterval;
  461. __le16 bcnperiod;
  462. u8 dtimperiod;
  463. u8 iebuf[512]; /* Enough for required and most optional IEs */
  464. } __packed;
  465. struct cmd_ds_802_11_associate_response {
  466. struct cmd_header hdr;
  467. __le16 capability;
  468. __le16 statuscode;
  469. __le16 aid;
  470. u8 iebuf[512];
  471. } __packed;
  472. struct cmd_ds_802_11_set_wep {
  473. struct cmd_header hdr;
  474. /* ACT_ADD, ACT_REMOVE or ACT_ENABLE */
  475. __le16 action;
  476. /* key Index selected for Tx */
  477. __le16 keyindex;
  478. /* 40, 128bit or TXWEP */
  479. uint8_t keytype[4];
  480. uint8_t keymaterial[4][16];
  481. } __packed;
  482. struct cmd_ds_802_11_snmp_mib {
  483. struct cmd_header hdr;
  484. __le16 action;
  485. __le16 oid;
  486. __le16 bufsize;
  487. u8 value[128];
  488. } __packed;
  489. struct cmd_ds_mac_reg_access {
  490. __le16 action;
  491. __le16 offset;
  492. __le32 value;
  493. } __packed;
  494. struct cmd_ds_bbp_reg_access {
  495. __le16 action;
  496. __le16 offset;
  497. u8 value;
  498. u8 reserved[3];
  499. } __packed;
  500. struct cmd_ds_rf_reg_access {
  501. __le16 action;
  502. __le16 offset;
  503. u8 value;
  504. u8 reserved[3];
  505. } __packed;
  506. struct cmd_ds_802_11_radio_control {
  507. struct cmd_header hdr;
  508. __le16 action;
  509. __le16 control;
  510. } __packed;
  511. struct cmd_ds_802_11_beacon_control {
  512. __le16 action;
  513. __le16 beacon_enable;
  514. __le16 beacon_period;
  515. } __packed;
  516. struct cmd_ds_802_11_sleep_params {
  517. struct cmd_header hdr;
  518. /* ACT_GET/ACT_SET */
  519. __le16 action;
  520. /* Sleep clock error in ppm */
  521. __le16 error;
  522. /* Wakeup offset in usec */
  523. __le16 offset;
  524. /* Clock stabilization time in usec */
  525. __le16 stabletime;
  526. /* control periodic calibration */
  527. uint8_t calcontrol;
  528. /* control the use of external sleep clock */
  529. uint8_t externalsleepclk;
  530. /* reserved field, should be set to zero */
  531. __le16 reserved;
  532. } __packed;
  533. struct cmd_ds_802_11_rf_channel {
  534. struct cmd_header hdr;
  535. __le16 action;
  536. __le16 channel;
  537. __le16 rftype; /* unused */
  538. __le16 reserved; /* unused */
  539. u8 channellist[32]; /* unused */
  540. } __packed;
  541. struct cmd_ds_802_11_rssi {
  542. /* weighting factor */
  543. __le16 N;
  544. __le16 reserved_0;
  545. __le16 reserved_1;
  546. __le16 reserved_2;
  547. } __packed;
  548. struct cmd_ds_802_11_rssi_rsp {
  549. __le16 SNR;
  550. __le16 noisefloor;
  551. __le16 avgSNR;
  552. __le16 avgnoisefloor;
  553. } __packed;
  554. struct cmd_ds_802_11_mac_address {
  555. struct cmd_header hdr;
  556. __le16 action;
  557. u8 macadd[ETH_ALEN];
  558. } __packed;
  559. struct cmd_ds_802_11_rf_tx_power {
  560. struct cmd_header hdr;
  561. __le16 action;
  562. __le16 curlevel;
  563. s8 maxlevel;
  564. s8 minlevel;
  565. } __packed;
  566. struct cmd_ds_802_11_monitor_mode {
  567. __le16 action;
  568. __le16 mode;
  569. } __packed;
  570. struct cmd_ds_set_boot2_ver {
  571. struct cmd_header hdr;
  572. __le16 action;
  573. __le16 version;
  574. } __packed;
  575. struct cmd_ds_802_11_fw_wake_method {
  576. struct cmd_header hdr;
  577. __le16 action;
  578. __le16 method;
  579. } __packed;
  580. struct cmd_ds_802_11_ps_mode {
  581. __le16 action;
  582. __le16 nullpktinterval;
  583. __le16 multipledtim;
  584. __le16 reserved;
  585. __le16 locallisteninterval;
  586. } __packed;
  587. struct cmd_confirm_sleep {
  588. struct cmd_header hdr;
  589. __le16 action;
  590. __le16 nullpktinterval;
  591. __le16 multipledtim;
  592. __le16 reserved;
  593. __le16 locallisteninterval;
  594. } __packed;
  595. struct cmd_ds_802_11_data_rate {
  596. struct cmd_header hdr;
  597. __le16 action;
  598. __le16 reserved;
  599. u8 rates[MAX_RATES];
  600. } __packed;
  601. struct cmd_ds_802_11_rate_adapt_rateset {
  602. struct cmd_header hdr;
  603. __le16 action;
  604. __le16 enablehwauto;
  605. __le16 bitmap;
  606. } __packed;
  607. struct cmd_ds_802_11_ad_hoc_start {
  608. struct cmd_header hdr;
  609. u8 ssid[IEEE80211_MAX_SSID_LEN];
  610. u8 bsstype;
  611. __le16 beaconperiod;
  612. u8 dtimperiod; /* Reserved on v9 and later */
  613. struct ieee_ie_ibss_param_set ibss;
  614. u8 reserved1[4];
  615. struct ieee_ie_ds_param_set ds;
  616. u8 reserved2[4];
  617. __le16 probedelay; /* Reserved on v9 and later */
  618. __le16 capability;
  619. u8 rates[MAX_RATES];
  620. u8 tlv_memory_size_pad[100];
  621. } __packed;
  622. struct cmd_ds_802_11_ad_hoc_result {
  623. struct cmd_header hdr;
  624. u8 pad[3];
  625. u8 bssid[ETH_ALEN];
  626. } __packed;
  627. struct adhoc_bssdesc {
  628. u8 bssid[ETH_ALEN];
  629. u8 ssid[IEEE80211_MAX_SSID_LEN];
  630. u8 type;
  631. __le16 beaconperiod;
  632. u8 dtimperiod;
  633. __le64 timestamp;
  634. __le64 localtime;
  635. struct ieee_ie_ds_param_set ds;
  636. u8 reserved1[4];
  637. struct ieee_ie_ibss_param_set ibss;
  638. u8 reserved2[4];
  639. __le16 capability;
  640. u8 rates[MAX_RATES];
  641. /* DO NOT ADD ANY FIELDS TO THIS STRUCTURE. It is used below in the
  642. * Adhoc join command and will cause a binary layout mismatch with
  643. * the firmware
  644. */
  645. } __packed;
  646. struct cmd_ds_802_11_ad_hoc_join {
  647. struct cmd_header hdr;
  648. struct adhoc_bssdesc bss;
  649. __le16 failtimeout; /* Reserved on v9 and later */
  650. __le16 probedelay; /* Reserved on v9 and later */
  651. } __packed;
  652. struct cmd_ds_802_11_ad_hoc_stop {
  653. struct cmd_header hdr;
  654. } __packed;
  655. struct cmd_ds_802_11_enable_rsn {
  656. struct cmd_header hdr;
  657. __le16 action;
  658. __le16 enable;
  659. } __packed;
  660. struct MrvlIEtype_keyParamSet {
  661. /* type ID */
  662. __le16 type;
  663. /* length of Payload */
  664. __le16 length;
  665. /* type of key: WEP=0, TKIP=1, AES=2 */
  666. __le16 keytypeid;
  667. /* key control Info specific to a keytypeid */
  668. __le16 keyinfo;
  669. /* length of key */
  670. __le16 keylen;
  671. /* key material of size keylen */
  672. u8 key[32];
  673. } __packed;
  674. #define MAX_WOL_RULES 16
  675. struct host_wol_rule {
  676. uint8_t rule_no;
  677. uint8_t rule_ops;
  678. __le16 sig_offset;
  679. __le16 sig_length;
  680. __le16 reserve;
  681. __be32 sig_mask;
  682. __be32 signature;
  683. } __packed;
  684. struct wol_config {
  685. uint8_t action;
  686. uint8_t pattern;
  687. uint8_t no_rules_in_cmd;
  688. uint8_t result;
  689. struct host_wol_rule rule[MAX_WOL_RULES];
  690. } __packed;
  691. struct cmd_ds_host_sleep {
  692. struct cmd_header hdr;
  693. __le32 criteria;
  694. uint8_t gpio;
  695. uint16_t gap;
  696. struct wol_config wol_conf;
  697. } __packed;
  698. struct cmd_ds_802_11_key_material {
  699. struct cmd_header hdr;
  700. __le16 action;
  701. struct MrvlIEtype_keyParamSet keyParamSet[2];
  702. } __packed;
  703. struct cmd_ds_802_11_eeprom_access {
  704. struct cmd_header hdr;
  705. __le16 action;
  706. __le16 offset;
  707. __le16 len;
  708. /* firmware says it returns a maximum of 20 bytes */
  709. #define LBS_EEPROM_READ_LEN 20
  710. u8 value[LBS_EEPROM_READ_LEN];
  711. } __packed;
  712. struct cmd_ds_802_11_tpc_cfg {
  713. struct cmd_header hdr;
  714. __le16 action;
  715. uint8_t enable;
  716. int8_t P0;
  717. int8_t P1;
  718. int8_t P2;
  719. uint8_t usesnr;
  720. } __packed;
  721. struct cmd_ds_802_11_pa_cfg {
  722. struct cmd_header hdr;
  723. __le16 action;
  724. uint8_t enable;
  725. int8_t P0;
  726. int8_t P1;
  727. int8_t P2;
  728. } __packed;
  729. struct cmd_ds_802_11_led_ctrl {
  730. __le16 action;
  731. __le16 numled;
  732. u8 data[256];
  733. } __packed;
  734. struct cmd_ds_802_11_afc {
  735. __le16 afc_auto;
  736. union {
  737. struct {
  738. __le16 threshold;
  739. __le16 period;
  740. };
  741. struct {
  742. __le16 timing_offset; /* signed */
  743. __le16 carrier_offset; /* signed */
  744. };
  745. };
  746. } __packed;
  747. struct cmd_tx_rate_query {
  748. __le16 txrate;
  749. } __packed;
  750. struct cmd_ds_get_tsf {
  751. __le64 tsfvalue;
  752. } __packed;
  753. struct cmd_ds_bt_access {
  754. __le16 action;
  755. __le32 id;
  756. u8 addr1[ETH_ALEN];
  757. u8 addr2[ETH_ALEN];
  758. } __packed;
  759. struct cmd_ds_fwt_access {
  760. __le16 action;
  761. __le32 id;
  762. u8 valid;
  763. u8 da[ETH_ALEN];
  764. u8 dir;
  765. u8 ra[ETH_ALEN];
  766. __le32 ssn;
  767. __le32 dsn;
  768. __le32 metric;
  769. u8 rate;
  770. u8 hopcount;
  771. u8 ttl;
  772. __le32 expiration;
  773. u8 sleepmode;
  774. __le32 snr;
  775. __le32 references;
  776. u8 prec[ETH_ALEN];
  777. } __packed;
  778. struct cmd_ds_mesh_config {
  779. struct cmd_header hdr;
  780. __le16 action;
  781. __le16 channel;
  782. __le16 type;
  783. __le16 length;
  784. u8 data[128]; /* last position reserved */
  785. } __packed;
  786. struct cmd_ds_mesh_access {
  787. struct cmd_header hdr;
  788. __le16 action;
  789. __le32 data[32]; /* last position reserved */
  790. } __packed;
  791. /* Number of stats counters returned by the firmware */
  792. #define MESH_STATS_NUM 8
  793. struct cmd_ds_command {
  794. /* command header */
  795. __le16 command;
  796. __le16 size;
  797. __le16 seqnum;
  798. __le16 result;
  799. /* command Body */
  800. union {
  801. struct cmd_ds_802_11_ps_mode psmode;
  802. struct cmd_ds_802_11_monitor_mode monitor;
  803. struct cmd_ds_802_11_rssi rssi;
  804. struct cmd_ds_802_11_rssi_rsp rssirsp;
  805. struct cmd_ds_mac_reg_access macreg;
  806. struct cmd_ds_bbp_reg_access bbpreg;
  807. struct cmd_ds_rf_reg_access rfreg;
  808. struct cmd_ds_802_11d_domain_info domaininfo;
  809. struct cmd_ds_802_11d_domain_info domaininforesp;
  810. struct cmd_ds_802_11_tpc_cfg tpccfg;
  811. struct cmd_ds_802_11_afc afc;
  812. struct cmd_ds_802_11_led_ctrl ledgpio;
  813. struct cmd_ds_bt_access bt;
  814. struct cmd_ds_fwt_access fwt;
  815. struct cmd_ds_802_11_beacon_control bcn_ctrl;
  816. } params;
  817. } __packed;
  818. #endif