diff options
author | Johannes Berg <johannes.berg@intel.com> | 2014-08-12 15:01:28 -0400 |
---|---|---|
committer | Johannes Berg <johannes.berg@intel.com> | 2014-08-26 05:16:02 -0400 |
commit | 5bc8c1f2b070bab82ed738f98ecfac725e33c57f (patch) | |
tree | cc5d73214736192a08d1478da050459a360bf3fd /net/wireless/scan.c | |
parent | 0e227084aee36b3ba27b4fc9cd9e425be6ce2ab8 (diff) |
cfg80211: allow passing frame type to cfg80211_inform_bss()
When using the cfg80211_inform_bss[_width]() functions drivers
cannot currently indicate whether the data was received in a
beacon or probe response. Fix that by passing a new enum that
indicates such (or unknown).
For good measure, use it in ath6kl.
Acked-by: Kalle Valo <kvalo@qca.qualcomm.com> [ath6kl]
Acked-by: Arend van Spriel <arend@broadcom.com> [brcmfmac]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/wireless/scan.c')
-rw-r--r-- | net/wireless/scan.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/net/wireless/scan.c b/net/wireless/scan.c index ad1a1a2808d3..620a4b40d466 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c | |||
@@ -884,6 +884,7 @@ struct cfg80211_bss* | |||
884 | cfg80211_inform_bss_width(struct wiphy *wiphy, | 884 | cfg80211_inform_bss_width(struct wiphy *wiphy, |
885 | struct ieee80211_channel *rx_channel, | 885 | struct ieee80211_channel *rx_channel, |
886 | enum nl80211_bss_scan_width scan_width, | 886 | enum nl80211_bss_scan_width scan_width, |
887 | enum cfg80211_bss_frame_type ftype, | ||
887 | const u8 *bssid, u64 tsf, u16 capability, | 888 | const u8 *bssid, u64 tsf, u16 capability, |
888 | u16 beacon_interval, const u8 *ie, size_t ielen, | 889 | u16 beacon_interval, const u8 *ie, size_t ielen, |
889 | s32 signal, gfp_t gfp) | 890 | s32 signal, gfp_t gfp) |
@@ -911,7 +912,7 @@ cfg80211_inform_bss_width(struct wiphy *wiphy, | |||
911 | tmp.pub.beacon_interval = beacon_interval; | 912 | tmp.pub.beacon_interval = beacon_interval; |
912 | tmp.pub.capability = capability; | 913 | tmp.pub.capability = capability; |
913 | /* | 914 | /* |
914 | * Since we do not know here whether the IEs are from a Beacon or Probe | 915 | * If we do not know here whether the IEs are from a Beacon or Probe |
915 | * Response frame, we need to pick one of the options and only use it | 916 | * Response frame, we need to pick one of the options and only use it |
916 | * with the driver that does not provide the full Beacon/Probe Response | 917 | * with the driver that does not provide the full Beacon/Probe Response |
917 | * frame. Use Beacon frame pointer to avoid indicating that this should | 918 | * frame. Use Beacon frame pointer to avoid indicating that this should |
@@ -926,7 +927,17 @@ cfg80211_inform_bss_width(struct wiphy *wiphy, | |||
926 | ies->from_beacon = false; | 927 | ies->from_beacon = false; |
927 | memcpy(ies->data, ie, ielen); | 928 | memcpy(ies->data, ie, ielen); |
928 | 929 | ||
929 | rcu_assign_pointer(tmp.pub.beacon_ies, ies); | 930 | switch (ftype) { |
931 | case CFG80211_BSS_FTYPE_BEACON: | ||
932 | ies->from_beacon = true; | ||
933 | /* fall through to assign */ | ||
934 | case CFG80211_BSS_FTYPE_UNKNOWN: | ||
935 | rcu_assign_pointer(tmp.pub.beacon_ies, ies); | ||
936 | break; | ||
937 | case CFG80211_BSS_FTYPE_PRESP: | ||
938 | rcu_assign_pointer(tmp.pub.proberesp_ies, ies); | ||
939 | break; | ||
940 | } | ||
930 | rcu_assign_pointer(tmp.pub.ies, ies); | 941 | rcu_assign_pointer(tmp.pub.ies, ies); |
931 | 942 | ||
932 | signal_valid = abs(rx_channel->center_freq - channel->center_freq) <= | 943 | signal_valid = abs(rx_channel->center_freq - channel->center_freq) <= |