diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2009-07-02 11:20:43 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2009-07-10 15:01:53 -0400 |
commit | 19957bb399e2722719c0e20c9ae91cf8b6aaff04 (patch) | |
tree | 9c4d53fe5938ceee41333a1afd5be0ed5c1ce313 /include/net/cfg80211.h | |
parent | 517357c685ccc4b5783cc7dbdae8824ada19a97f (diff) |
cfg80211: keep track of BSSes
In order to avoid problems with BSS structs going away
while they're in use, I've long wanted to make cfg80211
keep track of them. Without the SME, that wasn't doable
but now that we have the SME we can do this too. It can
keep track of up to four separate authentications and
one association, regardless of whether it's controlled
by the cfg80211 SME or the userspace SME.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'include/net/cfg80211.h')
-rw-r--r-- | include/net/cfg80211.h | 86 |
1 files changed, 22 insertions, 64 deletions
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index eb026541f928..ca986cc91098 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -584,7 +584,6 @@ enum cfg80211_signal_type { | |||
584 | * is no guarantee that these are well-formed!) | 584 | * is no guarantee that these are well-formed!) |
585 | * @len_information_elements: total length of the information elements | 585 | * @len_information_elements: total length of the information elements |
586 | * @signal: signal strength value (type depends on the wiphy's signal_type) | 586 | * @signal: signal strength value (type depends on the wiphy's signal_type) |
587 | * @hold: BSS should not expire | ||
588 | * @free_priv: function pointer to free private data | 587 | * @free_priv: function pointer to free private data |
589 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes | 588 | * @priv: private area for driver use, has at least wiphy->bss_priv_size bytes |
590 | */ | 589 | */ |
@@ -642,33 +641,17 @@ struct cfg80211_crypto_settings { | |||
642 | * | 641 | * |
643 | * This structure provides information needed to complete IEEE 802.11 | 642 | * This structure provides information needed to complete IEEE 802.11 |
644 | * authentication. | 643 | * authentication. |
645 | * NOTE: This structure will likely change when more code from mac80211 is | 644 | * |
646 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. | 645 | * @bss: The BSS to authenticate with. |
647 | * Before using this in a driver that does not use mac80211, it would be better | ||
648 | * to check the status of that work and better yet, volunteer to work on it. | ||
649 | * | ||
650 | * @chan: The channel to use or %NULL if not specified (auto-select based on | ||
651 | * scan results) | ||
652 | * @peer_addr: The address of the peer STA (AP BSSID in infrastructure case); | ||
653 | * this field is required to be present; if the driver wants to help with | ||
654 | * BSS selection, it should use (yet to be added) MLME event to allow user | ||
655 | * space SME to be notified of roaming candidate, so that the SME can then | ||
656 | * use the authentication request with the recommended BSSID and whatever | ||
657 | * other data may be needed for authentication/association | ||
658 | * @ssid: SSID or %NULL if not yet available | ||
659 | * @ssid_len: Length of ssid in octets | ||
660 | * @auth_type: Authentication type (algorithm) | 646 | * @auth_type: Authentication type (algorithm) |
661 | * @ie: Extra IEs to add to Authentication frame or %NULL | 647 | * @ie: Extra IEs to add to Authentication frame or %NULL |
662 | * @ie_len: Length of ie buffer in octets | 648 | * @ie_len: Length of ie buffer in octets |
663 | */ | 649 | */ |
664 | struct cfg80211_auth_request { | 650 | struct cfg80211_auth_request { |
665 | struct ieee80211_channel *chan; | 651 | struct cfg80211_bss *bss; |
666 | u8 *peer_addr; | ||
667 | const u8 *ssid; | ||
668 | size_t ssid_len; | ||
669 | enum nl80211_auth_type auth_type; | ||
670 | const u8 *ie; | 652 | const u8 *ie; |
671 | size_t ie_len; | 653 | size_t ie_len; |
654 | enum nl80211_auth_type auth_type; | ||
672 | }; | 655 | }; |
673 | 656 | ||
674 | /** | 657 | /** |
@@ -676,32 +659,18 @@ struct cfg80211_auth_request { | |||
676 | * | 659 | * |
677 | * This structure provides information needed to complete IEEE 802.11 | 660 | * This structure provides information needed to complete IEEE 802.11 |
678 | * (re)association. | 661 | * (re)association. |
679 | * NOTE: This structure will likely change when more code from mac80211 is | 662 | * @bss: The BSS to associate with. |
680 | * moved into cfg80211 so that non-mac80211 drivers can benefit from it, too. | ||
681 | * Before using this in a driver that does not use mac80211, it would be better | ||
682 | * to check the status of that work and better yet, volunteer to work on it. | ||
683 | * | ||
684 | * @chan: The channel to use or %NULL if not specified (auto-select based on | ||
685 | * scan results) | ||
686 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | ||
687 | * to be present and the STA must be in State 2 (authenticated) with the | ||
688 | * peer STA | ||
689 | * @ssid: SSID | ||
690 | * @ssid_len: Length of ssid in octets | ||
691 | * @ie: Extra IEs to add to (Re)Association Request frame or %NULL | 663 | * @ie: Extra IEs to add to (Re)Association Request frame or %NULL |
692 | * @ie_len: Length of ie buffer in octets | 664 | * @ie_len: Length of ie buffer in octets |
693 | * @use_mfp: Use management frame protection (IEEE 802.11w) in this association | 665 | * @use_mfp: Use management frame protection (IEEE 802.11w) in this association |
694 | * @crypto: crypto settings | 666 | * @crypto: crypto settings |
695 | */ | 667 | */ |
696 | struct cfg80211_assoc_request { | 668 | struct cfg80211_assoc_request { |
697 | struct ieee80211_channel *chan; | 669 | struct cfg80211_bss *bss; |
698 | u8 *peer_addr; | ||
699 | const u8 *ssid; | ||
700 | size_t ssid_len; | ||
701 | const u8 *ie; | 670 | const u8 *ie; |
702 | size_t ie_len; | 671 | size_t ie_len; |
703 | bool use_mfp; | ||
704 | struct cfg80211_crypto_settings crypto; | 672 | struct cfg80211_crypto_settings crypto; |
673 | bool use_mfp; | ||
705 | }; | 674 | }; |
706 | 675 | ||
707 | /** | 676 | /** |
@@ -710,16 +679,16 @@ struct cfg80211_assoc_request { | |||
710 | * This structure provides information needed to complete IEEE 802.11 | 679 | * This structure provides information needed to complete IEEE 802.11 |
711 | * deauthentication. | 680 | * deauthentication. |
712 | * | 681 | * |
713 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | 682 | * @bss: the BSS to deauthenticate from |
714 | * to be present and the STA must be authenticated with the peer STA | ||
715 | * @ie: Extra IEs to add to Deauthentication frame or %NULL | 683 | * @ie: Extra IEs to add to Deauthentication frame or %NULL |
716 | * @ie_len: Length of ie buffer in octets | 684 | * @ie_len: Length of ie buffer in octets |
685 | * @reason_code: The reason code for the deauthentication | ||
717 | */ | 686 | */ |
718 | struct cfg80211_deauth_request { | 687 | struct cfg80211_deauth_request { |
719 | u8 *peer_addr; | 688 | struct cfg80211_bss *bss; |
720 | u16 reason_code; | ||
721 | const u8 *ie; | 689 | const u8 *ie; |
722 | size_t ie_len; | 690 | size_t ie_len; |
691 | u16 reason_code; | ||
723 | }; | 692 | }; |
724 | 693 | ||
725 | /** | 694 | /** |
@@ -728,16 +697,16 @@ struct cfg80211_deauth_request { | |||
728 | * This structure provides information needed to complete IEEE 802.11 | 697 | * This structure provides information needed to complete IEEE 802.11 |
729 | * disassocation. | 698 | * disassocation. |
730 | * | 699 | * |
731 | * @peer_addr: The address of the peer STA (AP BSSID); this field is required | 700 | * @bss: the BSS to disassociate from |
732 | * to be present and the STA must be associated with the peer STA | ||
733 | * @ie: Extra IEs to add to Disassociation frame or %NULL | 701 | * @ie: Extra IEs to add to Disassociation frame or %NULL |
734 | * @ie_len: Length of ie buffer in octets | 702 | * @ie_len: Length of ie buffer in octets |
703 | * @reason_code: The reason code for the disassociation | ||
735 | */ | 704 | */ |
736 | struct cfg80211_disassoc_request { | 705 | struct cfg80211_disassoc_request { |
737 | u8 *peer_addr; | 706 | struct cfg80211_bss *bss; |
738 | u16 reason_code; | ||
739 | const u8 *ie; | 707 | const u8 *ie; |
740 | size_t ie_len; | 708 | size_t ie_len; |
709 | u16 reason_code; | ||
741 | }; | 710 | }; |
742 | 711 | ||
743 | /** | 712 | /** |
@@ -1252,6 +1221,9 @@ extern void wiphy_free(struct wiphy *wiphy); | |||
1252 | 1221 | ||
1253 | /* internal struct */ | 1222 | /* internal struct */ |
1254 | struct cfg80211_conn; | 1223 | struct cfg80211_conn; |
1224 | struct cfg80211_internal_bss; | ||
1225 | |||
1226 | #define MAX_AUTH_BSSES 4 | ||
1255 | 1227 | ||
1256 | /** | 1228 | /** |
1257 | * struct wireless_dev - wireless per-netdev state | 1229 | * struct wireless_dev - wireless per-netdev state |
@@ -1281,7 +1253,6 @@ struct wireless_dev { | |||
1281 | struct net_device *netdev; | 1253 | struct net_device *netdev; |
1282 | 1254 | ||
1283 | /* currently used for IBSS and SME - might be rearranged later */ | 1255 | /* currently used for IBSS and SME - might be rearranged later */ |
1284 | struct cfg80211_bss *current_bss; | ||
1285 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1256 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
1286 | u8 ssid_len; | 1257 | u8 ssid_len; |
1287 | enum { | 1258 | enum { |
@@ -1291,6 +1262,10 @@ struct wireless_dev { | |||
1291 | } sme_state; | 1262 | } sme_state; |
1292 | struct cfg80211_conn *conn; | 1263 | struct cfg80211_conn *conn; |
1293 | 1264 | ||
1265 | struct cfg80211_internal_bss *authtry_bsses[MAX_AUTH_BSSES]; | ||
1266 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | ||
1267 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | ||
1268 | |||
1294 | #ifdef CONFIG_WIRELESS_EXT | 1269 | #ifdef CONFIG_WIRELESS_EXT |
1295 | /* wext data */ | 1270 | /* wext data */ |
1296 | struct { | 1271 | struct { |
@@ -1813,23 +1788,6 @@ void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, gfp | |||
1813 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp); | 1788 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, gfp_t gfp); |
1814 | 1789 | ||
1815 | /** | 1790 | /** |
1816 | * cfg80211_hold_bss - exclude bss from expiration | ||
1817 | * @bss: bss which should not expire | ||
1818 | * | ||
1819 | * In a case when the BSS is not updated but it shouldn't expire this | ||
1820 | * function can be used to mark the BSS to be excluded from expiration. | ||
1821 | */ | ||
1822 | void cfg80211_hold_bss(struct cfg80211_bss *bss); | ||
1823 | |||
1824 | /** | ||
1825 | * cfg80211_unhold_bss - remove expiration exception from the BSS | ||
1826 | * @bss: bss which can expire again | ||
1827 | * | ||
1828 | * This function marks the BSS to be expirable again. | ||
1829 | */ | ||
1830 | void cfg80211_unhold_bss(struct cfg80211_bss *bss); | ||
1831 | |||
1832 | /** | ||
1833 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 1791 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
1834 | * @dev: network device | 1792 | * @dev: network device |
1835 | * @addr: The source MAC address of the frame | 1793 | * @addr: The source MAC address of the frame |