isl_oid.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507
  1. /*
  2. *
  3. *
  4. * Copyright (C) 2003 Herbert Valerio Riedel <hvr@gnu.org>
  5. * Copyright (C) 2004 Luis R. Rodriguez <mcgrof@ruslug.rutgers.edu>
  6. * Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation; either version 2 of the License
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  20. *
  21. */
  22. #if !defined(_ISL_OID_H)
  23. #define _ISL_OID_H
  24. /*
  25. * MIB related constant and structure definitions for communicating
  26. * with the device firmware
  27. */
  28. struct obj_ssid {
  29. u8 length;
  30. char octets[33];
  31. } __attribute__ ((packed));
  32. struct obj_key {
  33. u8 type; /* dot11_priv_t */
  34. u8 length;
  35. char key[32];
  36. } __attribute__ ((packed));
  37. struct obj_mlme {
  38. u8 address[6];
  39. u16 id;
  40. u16 state;
  41. u16 code;
  42. } __attribute__ ((packed));
  43. struct obj_mlmeex {
  44. u8 address[6];
  45. u16 id;
  46. u16 state;
  47. u16 code;
  48. u16 size;
  49. u8 data[0];
  50. } __attribute__ ((packed));
  51. struct obj_buffer {
  52. u32 size;
  53. u32 addr; /* 32bit bus address */
  54. } __attribute__ ((packed));
  55. struct obj_bss {
  56. u8 address[6];
  57. int:16; /* padding */
  58. char state;
  59. char reserved;
  60. short age;
  61. char quality;
  62. char rssi;
  63. struct obj_ssid ssid;
  64. short channel;
  65. char beacon_period;
  66. char dtim_period;
  67. short capinfo;
  68. short rates;
  69. short basic_rates;
  70. int:16; /* padding */
  71. } __attribute__ ((packed));
  72. struct obj_bsslist {
  73. u32 nr;
  74. struct obj_bss bsslist[0];
  75. } __attribute__ ((packed));
  76. struct obj_frequencies {
  77. u16 nr;
  78. u16 mhz[0];
  79. } __attribute__ ((packed));
  80. struct obj_attachment {
  81. char type;
  82. char reserved;
  83. short id;
  84. short size;
  85. char data[0];
  86. } __attribute__((packed));
  87. /*
  88. * in case everything's ok, the inlined function below will be
  89. * optimized away by the compiler...
  90. */
  91. static inline void
  92. __bug_on_wrong_struct_sizes(void)
  93. {
  94. BUG_ON(sizeof (struct obj_ssid) != 34);
  95. BUG_ON(sizeof (struct obj_key) != 34);
  96. BUG_ON(sizeof (struct obj_mlme) != 12);
  97. BUG_ON(sizeof (struct obj_mlmeex) != 14);
  98. BUG_ON(sizeof (struct obj_buffer) != 8);
  99. BUG_ON(sizeof (struct obj_bss) != 60);
  100. BUG_ON(sizeof (struct obj_bsslist) != 4);
  101. BUG_ON(sizeof (struct obj_frequencies) != 2);
  102. }
  103. enum dot11_state_t {
  104. DOT11_STATE_NONE = 0,
  105. DOT11_STATE_AUTHING = 1,
  106. DOT11_STATE_AUTH = 2,
  107. DOT11_STATE_ASSOCING = 3,
  108. DOT11_STATE_ASSOC = 5,
  109. DOT11_STATE_IBSS = 6,
  110. DOT11_STATE_WDS = 7
  111. };
  112. enum dot11_bsstype_t {
  113. DOT11_BSSTYPE_NONE = 0,
  114. DOT11_BSSTYPE_INFRA = 1,
  115. DOT11_BSSTYPE_IBSS = 2,
  116. DOT11_BSSTYPE_ANY = 3
  117. };
  118. enum dot11_auth_t {
  119. DOT11_AUTH_NONE = 0,
  120. DOT11_AUTH_OS = 1,
  121. DOT11_AUTH_SK = 2,
  122. DOT11_AUTH_BOTH = 3
  123. };
  124. enum dot11_mlme_t {
  125. DOT11_MLME_AUTO = 0,
  126. DOT11_MLME_INTERMEDIATE = 1,
  127. DOT11_MLME_EXTENDED = 2
  128. };
  129. enum dot11_priv_t {
  130. DOT11_PRIV_WEP = 0,
  131. DOT11_PRIV_TKIP = 1
  132. };
  133. /* Prism "Nitro" / Frameburst / "Packet Frame Grouping"
  134. * Value is in microseconds. Represents the # microseconds
  135. * the firmware will take to group frames before sending out then out
  136. * together with a CSMA contention. Without this all frames are
  137. * sent with a CSMA contention.
  138. * Bibliography:
  139. * http://www.hpl.hp.com/personal/Jean_Tourrilhes/Papers/Packet.Frame.Grouping.html
  140. */
  141. enum dot11_maxframeburst_t {
  142. /* Values for DOT11_OID_MAXFRAMEBURST */
  143. DOT11_MAXFRAMEBURST_OFF = 0, /* Card firmware default */
  144. DOT11_MAXFRAMEBURST_MIXED_SAFE = 650, /* 802.11 a,b,g safe */
  145. DOT11_MAXFRAMEBURST_IDEAL = 1300, /* Theoretical ideal level */
  146. DOT11_MAXFRAMEBURST_MAX = 5000, /* Use this as max,
  147. * Note: firmware allows for greater values. This is a
  148. * recommended max. I'll update this as I find
  149. * out what the real MAX is. Also note that you don't necessarily
  150. * get better results with a greater value here.
  151. */
  152. };
  153. /* Support for 802.11 long and short frame preambles.
  154. * Long preamble uses 128-bit sync field, 8-bit CRC
  155. * Short preamble uses 56-bit sync field, 16-bit CRC
  156. *
  157. * 802.11a -- not sure, both optionally ?
  158. * 802.11b supports long and optionally short
  159. * 802.11g supports both */
  160. enum dot11_preamblesettings_t {
  161. DOT11_PREAMBLESETTING_LONG = 0,
  162. /* Allows *only* long 802.11 preambles */
  163. DOT11_PREAMBLESETTING_SHORT = 1,
  164. /* Allows *only* short 802.11 preambles */
  165. DOT11_PREAMBLESETTING_DYNAMIC = 2
  166. /* AutomatiGically set */
  167. };
  168. /* Support for 802.11 slot timing (time between packets).
  169. *
  170. * Long uses 802.11a slot timing (9 usec ?)
  171. * Short uses 802.11b slot timing (20 use ?) */
  172. enum dot11_slotsettings_t {
  173. DOT11_SLOTSETTINGS_LONG = 0,
  174. /* Allows *only* long 802.11b slot timing */
  175. DOT11_SLOTSETTINGS_SHORT = 1,
  176. /* Allows *only* long 802.11a slot timing */
  177. DOT11_SLOTSETTINGS_DYNAMIC = 2
  178. /* AutomatiGically set */
  179. };
  180. /* All you need to know, ERP is "Extended Rate PHY".
  181. * An Extended Rate PHY (ERP) STA or AP shall support three different
  182. * preamble and header formats:
  183. * Long preamble (refer to above)
  184. * Short preamble (refer to above)
  185. * OFDM preamble ( ? )
  186. *
  187. * I'm assuming here Protection tells the AP
  188. * to be careful, a STA which cannot handle the long pre-amble
  189. * has joined.
  190. */
  191. enum do11_nonerpstatus_t {
  192. DOT11_ERPSTAT_NONEPRESENT = 0,
  193. DOT11_ERPSTAT_USEPROTECTION = 1
  194. };
  195. /* (ERP is "Extended Rate PHY") Way to read NONERP is NON-ERP-*
  196. * The key here is DOT11 NON ERP NEVER protects against
  197. * NON ERP STA's. You *don't* want this unless
  198. * you know what you are doing. It means you will only
  199. * get Extended Rate capabilities */
  200. enum dot11_nonerpprotection_t {
  201. DOT11_NONERP_NEVER = 0,
  202. DOT11_NONERP_ALWAYS = 1,
  203. DOT11_NONERP_DYNAMIC = 2
  204. };
  205. /* Preset OID configuration for 802.11 modes
  206. * Note: DOT11_OID_CW[MIN|MAX] hold the values of the
  207. * DCS MIN|MAX backoff used */
  208. enum dot11_profile_t { /* And set/allowed values */
  209. /* Allowed values for DOT11_OID_PROFILES */
  210. DOT11_PROFILE_B_ONLY = 0,
  211. /* DOT11_OID_RATES: 1, 2, 5.5, 11Mbps
  212. * DOT11_OID_PREAMBLESETTINGS: DOT11_PREAMBLESETTING_DYNAMIC
  213. * DOT11_OID_CWMIN: 31
  214. * DOT11_OID_NONEPROTECTION: DOT11_NOERP_DYNAMIC
  215. * DOT11_OID_SLOTSETTINGS: DOT11_SLOTSETTINGS_LONG
  216. */
  217. DOT11_PROFILE_MIXED_G_WIFI = 1,
  218. /* DOT11_OID_RATES: 1, 2, 5.5, 11, 6, 9, 12, 18, 24, 36, 48, 54Mbs
  219. * DOT11_OID_PREAMBLESETTINGS: DOT11_PREAMBLESETTING_DYNAMIC
  220. * DOT11_OID_CWMIN: 15
  221. * DOT11_OID_NONEPROTECTION: DOT11_NOERP_DYNAMIC
  222. * DOT11_OID_SLOTSETTINGS: DOT11_SLOTSETTINGS_DYNAMIC
  223. */
  224. DOT11_PROFILE_MIXED_LONG = 2, /* "Long range" */
  225. /* Same as Profile MIXED_G_WIFI */
  226. DOT11_PROFILE_G_ONLY = 3,
  227. /* Same as Profile MIXED_G_WIFI */
  228. DOT11_PROFILE_TEST = 4,
  229. /* Same as Profile MIXED_G_WIFI except:
  230. * DOT11_OID_PREAMBLESETTINGS: DOT11_PREAMBLESETTING_SHORT
  231. * DOT11_OID_NONEPROTECTION: DOT11_NOERP_NEVER
  232. * DOT11_OID_SLOTSETTINGS: DOT11_SLOTSETTINGS_SHORT
  233. */
  234. DOT11_PROFILE_B_WIFI = 5,
  235. /* Same as Profile B_ONLY */
  236. DOT11_PROFILE_A_ONLY = 6,
  237. /* Same as Profile MIXED_G_WIFI except:
  238. * DOT11_OID_RATES: 6, 9, 12, 18, 24, 36, 48, 54Mbs
  239. */
  240. DOT11_PROFILE_MIXED_SHORT = 7
  241. /* Same as MIXED_G_WIFI */
  242. };
  243. /* The dot11d conformance level configures the 802.11d conformance levels.
  244. * The following conformance levels exist:*/
  245. enum oid_inl_conformance_t {
  246. OID_INL_CONFORMANCE_NONE = 0, /* Perform active scanning */
  247. OID_INL_CONFORMANCE_STRICT = 1, /* Strictly adhere to 802.11d */
  248. OID_INL_CONFORMANCE_FLEXIBLE = 2, /* Use passed 802.11d info to
  249. * determine channel AND/OR just make assumption that active
  250. * channels are valid channels */
  251. };
  252. enum oid_inl_mode_t {
  253. INL_MODE_NONE = -1,
  254. INL_MODE_PROMISCUOUS = 0,
  255. INL_MODE_CLIENT = 1,
  256. INL_MODE_AP = 2,
  257. INL_MODE_SNIFFER = 3
  258. };
  259. enum oid_inl_config_t {
  260. INL_CONFIG_NOTHING = 0x00,
  261. INL_CONFIG_MANUALRUN = 0x01,
  262. INL_CONFIG_FRAMETRAP = 0x02,
  263. INL_CONFIG_RXANNEX = 0x04,
  264. INL_CONFIG_TXANNEX = 0x08,
  265. INL_CONFIG_WDS = 0x10
  266. };
  267. enum oid_inl_phycap_t {
  268. INL_PHYCAP_2400MHZ = 1,
  269. INL_PHYCAP_5000MHZ = 2,
  270. INL_PHYCAP_FAA = 0x80000000, /* Means card supports the FAA switch */
  271. };
  272. enum oid_num_t {
  273. GEN_OID_MACADDRESS = 0,
  274. GEN_OID_LINKSTATE,
  275. GEN_OID_WATCHDOG,
  276. GEN_OID_MIBOP,
  277. GEN_OID_OPTIONS,
  278. GEN_OID_LEDCONFIG,
  279. /* 802.11 */
  280. DOT11_OID_BSSTYPE,
  281. DOT11_OID_BSSID,
  282. DOT11_OID_SSID,
  283. DOT11_OID_STATE,
  284. DOT11_OID_AID,
  285. DOT11_OID_COUNTRYSTRING,
  286. DOT11_OID_SSIDOVERRIDE,
  287. DOT11_OID_MEDIUMLIMIT,
  288. DOT11_OID_BEACONPERIOD,
  289. DOT11_OID_DTIMPERIOD,
  290. DOT11_OID_ATIMWINDOW,
  291. DOT11_OID_LISTENINTERVAL,
  292. DOT11_OID_CFPPERIOD,
  293. DOT11_OID_CFPDURATION,
  294. DOT11_OID_AUTHENABLE,
  295. DOT11_OID_PRIVACYINVOKED,
  296. DOT11_OID_EXUNENCRYPTED,
  297. DOT11_OID_DEFKEYID,
  298. DOT11_OID_DEFKEYX, /* DOT11_OID_DEFKEY1,...DOT11_OID_DEFKEY4 */
  299. DOT11_OID_STAKEY,
  300. DOT11_OID_REKEYTHRESHOLD,
  301. DOT11_OID_STASC,
  302. DOT11_OID_PRIVTXREJECTED,
  303. DOT11_OID_PRIVRXPLAIN,
  304. DOT11_OID_PRIVRXFAILED,
  305. DOT11_OID_PRIVRXNOKEY,
  306. DOT11_OID_RTSTHRESH,
  307. DOT11_OID_FRAGTHRESH,
  308. DOT11_OID_SHORTRETRIES,
  309. DOT11_OID_LONGRETRIES,
  310. DOT11_OID_MAXTXLIFETIME,
  311. DOT11_OID_MAXRXLIFETIME,
  312. DOT11_OID_AUTHRESPTIMEOUT,
  313. DOT11_OID_ASSOCRESPTIMEOUT,
  314. DOT11_OID_ALOFT_TABLE,
  315. DOT11_OID_ALOFT_CTRL_TABLE,
  316. DOT11_OID_ALOFT_RETREAT,
  317. DOT11_OID_ALOFT_PROGRESS,
  318. DOT11_OID_ALOFT_FIXEDRATE,
  319. DOT11_OID_ALOFT_RSSIGRAPH,
  320. DOT11_OID_ALOFT_CONFIG,
  321. DOT11_OID_VDCFX,
  322. DOT11_OID_MAXFRAMEBURST,
  323. DOT11_OID_PSM,
  324. DOT11_OID_CAMTIMEOUT,
  325. DOT11_OID_RECEIVEDTIMS,
  326. DOT11_OID_ROAMPREFERENCE,
  327. DOT11_OID_BRIDGELOCAL,
  328. DOT11_OID_CLIENTS,
  329. DOT11_OID_CLIENTSASSOCIATED,
  330. DOT11_OID_CLIENTX, /* DOT11_OID_CLIENTX,...DOT11_OID_CLIENT2007 */
  331. DOT11_OID_CLIENTFIND,
  332. DOT11_OID_WDSLINKADD,
  333. DOT11_OID_WDSLINKREMOVE,
  334. DOT11_OID_EAPAUTHSTA,
  335. DOT11_OID_EAPUNAUTHSTA,
  336. DOT11_OID_DOT1XENABLE,
  337. DOT11_OID_MICFAILURE,
  338. DOT11_OID_REKEYINDICATE,
  339. DOT11_OID_MPDUTXSUCCESSFUL,
  340. DOT11_OID_MPDUTXONERETRY,
  341. DOT11_OID_MPDUTXMULTIPLERETRIES,
  342. DOT11_OID_MPDUTXFAILED,
  343. DOT11_OID_MPDURXSUCCESSFUL,
  344. DOT11_OID_MPDURXDUPS,
  345. DOT11_OID_RTSSUCCESSFUL,
  346. DOT11_OID_RTSFAILED,
  347. DOT11_OID_ACKFAILED,
  348. DOT11_OID_FRAMERECEIVES,
  349. DOT11_OID_FRAMEERRORS,
  350. DOT11_OID_FRAMEABORTS,
  351. DOT11_OID_FRAMEABORTSPHY,
  352. DOT11_OID_SLOTTIME,
  353. DOT11_OID_CWMIN, /* MIN DCS backoff */
  354. DOT11_OID_CWMAX, /* MAX DCS backoff */
  355. DOT11_OID_ACKWINDOW,
  356. DOT11_OID_ANTENNARX,
  357. DOT11_OID_ANTENNATX,
  358. DOT11_OID_ANTENNADIVERSITY,
  359. DOT11_OID_CHANNEL,
  360. DOT11_OID_EDTHRESHOLD,
  361. DOT11_OID_PREAMBLESETTINGS,
  362. DOT11_OID_RATES,
  363. DOT11_OID_CCAMODESUPPORTED,
  364. DOT11_OID_CCAMODE,
  365. DOT11_OID_RSSIVECTOR,
  366. DOT11_OID_OUTPUTPOWERTABLE,
  367. DOT11_OID_OUTPUTPOWER,
  368. DOT11_OID_SUPPORTEDRATES,
  369. DOT11_OID_FREQUENCY,
  370. DOT11_OID_SUPPORTEDFREQUENCIES,
  371. DOT11_OID_NOISEFLOOR,
  372. DOT11_OID_FREQUENCYACTIVITY,
  373. DOT11_OID_IQCALIBRATIONTABLE,
  374. DOT11_OID_NONERPPROTECTION,
  375. DOT11_OID_SLOTSETTINGS,
  376. DOT11_OID_NONERPTIMEOUT,
  377. DOT11_OID_PROFILES,
  378. DOT11_OID_EXTENDEDRATES,
  379. DOT11_OID_DEAUTHENTICATE,
  380. DOT11_OID_AUTHENTICATE,
  381. DOT11_OID_DISASSOCIATE,
  382. DOT11_OID_ASSOCIATE,
  383. DOT11_OID_SCAN,
  384. DOT11_OID_BEACON,
  385. DOT11_OID_PROBE,
  386. DOT11_OID_DEAUTHENTICATEEX,
  387. DOT11_OID_AUTHENTICATEEX,
  388. DOT11_OID_DISASSOCIATEEX,
  389. DOT11_OID_ASSOCIATEEX,
  390. DOT11_OID_REASSOCIATE,
  391. DOT11_OID_REASSOCIATEEX,
  392. DOT11_OID_NONERPSTATUS,
  393. DOT11_OID_STATIMEOUT,
  394. DOT11_OID_MLMEAUTOLEVEL,
  395. DOT11_OID_BSSTIMEOUT,
  396. DOT11_OID_ATTACHMENT,
  397. DOT11_OID_PSMBUFFER,
  398. DOT11_OID_BSSS,
  399. DOT11_OID_BSSX, /*DOT11_OID_BSS1,...,DOT11_OID_BSS64 */
  400. DOT11_OID_BSSFIND,
  401. DOT11_OID_BSSLIST,
  402. OID_INL_TUNNEL,
  403. OID_INL_MEMADDR,
  404. OID_INL_MEMORY,
  405. OID_INL_MODE,
  406. OID_INL_COMPONENT_NR,
  407. OID_INL_VERSION,
  408. OID_INL_INTERFACE_ID,
  409. OID_INL_COMPONENT_ID,
  410. OID_INL_CONFIG,
  411. OID_INL_DOT11D_CONFORMANCE,
  412. OID_INL_PHYCAPABILITIES,
  413. OID_INL_OUTPUTPOWER,
  414. OID_NUM_LAST
  415. };
  416. #define OID_FLAG_CACHED 0x80
  417. #define OID_FLAG_TYPE 0x7f
  418. #define OID_TYPE_U32 0x01
  419. #define OID_TYPE_SSID 0x02
  420. #define OID_TYPE_KEY 0x03
  421. #define OID_TYPE_BUFFER 0x04
  422. #define OID_TYPE_BSS 0x05
  423. #define OID_TYPE_BSSLIST 0x06
  424. #define OID_TYPE_FREQUENCIES 0x07
  425. #define OID_TYPE_MLME 0x08
  426. #define OID_TYPE_MLMEEX 0x09
  427. #define OID_TYPE_ADDR 0x0A
  428. #define OID_TYPE_RAW 0x0B
  429. #define OID_TYPE_ATTACH 0x0C
  430. /* OID_TYPE_MLMEEX is special because of a variable size field when sending.
  431. * Not yet implemented (not used in driver anyway).
  432. */
  433. struct oid_t {
  434. enum oid_num_t oid;
  435. short range; /* to define a range of oid */
  436. short size; /* max size of the associated data */
  437. char flags;
  438. };
  439. union oid_res_t {
  440. void *ptr;
  441. u32 u;
  442. };
  443. #define IWMAX_BITRATES 20
  444. #define IWMAX_BSS 24
  445. #define IWMAX_FREQ 30
  446. #define PRIV_STR_SIZE 1024
  447. #endif /* !defined(_ISL_OID_H) */
  448. /* EOF */