Skip to content

Commit 6475cb0

Browse files
committed
Merge branch 'for-john' of git://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next
2 parents e563589 + 1eb3217 commit 6475cb0

42 files changed

Lines changed: 1526 additions & 616 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎drivers/net/wireless/iwlegacy/4965-mac.c‎

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6057,7 +6057,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
60576057
struct il_priv *il = hw->priv;
60586058
const struct il_channel_info *ch_info;
60596059
struct ieee80211_conf *conf = &hw->conf;
6060-
struct ieee80211_channel *channel = ch_switch->channel;
6060+
struct ieee80211_channel *channel = ch_switch->chandef.chan;
60616061
struct il_ht_config *ht_conf = &il->current_ht_config;
60626062
u16 ch;
60636063

@@ -6094,23 +6094,21 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
60946094
il->current_ht_config.smps = conf->smps_mode;
60956095

60966096
/* Configure HT40 channels */
6097-
il->ht.enabled = conf_is_ht(conf);
6098-
if (il->ht.enabled) {
6099-
if (conf_is_ht40_minus(conf)) {
6100-
il->ht.extension_chan_offset =
6101-
IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6102-
il->ht.is_40mhz = true;
6103-
} else if (conf_is_ht40_plus(conf)) {
6104-
il->ht.extension_chan_offset =
6105-
IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6106-
il->ht.is_40mhz = true;
6107-
} else {
6108-
il->ht.extension_chan_offset =
6109-
IEEE80211_HT_PARAM_CHA_SEC_NONE;
6110-
il->ht.is_40mhz = false;
6111-
}
6112-
} else
6097+
switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
6098+
case NL80211_CHAN_NO_HT:
6099+
case NL80211_CHAN_HT20:
61136100
il->ht.is_40mhz = false;
6101+
il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
6102+
break;
6103+
case NL80211_CHAN_HT40MINUS:
6104+
il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
6105+
il->ht.is_40mhz = true;
6106+
break;
6107+
case NL80211_CHAN_HT40PLUS:
6108+
il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
6109+
il->ht.is_40mhz = true;
6110+
break;
6111+
}
61146112

61156113
if ((le16_to_cpu(il->staging.channel) != ch))
61166114
il->staging.flags = 0;

‎drivers/net/wireless/iwlegacy/4965.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1493,7 +1493,7 @@ il4965_hw_channel_switch(struct il_priv *il,
14931493

14941494
cmd.band = band;
14951495
cmd.expect_beacon = 0;
1496-
ch = ch_switch->channel->hw_value;
1496+
ch = ch_switch->chandef.chan->hw_value;
14971497
cmd.channel = cpu_to_le16(ch);
14981498
cmd.rxon_flags = il->staging.flags;
14991499
cmd.rxon_filter_flags = il->staging.filter_flags;

‎drivers/net/wireless/iwlwifi/dvm/devices.c‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
379379
};
380380

381381
cmd.band = priv->band == IEEE80211_BAND_2GHZ;
382-
ch = ch_switch->channel->hw_value;
382+
ch = ch_switch->chandef.chan->hw_value;
383383
IWL_DEBUG_11H(priv, "channel switch from %d to %d\n",
384384
ctx->active.channel, ch);
385385
cmd.channel = cpu_to_le16(ch);
@@ -414,7 +414,8 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
414414
}
415415
IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
416416
cmd.switch_time);
417-
cmd.expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;
417+
cmd.expect_beacon =
418+
ch_switch->chandef.chan->flags & IEEE80211_CHAN_RADAR;
418419

419420
return iwl_dvm_send_cmd(priv, &hcmd);
420421
}
@@ -540,7 +541,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
540541
hcmd.data[0] = cmd;
541542

542543
cmd->band = priv->band == IEEE80211_BAND_2GHZ;
543-
ch = ch_switch->channel->hw_value;
544+
ch = ch_switch->chandef.chan->hw_value;
544545
IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
545546
ctx->active.channel, ch);
546547
cmd->channel = cpu_to_le16(ch);
@@ -575,7 +576,8 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
575576
}
576577
IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
577578
cmd->switch_time);
578-
cmd->expect_beacon = ch_switch->channel->flags & IEEE80211_CHAN_RADAR;
579+
cmd->expect_beacon =
580+
ch_switch->chandef.chan->flags & IEEE80211_CHAN_RADAR;
579581

580582
err = iwl_dvm_send_cmd(priv, &hcmd);
581583
kfree(cmd);

