hostap_common.h 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef HOSTAP_COMMON_H
  3. #define HOSTAP_COMMON_H
  4. #include <linux/types.h>
  5. #include <linux/if_ether.h>
  6. /* IEEE 802.11 defines */
  7. /* HFA384X Configuration RIDs */
  8. #define HFA384X_RID_CNFPORTTYPE 0xFC00
  9. #define HFA384X_RID_CNFOWNMACADDR 0xFC01
  10. #define HFA384X_RID_CNFDESIREDSSID 0xFC02
  11. #define HFA384X_RID_CNFOWNCHANNEL 0xFC03
  12. #define HFA384X_RID_CNFOWNSSID 0xFC04
  13. #define HFA384X_RID_CNFOWNATIMWINDOW 0xFC05
  14. #define HFA384X_RID_CNFSYSTEMSCALE 0xFC06
  15. #define HFA384X_RID_CNFMAXDATALEN 0xFC07
  16. #define HFA384X_RID_CNFWDSADDRESS 0xFC08
  17. #define HFA384X_RID_CNFPMENABLED 0xFC09
  18. #define HFA384X_RID_CNFPMEPS 0xFC0A
  19. #define HFA384X_RID_CNFMULTICASTRECEIVE 0xFC0B
  20. #define HFA384X_RID_CNFMAXSLEEPDURATION 0xFC0C
  21. #define HFA384X_RID_CNFPMHOLDOVERDURATION 0xFC0D
  22. #define HFA384X_RID_CNFOWNNAME 0xFC0E
  23. #define HFA384X_RID_CNFOWNDTIMPERIOD 0xFC10
  24. #define HFA384X_RID_CNFWDSADDRESS1 0xFC11 /* AP f/w only */
  25. #define HFA384X_RID_CNFWDSADDRESS2 0xFC12 /* AP f/w only */
  26. #define HFA384X_RID_CNFWDSADDRESS3 0xFC13 /* AP f/w only */
  27. #define HFA384X_RID_CNFWDSADDRESS4 0xFC14 /* AP f/w only */
  28. #define HFA384X_RID_CNFWDSADDRESS5 0xFC15 /* AP f/w only */
  29. #define HFA384X_RID_CNFWDSADDRESS6 0xFC16 /* AP f/w only */
  30. #define HFA384X_RID_CNFMULTICASTPMBUFFERING 0xFC17 /* AP f/w only */
  31. #define HFA384X_RID_UNKNOWN1 0xFC20
  32. #define HFA384X_RID_UNKNOWN2 0xFC21
  33. #define HFA384X_RID_CNFWEPDEFAULTKEYID 0xFC23
  34. #define HFA384X_RID_CNFDEFAULTKEY0 0xFC24
  35. #define HFA384X_RID_CNFDEFAULTKEY1 0xFC25
  36. #define HFA384X_RID_CNFDEFAULTKEY2 0xFC26
  37. #define HFA384X_RID_CNFDEFAULTKEY3 0xFC27
  38. #define HFA384X_RID_CNFWEPFLAGS 0xFC28
  39. #define HFA384X_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
  40. #define HFA384X_RID_CNFAUTHENTICATION 0xFC2A
  41. #define HFA384X_RID_CNFMAXASSOCSTA 0xFC2B /* AP f/w only */
  42. #define HFA384X_RID_CNFTXCONTROL 0xFC2C
  43. #define HFA384X_RID_CNFROAMINGMODE 0xFC2D
  44. #define HFA384X_RID_CNFHOSTAUTHENTICATION 0xFC2E /* AP f/w only */
  45. #define HFA384X_RID_CNFRCVCRCERROR 0xFC30
  46. #define HFA384X_RID_CNFMMLIFE 0xFC31
  47. #define HFA384X_RID_CNFALTRETRYCOUNT 0xFC32
  48. #define HFA384X_RID_CNFBEACONINT 0xFC33
  49. #define HFA384X_RID_CNFAPPCFINFO 0xFC34 /* AP f/w only */
  50. #define HFA384X_RID_CNFSTAPCFINFO 0xFC35
  51. #define HFA384X_RID_CNFPRIORITYQUSAGE 0xFC37
  52. #define HFA384X_RID_CNFTIMCTRL 0xFC40
  53. #define HFA384X_RID_UNKNOWN3 0xFC41 /* added in STA f/w 0.7.x */
  54. #define HFA384X_RID_CNFTHIRTY2TALLY 0xFC42 /* added in STA f/w 0.8.0 */
  55. #define HFA384X_RID_CNFENHSECURITY 0xFC43 /* AP f/w or STA f/w >= 1.6.3 */
  56. #define HFA384X_RID_CNFDBMADJUST 0xFC46 /* added in STA f/w 1.3.1 */
  57. #define HFA384X_RID_GENERICELEMENT 0xFC48 /* added in STA f/w 1.7.0;
  58. * write only */
  59. #define HFA384X_RID_PROPAGATIONDELAY 0xFC49 /* added in STA f/w 1.7.6 */
  60. #define HFA384X_RID_GROUPADDRESSES 0xFC80
  61. #define HFA384X_RID_CREATEIBSS 0xFC81
  62. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD 0xFC82
  63. #define HFA384X_RID_RTSTHRESHOLD 0xFC83
  64. #define HFA384X_RID_TXRATECONTROL 0xFC84
  65. #define HFA384X_RID_PROMISCUOUSMODE 0xFC85
  66. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD0 0xFC90 /* AP f/w only */
  67. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD1 0xFC91 /* AP f/w only */
  68. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD2 0xFC92 /* AP f/w only */
  69. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD3 0xFC93 /* AP f/w only */
  70. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD4 0xFC94 /* AP f/w only */
  71. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD5 0xFC95 /* AP f/w only */
  72. #define HFA384X_RID_FRAGMENTATIONTHRESHOLD6 0xFC96 /* AP f/w only */
  73. #define HFA384X_RID_RTSTHRESHOLD0 0xFC97 /* AP f/w only */
  74. #define HFA384X_RID_RTSTHRESHOLD1 0xFC98 /* AP f/w only */
  75. #define HFA384X_RID_RTSTHRESHOLD2 0xFC99 /* AP f/w only */
  76. #define HFA384X_RID_RTSTHRESHOLD3 0xFC9A /* AP f/w only */
  77. #define HFA384X_RID_RTSTHRESHOLD4 0xFC9B /* AP f/w only */
  78. #define HFA384X_RID_RTSTHRESHOLD5 0xFC9C /* AP f/w only */
  79. #define HFA384X_RID_RTSTHRESHOLD6 0xFC9D /* AP f/w only */
  80. #define HFA384X_RID_TXRATECONTROL0 0xFC9E /* AP f/w only */
  81. #define HFA384X_RID_TXRATECONTROL1 0xFC9F /* AP f/w only */
  82. #define HFA384X_RID_TXRATECONTROL2 0xFCA0 /* AP f/w only */
  83. #define HFA384X_RID_TXRATECONTROL3 0xFCA1 /* AP f/w only */
  84. #define HFA384X_RID_TXRATECONTROL4 0xFCA2 /* AP f/w only */
  85. #define HFA384X_RID_TXRATECONTROL5 0xFCA3 /* AP f/w only */
  86. #define HFA384X_RID_TXRATECONTROL6 0xFCA4 /* AP f/w only */
  87. #define HFA384X_RID_CNFSHORTPREAMBLE 0xFCB0
  88. #define HFA384X_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
  89. #define HFA384X_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
  90. #define HFA384X_RID_CNFBASICRATES 0xFCB3
  91. #define HFA384X_RID_CNFSUPPORTEDRATES 0xFCB4
  92. #define HFA384X_RID_CNFFALLBACKCTRL 0xFCB5 /* added in STA f/w 1.3.1 */
  93. #define HFA384X_RID_WEPKEYDISABLE 0xFCB6 /* added in STA f/w 1.3.1 */
  94. #define HFA384X_RID_WEPKEYMAPINDEX 0xFCB7 /* ? */
  95. #define HFA384X_RID_BROADCASTKEYID 0xFCB8 /* ? */
  96. #define HFA384X_RID_ENTSECFLAGEYID 0xFCB9 /* ? */
  97. #define HFA384X_RID_CNFPASSIVESCANCTRL 0xFCBA /* added in STA f/w 1.5.0 */
  98. #define HFA384X_RID_SSNHANDLINGMODE 0xFCBB /* added in STA f/w 1.7.0 */
  99. #define HFA384X_RID_MDCCONTROL 0xFCBC /* added in STA f/w 1.7.0 */
  100. #define HFA384X_RID_MDCCOUNTRY 0xFCBD /* added in STA f/w 1.7.0 */
  101. #define HFA384X_RID_TXPOWERMAX 0xFCBE /* added in STA f/w 1.7.0 */
  102. #define HFA384X_RID_CNFLFOENABLED 0xFCBF /* added in STA f/w 1.6.3 */
  103. #define HFA384X_RID_CAPINFO 0xFCC0 /* added in STA f/w 1.7.0 */
  104. #define HFA384X_RID_LISTENINTERVAL 0xFCC1 /* added in STA f/w 1.7.0 */
  105. #define HFA384X_RID_SW_ANT_DIV 0xFCC2 /* added in STA f/w 1.7.0; Prism3 */
  106. #define HFA384X_RID_LED_CTRL 0xFCC4 /* added in STA f/w 1.7.6 */
  107. #define HFA384X_RID_HFODELAY 0xFCC5 /* added in STA f/w 1.7.6 */
  108. #define HFA384X_RID_DISALLOWEDBSSID 0xFCC6 /* added in STA f/w 1.8.0 */
  109. #define HFA384X_RID_TICKTIME 0xFCE0
  110. #define HFA384X_RID_SCANREQUEST 0xFCE1
  111. #define HFA384X_RID_JOINREQUEST 0xFCE2
  112. #define HFA384X_RID_AUTHENTICATESTATION 0xFCE3 /* AP f/w only */
  113. #define HFA384X_RID_CHANNELINFOREQUEST 0xFCE4 /* AP f/w only */
  114. #define HFA384X_RID_HOSTSCAN 0xFCE5 /* added in STA f/w 1.3.1 */
  115. /* HFA384X Information RIDs */
  116. #define HFA384X_RID_MAXLOADTIME 0xFD00
  117. #define HFA384X_RID_DOWNLOADBUFFER 0xFD01
  118. #define HFA384X_RID_PRIID 0xFD02
  119. #define HFA384X_RID_PRISUPRANGE 0xFD03
  120. #define HFA384X_RID_CFIACTRANGES 0xFD04
  121. #define HFA384X_RID_NICSERNUM 0xFD0A
  122. #define HFA384X_RID_NICID 0xFD0B
  123. #define HFA384X_RID_MFISUPRANGE 0xFD0C
  124. #define HFA384X_RID_CFISUPRANGE 0xFD0D
  125. #define HFA384X_RID_CHANNELLIST 0xFD10
  126. #define HFA384X_RID_REGULATORYDOMAINS 0xFD11
  127. #define HFA384X_RID_TEMPTYPE 0xFD12
  128. #define HFA384X_RID_CIS 0xFD13
  129. #define HFA384X_RID_STAID 0xFD20
  130. #define HFA384X_RID_STASUPRANGE 0xFD21
  131. #define HFA384X_RID_MFIACTRANGES 0xFD22
  132. #define HFA384X_RID_CFIACTRANGES2 0xFD23
  133. #define HFA384X_RID_PRODUCTNAME 0xFD24 /* added in STA f/w 1.3.1;
  134. * only Prism2.5(?) */
  135. #define HFA384X_RID_PORTSTATUS 0xFD40
  136. #define HFA384X_RID_CURRENTSSID 0xFD41
  137. #define HFA384X_RID_CURRENTBSSID 0xFD42
  138. #define HFA384X_RID_COMMSQUALITY 0xFD43
  139. #define HFA384X_RID_CURRENTTXRATE 0xFD44
  140. #define HFA384X_RID_CURRENTBEACONINTERVAL 0xFD45
  141. #define HFA384X_RID_CURRENTSCALETHRESHOLDS 0xFD46
  142. #define HFA384X_RID_PROTOCOLRSPTIME 0xFD47
  143. #define HFA384X_RID_SHORTRETRYLIMIT 0xFD48
  144. #define HFA384X_RID_LONGRETRYLIMIT 0xFD49
  145. #define HFA384X_RID_MAXTRANSMITLIFETIME 0xFD4A
  146. #define HFA384X_RID_MAXRECEIVELIFETIME 0xFD4B
  147. #define HFA384X_RID_CFPOLLABLE 0xFD4C
  148. #define HFA384X_RID_AUTHENTICATIONALGORITHMS 0xFD4D
  149. #define HFA384X_RID_PRIVACYOPTIONIMPLEMENTED 0xFD4F
  150. #define HFA384X_RID_DBMCOMMSQUALITY 0xFD51 /* added in STA f/w 1.3.1 */
  151. #define HFA384X_RID_CURRENTTXRATE1 0xFD80 /* AP f/w only */
  152. #define HFA384X_RID_CURRENTTXRATE2 0xFD81 /* AP f/w only */
  153. #define HFA384X_RID_CURRENTTXRATE3 0xFD82 /* AP f/w only */
  154. #define HFA384X_RID_CURRENTTXRATE4 0xFD83 /* AP f/w only */
  155. #define HFA384X_RID_CURRENTTXRATE5 0xFD84 /* AP f/w only */
  156. #define HFA384X_RID_CURRENTTXRATE6 0xFD85 /* AP f/w only */
  157. #define HFA384X_RID_OWNMACADDR 0xFD86 /* AP f/w only */
  158. #define HFA384X_RID_SCANRESULTSTABLE 0xFD88 /* added in STA f/w 0.8.3 */
  159. #define HFA384X_RID_HOSTSCANRESULTS 0xFD89 /* added in STA f/w 1.3.1 */
  160. #define HFA384X_RID_AUTHENTICATIONUSED 0xFD8A /* added in STA f/w 1.3.4 */
  161. #define HFA384X_RID_CNFFAASWITCHCTRL 0xFD8B /* added in STA f/w 1.6.3 */
  162. #define HFA384X_RID_ASSOCIATIONFAILURE 0xFD8D /* added in STA f/w 1.8.0 */
  163. #define HFA384X_RID_PHYTYPE 0xFDC0
  164. #define HFA384X_RID_CURRENTCHANNEL 0xFDC1
  165. #define HFA384X_RID_CURRENTPOWERSTATE 0xFDC2
  166. #define HFA384X_RID_CCAMODE 0xFDC3
  167. #define HFA384X_RID_SUPPORTEDDATARATES 0xFDC6
  168. #define HFA384X_RID_LFO_VOLT_REG_TEST_RES 0xFDC7 /* added in STA f/w 1.7.1 */
  169. #define HFA384X_RID_BUILDSEQ 0xFFFE
  170. #define HFA384X_RID_FWID 0xFFFF
  171. struct hfa384x_comp_ident
  172. {
  173. __le16 id;
  174. __le16 variant;
  175. __le16 major;
  176. __le16 minor;
  177. } __packed;
  178. #define HFA384X_COMP_ID_PRI 0x15
  179. #define HFA384X_COMP_ID_STA 0x1f
  180. #define HFA384X_COMP_ID_FW_AP 0x14b
  181. struct hfa384x_sup_range
  182. {
  183. __le16 role;
  184. __le16 id;
  185. __le16 variant;
  186. __le16 bottom;
  187. __le16 top;
  188. } __packed;
  189. struct hfa384x_build_id
  190. {
  191. __le16 pri_seq;
  192. __le16 sec_seq;
  193. } __packed;
  194. /* FD01 - Download Buffer */
  195. struct hfa384x_rid_download_buffer
  196. {
  197. __le16 page;
  198. __le16 offset;
  199. __le16 length;
  200. } __packed;
  201. /* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */
  202. struct hfa384x_comms_quality {
  203. __le16 comm_qual; /* 0 .. 92 */
  204. __le16 signal_level; /* 27 .. 154 */
  205. __le16 noise_level; /* 27 .. 154 */
  206. } __packed;
  207. /* netdevice private ioctls (used, e.g., with iwpriv from user space) */
  208. /* New wireless extensions API - SET/GET convention (even ioctl numbers are
  209. * root only)
  210. */
  211. #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
  212. #define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
  213. #define PRISM2_IOCTL_WRITEMIF (SIOCIWFIRSTPRIV + 2)
  214. #define PRISM2_IOCTL_READMIF (SIOCIWFIRSTPRIV + 3)
  215. #define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4)
  216. #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6)
  217. #define PRISM2_IOCTL_INQUIRE (SIOCIWFIRSTPRIV + 8)
  218. #define PRISM2_IOCTL_WDS_ADD (SIOCIWFIRSTPRIV + 10)
  219. #define PRISM2_IOCTL_WDS_DEL (SIOCIWFIRSTPRIV + 12)
  220. #define PRISM2_IOCTL_SET_RID_WORD (SIOCIWFIRSTPRIV + 14)
  221. #define PRISM2_IOCTL_MACCMD (SIOCIWFIRSTPRIV + 16)
  222. #define PRISM2_IOCTL_ADDMAC (SIOCIWFIRSTPRIV + 18)
  223. #define PRISM2_IOCTL_DELMAC (SIOCIWFIRSTPRIV + 20)
  224. #define PRISM2_IOCTL_KICKMAC (SIOCIWFIRSTPRIV + 22)
  225. /* following are not in SIOCGIWPRIV list; check permission in the driver code
  226. */
  227. #define PRISM2_IOCTL_DOWNLOAD (SIOCDEVPRIVATE + 13)
  228. #define PRISM2_IOCTL_HOSTAPD (SIOCDEVPRIVATE + 14)
  229. /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */
  230. enum {
  231. /* PRISM2_PARAM_PTYPE = 1, */ /* REMOVED 2003-10-22 */
  232. PRISM2_PARAM_TXRATECTRL = 2,
  233. PRISM2_PARAM_BEACON_INT = 3,
  234. PRISM2_PARAM_PSEUDO_IBSS = 4,
  235. PRISM2_PARAM_ALC = 5,
  236. /* PRISM2_PARAM_TXPOWER = 6, */ /* REMOVED 2003-10-22 */
  237. PRISM2_PARAM_DUMP = 7,
  238. PRISM2_PARAM_OTHER_AP_POLICY = 8,
  239. PRISM2_PARAM_AP_MAX_INACTIVITY = 9,
  240. PRISM2_PARAM_AP_BRIDGE_PACKETS = 10,
  241. PRISM2_PARAM_DTIM_PERIOD = 11,
  242. PRISM2_PARAM_AP_NULLFUNC_ACK = 12,
  243. PRISM2_PARAM_MAX_WDS = 13,
  244. PRISM2_PARAM_AP_AUTOM_AP_WDS = 14,
  245. PRISM2_PARAM_AP_AUTH_ALGS = 15,
  246. PRISM2_PARAM_MONITOR_ALLOW_FCSERR = 16,
  247. PRISM2_PARAM_HOST_ENCRYPT = 17,
  248. PRISM2_PARAM_HOST_DECRYPT = 18,
  249. /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19, REMOVED 2005-08-14 */
  250. /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20, REMOVED 2005-08-14 */
  251. PRISM2_PARAM_HOST_ROAMING = 21,
  252. PRISM2_PARAM_BCRX_STA_KEY = 22,
  253. PRISM2_PARAM_IEEE_802_1X = 23,
  254. PRISM2_PARAM_ANTSEL_TX = 24,
  255. PRISM2_PARAM_ANTSEL_RX = 25,
  256. PRISM2_PARAM_MONITOR_TYPE = 26,
  257. PRISM2_PARAM_WDS_TYPE = 27,
  258. PRISM2_PARAM_HOSTSCAN = 28,
  259. PRISM2_PARAM_AP_SCAN = 29,
  260. PRISM2_PARAM_ENH_SEC = 30,
  261. PRISM2_PARAM_IO_DEBUG = 31,
  262. PRISM2_PARAM_BASIC_RATES = 32,
  263. PRISM2_PARAM_OPER_RATES = 33,
  264. PRISM2_PARAM_HOSTAPD = 34,
  265. PRISM2_PARAM_HOSTAPD_STA = 35,
  266. PRISM2_PARAM_WPA = 36,
  267. PRISM2_PARAM_PRIVACY_INVOKED = 37,
  268. PRISM2_PARAM_TKIP_COUNTERMEASURES = 38,
  269. PRISM2_PARAM_DROP_UNENCRYPTED = 39,
  270. PRISM2_PARAM_SCAN_CHANNEL_MASK = 40,
  271. };
  272. enum { HOSTAP_ANTSEL_DO_NOT_TOUCH = 0, HOSTAP_ANTSEL_DIVERSITY = 1,
  273. HOSTAP_ANTSEL_LOW = 2, HOSTAP_ANTSEL_HIGH = 3 };
  274. /* PRISM2_IOCTL_MACCMD ioctl() subcommands: */
  275. enum { AP_MAC_CMD_POLICY_OPEN = 0, AP_MAC_CMD_POLICY_ALLOW = 1,
  276. AP_MAC_CMD_POLICY_DENY = 2, AP_MAC_CMD_FLUSH = 3,
  277. AP_MAC_CMD_KICKALL = 4 };
  278. /* PRISM2_IOCTL_DOWNLOAD ioctl() dl_cmd: */
  279. enum {
  280. PRISM2_DOWNLOAD_VOLATILE = 1 /* RAM */,
  281. /* Note! Old versions of prism2_srec have a fatal error in CRC-16
  282. * calculation, which will corrupt all non-volatile downloads.
  283. * PRISM2_DOWNLOAD_NON_VOLATILE used to be 2, but it is now 3 to
  284. * prevent use of old versions of prism2_srec for non-volatile
  285. * download. */
  286. PRISM2_DOWNLOAD_NON_VOLATILE = 3 /* FLASH */,
  287. PRISM2_DOWNLOAD_VOLATILE_GENESIS = 4 /* RAM in Genesis mode */,
  288. /* Persistent versions of volatile download commands (keep firmware
  289. * data in memory and automatically re-download after hw_reset */
  290. PRISM2_DOWNLOAD_VOLATILE_PERSISTENT = 5,
  291. PRISM2_DOWNLOAD_VOLATILE_GENESIS_PERSISTENT = 6,
  292. };
  293. struct prism2_download_param {
  294. u32 dl_cmd;
  295. u32 start_addr;
  296. u32 num_areas;
  297. struct prism2_download_area {
  298. u32 addr; /* wlan card address */
  299. u32 len;
  300. void __user *ptr; /* pointer to data in user space */
  301. } data[0];
  302. };
  303. #define PRISM2_MAX_DOWNLOAD_AREA_LEN 131072
  304. #define PRISM2_MAX_DOWNLOAD_LEN 262144
  305. /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
  306. enum {
  307. PRISM2_HOSTAPD_FLUSH = 1,
  308. PRISM2_HOSTAPD_ADD_STA = 2,
  309. PRISM2_HOSTAPD_REMOVE_STA = 3,
  310. PRISM2_HOSTAPD_GET_INFO_STA = 4,
  311. /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
  312. PRISM2_SET_ENCRYPTION = 6,
  313. PRISM2_GET_ENCRYPTION = 7,
  314. PRISM2_HOSTAPD_SET_FLAGS_STA = 8,
  315. PRISM2_HOSTAPD_GET_RID = 9,
  316. PRISM2_HOSTAPD_SET_RID = 10,
  317. PRISM2_HOSTAPD_SET_ASSOC_AP_ADDR = 11,
  318. PRISM2_HOSTAPD_SET_GENERIC_ELEMENT = 12,
  319. PRISM2_HOSTAPD_MLME = 13,
  320. PRISM2_HOSTAPD_SCAN_REQ = 14,
  321. PRISM2_HOSTAPD_STA_CLEAR_STATS = 15,
  322. };
  323. #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
  324. #define PRISM2_HOSTAPD_RID_HDR_LEN \
  325. offsetof(struct prism2_hostapd_param, u.rid.data)
  326. #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
  327. offsetof(struct prism2_hostapd_param, u.generic_elem.data)
  328. /* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
  329. */
  330. #define HOSTAP_CRYPT_ALG_NAME_LEN 16
  331. struct prism2_hostapd_param {
  332. u32 cmd;
  333. u8 sta_addr[ETH_ALEN];
  334. union {
  335. struct {
  336. u16 aid;
  337. u16 capability;
  338. u8 tx_supp_rates;
  339. } add_sta;
  340. struct {
  341. u32 inactive_sec;
  342. } get_info_sta;
  343. struct {
  344. u8 alg[HOSTAP_CRYPT_ALG_NAME_LEN];
  345. u32 flags;
  346. u32 err;
  347. u8 idx;
  348. u8 seq[8]; /* sequence counter (set: RX, get: TX) */
  349. u16 key_len;
  350. u8 key[0];
  351. } crypt;
  352. struct {
  353. u32 flags_and;
  354. u32 flags_or;
  355. } set_flags_sta;
  356. struct {
  357. u16 rid;
  358. u16 len;
  359. u8 data[0];
  360. } rid;
  361. struct {
  362. u8 len;
  363. u8 data[0];
  364. } generic_elem;
  365. struct {
  366. #define MLME_STA_DEAUTH 0
  367. #define MLME_STA_DISASSOC 1
  368. u16 cmd;
  369. u16 reason_code;
  370. } mlme;
  371. struct {
  372. u8 ssid_len;
  373. u8 ssid[32];
  374. } scan_req;
  375. } u;
  376. };
  377. #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
  378. #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
  379. #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
  380. #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
  381. #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
  382. #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
  383. #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
  384. #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
  385. #endif /* HOSTAP_COMMON_H */