isl_oid.h 12 KB

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