‎drivers/net/wireless/iwlwifi/dvm/mac80211.c‎

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -970,7 +970,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
970970
{
971971
struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
972972
struct ieee80211_conf *conf = &hw->conf;
973-
struct ieee80211_channel *channel = ch_switch->channel;
973+
struct ieee80211_channel *channel = ch_switch->chandef.chan;
974974
struct iwl_ht_config *ht_conf = &priv->current_ht_config;
975975
/*
976976
* MULTI-FIXME
@@ -1008,11 +1008,21 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
10081008
priv->current_ht_config.smps = conf->smps_mode;
10091009

10101010
/* Configure HT40 channels */
1011-
ctx->ht.enabled = conf_is_ht(conf);
1012-
if (ctx->ht.enabled)
1013-
iwlagn_config_ht40(conf, ctx);
1014-
else
1011+
switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
1012+
case NL80211_CHAN_NO_HT:
1013+
case NL80211_CHAN_HT20:
10151014
ctx->ht.is_40mhz = false;
1015+
ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
1016+
break;
1017+
case NL80211_CHAN_HT40MINUS:
1018+
ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
1019+
ctx->ht.is_40mhz = true;
1020+
break;
1021+
case NL80211_CHAN_HT40PLUS:
1022+
ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
1023+
ctx->ht.is_40mhz = true;
1024+
break;
1025+
}
10161026

10171027
if ((le16_to_cpu(ctx->staging.channel) != ch))
10181028
ctx->staging.flags = 0;

‎drivers/net/wireless/iwlwifi/dvm/rxon.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1160,7 +1160,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
11601160
}
11611161

11621162
void iwlagn_config_ht40(struct ieee80211_conf *conf,
1163-
struct iwl_rxon_context *ctx)
1163+
struct iwl_rxon_context *ctx)
11641164
{
11651165
if (conf_is_ht40_minus(conf)) {
11661166
ctx->ht.extension_chan_offset =

‎drivers/net/wireless/mac80211_hwsim.c‎

Lines changed: 60 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include <linux/if_arp.h>
2626
#include <linux/rtnetlink.h>
2727
#include <linux/etherdevice.h>
28+
#include <linux/platform_device.h>
2829
#include <linux/debugfs.h>
2930
#include <linux/module.h>
3031
#include <linux/ktime.h>
@@ -52,6 +53,10 @@ static bool paged_rx = false;
5253
module_param(paged_rx, bool, 0644);
5354
MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones");
5455

56+
static bool rctbl = false;
57+
module_param(rctbl, bool, 0444);
58+
MODULE_PARM_DESC(rctbl, "Handle rate control table");
59+
5560
/**
5661
* enum hwsim_regtest - the type of regulatory tests we offer
5762
*
@@ -717,9 +722,17 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
717722
rx_status.flag |= RX_FLAG_MACTIME_START;
718723
rx_status.freq = chan->center_freq;
719724
rx_status.band = chan->band;
720-
rx_status.rate_idx = info->control.rates[0].idx;
721-
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
722-
rx_status.flag |= RX_FLAG_HT;
725+
if (info->control.rates[0].flags & IEEE80211_TX_RC_VHT_MCS) {
726+
rx_status.rate_idx =
727+
ieee80211_rate_get_vht_mcs(&info->control.rates[0]);
728+
rx_status.vht_nss =
729+
ieee80211_rate_get_vht_nss(&info->control.rates[0]);
730+
rx_status.flag |= RX_FLAG_VHT;
731+
} else {
732+
rx_status.rate_idx = info->control.rates[0].idx;
733+
if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
734+
rx_status.flag |= RX_FLAG_HT;
735+
}
723736
if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
724737
rx_status.flag |= RX_FLAG_40MHZ;
725738
if (info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
@@ -886,8 +899,12 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
886899
if (control->sta)
887900
hwsim_check_sta_magic(control->sta);
888901

889-
txi->rate_driver_data[0] = channel;
902+
if (rctbl)
903+
ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
904+
txi->control.rates,
905+
ARRAY_SIZE(txi->control.rates));
890906

907+
txi->rate_driver_data[0] = channel;
891908
mac80211_hwsim_monitor_rx(hw, skb, channel);
892909

893910
/* wmediumd mode check */
@@ -989,6 +1006,13 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
9891006
{
9901007
u32 _pid = ACCESS_ONCE(wmediumd_portid);
9911008

1009+
if (rctbl) {
1010+
struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
1011+
ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
1012+
txi->control.rates,
1013+
ARRAY_SIZE(txi->control.rates));
1014+
}
1015+
9921016
mac80211_hwsim_monitor_rx(hw, skb, chan);
9931017

9941018
if (_pid)
@@ -1019,6 +1043,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
10191043
if (skb == NULL)
10201044
return;
10211045
info = IEEE80211_SKB_CB(skb);
1046+
if (rctbl)
1047+
ieee80211_get_tx_rates(vif, NULL, skb,
1048+
info->control.rates,
1049+
ARRAY_SIZE(info->control.rates));
1050+
10221051
txrate = ieee80211_get_tx_rate(hw, info);
10231052

10241053
mgmt = (struct ieee80211_mgmt *) skb->data;
@@ -1687,6 +1716,7 @@ static void mac80211_hwsim_free(void)
16871716
debugfs_remove(data->debugfs_ps);
16881717
debugfs_remove(data->debugfs);
16891718
ieee80211_unregister_hw(data->hw);
1719+
device_release_driver(data->dev);
16901720
device_unregister(data->dev);
16911721
ieee80211_free_hw(data->hw);
16921722
}
@@ -1695,7 +1725,9 @@ static void mac80211_hwsim_free(void)
16951725

16961726

16971727
static struct device_driver mac80211_hwsim_driver = {
1698-
.name = "mac80211_hwsim"
1728+
.name = "mac80211_hwsim",
1729+
.bus = &platform_bus_type,
1730+
.owner = THIS_MODULE,
16991731
};
17001732

17011733
static const struct net_device_ops hwsim_netdev_ops = {
@@ -2187,9 +2219,15 @@ static int __init init_mac80211_hwsim(void)
21872219
spin_lock_init(&hwsim_radio_lock);
21882220
INIT_LIST_HEAD(&hwsim_radios);
21892221

2222+
err = driver_register(&mac80211_hwsim_driver);
2223+
if (err)
2224+
return err;
2225+
21902226
hwsim_class = class_create(THIS_MODULE, "mac80211_hwsim");
2191-
if (IS_ERR(hwsim_class))
2192-
return PTR_ERR(hwsim_class);
2227+
if (IS_ERR(hwsim_class)) {
2228+
err = PTR_ERR(hwsim_class);
2229+
goto failed_unregister_driver;
2230+
}
21932231

21942232
memset(addr, 0, ETH_ALEN);
21952233
addr[0] = 0x02;
@@ -2211,12 +2249,20 @@ static int __init init_mac80211_hwsim(void)
22112249
"hwsim%d", i);
22122250
if (IS_ERR(data->dev)) {
22132251
printk(KERN_DEBUG
2214-
"mac80211_hwsim: device_create "
2215-
"failed (%ld)\n", PTR_ERR(data->dev));
2252+
"mac80211_hwsim: device_create failed (%ld)\n",
2253+
PTR_ERR(data->dev));
22162254
err = -ENOMEM;
22172255
goto failed_drvdata;
22182256
}
22192257
data->dev->driver = &mac80211_hwsim_driver;
2258+
err = device_bind_driver(data->dev);
2259+
if (err != 0) {
2260+
printk(KERN_DEBUG
2261+
"mac80211_hwsim: device_bind_driver failed (%d)\n",
2262+
err);
2263+
goto failed_hw;
2264+
}
2265+
22202266
skb_queue_head_init(&data->pending);
22212267

