diff options
author | Simon Wunderlich <simon.wunderlich@s2003.tu-chemnitz.de> | 2013-07-08 10:55:49 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2013-07-16 02:58:01 -0400 |
commit | dcd6eac1f3b5fa1df11dfa99da0cf75b76cfef97 (patch) | |
tree | 6bd0f6452332418b8c17e9d4c0358fdb7d9678ef /net/wireless/scan.c | |
parent | be29b99a9b51b0338eea3c66a58de53bbd01de24 (diff) |
nl80211: add scan width to bss and scan request structs
To allow scanning and working with 5 MHz and 10 MHz BSS, extend the
inform bss commands and add wrappers to take 5 and 10 MHz bss into
account.
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de>
Signed-off-by: Mathias Kretschmer <mathias.kretschmer@fokus.fraunhofer.de>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r-- | net/wireless/scan.c | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index ae8c186b50d6..ad1e4068ce06 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -651,6 +651,8 @@ static bool cfg80211_combine_bsses(struct cfg80211_registered_device *dev, | |||
651 | continue; | 651 | continue; |
652 | if (bss->pub.channel != new->pub.channel) | 652 | if (bss->pub.channel != new->pub.channel) |
653 | continue; | 653 | continue; |
654 | if (bss->pub.scan_width != new->pub.scan_width) | ||
655 | continue; | ||
654 | if (rcu_access_pointer(bss->pub.beacon_ies)) | 656 | if (rcu_access_pointer(bss->pub.beacon_ies)) |
655 | continue; | 657 | continue; |
656 | ies = rcu_access_pointer(bss->pub.ies); | 658 | ies = rcu_access_pointer(bss->pub.ies); |
@@ -870,11 +872,12 @@ cfg80211_get_bss_channel(struct wiphy *wiphy, const u8 *ie, size_t ielen, | |||
870 | 872 | ||
871 | /* Returned bss is reference counted and must be cleaned up appropriately. */ | 873 | /* Returned bss is reference counted and must be cleaned up appropriately. */ |
872 | struct cfg80211_bss* | 874 | struct cfg80211_bss* |
873 | cfg80211_inform_bss(struct wiphy *wiphy, | 875 | cfg80211_inform_bss_width(struct wiphy *wiphy, |
874 | struct ieee80211_channel *channel, | 876 | struct ieee80211_channel *channel, |
875 | const u8 *bssid, u64 tsf, u16 capability, | 877 | enum nl80211_bss_scan_width scan_width, |
876 | u16 beacon_interval, const u8 *ie, size_t ielen, | 878 | const u8 *bssid, u64 tsf, u16 capability, |
877 | s32 signal, gfp_t gfp) | 879 | u16 beacon_interval, const u8 *ie, size_t ielen, |
880 | s32 signal, gfp_t gfp) | ||
878 | { | 881 | { |
879 | struct cfg80211_bss_ies *ies; | 882 | struct cfg80211_bss_ies *ies; |
880 | struct cfg80211_internal_bss tmp = {}, *res; | 883 | struct cfg80211_internal_bss tmp = {}, *res; |
@@ -892,6 +895,7 @@ cfg80211_inform_bss(struct wiphy *wiphy, | |||
892 | 895 | ||
893 | memcpy(tmp.pub.bssid, bssid, ETH_ALEN); | 896 | memcpy(tmp.pub.bssid, bssid, ETH_ALEN); |
894 | tmp.pub.channel = channel; | 897 | tmp.pub.channel = channel; |
898 | tmp.pub.scan_width = scan_width; | ||
895 | tmp.pub.signal = signal; | 899 | tmp.pub.signal = signal; |
896 | tmp.pub.beacon_interval = beacon_interval; | 900 | tmp.pub.beacon_interval = beacon_interval; |
897 | tmp.pub.capability = capability; | 901 | tmp.pub.capability = capability; |
@@ -924,14 +928,15 @@ cfg80211_inform_bss(struct wiphy *wiphy, | |||
924 | /* cfg80211_bss_update gives us a referenced result */ | 928 | /* cfg80211_bss_update gives us a referenced result */ |
925 | return &res->pub; | 929 | return &res->pub; |
926 | } | 930 | } |
927 | EXPORT_SYMBOL(cfg80211_inform_bss); | 931 | EXPORT_SYMBOL(cfg80211_inform_bss_width); |
928 | 932 | ||
929 | /* Returned bss is reference counted and must be cleaned up appropriately. */ | 933 | /* Returned bss is reference counted and must be cleaned up appropriately. */ |
930 | struct cfg80211_bss * | 934 | struct cfg80211_bss * |
931 | cfg80211_inform_bss_frame(struct wiphy *wiphy, | 935 | cfg80211_inform_bss_width_frame(struct wiphy *wiphy, |
932 | struct ieee80211_channel *channel, | 936 | struct ieee80211_channel *channel, |
933 | struct ieee80211_mgmt *mgmt, size_t len, | 937 | enum nl80211_bss_scan_width scan_width, |
934 | s32 signal, gfp_t gfp) | 938 | struct ieee80211_mgmt *mgmt, size_t len, |
939 | s32 signal, gfp_t gfp) | ||
935 | { | 940 | { |
936 | struct cfg80211_internal_bss tmp = {}, *res; | 941 | struct cfg80211_internal_bss tmp = {}, *res; |
937 | struct cfg80211_bss_ies *ies; | 942 | struct cfg80211_bss_ies *ies; |
@@ -941,7 +946,8 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
941 | BUILD_BUG_ON(offsetof(struct ieee80211_mgmt, u.probe_resp.variable) != | 946 | BUILD_BUG_ON(offsetof(struct ieee80211_mgmt, u.probe_resp.variable) != |
942 | offsetof(struct ieee80211_mgmt, u.beacon.variable)); | 947 | offsetof(struct ieee80211_mgmt, u.beacon.variable)); |
943 | 948 | ||
944 | trace_cfg80211_inform_bss_frame(wiphy, channel, mgmt, len, signal); | 949 | trace_cfg80211_inform_bss_width_frame(wiphy, channel, scan_width, mgmt, |
950 | len, signal); | ||
945 | 951 | ||
946 | if (WARN_ON(!mgmt)) | 952 | if (WARN_ON(!mgmt)) |
947 | return NULL; | 953 | return NULL; |
@@ -976,6 +982,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
976 | 982 | ||
977 | memcpy(tmp.pub.bssid, mgmt->bssid, ETH_ALEN); | 983 | memcpy(tmp.pub.bssid, mgmt->bssid, ETH_ALEN); |
978 | tmp.pub.channel = channel; | 984 | tmp.pub.channel = channel; |
985 | tmp.pub.scan_width = scan_width; | ||
979 | tmp.pub.signal = signal; | 986 | tmp.pub.signal = signal; |
980 | tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int); | 987 | tmp.pub.beacon_interval = le16_to_cpu(mgmt->u.probe_resp.beacon_int); |
981 | tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info); | 988 | tmp.pub.capability = le16_to_cpu(mgmt->u.probe_resp.capab_info); |
@@ -991,7 +998,7 @@ cfg80211_inform_bss_frame(struct wiphy *wiphy, | |||
991 | /* cfg80211_bss_update gives us a referenced result */ | 998 | /* cfg80211_bss_update gives us a referenced result */ |
992 | return &res->pub; | 999 | return &res->pub; |
993 | } | 1000 | } |
994 | EXPORT_SYMBOL(cfg80211_inform_bss_frame); | 1001 | EXPORT_SYMBOL(cfg80211_inform_bss_width_frame); |
995 | 1002 | ||
996 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) | 1003 | void cfg80211_ref_bss(struct wiphy *wiphy, struct cfg80211_bss *pub) |
997 | { | 1004 | { |