From: Jouni Malinen Date: Tue, 10 Jun 2008 16:27:00 +0000 (+0300) Subject: Added start/stop handlers and do not send frames to stopped radios X-Git-Tag: hostap_0_6_4~26 X-Git-Url: http://www.project-moonshot.org/gitweb/?a=commitdiff_plain;ds=sidebyside;h=badba00bd459e80e9dc558eec475e20d7be7c5a6;p=libeap.git Added start/stop handlers and do not send frames to stopped radios --- diff --git a/mac80211_hwsim/mac80211_hwsim.c b/mac80211_hwsim/mac80211_hwsim.c index 4421f79..3753421 100644 --- a/mac80211_hwsim/mac80211_hwsim.c +++ b/mac80211_hwsim/mac80211_hwsim.c @@ -80,6 +80,7 @@ struct mac80211_hwsim_data { int radio_enabled; int beacon_int; unsigned int rx_filter; + int started; }; @@ -176,7 +177,8 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb, if (hwsim_radios[i] == NULL || hwsim_radios[i] == hw) continue; data2 = hwsim_radios[i]->priv; - if (!data2->radio_enabled || data->freq != data2->freq) + if (!data2->started || !data2->radio_enabled || + data->freq != data2->freq) continue; nskb = skb_copy(skb, GFP_ATOMIC); @@ -197,13 +199,17 @@ static int mac80211_hwsim_tx(struct ieee80211_hw *hw, struct sk_buff *skb, static int mac80211_hwsim_start(struct ieee80211_hw *hw) { + struct mac80211_hwsim_data *data = hw->priv; printk(KERN_DEBUG "%s:%s\n", wiphy_name(hw->wiphy), __func__); + data->started = 1; return 0; } static void mac80211_hwsim_stop(struct ieee80211_hw *hw) { + struct mac80211_hwsim_data *data = hw->priv; + data->started = 0; printk(KERN_DEBUG "%s:%s\n", wiphy_name(hw->wiphy), __func__); }