22222268
SET_IEEE80211_DEV(hw, data->dev);
@@ -2259,6 +2305,8 @@ static int __init init_mac80211_hwsim(void)
22592305
IEEE80211_HW_AMPDU_AGGREGATION |
22602306
IEEE80211_HW_WANT_MONITOR_VIF |
22612307
IEEE80211_HW_QUEUE_CONTROL;
2308+
if (rctbl)
2309+
hw->flags |= IEEE80211_HW_SUPPORTS_RC_TABLE;
22622310

22632311
hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
22642312
WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
@@ -2515,6 +2563,8 @@ static int __init init_mac80211_hwsim(void)
25152563
ieee80211_free_hw(hw);
25162564
failed:
25172565
mac80211_hwsim_free();
2566+
failed_unregister_driver:
2567+
driver_unregister(&mac80211_hwsim_driver);
25182568
return err;
25192569
}
25202570
module_init(init_mac80211_hwsim);
@@ -2527,5 +2577,6 @@ static void __exit exit_mac80211_hwsim(void)
25272577

25282578
mac80211_hwsim_free();
25292579
unregister_netdev(hwsim_mon);
2580+
driver_unregister(&mac80211_hwsim_driver);
25302581
}
25312582
module_exit(exit_mac80211_hwsim);

‎drivers/net/wireless/ti/wl12xx/cmd.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ int wl12xx_cmd_channel_switch(struct wl1271 *wl,
301301
}
302302

303303
cmd->role_id = wlvif->role_id;
304-
cmd->channel = ch_switch->channel->hw_value;
304+
cmd->channel = ch_switch->chandef.chan->hw_value;
305305
cmd->switch_time = ch_switch->count;
306306
cmd->stop_tx = ch_switch->block_tx;
307307

‎drivers/net/wireless/ti/wl18xx/cmd.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,11 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
4242
}
4343

4444
cmd->role_id = wlvif->role_id;
45-
cmd->channel = ch_switch->channel->hw_value;
45+
cmd->channel = ch_switch->chandef.chan->hw_value;
4646
cmd->switch_time = ch_switch->count;
4747
cmd->stop_tx = ch_switch->block_tx;
4848

49-
switch (ch_switch->channel->band) {
49+
switch (ch_switch->chandef.chan->band) {
5050
case IEEE80211_BAND_2GHZ:
5151
cmd->band = WLCORE_BAND_2_4GHZ;
5252
break;
@@ -55,7 +55,7 @@ int wl18xx_cmd_channel_switch(struct wl1271 *wl,
5555
break;
5656
default:
5757
wl1271_error("invalid channel switch band: %d",
58-
ch_switch->channel->band);
58+
ch_switch->chandef.chan->band);
5959
ret = -EINVAL;
6060
goto out_free;
6161
}

0 commit comments

Comments
 (0)