aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/mac80211_hwsim.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2009-06-01 08:29:52 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-06-03 14:05:12 -0400
commit4c4c671aea16d2795f29c7a369518c3c36e15d2a (patch)
tree90dffe16ac5a7d7f54ecc356d15cf1b3847c4858 /drivers/net/wireless/mac80211_hwsim.c
parent729e9c7663190d71fe5e29831634df80f38199c1 (diff)
mac80211_hwsim: remove deprecated radio_enabled
This removes the use of the deprecated radio_enabled setting and code associated with that. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/mac80211_hwsim.c')
-rw-r--r--drivers/net/wireless/mac80211_hwsim.c27
1 files changed, 7 insertions, 20 deletions
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c
index 574b8bb121e1..e789c6e9938c 100644
--- a/drivers/net/wireless/mac80211_hwsim.c
+++ b/drivers/net/wireless/mac80211_hwsim.c
@@ -280,7 +280,6 @@ struct mac80211_hwsim_data {
280 struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)]; 280 struct ieee80211_rate rates[ARRAY_SIZE(hwsim_rates)];
281 281
282 struct ieee80211_channel *channel; 282 struct ieee80211_channel *channel;
283 int radio_enabled;
284 unsigned long beacon_int; /* in jiffies unit */ 283 unsigned long beacon_int; /* in jiffies unit */
285 unsigned int rx_filter; 284 unsigned int rx_filter;
286 int started; 285 int started;
@@ -418,8 +417,7 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
418 if (data == data2) 417 if (data == data2)
419 continue; 418 continue;
420 419
421 if (!data2->started || !data2->radio_enabled || 420 if (!data2->started || !hwsim_ps_rx_ok(data2, skb) ||
422 !hwsim_ps_rx_ok(data2, skb) ||
423 data->channel->center_freq != data2->channel->center_freq || 421 data->channel->center_freq != data2->channel->center_freq ||
424 !(data->group & data2->group)) 422 !(data->group & data2->group))
425 continue; 423 continue;
@@ -441,7 +439,6 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
441 439
442static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb) 440static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
443{ 441{
444 struct mac80211_hwsim_data *data = hw->priv;
445 bool ack; 442 bool ack;
446 struct ieee80211_tx_info *txi; 443 struct ieee80211_tx_info *txi;
447 444
@@ -453,13 +450,6 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
453 return NETDEV_TX_OK; 450 return NETDEV_TX_OK;
454 } 451 }
455 452
456 if (!data->radio_enabled) {
457 printk(KERN_DEBUG "%s: dropped TX frame since radio "
458 "disabled\n", wiphy_name(hw->wiphy));
459 dev_kfree_skb(skb);
460 return NETDEV_TX_OK;
461 }
462
463 ack = mac80211_hwsim_tx_frame(hw, skb); 453 ack = mac80211_hwsim_tx_frame(hw, skb);
464 454
465 txi = IEEE80211_SKB_CB(skb); 455 txi = IEEE80211_SKB_CB(skb);
@@ -546,7 +536,7 @@ static void mac80211_hwsim_beacon(unsigned long arg)
546 struct ieee80211_hw *hw = (struct ieee80211_hw *) arg; 536 struct ieee80211_hw *hw = (struct ieee80211_hw *) arg;
547 struct mac80211_hwsim_data *data = hw->priv; 537 struct mac80211_hwsim_data *data = hw->priv;
548 538
549 if (!data->started || !data->radio_enabled) 539 if (!data->started)
550 return; 540 return;
551 541
552 ieee80211_iterate_active_interfaces_atomic( 542 ieee80211_iterate_active_interfaces_atomic(
@@ -562,15 +552,14 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
562 struct mac80211_hwsim_data *data = hw->priv; 552 struct mac80211_hwsim_data *data = hw->priv;
563 struct ieee80211_conf *conf = &hw->conf; 553 struct ieee80211_conf *conf = &hw->conf;
564 554
565 printk(KERN_DEBUG "%s:%s (freq=%d radio_enabled=%d idle=%d ps=%d)\n", 555 printk(KERN_DEBUG "%s:%s (freq=%d idle=%d ps=%d)\n",
566 wiphy_name(hw->wiphy), __func__, 556 wiphy_name(hw->wiphy), __func__,
567 conf->channel->center_freq, conf->radio_enabled, 557 conf->channel->center_freq,
568 !!(conf->flags & IEEE80211_CONF_IDLE), 558 !!(conf->flags & IEEE80211_CONF_IDLE),
569 !!(conf->flags & IEEE80211_CONF_PS)); 559 !!(conf->flags & IEEE80211_CONF_PS));
570 560
571 data->channel = conf->channel; 561 data->channel = conf->channel;
572 data->radio_enabled = conf->radio_enabled; 562 if (!data->started || !data->beacon_int)
573 if (!data->started || !data->radio_enabled || !data->beacon_int)
574 del_timer(&data->beacon_timer); 563 del_timer(&data->beacon_timer);
575 else 564 else
576 mod_timer(&data->beacon_timer, jiffies + data->beacon_int); 565 mod_timer(&data->beacon_timer, jiffies + data->beacon_int);
@@ -787,8 +776,7 @@ static void hwsim_send_ps_poll(void *dat, u8 *mac, struct ieee80211_vif *vif)
787 pspoll->aid = cpu_to_le16(0xc000 | vp->aid); 776 pspoll->aid = cpu_to_le16(0xc000 | vp->aid);
788 memcpy(pspoll->bssid, vp->bssid, ETH_ALEN); 777 memcpy(pspoll->bssid, vp->bssid, ETH_ALEN);
789 memcpy(pspoll->ta, mac, ETH_ALEN); 778 memcpy(pspoll->ta, mac, ETH_ALEN);
790 if (data->radio_enabled && 779 if (!mac80211_hwsim_tx_frame(data->hw, skb))
791 !mac80211_hwsim_tx_frame(data->hw, skb))
792 printk(KERN_DEBUG "%s: PS-Poll frame not ack'ed\n", __func__); 780 printk(KERN_DEBUG "%s: PS-Poll frame not ack'ed\n", __func__);
793 dev_kfree_skb(skb); 781 dev_kfree_skb(skb);
794} 782}
@@ -819,8 +807,7 @@ static void hwsim_send_nullfunc(struct mac80211_hwsim_data *data, u8 *mac,
819 memcpy(hdr->addr1, vp->bssid, ETH_ALEN); 807 memcpy(hdr->addr1, vp->bssid, ETH_ALEN);
820 memcpy(hdr->addr2, mac, ETH_ALEN); 808 memcpy(hdr->addr2, mac, ETH_ALEN);
821 memcpy(hdr->addr3, vp->bssid, ETH_ALEN); 809 memcpy(hdr->addr3, vp->bssid, ETH_ALEN);
822 if (data->radio_enabled && 810 if (!mac80211_hwsim_tx_frame(data->hw, skb))
823 !mac80211_hwsim_tx_frame(data->hw, skb))
824 printk(KERN_DEBUG "%s: nullfunc frame not ack'ed\n", __func__); 811 printk(KERN_DEBUG "%s: nullfunc frame not ack'ed\n", __func__);
825 dev_kfree_skb(skb); 812 dev_kfree_skb(skb);
826} 813}