Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6475cb05 authored by John W. Linville's avatar John W. Linville
Browse files
parents e563589f 1eb32179
Loading
Loading
Loading
Loading
+15 −17
Original line number Original line Diff line number Diff line
@@ -6057,7 +6057,7 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
	struct il_priv *il = hw->priv;
	struct il_priv *il = hw->priv;
	const struct il_channel_info *ch_info;
	const struct il_channel_info *ch_info;
	struct ieee80211_conf *conf = &hw->conf;
	struct ieee80211_conf *conf = &hw->conf;
	struct ieee80211_channel *channel = ch_switch->channel;
	struct ieee80211_channel *channel = ch_switch->chandef.chan;
	struct il_ht_config *ht_conf = &il->current_ht_config;
	struct il_ht_config *ht_conf = &il->current_ht_config;
	u16 ch;
	u16 ch;


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


	/* Configure HT40 channels */
	/* Configure HT40 channels */
	il->ht.enabled = conf_is_ht(conf);
	switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
	if (il->ht.enabled) {
	case NL80211_CHAN_NO_HT:
		if (conf_is_ht40_minus(conf)) {
	case NL80211_CHAN_HT20:
			il->ht.extension_chan_offset =
		il->ht.is_40mhz = false;
			    IEEE80211_HT_PARAM_CHA_SEC_BELOW;
		il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
		break;
	case NL80211_CHAN_HT40MINUS:
		il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
		il->ht.is_40mhz = true;
		il->ht.is_40mhz = true;
		} else if (conf_is_ht40_plus(conf)) {
		break;
			il->ht.extension_chan_offset =
	case NL80211_CHAN_HT40PLUS:
			    IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
		il->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
		il->ht.is_40mhz = true;
		il->ht.is_40mhz = true;
		} else {
		break;
			il->ht.extension_chan_offset =
			    IEEE80211_HT_PARAM_CHA_SEC_NONE;
			il->ht.is_40mhz = false;
	}
	}
	} else
		il->ht.is_40mhz = false;


	if ((le16_to_cpu(il->staging.channel) != ch))
	if ((le16_to_cpu(il->staging.channel) != ch))
		il->staging.flags = 0;
		il->staging.flags = 0;
+1 −1
Original line number Original line Diff line number Diff line
@@ -1493,7 +1493,7 @@ il4965_hw_channel_switch(struct il_priv *il,


	cmd.band = band;
	cmd.band = band;
	cmd.expect_beacon = 0;
	cmd.expect_beacon = 0;
	ch = ch_switch->channel->hw_value;
	ch = ch_switch->chandef.chan->hw_value;
	cmd.channel = cpu_to_le16(ch);
	cmd.channel = cpu_to_le16(ch);
	cmd.rxon_flags = il->staging.flags;
	cmd.rxon_flags = il->staging.flags;
	cmd.rxon_filter_flags = il->staging.filter_flags;
	cmd.rxon_filter_flags = il->staging.filter_flags;
+6 −4
Original line number Original line Diff line number Diff line
@@ -379,7 +379,7 @@ static int iwl5000_hw_channel_switch(struct iwl_priv *priv,
	};
	};


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


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


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


	err = iwl_dvm_send_cmd(priv, &hcmd);
	err = iwl_dvm_send_cmd(priv, &hcmd);
	kfree(cmd);
	kfree(cmd);
