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