host.h 24 KB

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