isl_oid.h 12 KB

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