+15 −5
Original line number Original line Diff line number Diff line
@@ -970,7 +970,7 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
{
{
	struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
	struct iwl_priv *priv = IWL_MAC80211_GET_DVM(hw);
	struct ieee80211_conf *conf = &hw->conf;
	struct ieee80211_conf *conf = &hw->conf;
	struct ieee80211_channel *channel = ch_switch->channel;
	struct ieee80211_channel *channel = ch_switch->chandef.chan;
	struct iwl_ht_config *ht_conf = &priv->current_ht_config;
	struct iwl_ht_config *ht_conf = &priv->current_ht_config;
	/*
	/*
	 * MULTI-FIXME
	 * MULTI-FIXME
@@ -1008,11 +1008,21 @@ static void iwlagn_mac_channel_switch(struct ieee80211_hw *hw,
	priv->current_ht_config.smps = conf->smps_mode;
	priv->current_ht_config.smps = conf->smps_mode;


	/* Configure HT40 channels */
	/* Configure HT40 channels */
	ctx->ht.enabled = conf_is_ht(conf);
	switch (cfg80211_get_chandef_type(&ch_switch->chandef)) {
	if (ctx->ht.enabled)
	case NL80211_CHAN_NO_HT:
		iwlagn_config_ht40(conf, ctx);
	case NL80211_CHAN_HT20:
	else
		ctx->ht.is_40mhz = false;
		ctx->ht.is_40mhz = false;
		ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_NONE;
		break;
	case NL80211_CHAN_HT40MINUS:
		ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_BELOW;
		ctx->ht.is_40mhz = true;
		break;
	case NL80211_CHAN_HT40PLUS:
		ctx->ht.extension_chan_offset = IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
		ctx->ht.is_40mhz = true;
		break;
	}


	if ((le16_to_cpu(ctx->staging.channel) != ch))
	if ((le16_to_cpu(ctx->staging.channel) != ch))
		ctx->staging.flags = 0;
		ctx->staging.flags = 0;
+60 −9
Original line number Original line Diff line number Diff line
@@ -25,6 +25,7 @@
#include <linux/if_arp.h>
#include <linux/if_arp.h>
#include <linux/rtnetlink.h>
#include <linux/rtnetlink.h>
#include <linux/etherdevice.h>
#include <linux/etherdevice.h>
#include <linux/platform_device.h>
#include <linux/debugfs.h>
#include <linux/debugfs.h>
#include <linux/module.h>
#include <linux/module.h>
#include <linux/ktime.h>
#include <linux/ktime.h>
@@ -52,6 +53,10 @@ static bool paged_rx = false;
module_param(paged_rx, bool, 0644);
module_param(paged_rx, bool, 0644);
MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones");
MODULE_PARM_DESC(paged_rx, "Use paged SKBs for RX instead of linear ones");


static bool rctbl = false;
module_param(rctbl, bool, 0444);
MODULE_PARM_DESC(rctbl, "Handle rate control table");

/**
/**
 * enum hwsim_regtest - the type of regulatory tests we offer
 * enum hwsim_regtest - the type of regulatory tests we offer
 *
 *
@@ -717,9 +722,17 @@ static bool mac80211_hwsim_tx_frame_no_nl(struct ieee80211_hw *hw,
	rx_status.flag |= RX_FLAG_MACTIME_START;
	rx_status.flag |= RX_FLAG_MACTIME_START;
	rx_status.freq = chan->center_freq;
	rx_status.freq = chan->center_freq;
	rx_status.band = chan->band;
	rx_status.band = chan->band;
	if (info->control.rates[0].flags & IEEE80211_TX_RC_VHT_MCS) {
		rx_status.rate_idx =
			ieee80211_rate_get_vht_mcs(&info->control.rates[0]);
		rx_status.vht_nss =
			ieee80211_rate_get_vht_nss(&info->control.rates[0]);
		rx_status.flag |= RX_FLAG_VHT;
	} else {
		rx_status.rate_idx = info->control.rates[0].idx;
		rx_status.rate_idx = info->control.rates[0].idx;
		if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
		if (info->control.rates[0].flags & IEEE80211_TX_RC_MCS)
			rx_status.flag |= RX_FLAG_HT;
			rx_status.flag |= RX_FLAG_HT;
	}
	if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
	if (info->control.rates[0].flags & IEEE80211_TX_RC_40_MHZ_WIDTH)
		rx_status.flag |= RX_FLAG_40MHZ;
		rx_status.flag |= RX_FLAG_40MHZ;
	if (info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
	if (info->control.rates[0].flags & IEEE80211_TX_RC_SHORT_GI)
@@ -886,8 +899,12 @@ static void mac80211_hwsim_tx(struct ieee80211_hw *hw,
	if (control->sta)
	if (control->sta)
		hwsim_check_sta_magic(control->sta);
		hwsim_check_sta_magic(control->sta);


	txi->rate_driver_data[0] = channel;
	if (rctbl)
		ieee80211_get_tx_rates(txi->control.vif, control->sta, skb,
				       txi->control.rates,
				       ARRAY_SIZE(txi->control.rates));


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


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


	if (rctbl) {
		struct ieee80211_tx_info *txi = IEEE80211_SKB_CB(skb);
		ieee80211_get_tx_rates(txi->control.vif, NULL, skb,
				       txi->control.rates,
				       ARRAY_SIZE(txi->control.rates));
	}

	mac80211_hwsim_monitor_rx(hw, skb, chan);
	mac80211_hwsim_monitor_rx(hw, skb, chan);


	if (_pid)
	if (_pid)
@@ -1019,6 +1043,11 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac,
	if (skb == NULL)
	if (skb == NULL)
		return;
		return;
	info = IEEE80211_SKB_CB(skb);
	info = IEEE80211_SKB_CB(skb);
	if (rctbl)
		ieee80211_get_tx_rates(vif, NULL, skb,
				       info->control.rates,
				       ARRAY_SIZE(info->control.rates));

	txrate = ieee80211_get_tx_rate(hw, info);
	txrate = ieee80211_get_tx_rate(hw, info);


	mgmt = (struct ieee80211_mgmt *) skb->data;
	mgmt = (struct ieee80211_mgmt *) skb->data;
@@ -1687,6 +1716,7 @@ static void mac80211_hwsim_free(void)
		debugfs_remove(data->debugfs_ps);
		debugfs_remove(data->debugfs_ps);
		debugfs_remove(data->debugfs);
		debugfs_remove(data->debugfs);
		ieee80211_unregister_hw(data->hw);
		ieee80211_unregister_hw(data->hw);
		device_release_driver(data->dev);
		device_unregister(data->dev);
		device_unregister(data->dev);
		ieee80211_free_hw(data->hw);
		ieee80211_free_hw(data->hw);
	}
	}
@@ -1695,7 +1725,9 @@ static void mac80211_hwsim_free(void)




static struct device_driver mac80211_hwsim_driver = {
static struct device_driver mac80211_hwsim_driver = {
	.name = "mac80211_hwsim"
	.name = "mac80211_hwsim",
	.bus = &platform_bus_type,
	.owner = THIS_MODULE,
};
};


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


	err = driver_register(&mac80211_hwsim_driver);
	if (err)
		return err;

	hwsim_class = class_create(THIS_MODULE, "mac80211_hwsim");
	hwsim_class = class_create(THIS_MODULE, "mac80211_hwsim");
	if (IS_ERR(hwsim_class))
	if (IS_ERR(hwsim_class)) {
		return PTR_ERR(hwsim_class);
		err = PTR_ERR(hwsim_class);
		goto failed_unregister_driver;
	}


	memset(addr, 0, ETH_ALEN);
	memset(addr, 0, ETH_ALEN);
	addr[0] = 0x02;
	addr[0] = 0x02;
@@ -2211,12 +2249,20 @@ static int __init init_mac80211_hwsim(void)
					  "hwsim%d", i);
					  "hwsim%d", i);
		if (IS_ERR(data->dev)) {
		if (IS_ERR(data->dev)) {
			printk(KERN_DEBUG
			printk(KERN_DEBUG
			       "mac80211_hwsim: device_create "
			       "mac80211_hwsim: device_create failed (%ld)\n",
			       "failed (%ld)\n", PTR_ERR(data->dev));
			       PTR_ERR(data->dev));
			err = -ENOMEM;
			err = -ENOMEM;
			goto failed_drvdata;
			goto failed_drvdata;
		}
		}
		data->dev->driver = &mac80211_hwsim_driver;
		data->dev->driver = &mac80211_hwsim_driver;
		err = device_bind_driver(data->dev);
		if (err != 0) {
			printk(KERN_DEBUG
			       "mac80211_hwsim: device_bind_driver failed (%d)\n",
			       err);
			goto failed_hw;
		}

		skb_queue_head_init(&data->pending);
		skb_queue_head_init(&data->pending);


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


		hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
		hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS |
				    WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
				    WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL;
@@ -2515,6 +2563,8 @@ static int __init init_mac80211_hwsim(void)
	ieee80211_free_hw(hw);
	ieee80211_free_hw(hw);
failed:
failed:
	mac80211_hwsim_free();
	mac80211_hwsim_free();
failed_unregister_driver:
	driver_unregister(&mac80211_hwsim_driver);
	return err;
	return err;
}
}
module_init(init_mac80211_hwsim);
module_init(init_mac80211_hwsim);
@@ -2527,5 +2577,6 @@ static void __exit exit_mac80211_hwsim(void)


	mac80211_hwsim_free();
	mac80211_hwsim_free();
	unregister_netdev(hwsim_mon);
	unregister_netdev(hwsim_mon);
	driver_unregister(&mac80211_hwsim_driver);
}
}
module_exit(exit_mac80211_hwsim);
module_exit(exit_mac80211_hwsim);
Loading