host.h 24 KB

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