210-mac80211_include_wireless_dev.patch 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806
  1. --- a/include/linux/ieee80211.h
  2. +++ b/include/linux/ieee80211.h
  3. @@ -106,6 +106,75 @@ struct ieee80211_hdr {
  4. } __attribute__ ((packed));
  5. +struct ieee80211_ht_capability {
  6. + __le16 capabilities_info;
  7. + u8 mac_ht_params_info;
  8. + u8 supported_mcs_set[16];
  9. + __le16 extended_ht_capability_info;
  10. + __le32 tx_BF_capability_info;
  11. + u8 antenna_selection_info;
  12. +}__attribute__ ((packed));
  13. +
  14. +struct ieee80211_ht_additional_info {
  15. + u8 control_chan;
  16. + u8 ht_param;
  17. + __le16 operation_mode;
  18. + __le16 stbc_param;
  19. + u8 basic_set[16];
  20. +}__attribute__ ((packed));
  21. +
  22. +
  23. +#define IEEE80211_TSINFO_TYPE(a) ((a.byte1 & 0x01) >> 0)
  24. +#define IEEE80211_TSINFO_TSID(a) ((a.byte1 & 0x1E) >> 1)
  25. +#define IEEE80211_TSINFO_DIR(a) ((a.byte1 & 0x60) >> 5)
  26. +#define IEEE80211_TSINFO_POLICY(a) ((a.byte1 & 0x80) >> 7 + \
  27. + (a.byte2 & 0x01) << 1)
  28. +#define IEEE80211_TSINFO_AGG(a) ((a.byte2 & 0x02) >> 1)
  29. +#define IEEE80211_TSINFO_APSD(a) ((a.byte2 & 0x04) >> 2)
  30. +#define IEEE80211_TSINFO_UP(a) ((a.byte2 & 0x38) >> 3)
  31. +#define IEEE80211_TSINFO_ACK(a) ((a.byte2 & 0xC0) >> 6)
  32. +#define IEEE80211_TSINFO_SCHEDULE(a) ((a.byte3 & 0x01) >> 0)
  33. +
  34. +#define IEEE80211_SET_TSINFO_TYPE(i, d) (i.byte1 |= (d << 0) & 0x01)
  35. +#define IEEE80211_SET_TSINFO_TSID(i, d) (i.byte1 |= (d << 1) & 0x1E)
  36. +#define IEEE80211_SET_TSINFO_DIR(i, d) (i.byte1 |= (d << 5) & 0x60)
  37. +#define IEEE80211_SET_TSINFO_POLICY(i, d) \
  38. +do { \
  39. + i.byte1 |= (d & 0x01) << 7; \
  40. + i.byte2 |= (d & 0x02) >> 1; \
  41. +} while(0)
  42. +#define IEEE80211_SET_TSINFO_AGG(i, d) (i.byte2 |= (d << 1) & 0x02)
  43. +#define IEEE80211_SET_TSINFO_APSD(i, d) (i.byte2 |= (d << 2) & 0x04)
  44. +#define IEEE80211_SET_TSINFO_UP(i, d) (i.byte2 |= (d << 3) & 0x38)
  45. +#define IEEE80211_SET_TSINFO_ACK(i, d) (i.byte2 |= (d << 6) & 0xC0)
  46. +#define IEEE80211_SET_TSINFO_SCHEDULE(i, d) (i.byte3 |= (d << 0) & 0x01)
  47. +
  48. +struct ieee80211_ts_info {
  49. + u8 byte1;
  50. + u8 byte2;
  51. + u8 byte3;
  52. +} __attribute__ ((packed));
  53. +
  54. +struct ieee80211_elem_tspec {
  55. + struct ieee80211_ts_info ts_info;
  56. + __le16 nominal_msdu_size;
  57. + __le16 max_msdu_size;
  58. + __le32 min_service_interval;
  59. + __le32 max_service_interval;
  60. + __le32 inactivity_interval;
  61. + __le32 suspension_interval;
  62. + __le32 service_start_time;
  63. + __le32 min_data_rate;
  64. + __le32 mean_data_rate;
  65. + __le32 peak_data_rate;
  66. + __le32 burst_size;
  67. + __le32 delay_bound;
  68. + __le32 min_phy_rate;
  69. + __le16 surplus_band_allow;
  70. + __le16 medium_time;
  71. +} __attribute__ ((packed));
  72. +
  73. +
  74. struct ieee80211_mgmt {
  75. __le16 frame_control;
  76. __le16 duration;
  77. @@ -173,9 +242,51 @@ struct ieee80211_mgmt {
  78. struct {
  79. u8 action_code;
  80. u8 dialog_token;
  81. + u8 variable[0];
  82. + } __attribute__ ((packed)) addts_req;
  83. + struct {
  84. + u8 action_code;
  85. + u8 dialog_token;
  86. + __le16 status_code;
  87. + u8 variable[0];
  88. + } __attribute__ ((packed)) addts_resp;
  89. + struct {
  90. + u8 action_code;
  91. + struct ieee80211_ts_info ts_info;
  92. + __le16 reason_code;
  93. + } __attribute__ ((packed)) delts;
  94. + struct {
  95. + u8 action_code;
  96. + u8 dialog_token;
  97. u8 status_code;
  98. u8 variable[0];
  99. } __attribute__ ((packed)) wme_action;
  100. + struct {
  101. + u8 action_code;
  102. + u8 dest[6];
  103. + u8 src[6];
  104. + __le16 capab_info;
  105. + __le16 timeout;
  106. + /* Followed by Supported Rates and
  107. + * Extended Supported Rates */
  108. + u8 variable[0];
  109. + } __attribute__ ((packed)) dls_req;
  110. + struct {
  111. + u8 action_code;
  112. + __le16 status_code;
  113. + u8 dest[6];
  114. + u8 src[6];
  115. + /* Followed by Capability Information,
  116. + * Supported Rates and Extended
  117. + * Supported Rates */
  118. + u8 variable[0];
  119. + } __attribute__ ((packed)) dls_resp;
  120. + struct {
  121. + u8 action_code;
  122. + u8 dest[6];
  123. + u8 src[6];
  124. + __le16 reason_code;
  125. + } __attribute__ ((packed)) dls_teardown;
  126. struct{
  127. u8 action_code;
  128. u8 element_id;
  129. @@ -184,6 +295,25 @@ struct ieee80211_mgmt {
  130. u8 new_chan;
  131. u8 switch_count;
  132. } __attribute__((packed)) chan_switch;
  133. + struct{
  134. + u8 action_code;
  135. + u8 dialog_token;
  136. + __le16 capab;
  137. + __le16 timeout;
  138. + __le16 start_seq_num;
  139. + } __attribute__((packed)) addba_req;
  140. + struct{
  141. + u8 action_code;
  142. + u8 dialog_token;
  143. + __le16 status;
  144. + __le16 capab;
  145. + __le16 timeout;
  146. + } __attribute__((packed)) addba_resp;
  147. + struct{
  148. + u8 action_code;
  149. + __le16 params;
  150. + __le16 reason_code;
  151. + }__attribute__((packed)) delba;
  152. } u;
  153. } __attribute__ ((packed)) action;
  154. } u;
  155. @@ -270,6 +400,18 @@ enum ieee80211_statuscode {
  156. WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
  157. WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
  158. WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
  159. + /* 802.11e */
  160. + WLAN_STATUS_UNSPECIFIED_QOS = 32,
  161. + WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
  162. + WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
  163. + WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
  164. + WLAN_STATUS_REQUEST_DECLINED = 37,
  165. + WLAN_STATUS_INVALID_QOS_PARAM = 38,
  166. + WLAN_STATUS_CHANGE_TSPEC = 39,
  167. + WLAN_STATUS_WAIT_TS_DELAY = 47,
  168. + WLAN_STATUS_NO_DIRECT_LINK = 48,
  169. + WLAN_STATUS_STA_NOT_PRESENT = 49,
  170. + WLAN_STATUS_STA_NOT_QSTA = 50,
  171. };
  172. @@ -300,9 +442,50 @@ enum ieee80211_reasoncode {
  173. WLAN_REASON_INVALID_RSN_IE_CAP = 22,
  174. WLAN_REASON_IEEE8021X_FAILED = 23,
  175. WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
  176. + /* 802.11e */
  177. + WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
  178. + WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
  179. + WLAN_REASON_DISASSOC_LOW_ACK = 34,
  180. + WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
  181. + WLAN_REASON_QSTA_LEAVE_QBSS = 36,
  182. + WLAN_REASON_QSTA_NOT_USE = 37,
  183. + WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
  184. + WLAN_REASON_QSTA_TIMEOUT = 39,
  185. + WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
  186. };
  187. +/* Category Code */
  188. +enum ieee80211_category {
  189. + WLAN_CATEGORY_SPECTRUM_MGMT = 0,
  190. + WLAN_CATEGORY_QOS = 1,
  191. + WLAN_CATEGORY_DLS = 2,
  192. + WLAN_CATEGORY_BACK = 3,
  193. + WLAN_CATEGORY_WMM = 17,
  194. +};
  195. +
  196. +/* QoS Action Code */
  197. +enum ieee80211_qos_actioncode {
  198. + WLAN_ACTION_QOS_ADDTS_REQ = 0,
  199. + WLAN_ACTION_QOS_ADDTS_RESP = 1,
  200. + WLAN_ACTION_QOS_DELTS = 2,
  201. + WLAN_ACTION_QOS_SCHEDULE = 3,
  202. +};
  203. +
  204. +/* DLS Action Code */
  205. +enum ieee80211_dls_actioncode {
  206. + WLAN_ACTION_DLS_REQ = 0,
  207. + WLAN_ACTION_DLS_RESP = 1,
  208. + WLAN_ACTION_DLS_TEARDOWN = 2,
  209. +};
  210. +
  211. +/* BACK Action Code */
  212. +enum ieee80211_back_actioncode {
  213. + WLAN_ACTION_ADDBA_REQ = 0,
  214. + WLAN_ACTION_ADDBA_RESP = 1,
  215. + WLAN_ACTION_DELBA = 2,
  216. +};
  217. +
  218. /* Information Element IDs */
  219. enum ieee80211_eid {
  220. WLAN_EID_SSID = 0,
  221. @@ -318,6 +501,15 @@ enum ieee80211_eid {
  222. WLAN_EID_HP_PARAMS = 8,
  223. WLAN_EID_HP_TABLE = 9,
  224. WLAN_EID_REQUEST = 10,
  225. + /* 802.11e */
  226. + WLAN_EID_QBSS_LOAD = 11,
  227. + WLAN_EID_EDCA_PARAM_SET = 12,
  228. + WLAN_EID_TSPEC = 13,
  229. + WLAN_EID_TCLAS = 14,
  230. + WLAN_EID_SCHEDULE = 15,
  231. + WLAN_EID_TS_DELAY = 43,
  232. + WLAN_EID_TCLAS_PROCESSING = 44,
  233. + WLAN_EID_QOS_CAPA = 46,
  234. /* 802.11h */
  235. WLAN_EID_PWR_CONSTRAINT = 32,
  236. WLAN_EID_PWR_CAPABILITY = 33,
  237. @@ -332,6 +524,9 @@ enum ieee80211_eid {
  238. /* 802.11g */
  239. WLAN_EID_ERP_INFO = 42,
  240. WLAN_EID_EXT_SUPP_RATES = 50,
  241. + /* 802.11n */
  242. + WLAN_EID_HT_CAPABILITY = 45,
  243. + WLAN_EID_HT_EXTRA_INFO = 61,
  244. /* 802.11i */
  245. WLAN_EID_RSN = 48,
  246. WLAN_EID_WPA = 221,
  247. @@ -340,6 +535,9 @@ enum ieee80211_eid {
  248. WLAN_EID_QOS_PARAMETER = 222
  249. };
  250. +/* 80211n */
  251. +#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
  252. +
  253. /* cipher suite selectors */
  254. #define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
  255. #define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
  256. @@ -350,4 +548,37 @@ enum ieee80211_eid {
  257. #define WLAN_MAX_KEY_LEN 32
  258. +enum ieee80211_tsinfo_direction {
  259. + WLAN_TSINFO_UPLINK = 0,
  260. + WLAN_TSINFO_DOWNLINK = 1,
  261. + WLAN_TSINFO_DIRECTLINK = 2,
  262. + WLAN_TSINFO_BIDIRECTIONAL = 3,
  263. +};
  264. +
  265. +enum ieee80211_tsinfo_access {
  266. + WLAN_TSINFO_EDCA = 1,
  267. + WLAN_TSINFO_HCCA = 2,
  268. + WLAN_TSINFO_HEMM = 3,
  269. +};
  270. +
  271. +enum ieee80211_tsinfo_psb {
  272. + WLAN_TSINFO_PSB_LEGACY = 0,
  273. + WLAN_TSINFO_PSB_APSD = 1,
  274. +};
  275. +
  276. +
  277. +/* WI-FI Alliance OUI Type and Subtype */
  278. +enum wifi_oui_type {
  279. + WIFI_OUI_TYPE_WPA = 1,
  280. + WIFI_OUI_TYPE_WMM = 2,
  281. + WIFI_OUI_TYPE_WSC = 4,
  282. + WIFI_OUI_TYPE_PSD = 6,
  283. +};
  284. +
  285. +enum wifi_oui_stype_wmm {
  286. + WIFI_OUI_STYPE_WMM_INFO = 0,
  287. + WIFI_OUI_STYPE_WMM_PARAM = 1,
  288. + WIFI_OUI_STYPE_WMM_TSPEC = 2,
  289. +};
  290. +
  291. #endif /* IEEE80211_H */
  292. --- a/include/linux/nl80211.h
  293. +++ b/include/linux/nl80211.h
  294. @@ -7,6 +7,217 @@
  295. */
  296. /**
  297. + * enum nl80211_commands - supported nl80211 commands
  298. + * @NL80211_CMD_UNSPEC: unspecified command to catch errors
  299. + * @NL80211_CMD_RENAME_WIPHY: rename a wiphy, needs
  300. + * %NL80211_ATTR_WIPHY and %NL80211_ATTR_WIPHY_NAME
  301. + * @NL80211_CMD_WIPHY_NEWNAME: rename notification
  302. + * @NL80211_CMD_GET_CMDLIST: TO BE DEFINED PROPERLY. currently the code makes
  303. + * it depend on the wiphy only but it really should depend on the
  304. + * interface type too....
  305. + * @NL80211_CMD_NEW_CMDLIST: command list result
  306. + * @NL80211_CMD_ADD_VIRTUAL_INTERFACE: create a virtual interface for the
  307. + * wiphy identified by an %NL80211_ATTR_WIPHY attribute with the given
  308. + * %NL80211_ATTR_IFTYPE and %NL80211_ATTR_IFNAME.
  309. + * @NL80211_CMD_DEL_VIRTUAL_INTERFACE: destroy a virtual interface identified
  310. + * by %NL80211_ATTR_IFINDEX.
  311. + * @NL80211_CMD_CHANGE_VIRTUAL_INTERFACE: change type of virtual interface to
  312. + * the type given by %NL80211_ATTR_IFTYPE, the interface is identified by
  313. + * %NL80211_ATTR_IFINDEX.
  314. + * @NL80211_CMD_GET_WIPHYS: request a list of all wiphys present in the system
  315. + * @NL80211_CMD_NEW_WIPHYS: returned list of all wiphys
  316. + * @NL80211_CMD_GET_INTERFACES: request a list of all interfaces belonging to
  317. + * the wiphy identified by %NL80211_ATTR_WIPHY
  318. + * @NL80211_CMD_NEW_INTERFACES: result for %NL80211_CMD_GET_INTERFACES
  319. + * @NL80211_CMD_INITIATE_SCAN: initiate a scan with the passed parameters. THe
  320. + * parameters may contain %NL80211_ATTR_FLAG_SCAN_ACTIVE,
  321. + * %NL80211_ATTR_PHYMODE and a list of channels in an
  322. + * %NL80211_ATTR_CHANNEL_LIST attribute (an array of nested attributes)
  323. + * containing %NL80211_ATTR_CHANNEL, %NL80211_ATTR_PHYMODE, and possibly
  324. + * %NL80211_ATTR_FLAG_SCAN_ACTIVE. The outer %NL80211_ATTR_FLAG_SCAN_ACTIVE
  325. + * is ignored when a channel list is present.
  326. + * @NL80211_CMD_SCAN_RESULT: scan result, contains an array in
  327. + * %NL80211_ATTR_BSS_LIST.
  328. + * @NL80211_CMD_ASSOCIATE: associate with the given parameters
  329. + * (%NL80211_ATTR_SSID is mandatory, %NL80211_ATTR_TIMEOUT_TU,
  330. + * %NL80211_ATTR_BSSID, %NL80211_ATTR_CHANNEL, %NL80211_ATTR_PHYMODE,
  331. + * and %NL80211_ATTR_IE may be given)
  332. + * @NL80211_CMD_ADD_KEY: add a key with given %NL80211_ATTR_KEY_DATA,
  333. + * %NL80211_ATTR_KEY_ID, %NL80211_ATTR_KEY_TYPE, %NL80211_ATTR_MAC and
  334. + * %NL80211_ATTR_KEY_CIPHER attributes.
  335. + * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_ID,
  336. + * %NL80211_ATTR_KEY_TYPE and %NL80211_ATTR_MAC or all keys.
  337. + * @__NL80211_CMD_AFTER_LAST: internal use
  338. + */
  339. +enum nl80211_commands {
  340. +/* don't change the order or add anything inbetween, this is ABI! */
  341. + NL80211_CMD_UNSPEC,
  342. + /* %input: wiphy, wiphy_name */
  343. + NL80211_CMD_RENAME_WIPHY,
  344. + NL80211_CMD_WIPHY_NEWNAME,
  345. + /* %input: wiphy|ifindex */
  346. + NL80211_CMD_GET_CMDLIST,
  347. + NL80211_CMD_NEW_CMDLIST,
  348. + /* %input: wiphy, ifname, {iftype} */
  349. + NL80211_CMD_ADD_VIRTUAL_INTERFACE,
  350. + /* %input: wiphy, ifindex */
  351. + NL80211_CMD_DEL_VIRTUAL_INTERFACE,
  352. + /* %input: ifindex, iftype */
  353. + NL80211_CMD_CHANGE_VIRTUAL_INTERFACE,
  354. + /* %input: */
  355. + NL80211_CMD_GET_WIPHYS,
  356. + NL80211_CMD_NEW_WIPHYS,
  357. + /* %input: wiphy */
  358. + NL80211_CMD_GET_INTERFACES,
  359. + NL80211_CMD_NEW_INTERFACES,
  360. + NL80211_CMD_INITIATE_SCAN,
  361. + NL80211_CMD_SCAN_RESULT,
  362. + NL80211_CMD_GET_ASSOCIATION,
  363. + NL80211_CMD_ASSOCIATION_CHANGED,
  364. + NL80211_CMD_ASSOCIATE,
  365. + NL80211_CMD_DISASSOCIATE,
  366. + NL80211_CMD_DEAUTH,
  367. + NL80211_CMD_GET_AUTH_LIST,
  368. + NL80211_CMD_NEW_AUTH_LIST,
  369. + NL80211_CMD_AUTHENTICATION_CHANGED,
  370. + NL80211_CMD_AP_SET_BEACON,
  371. + NL80211_CMD_AP_ADD_STA,
  372. + NL80211_CMD_AP_UPDATE_STA,
  373. + NL80211_CMD_AP_GET_STA_INFO,
  374. + NL80211_CMD_AP_SET_RATESETS,
  375. + NL80211_CMD_ADD_KEY,
  376. + NL80211_CMD_DEL_KEY,
  377. +
  378. + /* add commands here */
  379. +
  380. + /* used to define NL80211_CMD_MAX below */
  381. + __NL80211_CMD_AFTER_LAST
  382. +};
  383. +#define NL80211_CMD_MAX (__NL80211_CMD_AFTER_LAST - 1)
  384. +
  385. +
  386. +/**
  387. + * enum nl80211_attrs - nl80211 netlink attributes
  388. + * @NL80211_ATTR_UNSPEC: unspecified attribute to catch errors
  389. + * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on
  390. + * @NL80211_ATTR_IFNAME: network interface name
  391. + * @NL80211_ATTR_WIPHY: index of wiphy to operate on, cf.
  392. + * /sys/class/ieee80211/<phyname>/index
  393. + * @NL80211_ATTR_WIPHY_NAME: wiphy name (used for renaming)
  394. + * @NL80211_ATTR_CMDS: list of u8's identifying commands a device supports
  395. + * @NL80211_ATTR_IFTYPE: type of virtual interface, see &enum nl80211_iftype
  396. + * @NL80211_ATTR_INTERFACE_LIST: interface array, nested netlink attribute
  397. + * @NL80211_ATTR_WIPHY_LIST: wiphy array, nested netlink attribute
  398. + * @NL80211_ATTR_BSSID: BSSID (must be 6 bytes)
  399. + * @NL80211_ATTR_SSID: SSID (1-32 bytes)
  400. + * @NL80211_ATTR_CHANNEL: channel number
  401. + * @NL80211_ATTR_PHYMODE: PHY mode, see &enum nl80211_phymode
  402. + * @NL80211_ATTR_CHANNEL_LIST: netlink nested attribute array containing scan
  403. + * parameters for channels
  404. + * @NL80211_ATTR_BSS_LIST: nested attribute containing an array
  405. + * @NL80211_ATTR_BSSTYPE: BSS type, see &enum nl80211_bsstype
  406. + * @NL80211_ATTR_BEACON_PERIOD: beacon period
  407. + * @NL80211_ATTR_DTIM_PERIOD: DTIM period
  408. + * @NL80211_ATTR_TIMESTAMP: 64-bit timestamp of received beacon/probe response
  409. + * @NL80211_ATTR_IE: information element(s), maximum length %NL80211_MAX_IE_LEN
  410. + * @NL80211_ATTR_AUTH_ALGORITHM: authentication algorithm
  411. + * @NL80211_ATTR_TIMEOUT_TU: timeout in TU (TO BE USED)
  412. + * @NL80211_ATTR_REASON_CODE: 802.11 reason code
  413. + * @NL80211_ATTR_ASSOCIATION_ID: association ID (u16, 1-2007)
  414. + * @NL80211_ATTR_DEAUTHENTICATED: TO BE USED
  415. + * @NL80211_ATTR_RX_SENSITIVITY: receiver sensitivity in dBm
  416. + * @NL80211_ATTR_TRANSMIT_POWER: transmit power in mW
  417. + * @NL80211_ATTR_FRAG_THRESHOLD: fragmentation threshold (bytes)
  418. + * @NL80211_ATTR_FLAG_SCAN_ACTIVE: netlink flag indiciating active scan
  419. + * @NL80211_ATTR_KEY_DATA: temporal key data
  420. + * @NL80211_ATTR_KEY_ID: key ID (u8, 0-3)
  421. + * @NL80211_ATTR_KEY_TYPE: key type (see &enum nl80211_keytype)
  422. + * @NL80211_ATTR_MAC: MAC address
  423. + * @NL80211_ATTR_KEY_CIPHER: key cipher suite (u32)
  424. + * @__NL80211_ATTR_AFTER_LAST: internal use
  425. + */
  426. +enum nl80211_attrs {
  427. +/* don't change the order or add anything inbetween, this is ABI! */
  428. + NL80211_ATTR_UNSPEC,
  429. + /* %type: u32 */
  430. + NL80211_ATTR_IFINDEX,
  431. + /* %type: nulstring */
  432. + NL80211_ATTR_IFNAME,
  433. + /* %type: u32 */
  434. + NL80211_ATTR_WIPHY,
  435. + /* %type: nulstring */
  436. + NL80211_ATTR_WIPHY_NAME,
  437. + NL80211_ATTR_CMDS,
  438. + /* %type: u32 */
  439. + NL80211_ATTR_IFTYPE,
  440. + NL80211_ATTR_INTERFACE_LIST,
  441. + NL80211_ATTR_WIPHY_LIST,
  442. + NL80211_ATTR_BSSID,
  443. + NL80211_ATTR_SSID,
  444. + NL80211_ATTR_CHANNEL,
  445. + NL80211_ATTR_PHYMODE,
  446. + NL80211_ATTR_CHANNEL_LIST,
  447. + NL80211_ATTR_BSS_LIST,
  448. + NL80211_ATTR_BSSTYPE,
  449. + NL80211_ATTR_BEACON_PERIOD,
  450. + NL80211_ATTR_DTIM_PERIOD,
  451. + NL80211_ATTR_TIMESTAMP,
  452. + NL80211_ATTR_IE,
  453. + NL80211_ATTR_AUTH_ALGORITHM,
  454. + NL80211_ATTR_TIMEOUT_TU,
  455. + NL80211_ATTR_REASON_CODE,
  456. + NL80211_ATTR_ASSOCIATION_ID,
  457. + NL80211_ATTR_DEAUTHENTICATED,
  458. + NL80211_ATTR_RX_SENSITIVITY,
  459. + NL80211_ATTR_TRANSMIT_POWER,
  460. + NL80211_ATTR_FRAG_THRESHOLD,
  461. + NL80211_ATTR_FLAG_SCAN_ACTIVE,
  462. +
  463. + NL80211_ATTR_KEY_DATA,
  464. + NL80211_ATTR_KEY_ID,
  465. + NL80211_ATTR_KEY_TYPE,
  466. + NL80211_ATTR_MAC,
  467. + NL80211_ATTR_KEY_CIPHER,
  468. +
  469. + NL80211_ATTR_BEACON_HEAD,
  470. + NL80211_ATTR_BEACON_TAIL,
  471. +
  472. + /* add attributes here, update the policy in nl80211.c */
  473. +
  474. + /* used to define NL80211_ATTR_MAX below */
  475. + __NL80211_ATTR_AFTER_LAST,
  476. +};
  477. +#define NL80211_ATTR_MAX (__NL80211_ATTR_AFTER_LAST - 1)
  478. +
  479. +/**
  480. + * enum nl80211_multicast_groups - multicast groups for nl80211
  481. + * @NL80211_GROUP_CONFIG: members of this group are notified of
  482. + * configuration changes
  483. + */
  484. +enum nl80211_multicast_groups {
  485. + /* be notified of configuration changes like wiphy renames */
  486. + NL80211_GROUP_CONFIG,
  487. +
  488. + /* add groups here */
  489. +
  490. + /* keep last */
  491. + __NL80211_GROUP_AFTER_LAST
  492. +};
  493. +#define NL80211_GROUP_MAX (__NL80211_GROUP_AFTER_LAST - 1)
  494. +
  495. +/*
  496. + * maximum length of IE(s) passed in an NL80211_ATTR_IE.
  497. + * this is an arbitrary limit, 774 means three full-length
  498. + * IEs would fit... increase if necessary */
  499. +#define NL80211_MAX_IE_LEN 774
  500. +
  501. +/*
  502. + * maximum number of items in an ATTR_CHANNEL_LIST,
  503. + * just to avoid too large allocations
  504. + */
  505. +#define NL80211_MAX_CHANNEL_LIST_ITEM 200
  506. +
  507. +/**
  508. * enum nl80211_iftype - (virtual) interface types
  509. * @NL80211_IFTYPE_UNSPECIFIED: unspecified type, driver decides
  510. * @NL80211_IFTYPE_ADHOC: independent BSS member
  511. @@ -35,4 +246,56 @@ enum nl80211_iftype {
  512. };
  513. #define NL80211_IFTYPE_MAX (__NL80211_IFTYPE_AFTER_LAST - 1)
  514. +/**
  515. + * enum nl80211_phymode - PHY modes
  516. + * @NL80211_PHYMODE_A: 5 GHz PHY
  517. + * @NL80211_PHYMODE_B: 2.4 GHz PHY (B mode)
  518. + * @NL80211_PHYMODE_G: 2.4 GHz PHY (G, compatible with B)
  519. + * @__NL80211_PHYMODE_AFTER_LAST: internal use
  520. + *
  521. + * These values are used for %NL80211_ATTR_PHYMODE.
  522. + */
  523. +enum nl80211_phymode {
  524. + NL80211_PHYMODE_A,
  525. + NL80211_PHYMODE_B,
  526. + NL80211_PHYMODE_G,
  527. +
  528. + /* keep last */
  529. + __NL80211_PHYMODE_AFTER_LAST
  530. +};
  531. +#define NL80211_PHYMODE_MAX (__NL80211_PHYMODE_AFTER_LAST - 1)
  532. +
  533. +/**
  534. + * enum nl80211_bsstype - BSS types
  535. + * @NL80211_BSSTYPE_INFRASTRUCTURE: infrastructure BSS
  536. + * @NL80211_BSSTYPE_INDEPENDENT: independent BSS (ad-hoc network)
  537. + * @__NL80211_BSSTYPE_AFTER_LAST: internal use
  538. + *
  539. + * These values are used for %NL80211_ATTR_BSSTYPE.
  540. + */
  541. +enum nl80211_bsstype {
  542. + NL80211_BSSTYPE_INFRASTRUCTURE,
  543. + NL80211_BSSTYPE_INDEPENDENT,
  544. +
  545. + /* keep last */
  546. + __NL80211_BSSTYPE_AFTER_LAST
  547. +};
  548. +#define NL80211_BSSTYPE_MAX (__NL80211_BSSTYPE_AFTER_LAST - 1)
  549. +
  550. +/**
  551. + * enum nl80211_keytype - key types
  552. + * @NL80211_KEYTYPE_GROUP: group key
  553. + * @NL80211_KEYTYPE_PAIRWISE: pairwise key
  554. + * @NL80211_KEYTYPE_PEER: peer key
  555. + */
  556. +enum nl80211_keytype {
  557. + NL80211_KEYTYPE_GROUP,
  558. + NL80211_KEYTYPE_PAIRWISE,
  559. + NL80211_KEYTYPE_PEER,
  560. +
  561. + /* keep last */
  562. + __NL80211_KEYTYPE_AFTER_LAST
  563. +};
  564. +#define NL80211_KEYTYPE_MAX (__NL80211_KEYTYPE_AFTER_LAST - 1)
  565. +
  566. #endif /* __LINUX_NL80211_H */
  567. --- a/include/net/cfg80211.h
  568. +++ b/include/net/cfg80211.h
  569. @@ -3,6 +3,7 @@
  570. #include <linux/netlink.h>
  571. #include <linux/skbuff.h>
  572. +#include <linux/nl80211.h>
  573. #include <net/genetlink.h>
  574. /*
  575. @@ -49,6 +50,69 @@ extern int ieee80211_radiotap_iterator_n
  576. struct ieee80211_radiotap_iterator *iterator);
  577. +/**
  578. + * struct scan_channel - describes a single channel to scan
  579. + * @phymode: PHY mode for this channel
  580. + * @channel: channel number (1-14, ...)
  581. + * @active: scan actively or passively on this channel
  582. + */
  583. +struct scan_channel {
  584. + enum nl80211_phymode phymode;
  585. + u32 channel;
  586. + int active;
  587. +};
  588. +
  589. +/**
  590. + * struct scan_params - describes scan parameters
  591. + * @n_channels: number of items in @channels array or -1 to indicate all
  592. + * channels should be scanned (in that case @channels will be %NULL)
  593. + * @active: when n_channels is -1 this determines active/passive scanning.
  594. + * @phymode: when n_channels is -1 this determines PHY mode to scan. It is
  595. + * not possible to scan different PHY modes in one request w/o giving
  596. + * a channel list.
  597. + * @channels: array containing @n_channels &struct scan_channel items
  598. + */
  599. +struct scan_params {
  600. + int n_channels;
  601. + int active;
  602. + enum nl80211_phymode phymode;
  603. + struct scan_channel *channels;
  604. +};
  605. +
  606. +/**
  607. + * struct association_params - describes association parameters
  608. + * @valid: this member contains flags which items are valid
  609. + * @bssid: the BSSID of the BSS to associate [%ASSOC_PARAMS_BSSID]
  610. + * @timeout: timeout (in TU) [%ASSOC_PARAMS_TIMEOUT]
  611. + * @ie: information element(s) to include in the association frames [%ASSOC_PARAMS_IE]
  612. + * @ie_len: length of the information element(s)
  613. + * @ssid: the SSID, always valid.
  614. + * @ssid_len: length of the SSID
  615. + */
  616. +struct association_params {
  617. + u8 *bssid;
  618. + u32 timeout;
  619. + u8 *ie;
  620. + int ie_len;
  621. + u8 *ssid;
  622. + int ssid_len;
  623. +
  624. + unsigned int valid;
  625. +};
  626. +#define ASSOC_PARAMS_TIMEOUT (1<<0)
  627. +
  628. +/**
  629. + * struct key_params - key information
  630. + */
  631. +struct key_params {
  632. + u8 *key;
  633. + int key_len;
  634. + int key_id;
  635. + u32 key_type;
  636. + u8 *macaddress;
  637. + u32 cipher;
  638. +};
  639. +
  640. /* from net/wireless.h */
  641. struct wiphy;
  642. @@ -68,11 +132,62 @@ struct wiphy;
  643. * @add_virtual_intf: create a new virtual interface with the given name
  644. *
  645. * @del_virtual_intf: remove the virtual interface determined by ifindex.
  646. + *
  647. + * @change_virtual_intf: change type of virtual interface
  648. + *
  649. + * @associate: associate with given parameters
  650. + *
  651. + * @disassociate: disassociate from current AP
  652. + *
  653. + * @deauth: deauth from current AP
  654. + *
  655. + * @initiate_scan: scan with the given information (see &struct scan_params above)
  656. + *
  657. + * @get_association: get BSSID of the BSS that the device is currently
  658. + * associated to and return 1, or return 0 if not
  659. + * associated (or a negative error code)
  660. + * @get_auth_list: get list of BSSIDs of all BSSs the device has
  661. + * authenticated with, must call next_bssid for each,
  662. + * next_bssid returns non-zero on error, the given data
  663. + * is to be passed to that callback
  664. + * @add_key: add a key using &struct key_params
  665. + * @del_key: delete a key using info from &struct key_params
  666. */
  667. struct cfg80211_ops {
  668. int (*add_virtual_intf)(struct wiphy *wiphy, char *name,
  669. - unsigned int type);
  670. + enum nl80211_iftype type);
  671. int (*del_virtual_intf)(struct wiphy *wiphy, int ifindex);
  672. + int (*change_virtual_intf)(struct wiphy *wiphy, int ifindex,
  673. + enum nl80211_iftype type);
  674. +
  675. + int (*associate)(struct wiphy *wiphy, struct net_device *dev,
  676. + struct association_params *params);
  677. + int (*disassociate)(struct wiphy *wiphy, struct net_device *dev);
  678. + int (*deauth)(struct wiphy *wiphy, struct net_device *dev);
  679. +
  680. +
  681. + int (*initiate_scan)(struct wiphy *wiphy, struct net_device *dev,
  682. + struct scan_params *params);
  683. +
  684. +
  685. + int (*get_association)(struct wiphy *wiphy, struct net_device *dev,
  686. + u8 *bssid);
  687. +
  688. + int (*get_auth_list)(struct wiphy *wiphy, struct net_device *dev,
  689. + void *data,
  690. + int (*next_bssid)(void *data, u8 *bssid));
  691. +
  692. + int (*add_key)(struct wiphy *wiphy, struct net_device *dev,
  693. + struct key_params *params);
  694. + int (*del_key)(struct wiphy *wiphy, struct net_device *dev,
  695. + struct key_params *params);
  696. };
  697. +
  698. +/* helper functions specific to nl80211 */
  699. +extern void *nl80211hdr_put(struct sk_buff *skb, u32 pid,
  700. + u32 seq, int flags, u8 cmd);
  701. +extern void *nl80211msg_new(struct sk_buff **skb, u32 pid,
  702. + u32 seq, int flags, u8 cmd);
  703. +
  704. #endif /* __NET_CFG80211_H */
  705. --- a/include/net/iw_handler.h
  706. +++ b/include/net/iw_handler.h
  707. @@ -431,7 +431,13 @@ struct iw_public_data {
  708. * Those may be called only within the kernel.
  709. */
  710. -/* functions that may be called by driver modules */
  711. +/* First : function strictly used inside the kernel */
  712. +
  713. +/* Handle /proc/net/wireless, called in net/code/dev.c */
  714. +extern int dev_get_wireless_info(char * buffer, char **start, off_t offset,
  715. + int length);
  716. +
  717. +/* Second : functions that may be called by driver modules */
  718. /* Send a single event to user space */
  719. extern void wireless_send_event(struct net_device * dev,
  720. --- a/include/net/mac80211.h
  721. +++ b/include/net/mac80211.h
  722. @@ -300,7 +300,6 @@ struct ieee80211_conf {
  723. /* Following five fields are used for IEEE 802.11H */
  724. unsigned int radar_detect;
  725. unsigned int spect_mgmt;
  726. - /* All following fields are currently unused. */
  727. unsigned int quiet_duration; /* duration of quiet period */
  728. unsigned int quiet_offset; /* how far into the beacon is the quiet
  729. * period */
  730. @@ -521,6 +520,9 @@ struct ieee80211_hw {
  731. * per-packet RC4 key with each TX frame when doing hwcrypto */
  732. #define IEEE80211_HW_TKIP_REQ_PHASE2_KEY (1<<14)
  733. + /* The device capable of supporting 11n */
  734. +#define IEEE80211_HW_SUPPORT_HT_MODE (1<<15)
  735. +
  736. u32 flags; /* hardware flags defined above */
  737. /* Set to the size of a needed device specific skb headroom for TX skbs. */
  738. @@ -649,8 +651,7 @@ struct ieee80211_ops {
  739. * used if the wlan hardware or low-level driver implements PAE.
  740. * 80211.o module will anyway filter frames based on authorization
  741. * state, so this function pointer can be NULL if low-level driver does
  742. - * not require event notification about port state changes.
  743. - * Currently unused. */
  744. + * not require event notification about port state changes. */
  745. int (*set_port_auth)(struct ieee80211_hw *hw, u8 *addr,
  746. int authorized);
  747. @@ -702,8 +703,9 @@ struct ieee80211_ops {
  748. /* Get statistics of the current TX queue status. This is used to get
  749. * number of currently queued packets (queue length), maximum queue
  750. * size (limit), and total number of packets sent using each TX queue
  751. - * (count).
  752. - * Currently unused. */
  753. + * (count). This information is used for WMM to find out which TX
  754. + * queues have room for more packets and by hostapd to provide
  755. + * statistics about the current queueing state to external programs. */
  756. int (*get_tx_stats)(struct ieee80211_hw *hw,
  757. struct ieee80211_tx_queue_stats *stats);
  758. @@ -713,12 +715,25 @@ struct ieee80211_ops {
  759. * Must be atomic. */
  760. u64 (*get_tsf)(struct ieee80211_hw *hw);
  761. + /* Call low level driver with 11n Block Ack action */
  762. + int (*handle_ba_action)(struct ieee80211_hw *hw,
  763. + struct ieee80211_mgmt *mgmt);
  764. +
  765. /* Reset the TSF timer and allow firmware/hardware to synchronize with
  766. * other STAs in the IBSS. This is only used in IBSS mode. This
  767. * function is optional if the firmware/hardware takes full care of
  768. * TSF synchronization. */
  769. void (*reset_tsf)(struct ieee80211_hw *hw);
  770. + /* Configure ht parameters. */
  771. + int (*conf_ht)(struct ieee80211_hw *hw,
  772. + struct ieee80211_ht_capability *ht_cap_param,
  773. + struct ieee80211_ht_additional_info *ht_extra_param);
  774. +
  775. + /* Get ht capabilities from the device */
  776. + void (*get_ht_capab)(struct ieee80211_hw *hw,
  777. + struct ieee80211_ht_capability *ht_cap_param);
  778. +
  779. /* Setup beacon data for IBSS beacons. Unlike access point (Master),
  780. * IBSS uses a fixed beacon frame which is configured using this
  781. * function. This handler is required only for IBSS mode. */