host.h 25 KB

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