aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/nl80211.h
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2009-07-01 15:26:54 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-07-10 15:01:51 -0400
commitb23aa676ab9d54469cda9f7151f51a2851c6f36e (patch)
treedd4af5fa38dbfec362ded1d655ed584bbcf60a53 /include/linux/nl80211.h
parent6a669e65c5ec393a650362874e13f7d3365a7827 (diff)
cfg80211: connect/disconnect API
This patch introduces the cfg80211 connect/disconnect API. The goal here is to run the AUTH and ASSOC steps in one call. This is needed for some fullmac cards that run both steps directly from the target, after the host driver sends a connect command. Additionally, all the new crypto parameters for connect() are now also valid for associate() -- although associate requires the IEs to be used, the information can be useful for drivers and should be given. Signed-off-by: Samuel Ortiz <samuel.ortiz@intel.com> Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/linux/nl80211.h')
-rw-r--r--include/linux/nl80211.h80
1 files changed, 80 insertions, 0 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 651b18839088..b34c17f52f3e 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -246,6 +246,22 @@
246 * to identify the device, and the TESTDATA blob attribute to pass through 246 * to identify the device, and the TESTDATA blob attribute to pass through
247 * to the driver. 247 * to the driver.
248 * 248 *
249 * @NL80211_CMD_CONNECT: connection request and notification; this command
250 * requests to connect to a specified network but without separating
251 * auth and assoc steps. For this, you need to specify the SSID in a
252 * %NL80211_ATTR_SSID attribute, and can optionally specify the association
253 * IEs in %NL80211_ATTR_IE, %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_MAC,
254 * %NL80211_ATTR_WIPHY_FREQ and %NL80211_ATTR_CONTROL_PORT.
255 * It is also sent as an event, with the BSSID and response IEs when the
256 * connection is established or failed to be established. This can be
257 * determined by the STATUS_CODE attribute.
258 * @NL80211_CMD_ROAM: request that the card roam (currently not implemented),
259 * sent as an event when the card/driver roamed by itself.
260 * @NL80211_CMD_DISCONNECT: drop a given connection; also used to notify
261 * userspace that a connection was dropped by the AP or due to other
262 * reasons, for this the %NL80211_ATTR_DISCONNECTED_BY_AP and
263 * %NL80211_ATTR_REASON_CODE attributes are used.
264 *
249 * @NL80211_CMD_MAX: highest used command number 265 * @NL80211_CMD_MAX: highest used command number
250 * @__NL80211_CMD_AFTER_LAST: internal use 266 * @__NL80211_CMD_AFTER_LAST: internal use
251 */ 267 */
@@ -316,6 +332,10 @@ enum nl80211_commands {
316 332
317 NL80211_CMD_TESTMODE, 333 NL80211_CMD_TESTMODE,
318 334
335 NL80211_CMD_CONNECT,
336 NL80211_CMD_ROAM,
337 NL80211_CMD_DISCONNECT,
338
319 /* add new commands above here */ 339 /* add new commands above here */
320 340
321 /* used to define NL80211_CMD_MAX below */ 341 /* used to define NL80211_CMD_MAX below */
@@ -520,6 +540,30 @@ enum nl80211_commands {
520 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver. 540 * @NL80211_ATTR_TESTDATA: Testmode data blob, passed through to the driver.
521 * We recommend using nested, driver-specific attributes within this. 541 * We recommend using nested, driver-specific attributes within this.
522 * 542 *
543 * @NL80211_ATTR_DISCONNECTED_BY_AP: A flag indicating that the DISCONNECT
544 * event was due to the AP disconnecting the station, and not due to
545 * a local disconnect request.
546 * @NL80211_ATTR_STATUS_CODE: StatusCode for the %NL80211_CMD_CONNECT
547 * event (u16)
548 * @NL80211_ATTR_PRIVACY: Flag attribute, used with connect(), indicating
549 * that protected APs should be used.
550 *
551 * @NL80211_ATTR_CIPHERS_PAIRWISE: Used with CONNECT and ASSOCIATE to
552 * indicate which unicast key ciphers will be used with the connection
553 * (an array of u32).
554 * @NL80211_ATTR_CIPHER_GROUP: Used with CONNECT and ASSOCIATE to indicate
555 * which group key cipher will be used with the connection (a u32).
556 * @NL80211_ATTR_WPA_VERSIONS: Used with CONNECT and ASSOCIATE to indicate
557 * which WPA version(s) the AP we want to associate with is using
558 * (a u32 with flags from &enum nl80211_wpa_versions).
559 * @NL80211_ATTR_AKM_SUITES: Used with CONNECT and ASSOCIATE to indicate
560 * which key management algorithm(s) to use (an array of u32).
561 *
562 * @NL80211_ATTR_REQ_IE: (Re)association request information elements as
563 * sent out by the card, for ROAM and successful CONNECT events.
564 * @NL80211_ATTR_RESP_IE: (Re)association response information elements as
565 * sent by peer, for ROAM and successful CONNECT events.
566 *
523 * @NL80211_ATTR_MAX: highest attribute number currently defined 567 * @NL80211_ATTR_MAX: highest attribute number currently defined
524 * @__NL80211_ATTR_AFTER_LAST: internal use 568 * @__NL80211_ATTR_AFTER_LAST: internal use
525 */ 569 */
@@ -630,6 +674,19 @@ enum nl80211_attrs {
630 674
631 NL80211_ATTR_TESTDATA, 675 NL80211_ATTR_TESTDATA,
632 676
677 NL80211_ATTR_PRIVACY,
678
679 NL80211_ATTR_DISCONNECTED_BY_AP,
680 NL80211_ATTR_STATUS_CODE,
681
682 NL80211_ATTR_CIPHER_SUITES_PAIRWISE,
683 NL80211_ATTR_CIPHER_SUITE_GROUP,
684 NL80211_ATTR_WPA_VERSIONS,
685 NL80211_ATTR_AKM_SUITES,
686
687 NL80211_ATTR_REQ_IE,
688 NL80211_ATTR_RESP_IE,
689
633 /* add attributes here, update the policy in nl80211.c */ 690 /* add attributes here, update the policy in nl80211.c */
634 691
635 __NL80211_ATTR_AFTER_LAST, 692 __NL80211_ATTR_AFTER_LAST,
@@ -640,6 +697,7 @@ enum nl80211_attrs {
640 * Allow user space programs to use #ifdef on new attributes by defining them 697 * Allow user space programs to use #ifdef on new attributes by defining them
641 * here 698 * here
642 */ 699 */
700#define NL80211_CMD_CONNECT NL80211_CMD_CONNECT
643#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY 701#define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY
644#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES 702#define NL80211_ATTR_BSS_BASIC_RATES NL80211_ATTR_BSS_BASIC_RATES
645#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS 703#define NL80211_ATTR_WIPHY_TXQ_PARAMS NL80211_ATTR_WIPHY_TXQ_PARAMS
@@ -653,6 +711,10 @@ enum nl80211_attrs {
653#define NL80211_ATTR_SSID NL80211_ATTR_SSID 711#define NL80211_ATTR_SSID NL80211_ATTR_SSID
654#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE 712#define NL80211_ATTR_AUTH_TYPE NL80211_ATTR_AUTH_TYPE
655#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE 713#define NL80211_ATTR_REASON_CODE NL80211_ATTR_REASON_CODE
714#define NL80211_ATTR_CIPHER_SUITES_PAIRWISE NL80211_ATTR_CIPHER_SUITES_PAIRWISE
715#define NL80211_ATTR_CIPHER_SUITE_GROUP NL80211_ATTR_CIPHER_SUITE_GROUP
716#define NL80211_ATTR_WPA_VERSIONS NL80211_ATTR_WPA_VERSIONS
717#define NL80211_ATTR_AKM_SUITES NL80211_ATTR_AKM_SUITES
656 718
657#define NL80211_MAX_SUPP_RATES 32 719#define NL80211_MAX_SUPP_RATES 32
658#define NL80211_MAX_SUPP_REG_RULES 32 720#define NL80211_MAX_SUPP_REG_RULES 32
@@ -661,6 +723,9 @@ enum nl80211_attrs {
661#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 723#define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24
662#define NL80211_HT_CAPABILITY_LEN 26 724#define NL80211_HT_CAPABILITY_LEN 26
663 725
726#define NL80211_MAX_NR_CIPHER_SUITES 5
727#define NL80211_MAX_NR_AKM_SUITES 2
728
664/** 729/**
665 * enum nl80211_iftype - (virtual) interface types 730 * enum nl80211_iftype - (virtual) interface types
666 * 731 *
@@ -1205,12 +1270,22 @@ enum nl80211_bss {
1205 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only) 1270 * @NL80211_AUTHTYPE_SHARED_KEY: Shared Key authentication (WEP only)
1206 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r) 1271 * @NL80211_AUTHTYPE_FT: Fast BSS Transition (IEEE 802.11r)
1207 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP) 1272 * @NL80211_AUTHTYPE_NETWORK_EAP: Network EAP (some Cisco APs and mainly LEAP)
1273 * @__NL80211_AUTHTYPE_NUM: internal
1274 * @NL80211_AUTHTYPE_MAX: maximum valid auth algorithm
1275 * @NL80211_AUTHTYPE_AUTOMATIC: determine automatically (if necessary by
1276 * trying multiple times); this is invalid in netlink -- leave out
1277 * the attribute for this on CONNECT commands.
1208 */ 1278 */
1209enum nl80211_auth_type { 1279enum nl80211_auth_type {
1210 NL80211_AUTHTYPE_OPEN_SYSTEM, 1280 NL80211_AUTHTYPE_OPEN_SYSTEM,
1211 NL80211_AUTHTYPE_SHARED_KEY, 1281 NL80211_AUTHTYPE_SHARED_KEY,
1212 NL80211_AUTHTYPE_FT, 1282 NL80211_AUTHTYPE_FT,
1213 NL80211_AUTHTYPE_NETWORK_EAP, 1283 NL80211_AUTHTYPE_NETWORK_EAP,
1284
1285 /* keep last */
1286 __NL80211_AUTHTYPE_NUM,
1287 NL80211_AUTHTYPE_MAX = __NL80211_AUTHTYPE_NUM - 1,
1288 NL80211_AUTHTYPE_AUTOMATIC
1214}; 1289};
1215 1290
1216/** 1291/**
@@ -1235,4 +1310,9 @@ enum nl80211_mfp {
1235 NL80211_MFP_REQUIRED, 1310 NL80211_MFP_REQUIRED,
1236}; 1311};
1237 1312
1313enum nl80211_wpa_versions {
1314 NL80211_WPA_VERSION_1 = 1 << 0,
1315 NL80211_WPA_VERSION_2 = 1 << 1,
1316};
1317
1238#endif /* __LINUX_NL80211_H */ 1318#endif /* __LINUX_NL80211_H */