提交 944b9e37 编写于 作者: J Johannes Berg

Merge remote-tracking branch 'mac80211/master' into mac80211-next

Pull in mac80211.git to let the next patch apply
without conflicts, also resolving a hwsim conflict.

Conflicts:
	drivers/net/wireless/mac80211_hwsim.c
Signed-off-by: NJohannes Berg <johannes.berg@intel.com>
...@@ -131,7 +131,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq) ...@@ -131,7 +131,7 @@ static void bcma_core_mips_set_irq(struct bcma_device *dev, unsigned int irq)
/* backplane irq line is in use, find out who uses /* backplane irq line is in use, find out who uses
* it and set user to irq 0 * it and set user to irq 0
*/ */
list_for_each_entry_reverse(core, &bus->cores, list) { list_for_each_entry(core, &bus->cores, list) {
if ((1 << bcma_core_mips_irqflag(core)) == if ((1 << bcma_core_mips_irqflag(core)) ==
oldirqflag) { oldirqflag) {
bcma_core_mips_set_irq(core, 0); bcma_core_mips_set_irq(core, 0);
...@@ -161,7 +161,7 @@ static void bcma_core_mips_dump_irq(struct bcma_bus *bus) ...@@ -161,7 +161,7 @@ static void bcma_core_mips_dump_irq(struct bcma_bus *bus)
{ {
struct bcma_device *core; struct bcma_device *core;
list_for_each_entry_reverse(core, &bus->cores, list) { list_for_each_entry(core, &bus->cores, list) {
bcma_core_mips_print_irq(core, bcma_core_mips_irq(core)); bcma_core_mips_print_irq(core, bcma_core_mips_irq(core));
} }
} }
...@@ -224,7 +224,7 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore) ...@@ -224,7 +224,7 @@ void bcma_core_mips_init(struct bcma_drv_mips *mcore)
mcore->assigned_irqs = 1; mcore->assigned_irqs = 1;
/* Assign IRQs to all cores on the bus */ /* Assign IRQs to all cores on the bus */
list_for_each_entry_reverse(core, &bus->cores, list) { list_for_each_entry(core, &bus->cores, list) {
int mips_irq; int mips_irq;
if (core->irq) if (core->irq)
continue; continue;
......
...@@ -462,8 +462,10 @@ int bcma_bus_scan(struct bcma_bus *bus) ...@@ -462,8 +462,10 @@ int bcma_bus_scan(struct bcma_bus *bus)
while (eromptr < eromend) { while (eromptr < eromend) {
struct bcma_device *other_core; struct bcma_device *other_core;
struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL); struct bcma_device *core = kzalloc(sizeof(*core), GFP_KERNEL);
if (!core) if (!core) {
return -ENOMEM; err = -ENOMEM;
goto out;
}
INIT_LIST_HEAD(&core->list); INIT_LIST_HEAD(&core->list);
core->bus = bus; core->bus = bus;
...@@ -478,7 +480,7 @@ int bcma_bus_scan(struct bcma_bus *bus) ...@@ -478,7 +480,7 @@ int bcma_bus_scan(struct bcma_bus *bus)
} else if (err == -ESPIPE) { } else if (err == -ESPIPE) {
break; break;
} }
return err; goto out;
} }
core->core_index = core_num++; core->core_index = core_num++;
...@@ -494,10 +496,12 @@ int bcma_bus_scan(struct bcma_bus *bus) ...@@ -494,10 +496,12 @@ int bcma_bus_scan(struct bcma_bus *bus)
list_add_tail(&core->list, &bus->cores); list_add_tail(&core->list, &bus->cores);
} }
err = 0;
out:
if (bus->hosttype == BCMA_HOSTTYPE_SOC) if (bus->hosttype == BCMA_HOSTTYPE_SOC)
iounmap(eromptr); iounmap(eromptr);
return 0; return err;
} }
int __init bcma_bus_scan_early(struct bcma_bus *bus, int __init bcma_bus_scan_early(struct bcma_bus *bus,
...@@ -537,7 +541,7 @@ int __init bcma_bus_scan_early(struct bcma_bus *bus, ...@@ -537,7 +541,7 @@ int __init bcma_bus_scan_early(struct bcma_bus *bus,
else if (err == -ESPIPE) else if (err == -ESPIPE)
break; break;
else if (err < 0) else if (err < 0)
return err; goto out;
core->core_index = core_num++; core->core_index = core_num++;
bus->nr_cores++; bus->nr_cores++;
...@@ -551,6 +555,7 @@ int __init bcma_bus_scan_early(struct bcma_bus *bus, ...@@ -551,6 +555,7 @@ int __init bcma_bus_scan_early(struct bcma_bus *bus,
break; break;
} }
out:
if (bus->hosttype == BCMA_HOSTTYPE_SOC) if (bus->hosttype == BCMA_HOSTTYPE_SOC)
iounmap(eromptr); iounmap(eromptr);
......
...@@ -741,11 +741,6 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw, ...@@ -741,11 +741,6 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
txi = IEEE80211_SKB_CB(skb); txi = IEEE80211_SKB_CB(skb);
if (txi->control.vif)
hwsim_check_magic(txi->control.vif);
if (control->sta)
hwsim_check_sta_magic(control->sta);
ieee80211_tx_info_clear_status(txi); ieee80211_tx_info_clear_status(txi);
/* frame was transmitted at most favorable rate at first attempt */ /* frame was transmitted at most favorable rate at first attempt */
......
...@@ -96,6 +96,7 @@ enum ieee80211_band { ...@@ -96,6 +96,7 @@ enum ieee80211_band {
* is not permitted. * is not permitted.
* @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel * @IEEE80211_CHAN_NO_HT40MINUS: extension channel below this channel
* is not permitted. * is not permitted.
* @IEEE80211_CHAN_NO_OFDM: OFDM is not allowed on this channel.
*/ */
enum ieee80211_channel_flags { enum ieee80211_channel_flags {
IEEE80211_CHAN_DISABLED = 1<<0, IEEE80211_CHAN_DISABLED = 1<<0,
...@@ -104,6 +105,7 @@ enum ieee80211_channel_flags { ...@@ -104,6 +105,7 @@ enum ieee80211_channel_flags {
IEEE80211_CHAN_RADAR = 1<<3, IEEE80211_CHAN_RADAR = 1<<3,
IEEE80211_CHAN_NO_HT40PLUS = 1<<4, IEEE80211_CHAN_NO_HT40PLUS = 1<<4,
IEEE80211_CHAN_NO_HT40MINUS = 1<<5, IEEE80211_CHAN_NO_HT40MINUS = 1<<5,
IEEE80211_CHAN_NO_OFDM = 1<<6,
}; };
#define IEEE80211_CHAN_NO_HT40 \ #define IEEE80211_CHAN_NO_HT40 \
......
...@@ -1389,6 +1389,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, ...@@ -1389,6 +1389,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
else else
memset(next_hop, 0, ETH_ALEN); memset(next_hop, 0, ETH_ALEN);
memset(pinfo, 0, sizeof(*pinfo));
pinfo->generation = mesh_paths_generation; pinfo->generation = mesh_paths_generation;
pinfo->filled = MPATH_INFO_FRAME_QLEN | pinfo->filled = MPATH_INFO_FRAME_QLEN |
...@@ -1407,7 +1409,6 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, ...@@ -1407,7 +1409,6 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
pinfo->discovery_timeout = pinfo->discovery_timeout =
jiffies_to_msecs(mpath->discovery_timeout); jiffies_to_msecs(mpath->discovery_timeout);
pinfo->discovery_retries = mpath->discovery_retries; pinfo->discovery_retries = mpath->discovery_retries;
pinfo->flags = 0;
if (mpath->flags & MESH_PATH_ACTIVE) if (mpath->flags & MESH_PATH_ACTIVE)
pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE; pinfo->flags |= NL80211_MPATH_FLAG_ACTIVE;
if (mpath->flags & MESH_PATH_RESOLVING) if (mpath->flags & MESH_PATH_RESOLVING)
...@@ -1416,10 +1417,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop, ...@@ -1416,10 +1417,8 @@ static void mpath_set_pinfo(struct mesh_path *mpath, u8 *next_hop,
pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID; pinfo->flags |= NL80211_MPATH_FLAG_SN_VALID;
if (mpath->flags & MESH_PATH_FIXED) if (mpath->flags & MESH_PATH_FIXED)
pinfo->flags |= NL80211_MPATH_FLAG_FIXED; pinfo->flags |= NL80211_MPATH_FLAG_FIXED;
if (mpath->flags & MESH_PATH_RESOLVING) if (mpath->flags & MESH_PATH_RESOLVED)
pinfo->flags |= NL80211_MPATH_FLAG_RESOLVING; pinfo->flags |= NL80211_MPATH_FLAG_RESOLVED;
pinfo->flags = mpath->flags;
} }
static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev, static int ieee80211_get_mpath(struct wiphy *wiphy, struct net_device *dev,
......
...@@ -632,6 +632,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) ...@@ -632,6 +632,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
del_timer_sync(&sdata->u.mesh.housekeeping_timer); del_timer_sync(&sdata->u.mesh.housekeeping_timer);
del_timer_sync(&sdata->u.mesh.mesh_path_root_timer); del_timer_sync(&sdata->u.mesh.mesh_path_root_timer);
del_timer_sync(&sdata->u.mesh.mesh_path_timer);
/* /*
* If the timer fired while we waited for it, it will have * If the timer fired while we waited for it, it will have
* requeued the work. Now the work will be running again * requeued the work. Now the work will be running again
...@@ -644,6 +645,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata) ...@@ -644,6 +645,8 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
local->fif_other_bss--; local->fif_other_bss--;
atomic_dec(&local->iff_allmultis); atomic_dec(&local->iff_allmultis);
ieee80211_configure_filter(local); ieee80211_configure_filter(local);
sdata->u.mesh.timers_running = 0;
} }
static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
......
...@@ -1467,6 +1467,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata, ...@@ -1467,6 +1467,8 @@ static void ieee80211_set_disassoc(struct ieee80211_sub_if_data *sdata,
del_timer_sync(&sdata->u.mgd.bcn_mon_timer); del_timer_sync(&sdata->u.mgd.bcn_mon_timer);
del_timer_sync(&sdata->u.mgd.timer); del_timer_sync(&sdata->u.mgd.timer);
del_timer_sync(&sdata->u.mgd.chswitch_timer); del_timer_sync(&sdata->u.mgd.chswitch_timer);
sdata->u.mgd.timers_running = 0;
} }
void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata, void ieee80211_sta_rx_notify(struct ieee80211_sub_if_data *sdata,
...@@ -3298,6 +3300,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata, ...@@ -3298,6 +3300,8 @@ int ieee80211_mgd_auth(struct ieee80211_sub_if_data *sdata,
goto out_unlock; goto out_unlock;
err_clear: err_clear:
memset(ifmgd->bssid, 0, ETH_ALEN);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
ifmgd->auth_data = NULL; ifmgd->auth_data = NULL;
err_free: err_free:
kfree(auth_data); kfree(auth_data);
...@@ -3506,6 +3510,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -3506,6 +3510,8 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
err = 0; err = 0;
goto out; goto out;
err_clear: err_clear:
memset(ifmgd->bssid, 0, ETH_ALEN);
ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BSSID);
ifmgd->assoc_data = NULL; ifmgd->assoc_data = NULL;
err_free: err_free:
kfree(assoc_data); kfree(assoc_data);
......
...@@ -299,7 +299,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted, ...@@ -299,7 +299,7 @@ static void __ieee80211_scan_completed(struct ieee80211_hw *hw, bool aborted,
if (local->scan_req != local->int_scan_req) if (local->scan_req != local->int_scan_req)
cfg80211_scan_done(local->scan_req, aborted); cfg80211_scan_done(local->scan_req, aborted);
local->scan_req = NULL; local->scan_req = NULL;
local->scan_sdata = NULL; rcu_assign_pointer(local->scan_sdata, NULL);
local->scanning = 0; local->scanning = 0;
local->scan_channel = NULL; local->scan_channel = NULL;
...@@ -984,7 +984,6 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata) ...@@ -984,7 +984,6 @@ int ieee80211_request_sched_scan_stop(struct ieee80211_sub_if_data *sdata)
kfree(local->sched_scan_ies.ie[i]); kfree(local->sched_scan_ies.ie[i]);
drv_sched_scan_stop(local, sdata); drv_sched_scan_stop(local, sdata);
rcu_assign_pointer(local->sched_scan_sdata, NULL);
} }
out: out:
mutex_unlock(&local->mtx); mutex_unlock(&local->mtx);
......
...@@ -1807,37 +1807,31 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb, ...@@ -1807,37 +1807,31 @@ netdev_tx_t ieee80211_subif_start_xmit(struct sk_buff *skb,
meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr, meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
sdata, NULL, NULL); sdata, NULL, NULL);
} else { } else {
int is_mesh_mcast = 1; /* DS -> MBSS (802.11-2012 13.11.3.3).
const u8 *mesh_da; * For unicast with unknown forwarding information,
* destination might be in the MBSS or if that fails
if (is_multicast_ether_addr(skb->data)) * forwarded to another mesh gate. In either case
/* DA TA mSA AE:SA */ * resolution will be handled in ieee80211_xmit(), so
mesh_da = skb->data; * leave the original DA. This also works for mcast */
else { const u8 *mesh_da = skb->data;
static const u8 bcast[ETH_ALEN] =
{ 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; if (mppath)
if (mppath) {
/* RA TA mDA mSA AE:DA SA */
mesh_da = mppath->mpp; mesh_da = mppath->mpp;
is_mesh_mcast = 0; else if (mpath)
} else if (mpath) {
mesh_da = mpath->dst; mesh_da = mpath->dst;
is_mesh_mcast = 0; rcu_read_unlock();
} else {
/* DA TA mSA AE:SA */
mesh_da = bcast;
}
}
hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc, hdrlen = ieee80211_fill_mesh_addresses(&hdr, &fc,
mesh_da, sdata->vif.addr); mesh_da, sdata->vif.addr);
rcu_read_unlock(); if (is_multicast_ether_addr(mesh_da))
if (is_mesh_mcast) /* DA TA mSA AE:SA */
meshhdrlen = meshhdrlen =
ieee80211_new_mesh_header(&mesh_hdr, ieee80211_new_mesh_header(&mesh_hdr,
sdata, sdata,
skb->data + ETH_ALEN, skb->data + ETH_ALEN,
NULL); NULL);
else else
/* RA TA mDA mSA AE:DA SA */
meshhdrlen = meshhdrlen =
ieee80211_new_mesh_header(&mesh_hdr, ieee80211_new_mesh_header(&mesh_hdr,
sdata, sdata,
......
...@@ -5656,8 +5656,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info) ...@@ -5656,8 +5656,10 @@ static int nl80211_connect(struct sk_buff *skb, struct genl_info *info)
sizeof(connect.ht_capa_mask)); sizeof(connect.ht_capa_mask));
if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) { if (info->attrs[NL80211_ATTR_HT_CAPABILITY]) {
if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) if (!info->attrs[NL80211_ATTR_HT_CAPABILITY_MASK]) {
kfree(connkeys);
return -EINVAL; return -EINVAL;
}
memcpy(&connect.ht_capa, memcpy(&connect.ht_capa,
nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]), nla_data(info->attrs[NL80211_ATTR_HT_CAPABILITY]),
sizeof(connect.ht_capa)); sizeof(connect.ht_capa));
......
...@@ -680,6 +680,8 @@ static u32 map_regdom_flags(u32 rd_flags) ...@@ -680,6 +680,8 @@ static u32 map_regdom_flags(u32 rd_flags)
channel_flags |= IEEE80211_CHAN_NO_IBSS; channel_flags |= IEEE80211_CHAN_NO_IBSS;
if (rd_flags & NL80211_RRF_DFS) if (rd_flags & NL80211_RRF_DFS)
channel_flags |= IEEE80211_CHAN_RADAR; channel_flags |= IEEE80211_CHAN_RADAR;
if (rd_flags & NL80211_RRF_NO_OFDM)
channel_flags |= IEEE80211_CHAN_NO_OFDM;
return channel_flags; return channel_flags;
} }
...@@ -901,7 +903,21 @@ static void handle_channel(struct wiphy *wiphy, ...@@ -901,7 +903,21 @@ static void handle_channel(struct wiphy *wiphy,
chan->max_antenna_gain = min(chan->orig_mag, chan->max_antenna_gain = min(chan->orig_mag,
(int) MBI_TO_DBI(power_rule->max_antenna_gain)); (int) MBI_TO_DBI(power_rule->max_antenna_gain));
chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp); chan->max_reg_power = (int) MBM_TO_DBM(power_rule->max_eirp);
chan->max_power = min(chan->max_power, chan->max_reg_power); if (chan->orig_mpwr) {
/*
* Devices that have their own custom regulatory domain
* but also use WIPHY_FLAG_STRICT_REGULATORY will follow the
* passed country IE power settings.
*/
if (initiator == NL80211_REGDOM_SET_BY_COUNTRY_IE &&
wiphy->flags & WIPHY_FLAG_CUSTOM_REGULATORY &&
wiphy->flags & WIPHY_FLAG_STRICT_REGULATORY)
chan->max_power = chan->max_reg_power;
else
chan->max_power = min(chan->orig_mpwr,
chan->max_reg_power);
} else
chan->max_power = chan->max_reg_power;
} }
static void handle_band(struct wiphy *wiphy, static void handle_band(struct wiphy *wiphy,
...@@ -1885,6 +1901,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy) ...@@ -1885,6 +1901,7 @@ static void restore_custom_reg_settings(struct wiphy *wiphy)
chan->flags = chan->orig_flags; chan->flags = chan->orig_flags;
chan->max_antenna_gain = chan->orig_mag; chan->max_antenna_gain = chan->orig_mag;
chan->max_power = chan->orig_mpwr; chan->max_power = chan->orig_mpwr;
chan->beacon_found = false;
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册