提交 8a4988d1 编写于 作者: J Janusz.Dziedzic@tieto.com 提交者: Johannes Berg

mac80211: IBSS: refactor ieee80211_rx_bss_info

Put station specific code in ieee80211_update_sta_info
function.
Signed-off-by: NJanusz Dziedzic <janusz.dziedzic@tieto.com>
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
上级 d66c2582
...@@ -965,29 +965,25 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata, ...@@ -965,29 +965,25 @@ static void ieee80211_rx_mgmt_auth_ibss(struct ieee80211_sub_if_data *sdata,
mgmt->sa, sdata->u.ibss.bssid, NULL, 0, 0, 0); mgmt->sa, sdata->u.ibss.bssid, NULL, 0, 0, 0);
} }
static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, static void ieee80211_update_sta_info(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt, size_t len, struct ieee80211_mgmt *mgmt, size_t len,
struct ieee80211_rx_status *rx_status, struct ieee80211_rx_status *rx_status,
struct ieee802_11_elems *elems) struct ieee802_11_elems *elems,
struct ieee80211_channel *channel)
{ {
struct ieee80211_local *local = sdata->local;
struct cfg80211_bss *cbss;
struct ieee80211_bss *bss;
struct sta_info *sta; struct sta_info *sta;
struct ieee80211_channel *channel;
u64 beacon_timestamp, rx_timestamp;
u32 supp_rates = 0;
enum ieee80211_band band = rx_status->band; enum ieee80211_band band = rx_status->band;
enum nl80211_bss_scan_width scan_width; enum nl80211_bss_scan_width scan_width;
struct ieee80211_local *local = sdata->local;
struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band]; struct ieee80211_supported_band *sband = local->hw.wiphy->bands[band];
bool rates_updated = false; bool rates_updated = false;
u32 supp_rates = 0;
channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq); if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
if (!channel)
return; return;
if (sdata->vif.type == NL80211_IFTYPE_ADHOC && if (!ether_addr_equal(mgmt->bssid, sdata->u.ibss.bssid))
ether_addr_equal(mgmt->bssid, sdata->u.ibss.bssid)) { return;
rcu_read_lock(); rcu_read_lock();
sta = sta_info_get(sdata, mgmt->sa); sta = sta_info_get(sdata, mgmt->sa);
...@@ -1007,8 +1003,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -1007,8 +1003,7 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
scan_width = NL80211_BSS_CHAN_WIDTH_10; scan_width = NL80211_BSS_CHAN_WIDTH_10;
sta->sta.supp_rates[band] = supp_rates | sta->sta.supp_rates[band] = supp_rates |
ieee80211_mandatory_rates(sband, ieee80211_mandatory_rates(sband, scan_width);
scan_width);
if (sta->sta.supp_rates[band] != prev_rates) { if (sta->sta.supp_rates[band] != prev_rates) {
ibss_dbg(sdata, ibss_dbg(sdata,
"updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n", "updated supp_rates set for %pM based on beacon/probe_resp (0x%x -> 0x%x)\n",
...@@ -1044,13 +1039,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -1044,13 +1039,13 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
* fall back to HT20 if we don't use or use * fall back to HT20 if we don't use or use
* the other extension channel * the other extension channel
*/ */
if (chandef.center_freq1 != if (chandef.center_freq1 != sdata->u.ibss.chandef.center_freq1)
sdata->u.ibss.chandef.center_freq1)
htcap_ie.cap_info &= htcap_ie.cap_info &=
cpu_to_le16(~IEEE80211_HT_CAP_SUP_WIDTH_20_40); cpu_to_le16(~IEEE80211_HT_CAP_SUP_WIDTH_20_40);
rates_updated |= ieee80211_ht_cap_ie_to_sta_ht_cap( rates_updated |= ieee80211_ht_cap_ie_to_sta_ht_cap(sdata, sband,
sdata, sband, &htcap_ie, sta); &htcap_ie,
sta);
} }
if (sta && rates_updated) { if (sta && rates_updated) {
...@@ -1067,7 +1062,26 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata, ...@@ -1067,7 +1062,26 @@ static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
} }
rcu_read_unlock(); rcu_read_unlock();
} }
static void ieee80211_rx_bss_info(struct ieee80211_sub_if_data *sdata,
struct ieee80211_mgmt *mgmt, size_t len,
struct ieee80211_rx_status *rx_status,
struct ieee802_11_elems *elems)
{
struct ieee80211_local *local = sdata->local;
struct cfg80211_bss *cbss;
struct ieee80211_bss *bss;
struct ieee80211_channel *channel;
u64 beacon_timestamp, rx_timestamp;
u32 supp_rates = 0;
enum ieee80211_band band = rx_status->band;
channel = ieee80211_get_channel(local->hw.wiphy, rx_status->freq);
if (!channel)
return;
ieee80211_update_sta_info(sdata, mgmt, len, rx_status, elems, channel);
bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems, bss = ieee80211_bss_info_update(local, rx_status, mgmt, len, elems,
channel); channel);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册