diff options
author | Johannes Berg <johannes.berg@intel.com> | 2012-02-13 09:17:18 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-22 14:51:18 -0500 |
commit | 8860020e0be1f03d83dc9e9e93e18a4ddbe01038 (patch) | |
tree | 09fa9089770e8a42e913f6c11abbba04bec20fad /include | |
parent | 4e3bc141d480661634d0fadad7dbb1ddde70b4d4 (diff) |
cfg80211: restructure AP/GO mode API
The AP/GO mode API isn't very clearly defined, it
has "set beacon" and "new beacon" etc.
Modify the API to the following:
* start AP -- all settings
* change beacon -- new beacon data
* stop AP -- stop AP mode operation
This also reflects in the nl80211 API, rename
the commands there correspondingly (but keep
the old names for compatibility.)
Overall, this makes it much clearer what's going
on in the API.
Kalle developed the ath6kl changes, I created
the rest of the patch.
Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/nl80211.h | 34 | ||||
-rw-r--r-- | include/net/cfg80211.h | 70 |
2 files changed, 59 insertions, 45 deletions
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index ad56e21a9f10..be35a68746a7 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -156,21 +156,23 @@ | |||
156 | * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX | 156 | * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX |
157 | * or %NL80211_ATTR_MAC. | 157 | * or %NL80211_ATTR_MAC. |
158 | * | 158 | * |
159 | * @NL80211_CMD_GET_BEACON: retrieve beacon information (returned in a | 159 | * @NL80211_CMD_GET_BEACON: (not used) |
160 | * %NL80222_CMD_NEW_BEACON message) | 160 | * @NL80211_CMD_SET_BEACON: change the beacon on an access point interface |
161 | * @NL80211_CMD_SET_BEACON: set the beacon on an access point interface | 161 | * using the %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL |
162 | * using the %NL80211_ATTR_BEACON_INTERVAL, %NL80211_ATTR_DTIM_PERIOD, | 162 | * attributes. For drivers that generate the beacon and probe responses |
163 | * %NL80211_ATTR_BEACON_HEAD and %NL80211_ATTR_BEACON_TAIL attributes. | 163 | * internally, the following attributes must be provided: %NL80211_ATTR_IE, |
164 | * Following attributes are provided for drivers that generate full Beacon | 164 | * %NL80211_ATTR_IE_PROBE_RESP and %NL80211_ATTR_IE_ASSOC_RESP. |
165 | * and Probe Response frames internally: %NL80211_ATTR_SSID, | 165 | * @NL80211_CMD_START_AP: Start AP operation on an AP interface, parameters |
166 | * are like for %NL80211_CMD_SET_BEACON, and additionally parameters that | ||
167 | * do not change are used, these include %NL80211_ATTR_BEACON_INTERVAL, | ||
168 | * %NL80211_ATTR_DTIM_PERIOD, %NL80211_ATTR_SSID, | ||
166 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, | 169 | * %NL80211_ATTR_HIDDEN_SSID, %NL80211_ATTR_CIPHERS_PAIRWISE, |
167 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, | 170 | * %NL80211_ATTR_CIPHER_GROUP, %NL80211_ATTR_WPA_VERSIONS, |
168 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY, | 171 | * %NL80211_ATTR_AKM_SUITES, %NL80211_ATTR_PRIVACY and |
169 | * %NL80211_ATTR_AUTH_TYPE, %NL80211_ATTR_IE, %NL80211_ATTR_IE_PROBE_RESP, | 172 | * %NL80211_ATTR_AUTH_TYPE. |
170 | * %NL80211_ATTR_IE_ASSOC_RESP. | 173 | * @NL80211_CMD_NEW_BEACON: old alias for %NL80211_CMD_START_AP |
171 | * @NL80211_CMD_NEW_BEACON: add a new beacon to an access point interface, | 174 | * @NL80211_CMD_STOP_AP: Stop AP operation on the given interface |
172 | * parameters are like for %NL80211_CMD_SET_BEACON. | 175 | * @NL80211_CMD_DEL_BEACON: old alias for %NL80211_CMD_STOP_AP |
173 | * @NL80211_CMD_DEL_BEACON: remove the beacon, stop sending it | ||
174 | * | 176 | * |
175 | * @NL80211_CMD_GET_STATION: Get station attributes for station identified by | 177 | * @NL80211_CMD_GET_STATION: Get station attributes for station identified by |
176 | * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. | 178 | * %NL80211_ATTR_MAC on the interface identified by %NL80211_ATTR_IFINDEX. |
@@ -565,8 +567,10 @@ enum nl80211_commands { | |||
565 | 567 | ||
566 | NL80211_CMD_GET_BEACON, | 568 | NL80211_CMD_GET_BEACON, |
567 | NL80211_CMD_SET_BEACON, | 569 | NL80211_CMD_SET_BEACON, |
568 | NL80211_CMD_NEW_BEACON, | 570 | NL80211_CMD_START_AP, |
569 | NL80211_CMD_DEL_BEACON, | 571 | NL80211_CMD_NEW_BEACON = NL80211_CMD_START_AP, |
572 | NL80211_CMD_STOP_AP, | ||
573 | NL80211_CMD_DEL_BEACON = NL80211_CMD_STOP_AP, | ||
570 | 574 | ||
571 | NL80211_CMD_GET_STATION, | 575 | NL80211_CMD_GET_STATION, |
572 | NL80211_CMD_SET_STATION, | 576 | NL80211_CMD_SET_STATION, |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index e0c9ff3a1977..755a7707a7c5 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -366,25 +366,13 @@ struct cfg80211_crypto_settings { | |||
366 | }; | 366 | }; |
367 | 367 | ||
368 | /** | 368 | /** |
369 | * struct beacon_parameters - beacon parameters | 369 | * struct cfg80211_beacon_data - beacon data |
370 | * | ||
371 | * Used to configure the beacon for an interface. | ||
372 | * | ||
373 | * @head: head portion of beacon (before TIM IE) | 370 | * @head: head portion of beacon (before TIM IE) |
374 | * or %NULL if not changed | 371 | * or %NULL if not changed |
375 | * @tail: tail portion of beacon (after TIM IE) | 372 | * @tail: tail portion of beacon (after TIM IE) |
376 | * or %NULL if not changed | 373 | * or %NULL if not changed |
377 | * @interval: beacon interval or zero if not changed | ||
378 | * @dtim_period: DTIM period or zero if not changed | ||
379 | * @head_len: length of @head | 374 | * @head_len: length of @head |
380 | * @tail_len: length of @tail | 375 | * @tail_len: length of @tail |
381 | * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from | ||
382 | * user space) | ||
383 | * @ssid_len: length of @ssid | ||
384 | * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames | ||
385 | * @crypto: crypto settings | ||
386 | * @privacy: the BSS uses privacy | ||
387 | * @auth_type: Authentication type (algorithm) | ||
388 | * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL | 376 | * @beacon_ies: extra information element(s) to add into Beacon frames or %NULL |
389 | * @beacon_ies_len: length of beacon_ies in octets | 377 | * @beacon_ies_len: length of beacon_ies in octets |
390 | * @proberesp_ies: extra information element(s) to add into Probe Response | 378 | * @proberesp_ies: extra information element(s) to add into Probe Response |
@@ -396,24 +384,46 @@ struct cfg80211_crypto_settings { | |||
396 | * @probe_resp_len: length of probe response template (@probe_resp) | 384 | * @probe_resp_len: length of probe response template (@probe_resp) |
397 | * @probe_resp: probe response template (AP mode only) | 385 | * @probe_resp: probe response template (AP mode only) |
398 | */ | 386 | */ |
399 | struct beacon_parameters { | 387 | struct cfg80211_beacon_data { |
400 | u8 *head, *tail; | 388 | const u8 *head, *tail; |
401 | int interval, dtim_period; | 389 | const u8 *beacon_ies; |
402 | int head_len, tail_len; | 390 | const u8 *proberesp_ies; |
391 | const u8 *assocresp_ies; | ||
392 | const u8 *probe_resp; | ||
393 | |||
394 | size_t head_len, tail_len; | ||
395 | size_t beacon_ies_len; | ||
396 | size_t proberesp_ies_len; | ||
397 | size_t assocresp_ies_len; | ||
398 | size_t probe_resp_len; | ||
399 | }; | ||
400 | |||
401 | /** | ||
402 | * struct cfg80211_ap_settings - AP configuration | ||
403 | * | ||
404 | * Used to configure an AP interface. | ||
405 | * | ||
406 | * @beacon: beacon data | ||
407 | * @beacon_interval: beacon interval | ||
408 | * @dtim_period: DTIM period | ||
409 | * @ssid: SSID to be used in the BSS (note: may be %NULL if not provided from | ||
410 | * user space) | ||
411 | * @ssid_len: length of @ssid | ||
412 | * @hidden_ssid: whether to hide the SSID in Beacon/Probe Response frames | ||
413 | * @crypto: crypto settings | ||
414 | * @privacy: the BSS uses privacy | ||
415 | * @auth_type: Authentication type (algorithm) | ||
416 | */ | ||
417 | struct cfg80211_ap_settings { | ||
418 | struct cfg80211_beacon_data beacon; | ||
419 | |||
420 | int beacon_interval, dtim_period; | ||
403 | const u8 *ssid; | 421 | const u8 *ssid; |
404 | size_t ssid_len; | 422 | size_t ssid_len; |
405 | enum nl80211_hidden_ssid hidden_ssid; | 423 | enum nl80211_hidden_ssid hidden_ssid; |
406 | struct cfg80211_crypto_settings crypto; | 424 | struct cfg80211_crypto_settings crypto; |
407 | bool privacy; | 425 | bool privacy; |
408 | enum nl80211_auth_type auth_type; | 426 | enum nl80211_auth_type auth_type; |
409 | const u8 *beacon_ies; | ||
410 | size_t beacon_ies_len; | ||
411 | const u8 *proberesp_ies; | ||
412 | size_t proberesp_ies_len; | ||
413 | const u8 *assocresp_ies; | ||
414 | size_t assocresp_ies_len; | ||
415 | int probe_resp_len; | ||
416 | u8 *probe_resp; | ||
417 | }; | 427 | }; |
418 | 428 | ||
419 | /** | 429 | /** |
@@ -1518,11 +1528,11 @@ struct cfg80211_ops { | |||
1518 | struct net_device *netdev, | 1528 | struct net_device *netdev, |
1519 | u8 key_index); | 1529 | u8 key_index); |
1520 | 1530 | ||
1521 | int (*add_beacon)(struct wiphy *wiphy, struct net_device *dev, | 1531 | int (*start_ap)(struct wiphy *wiphy, struct net_device *dev, |
1522 | struct beacon_parameters *info); | 1532 | struct cfg80211_ap_settings *settings); |
1523 | int (*set_beacon)(struct wiphy *wiphy, struct net_device *dev, | 1533 | int (*change_beacon)(struct wiphy *wiphy, struct net_device *dev, |
1524 | struct beacon_parameters *info); | 1534 | struct cfg80211_beacon_data *info); |
1525 | int (*del_beacon)(struct wiphy *wiphy, struct net_device *dev); | 1535 | int (*stop_ap)(struct wiphy *wiphy, struct net_device *dev); |
1526 | 1536 | ||
1527 | 1537 | ||
1528 | int (*add_station)(struct wiphy *wiphy, struct net_device *dev, | 1538 | int (*add_station)(struct wiphy *wiphy, struct net_device *dev, |