Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 171375
b: refs/heads/master
c: 7054183
h: refs/heads/master
i:
  171373: 466518c
  171371: 4dc7b87
  171367: c673499
  171359: f57698c
v: v3
  • Loading branch information
Jouni Malinen authored and John W. Linville committed Nov 2, 2009
1 parent c63c325 commit 35b2700
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: c5f8289cd9b2e31fca506cb82f4aaa5ffc468602
refs/heads/master: 70541839dd2eacb521fa4f8515ab696599b36ea3
13 changes: 11 additions & 2 deletions trunk/drivers/net/wireless/mac80211_hwsim.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ struct mac80211_hwsim_data {
struct ieee80211_channel *channel;
unsigned long beacon_int; /* in jiffies unit */
unsigned int rx_filter;
int started;
bool started, idle;
struct timer_list beacon_timer;
enum ps_mode {
PS_DISABLED, PS_ENABLED, PS_AUTO_POLL, PS_MANUAL_POLL
Expand Down Expand Up @@ -402,6 +402,12 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
struct ieee80211_rx_status rx_status;

if (data->idle) {
printk(KERN_DEBUG "%s: Trying to TX when idle - reject\n",
wiphy_name(hw->wiphy));
return false;
}

memset(&rx_status, 0, sizeof(rx_status));
/* TODO: set mactime */
rx_status.freq = data->channel->center_freq;
Expand All @@ -428,7 +434,8 @@ static bool mac80211_hwsim_tx_frame(struct ieee80211_hw *hw,
if (data == data2)
continue;

if (!data2->started || !hwsim_ps_rx_ok(data2, skb) ||
if (data2->idle || !data2->started ||
!hwsim_ps_rx_ok(data2, skb) ||
!data->channel || !data2->channel ||
data->channel->center_freq != data2->channel->center_freq ||
!(data->group & data2->group))
Expand Down Expand Up @@ -571,6 +578,8 @@ static int mac80211_hwsim_config(struct ieee80211_hw *hw, u32 changed)
!!(conf->flags & IEEE80211_CONF_IDLE),
!!(conf->flags & IEEE80211_CONF_PS));

data->idle = !!(conf->flags & IEEE80211_CONF_IDLE);

data->channel = conf->channel;
if (!data->started || !data->beacon_int)
del_timer(&data->beacon_timer);
Expand Down

0 comments on commit 35b2700

Please sign in to comment.