Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
hostap_common.h
Go to the documentation of this file.
1 #ifndef HOSTAP_COMMON_H
2 #define HOSTAP_COMMON_H
3 
4 #include <linux/types.h>
5 #include <linux/if_ether.h>
6 
7 /* IEEE 802.11 defines */
8 
9 /* HFA384X Configuration RIDs */
10 #define HFA384X_RID_CNFPORTTYPE 0xFC00
11 #define HFA384X_RID_CNFOWNMACADDR 0xFC01
12 #define HFA384X_RID_CNFDESIREDSSID 0xFC02
13 #define HFA384X_RID_CNFOWNCHANNEL 0xFC03
14 #define HFA384X_RID_CNFOWNSSID 0xFC04
15 #define HFA384X_RID_CNFOWNATIMWINDOW 0xFC05
16 #define HFA384X_RID_CNFSYSTEMSCALE 0xFC06
17 #define HFA384X_RID_CNFMAXDATALEN 0xFC07
18 #define HFA384X_RID_CNFWDSADDRESS 0xFC08
19 #define HFA384X_RID_CNFPMENABLED 0xFC09
20 #define HFA384X_RID_CNFPMEPS 0xFC0A
21 #define HFA384X_RID_CNFMULTICASTRECEIVE 0xFC0B
22 #define HFA384X_RID_CNFMAXSLEEPDURATION 0xFC0C
23 #define HFA384X_RID_CNFPMHOLDOVERDURATION 0xFC0D
24 #define HFA384X_RID_CNFOWNNAME 0xFC0E
25 #define HFA384X_RID_CNFOWNDTIMPERIOD 0xFC10
26 #define HFA384X_RID_CNFWDSADDRESS1 0xFC11 /* AP f/w only */
27 #define HFA384X_RID_CNFWDSADDRESS2 0xFC12 /* AP f/w only */
28 #define HFA384X_RID_CNFWDSADDRESS3 0xFC13 /* AP f/w only */
29 #define HFA384X_RID_CNFWDSADDRESS4 0xFC14 /* AP f/w only */
30 #define HFA384X_RID_CNFWDSADDRESS5 0xFC15 /* AP f/w only */
31 #define HFA384X_RID_CNFWDSADDRESS6 0xFC16 /* AP f/w only */
32 #define HFA384X_RID_CNFMULTICASTPMBUFFERING 0xFC17 /* AP f/w only */
33 #define HFA384X_RID_UNKNOWN1 0xFC20
34 #define HFA384X_RID_UNKNOWN2 0xFC21
35 #define HFA384X_RID_CNFWEPDEFAULTKEYID 0xFC23
36 #define HFA384X_RID_CNFDEFAULTKEY0 0xFC24
37 #define HFA384X_RID_CNFDEFAULTKEY1 0xFC25
38 #define HFA384X_RID_CNFDEFAULTKEY2 0xFC26
39 #define HFA384X_RID_CNFDEFAULTKEY3 0xFC27
40 #define HFA384X_RID_CNFWEPFLAGS 0xFC28
41 #define HFA384X_RID_CNFWEPKEYMAPPINGTABLE 0xFC29
42 #define HFA384X_RID_CNFAUTHENTICATION 0xFC2A
43 #define HFA384X_RID_CNFMAXASSOCSTA 0xFC2B /* AP f/w only */
44 #define HFA384X_RID_CNFTXCONTROL 0xFC2C
45 #define HFA384X_RID_CNFROAMINGMODE 0xFC2D
46 #define HFA384X_RID_CNFHOSTAUTHENTICATION 0xFC2E /* AP f/w only */
47 #define HFA384X_RID_CNFRCVCRCERROR 0xFC30
48 #define HFA384X_RID_CNFMMLIFE 0xFC31
49 #define HFA384X_RID_CNFALTRETRYCOUNT 0xFC32
50 #define HFA384X_RID_CNFBEACONINT 0xFC33
51 #define HFA384X_RID_CNFAPPCFINFO 0xFC34 /* AP f/w only */
52 #define HFA384X_RID_CNFSTAPCFINFO 0xFC35
53 #define HFA384X_RID_CNFPRIORITYQUSAGE 0xFC37
54 #define HFA384X_RID_CNFTIMCTRL 0xFC40
55 #define HFA384X_RID_UNKNOWN3 0xFC41 /* added in STA f/w 0.7.x */
56 #define HFA384X_RID_CNFTHIRTY2TALLY 0xFC42 /* added in STA f/w 0.8.0 */
57 #define HFA384X_RID_CNFENHSECURITY 0xFC43 /* AP f/w or STA f/w >= 1.6.3 */
58 #define HFA384X_RID_CNFDBMADJUST 0xFC46 /* added in STA f/w 1.3.1 */
59 #define HFA384X_RID_GENERICELEMENT 0xFC48 /* added in STA f/w 1.7.0;
60  * write only */
61 #define HFA384X_RID_PROPAGATIONDELAY 0xFC49 /* added in STA f/w 1.7.6 */
62 #define HFA384X_RID_GROUPADDRESSES 0xFC80
63 #define HFA384X_RID_CREATEIBSS 0xFC81
64 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD 0xFC82
65 #define HFA384X_RID_RTSTHRESHOLD 0xFC83
66 #define HFA384X_RID_TXRATECONTROL 0xFC84
67 #define HFA384X_RID_PROMISCUOUSMODE 0xFC85
68 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD0 0xFC90 /* AP f/w only */
69 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD1 0xFC91 /* AP f/w only */
70 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD2 0xFC92 /* AP f/w only */
71 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD3 0xFC93 /* AP f/w only */
72 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD4 0xFC94 /* AP f/w only */
73 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD5 0xFC95 /* AP f/w only */
74 #define HFA384X_RID_FRAGMENTATIONTHRESHOLD6 0xFC96 /* AP f/w only */
75 #define HFA384X_RID_RTSTHRESHOLD0 0xFC97 /* AP f/w only */
76 #define HFA384X_RID_RTSTHRESHOLD1 0xFC98 /* AP f/w only */
77 #define HFA384X_RID_RTSTHRESHOLD2 0xFC99 /* AP f/w only */
78 #define HFA384X_RID_RTSTHRESHOLD3 0xFC9A /* AP f/w only */
79 #define HFA384X_RID_RTSTHRESHOLD4 0xFC9B /* AP f/w only */
80 #define HFA384X_RID_RTSTHRESHOLD5 0xFC9C /* AP f/w only */
81 #define HFA384X_RID_RTSTHRESHOLD6 0xFC9D /* AP f/w only */
82 #define HFA384X_RID_TXRATECONTROL0 0xFC9E /* AP f/w only */
83 #define HFA384X_RID_TXRATECONTROL1 0xFC9F /* AP f/w only */
84 #define HFA384X_RID_TXRATECONTROL2 0xFCA0 /* AP f/w only */
85 #define HFA384X_RID_TXRATECONTROL3 0xFCA1 /* AP f/w only */
86 #define HFA384X_RID_TXRATECONTROL4 0xFCA2 /* AP f/w only */
87 #define HFA384X_RID_TXRATECONTROL5 0xFCA3 /* AP f/w only */
88 #define HFA384X_RID_TXRATECONTROL6 0xFCA4 /* AP f/w only */
89 #define HFA384X_RID_CNFSHORTPREAMBLE 0xFCB0
90 #define HFA384X_RID_CNFEXCLUDELONGPREAMBLE 0xFCB1
91 #define HFA384X_RID_CNFAUTHENTICATIONRSPTO 0xFCB2
92 #define HFA384X_RID_CNFBASICRATES 0xFCB3
93 #define HFA384X_RID_CNFSUPPORTEDRATES 0xFCB4
94 #define HFA384X_RID_CNFFALLBACKCTRL 0xFCB5 /* added in STA f/w 1.3.1 */
95 #define HFA384X_RID_WEPKEYDISABLE 0xFCB6 /* added in STA f/w 1.3.1 */
96 #define HFA384X_RID_WEPKEYMAPINDEX 0xFCB7 /* ? */
97 #define HFA384X_RID_BROADCASTKEYID 0xFCB8 /* ? */
98 #define HFA384X_RID_ENTSECFLAGEYID 0xFCB9 /* ? */
99 #define HFA384X_RID_CNFPASSIVESCANCTRL 0xFCBA /* added in STA f/w 1.5.0 */
100 #define HFA384X_RID_SSNHANDLINGMODE 0xFCBB /* added in STA f/w 1.7.0 */
101 #define HFA384X_RID_MDCCONTROL 0xFCBC /* added in STA f/w 1.7.0 */
102 #define HFA384X_RID_MDCCOUNTRY 0xFCBD /* added in STA f/w 1.7.0 */
103 #define HFA384X_RID_TXPOWERMAX 0xFCBE /* added in STA f/w 1.7.0 */
104 #define HFA384X_RID_CNFLFOENABLED 0xFCBF /* added in STA f/w 1.6.3 */
105 #define HFA384X_RID_CAPINFO 0xFCC0 /* added in STA f/w 1.7.0 */
106 #define HFA384X_RID_LISTENINTERVAL 0xFCC1 /* added in STA f/w 1.7.0 */
107 #define HFA384X_RID_SW_ANT_DIV 0xFCC2 /* added in STA f/w 1.7.0; Prism3 */
108 #define HFA384X_RID_LED_CTRL 0xFCC4 /* added in STA f/w 1.7.6 */
109 #define HFA384X_RID_HFODELAY 0xFCC5 /* added in STA f/w 1.7.6 */
110 #define HFA384X_RID_DISALLOWEDBSSID 0xFCC6 /* added in STA f/w 1.8.0 */
111 #define HFA384X_RID_TICKTIME 0xFCE0
112 #define HFA384X_RID_SCANREQUEST 0xFCE1
113 #define HFA384X_RID_JOINREQUEST 0xFCE2
114 #define HFA384X_RID_AUTHENTICATESTATION 0xFCE3 /* AP f/w only */
115 #define HFA384X_RID_CHANNELINFOREQUEST 0xFCE4 /* AP f/w only */
116 #define HFA384X_RID_HOSTSCAN 0xFCE5 /* added in STA f/w 1.3.1 */
117 
118 /* HFA384X Information RIDs */
119 #define HFA384X_RID_MAXLOADTIME 0xFD00
120 #define HFA384X_RID_DOWNLOADBUFFER 0xFD01
121 #define HFA384X_RID_PRIID 0xFD02
122 #define HFA384X_RID_PRISUPRANGE 0xFD03
123 #define HFA384X_RID_CFIACTRANGES 0xFD04
124 #define HFA384X_RID_NICSERNUM 0xFD0A
125 #define HFA384X_RID_NICID 0xFD0B
126 #define HFA384X_RID_MFISUPRANGE 0xFD0C
127 #define HFA384X_RID_CFISUPRANGE 0xFD0D
128 #define HFA384X_RID_CHANNELLIST 0xFD10
129 #define HFA384X_RID_REGULATORYDOMAINS 0xFD11
130 #define HFA384X_RID_TEMPTYPE 0xFD12
131 #define HFA384X_RID_CIS 0xFD13
132 #define HFA384X_RID_STAID 0xFD20
133 #define HFA384X_RID_STASUPRANGE 0xFD21
134 #define HFA384X_RID_MFIACTRANGES 0xFD22
135 #define HFA384X_RID_CFIACTRANGES2 0xFD23
136 #define HFA384X_RID_PRODUCTNAME 0xFD24 /* added in STA f/w 1.3.1;
137  * only Prism2.5(?) */
138 #define HFA384X_RID_PORTSTATUS 0xFD40
139 #define HFA384X_RID_CURRENTSSID 0xFD41
140 #define HFA384X_RID_CURRENTBSSID 0xFD42
141 #define HFA384X_RID_COMMSQUALITY 0xFD43
142 #define HFA384X_RID_CURRENTTXRATE 0xFD44
143 #define HFA384X_RID_CURRENTBEACONINTERVAL 0xFD45
144 #define HFA384X_RID_CURRENTSCALETHRESHOLDS 0xFD46
145 #define HFA384X_RID_PROTOCOLRSPTIME 0xFD47
146 #define HFA384X_RID_SHORTRETRYLIMIT 0xFD48
147 #define HFA384X_RID_LONGRETRYLIMIT 0xFD49
148 #define HFA384X_RID_MAXTRANSMITLIFETIME 0xFD4A
149 #define HFA384X_RID_MAXRECEIVELIFETIME 0xFD4B
150 #define HFA384X_RID_CFPOLLABLE 0xFD4C
151 #define HFA384X_RID_AUTHENTICATIONALGORITHMS 0xFD4D
152 #define HFA384X_RID_PRIVACYOPTIONIMPLEMENTED 0xFD4F
153 #define HFA384X_RID_DBMCOMMSQUALITY 0xFD51 /* added in STA f/w 1.3.1 */
154 #define HFA384X_RID_CURRENTTXRATE1 0xFD80 /* AP f/w only */
155 #define HFA384X_RID_CURRENTTXRATE2 0xFD81 /* AP f/w only */
156 #define HFA384X_RID_CURRENTTXRATE3 0xFD82 /* AP f/w only */
157 #define HFA384X_RID_CURRENTTXRATE4 0xFD83 /* AP f/w only */
158 #define HFA384X_RID_CURRENTTXRATE5 0xFD84 /* AP f/w only */
159 #define HFA384X_RID_CURRENTTXRATE6 0xFD85 /* AP f/w only */
160 #define HFA384X_RID_OWNMACADDR 0xFD86 /* AP f/w only */
161 #define HFA384X_RID_SCANRESULTSTABLE 0xFD88 /* added in STA f/w 0.8.3 */
162 #define HFA384X_RID_HOSTSCANRESULTS 0xFD89 /* added in STA f/w 1.3.1 */
163 #define HFA384X_RID_AUTHENTICATIONUSED 0xFD8A /* added in STA f/w 1.3.4 */
164 #define HFA384X_RID_CNFFAASWITCHCTRL 0xFD8B /* added in STA f/w 1.6.3 */
165 #define HFA384X_RID_ASSOCIATIONFAILURE 0xFD8D /* added in STA f/w 1.8.0 */
166 #define HFA384X_RID_PHYTYPE 0xFDC0
167 #define HFA384X_RID_CURRENTCHANNEL 0xFDC1
168 #define HFA384X_RID_CURRENTPOWERSTATE 0xFDC2
169 #define HFA384X_RID_CCAMODE 0xFDC3
170 #define HFA384X_RID_SUPPORTEDDATARATES 0xFDC6
171 #define HFA384X_RID_LFO_VOLT_REG_TEST_RES 0xFDC7 /* added in STA f/w 1.7.1 */
172 #define HFA384X_RID_BUILDSEQ 0xFFFE
173 #define HFA384X_RID_FWID 0xFFFF
175 
177 {
180  __le16 major;
181  __le16 minor;
184 #define HFA384X_COMP_ID_PRI 0x15
185 #define HFA384X_COMP_ID_STA 0x1f
186 #define HFA384X_COMP_ID_FW_AP 0x14b
187 
189 {
193  __le16 bottom;
194  __le16 top;
195 } __packed;
197 
199 {
200  __le16 pri_seq;
201  __le16 sec_seq;
202 } __packed;
204 /* FD01 - Download Buffer */
206 {
208  __le16 offset;
209  __le16 length;
210 } __packed;
212 /* BSS connection quality (RID FD43 range, RID FD51 dBm-normalized) */
214  __le16 comm_qual; /* 0 .. 92 */
215  __le16 signal_level; /* 27 .. 154 */
216  __le16 noise_level; /* 27 .. 154 */
217 } __packed;
218 
219 
220 /* netdevice private ioctls (used, e.g., with iwpriv from user space) */
221 
222 /* New wireless extensions API - SET/GET convention (even ioctl numbers are
223  * root only)
224  */
225 #define PRISM2_IOCTL_PRISM2_PARAM (SIOCIWFIRSTPRIV + 0)
226 #define PRISM2_IOCTL_GET_PRISM2_PARAM (SIOCIWFIRSTPRIV + 1)
227 #define PRISM2_IOCTL_WRITEMIF (SIOCIWFIRSTPRIV + 2)
228 #define PRISM2_IOCTL_READMIF (SIOCIWFIRSTPRIV + 3)
229 #define PRISM2_IOCTL_MONITOR (SIOCIWFIRSTPRIV + 4)
230 #define PRISM2_IOCTL_RESET (SIOCIWFIRSTPRIV + 6)
231 #define PRISM2_IOCTL_INQUIRE (SIOCIWFIRSTPRIV + 8)
232 #define PRISM2_IOCTL_WDS_ADD (SIOCIWFIRSTPRIV + 10)
233 #define PRISM2_IOCTL_WDS_DEL (SIOCIWFIRSTPRIV + 12)
234 #define PRISM2_IOCTL_SET_RID_WORD (SIOCIWFIRSTPRIV + 14)
235 #define PRISM2_IOCTL_MACCMD (SIOCIWFIRSTPRIV + 16)
236 #define PRISM2_IOCTL_ADDMAC (SIOCIWFIRSTPRIV + 18)
237 #define PRISM2_IOCTL_DELMAC (SIOCIWFIRSTPRIV + 20)
238 #define PRISM2_IOCTL_KICKMAC (SIOCIWFIRSTPRIV + 22)
239 
240 /* following are not in SIOCGIWPRIV list; check permission in the driver code
241  */
242 #define PRISM2_IOCTL_DOWNLOAD (SIOCDEVPRIVATE + 13)
243 #define PRISM2_IOCTL_HOSTAPD (SIOCDEVPRIVATE + 14)
244 
245 
246 /* PRISM2_IOCTL_PRISM2_PARAM ioctl() subtypes: */
247 enum {
248  /* PRISM2_PARAM_PTYPE = 1, */ /* REMOVED 2003-10-22 */
253  /* PRISM2_PARAM_TXPOWER = 6, */ /* REMOVED 2003-10-22 */
266  /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_RX = 19, REMOVED 2005-08-14 */
267  /* PRISM2_PARAM_BUS_MASTER_THRESHOLD_TX = 20, REMOVED 2005-08-14 */
288 };
292 
294 /* PRISM2_IOCTL_MACCMD ioctl() subcommands: */
297  AP_MAC_CMD_KICKALL = 4 };
298 
299 
300 /* PRISM2_IOCTL_DOWNLOAD ioctl() dl_cmd: */
301 enum {
302  PRISM2_DOWNLOAD_VOLATILE = 1 /* RAM */,
303  /* Note! Old versions of prism2_srec have a fatal error in CRC-16
304  * calculation, which will corrupt all non-volatile downloads.
305  * PRISM2_DOWNLOAD_NON_VOLATILE used to be 2, but it is now 3 to
306  * prevent use of old versions of prism2_srec for non-volatile
307  * download. */
308  PRISM2_DOWNLOAD_NON_VOLATILE = 3 /* FLASH */,
309  PRISM2_DOWNLOAD_VOLATILE_GENESIS = 4 /* RAM in Genesis mode */,
310  /* Persistent versions of volatile download commands (keep firmware
311  * data in memory and automatically re-download after hw_reset */
314 };
321  u32 addr; /* wlan card address */
322  u32 len;
323  void __user *ptr; /* pointer to data in user space */
324  } data[0];
325 };
327 #define PRISM2_MAX_DOWNLOAD_AREA_LEN 131072
328 #define PRISM2_MAX_DOWNLOAD_LEN 262144
329 
330 
331 /* PRISM2_IOCTL_HOSTAPD ioctl() cmd: */
332 enum {
337  /* REMOVED: PRISM2_HOSTAPD_RESET_TXEXC_STA = 5, */
348 };
350 #define PRISM2_HOSTAPD_MAX_BUF_SIZE 1024
351 #define PRISM2_HOSTAPD_RID_HDR_LEN \
352 offsetof(struct prism2_hostapd_param, u.rid.data)
353 #define PRISM2_HOSTAPD_GENERIC_ELEMENT_HDR_LEN \
354 offsetof(struct prism2_hostapd_param, u.generic_elem.data)
355 
356 /* Maximum length for algorithm names (-1 for nul termination) used in ioctl()
357  */
358 #define HOSTAP_CRYPT_ALG_NAME_LEN 16
362  u32 cmd;
364  union {
365  struct {
367  u16 capability;
370  struct {
373  struct {
378  u8 seq[8]; /* sequence counter (set: RX, get: TX) */
379  u16 key_len;
380  u8 key[0];
381  } crypt;
382  struct {
383  u32 flags_and;
384  u32 flags_or;
386  struct {
388  u16 len;
389  u8 data[0];
390  } rid;
391  struct {
392  u8 len;
393  u8 data[0];
395  struct {
396 #define MLME_STA_DEAUTH 0
397 #define MLME_STA_DISASSOC 1
398  u16 cmd;
400  } mlme;
401  struct {
402  u8 ssid_len;
403  u8 ssid[32];
404  } scan_req;
405  } u;
406 };
408 #define HOSTAP_CRYPT_FLAG_SET_TX_KEY BIT(0)
409 #define HOSTAP_CRYPT_FLAG_PERMANENT BIT(1)
411 #define HOSTAP_CRYPT_ERR_UNKNOWN_ALG 2
412 #define HOSTAP_CRYPT_ERR_UNKNOWN_ADDR 3
413 #define HOSTAP_CRYPT_ERR_CRYPT_INIT_FAILED 4
414 #define HOSTAP_CRYPT_ERR_KEY_SET_FAILED 5
415 #define HOSTAP_CRYPT_ERR_TX_KEY_SET_FAILED 6
416 #define HOSTAP_CRYPT_ERR_CARD_CONF_FAILED 7
417 
418 
419 #endif /* HOSTAP_COMMON_H */