mac80211: use new cfg80211_inform_bss_frame_data() API

The new API is more easily extensible with a metadata struct
passed to it, use it in mac80211.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
Johannes Berg 2015-10-13 11:36:21 +02:00
parent e2845c458e
commit 61f6bba006
2 changed files with 15 additions and 15 deletions

View File

@ -229,7 +229,7 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
struct cfg80211_chan_def chandef; struct cfg80211_chan_def chandef;
struct ieee80211_channel *chan; struct ieee80211_channel *chan;
struct beacon_data *presp; struct beacon_data *presp;
enum nl80211_bss_scan_width scan_width; struct cfg80211_inform_bss bss_meta = {};
bool have_higher_than_11mbit; bool have_higher_than_11mbit;
bool radar_required; bool radar_required;
int err; int err;
@ -383,10 +383,11 @@ static void __ieee80211_sta_join_ibss(struct ieee80211_sub_if_data *sdata,
mod_timer(&ifibss->timer, mod_timer(&ifibss->timer,
round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL)); round_jiffies(jiffies + IEEE80211_IBSS_MERGE_INTERVAL));
scan_width = cfg80211_chandef_to_scan_width(&chandef); bss_meta.chan = chan;
bss = cfg80211_inform_bss_width_frame(local->hw.wiphy, chan, bss_meta.scan_width = cfg80211_chandef_to_scan_width(&chandef);
scan_width, mgmt, bss = cfg80211_inform_bss_frame_data(local->hw.wiphy, &bss_meta, mgmt,
presp->head_len, 0, GFP_KERNEL); presp->head_len, GFP_KERNEL);
cfg80211_put_bss(local->hw.wiphy, bss); cfg80211_put_bss(local->hw.wiphy, bss);
netif_carrier_on(sdata->dev); netif_carrier_on(sdata->dev);
cfg80211_ibss_joined(sdata->dev, ifibss->bssid, chan, GFP_KERNEL); cfg80211_ibss_joined(sdata->dev, ifibss->bssid, chan, GFP_KERNEL);

View File

@ -67,24 +67,23 @@ ieee80211_bss_info_update(struct ieee80211_local *local,
struct cfg80211_bss *cbss; struct cfg80211_bss *cbss;
struct ieee80211_bss *bss; struct ieee80211_bss *bss;
int clen, srlen; int clen, srlen;
enum nl80211_bss_scan_width scan_width; struct cfg80211_inform_bss bss_meta = {};
s32 signal = 0;
bool signal_valid; bool signal_valid;
if (ieee80211_hw_check(&local->hw, SIGNAL_DBM)) if (ieee80211_hw_check(&local->hw, SIGNAL_DBM))
signal = rx_status->signal * 100; bss_meta.signal = rx_status->signal * 100;
else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC)) else if (ieee80211_hw_check(&local->hw, SIGNAL_UNSPEC))
signal = (rx_status->signal * 100) / local->hw.max_signal; bss_meta.signal = (rx_status->signal * 100) / local->hw.max_signal;
scan_width = NL80211_BSS_CHAN_WIDTH_20; bss_meta.scan_width = NL80211_BSS_CHAN_WIDTH_20;
if (rx_status->flag & RX_FLAG_5MHZ) if (rx_status->flag & RX_FLAG_5MHZ)
scan_width = NL80211_BSS_CHAN_WIDTH_5; bss_meta.scan_width = NL80211_BSS_CHAN_WIDTH_5;
if (rx_status->flag & RX_FLAG_10MHZ) if (rx_status->flag & RX_FLAG_10MHZ)
scan_width = NL80211_BSS_CHAN_WIDTH_10; bss_meta.scan_width = NL80211_BSS_CHAN_WIDTH_10;
cbss = cfg80211_inform_bss_width_frame(local->hw.wiphy, channel, bss_meta.chan = channel;
scan_width, mgmt, len, signal, cbss = cfg80211_inform_bss_frame_data(local->hw.wiphy, &bss_meta,
GFP_ATOMIC); mgmt, len, GFP_ATOMIC);
if (!cbss) if (!cbss)
return NULL; return NULL;
/* In case the signal is invalid update the status */ /* In case the signal is invalid update the status */