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 | |
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')
-rw-r--r-- | net/wireless/nl80211.c | 1 | ||||
-rw-r--r-- | net/wireless/scan.c | 31 | ||||
-rw-r--r-- | net/wireless/trace.h | 12 |
3 files changed, 28 insertions, 16 deletions
diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 6dca5a700174..ef4c312cc92c 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c | |||
@@ -5674,6 +5674,7 @@ static int nl80211_send_bss(struct sk_buff *msg, struct netlink_callback *cb, | |||
5674 | goto nla_put_failure; | 5674 | goto nla_put_failure; |
5675 | if (nla_put_u16(msg, NL80211_BSS_CAPABILITY, res->capability) || | 5675 | if (nla_put_u16(msg, NL80211_BSS_CAPABILITY, res->capability) || |
5676 | nla_put_u32(msg, NL80211_BSS_FREQUENCY, res->channel->center_freq) || | 5676 | nla_put_u32(msg, NL80211_BSS_FREQUENCY, res->channel->center_freq) || |
5677 | nla_put_u32(msg, NL80211_BSS_CHAN_WIDTH, res->scan_width) || | ||
5677 | nla_put_u32(msg, NL80211_BSS_SEEN_MS_AGO, | 5678 | nla_put_u32(msg, NL80211_BSS_SEEN_MS_AGO, |
5678 | jiffies_to_msecs(jiffies - intbss->ts))) | 5679 | jiffies_to_msecs(jiffies - intbss->ts))) |
5679 | goto nla_put_failure; | 5680 | goto nla_put_failure; |
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 | { |
diff --git a/net/wireless/trace.h b/net/wireless/trace.h index e1534baf2ebb..09af6eb426a8 100644 --- a/net/wireless/trace.h +++ b/net/wireless/trace.h | |||
@@ -2391,26 +2391,30 @@ TRACE_EVENT(cfg80211_get_bss, | |||
2391 | __entry->capa_mask, __entry->capa_val) | 2391 | __entry->capa_mask, __entry->capa_val) |
2392 | ); | 2392 | ); |
2393 | 2393 | ||
2394 | TRACE_EVENT(cfg80211_inform_bss_frame, | 2394 | TRACE_EVENT(cfg80211_inform_bss_width_frame, |
2395 | TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel, | 2395 | TP_PROTO(struct wiphy *wiphy, struct ieee80211_channel *channel, |
2396 | enum nl80211_bss_scan_width scan_width, | ||
2396 | struct ieee80211_mgmt *mgmt, size_t len, | 2397 | struct ieee80211_mgmt *mgmt, size_t len, |
2397 | s32 signal), | 2398 | s32 signal), |
2398 | TP_ARGS(wiphy, channel, mgmt, len, signal), | 2399 | TP_ARGS(wiphy, channel, scan_width, mgmt, len, signal), |
2399 | TP_STRUCT__entry( | 2400 | TP_STRUCT__entry( |
2400 | WIPHY_ENTRY | 2401 | WIPHY_ENTRY |
2401 | CHAN_ENTRY | 2402 | CHAN_ENTRY |
2403 | __field(enum nl80211_bss_scan_width, scan_width) | ||
2402 | __dynamic_array(u8, mgmt, len) | 2404 | __dynamic_array(u8, mgmt, len) |
2403 | __field(s32, signal) | 2405 | __field(s32, signal) |
2404 | ), | 2406 | ), |
2405 | TP_fast_assign( | 2407 | TP_fast_assign( |
2406 | WIPHY_ASSIGN; | 2408 | WIPHY_ASSIGN; |
2407 | CHAN_ASSIGN(channel); | 2409 | CHAN_ASSIGN(channel); |
2410 | __entry->scan_width = scan_width; | ||
2408 | if (mgmt) | 2411 | if (mgmt) |
2409 | memcpy(__get_dynamic_array(mgmt), mgmt, len); | 2412 | memcpy(__get_dynamic_array(mgmt), mgmt, len); |
2410 | __entry->signal = signal; | 2413 | __entry->signal = signal; |
2411 | ), | 2414 | ), |
2412 | TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT "signal: %d", | 2415 | TP_printk(WIPHY_PR_FMT ", " CHAN_PR_FMT "(scan_width: %d) signal: %d", |
2413 | WIPHY_PR_ARG, CHAN_PR_ARG, __entry->signal) | 2416 | WIPHY_PR_ARG, CHAN_PR_ARG, __entry->scan_width, |
2417 | __entry->signal) | ||
2414 | ); | 2418 | ); |
2415 | 2419 | ||
2416 | DECLARE_EVENT_CLASS(cfg80211_bss_evt, | 2420 | DECLARE_EVENT_CLASS(cfg80211_bss_evt, |