Message ID | 20140106180150.GB5358@magnum.frso.rivierawaves.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Headers | show |
On Mon, 2014-01-06 at 19:01 +0100, Karl Beldan wrote: > + if (vif->csa_active) { > + vp->csa_bcn_cnt++; I don't see any readers of this variable? > + if (vp->csa_finished) { > + wiphy_debug(hw->wiphy,"%s extra CSA-beacon\n", __func__); > + } else if (ieee80211_csa_is_complete(vif)) { > + wiphy_debug(hw->wiphy, > + "%s CSA complete after %d beacons\n", > + __func__, vp->csa_bcn_cnt); except for the debug, but is that really useful? > + ieee80211_csa_finish(vif); > + vp->csa_finished = true; and if we remove the other debug we can also remove the csa_finished variable, that seems reasonable to me since mac80211 would already warn anyway, no? johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, Jan 07, 2014 at 04:33:38PM +0100, Johannes Berg wrote: > On Mon, 2014-01-06 at 19:01 +0100, Karl Beldan wrote: > > > + if (vif->csa_active) { > > + vp->csa_bcn_cnt++; > > I don't see any readers of this variable? > > > + if (vp->csa_finished) { > > + wiphy_debug(hw->wiphy,"%s extra CSA-beacon\n", __func__); > > + } else if (ieee80211_csa_is_complete(vif)) { > > + wiphy_debug(hw->wiphy, > > + "%s CSA complete after %d beacons\n", > > + __func__, vp->csa_bcn_cnt); > > except for the debug, but is that really useful? > In a sim/debug module ? I found it appropriate ;) Seriously I have no strong opinion on this matter, as I said, feel free to do whatever you want with this, there's nothing critical here. > > + ieee80211_csa_finish(vif); > > + vp->csa_finished = true; > > and if we remove the other debug we can also remove the csa_finished > variable, that seems reasonable to me since mac80211 would already warn > anyway, no? > I just got rid of a big blahblah I got for this, please, adjust as you see fit as I have no strong opinion on this matter. Karl -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Tue, 2014-01-07 at 18:34 +0100, Karl Beldan wrote: > On Tue, Jan 07, 2014 at 04:33:38PM +0100, Johannes Berg wrote: > > On Mon, 2014-01-06 at 19:01 +0100, Karl Beldan wrote: > > > > > + if (vif->csa_active) { > > > + vp->csa_bcn_cnt++; > > > > I don't see any readers of this variable? > > > > > + if (vp->csa_finished) { > > > + wiphy_debug(hw->wiphy,"%s extra CSA-beacon\n", __func__); > > > + } else if (ieee80211_csa_is_complete(vif)) { > > > + wiphy_debug(hw->wiphy, > > > + "%s CSA complete after %d beacons\n", > > > + __func__, vp->csa_bcn_cnt); > > > > except for the debug, but is that really useful? > > > In a sim/debug module ? I found it appropriate ;) > Seriously I have no strong opinion on this matter, as I said, feel free > to do whatever you want with this, there's nothing critical here. > > > > + ieee80211_csa_finish(vif); > > > + vp->csa_finished = true; > > > > and if we remove the other debug we can also remove the csa_finished > > variable, that seems reasonable to me since mac80211 would already warn > > anyway, no? > > > I just got rid of a big blahblah I got for this, please, adjust as you > see fit as I have no strong opinion on this matter. Well, heh. That'd mean learning all about the API? I think I have a patch somewhere from somebody else that looked simpler, I think I'll take that and see what happens. johannes -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Mon, Jan 20, 2014 at 12:09:40PM +0100, Johannes Berg wrote: > On Tue, 2014-01-07 at 18:34 +0100, Karl Beldan wrote: > > On Tue, Jan 07, 2014 at 04:33:38PM +0100, Johannes Berg wrote: > > > On Mon, 2014-01-06 at 19:01 +0100, Karl Beldan wrote: [...] > > Well, heh. That'd mean learning all about the API? I think I have a > patch somewhere from somebody else that looked simpler, I think I'll > take that and see what happens. > Arf, I wasn't aware of the trouble. Karl -- To unsubscribe from this list: send the line "unsubscribe linux-wireless" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/net/wireless/mac80211_hwsim.c b/drivers/net/wireless/mac80211_hwsim.c index 9c0cc8d..b76de14 100644 --- a/drivers/net/wireless/mac80211_hwsim.c +++ b/drivers/net/wireless/mac80211_hwsim.c @@ -169,6 +169,8 @@ struct hwsim_vif_priv { bool assoc; bool bcn_en; u16 aid; + int csa_bcn_cnt; + bool csa_finished; }; #define HWSIM_VIF_MAGIC 0x69537748 @@ -1032,6 +1034,7 @@ static void mac80211_hwsim_tx_frame(struct ieee80211_hw *hw, static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, struct ieee80211_vif *vif) { + struct hwsim_vif_priv *vp = (void *)vif->drv_priv; struct mac80211_hwsim_data *data = arg; struct ieee80211_hw *hw = data->hw; struct ieee80211_tx_info *info; @@ -1066,6 +1069,19 @@ static void mac80211_hwsim_beacon_tx(void *arg, u8 *mac, mac80211_hwsim_tx_frame(hw, skb, rcu_dereference(vif->chanctx_conf)->def.chan); + + if (vif->csa_active) { + vp->csa_bcn_cnt++; + if (vp->csa_finished) { + wiphy_debug(hw->wiphy,"%s extra CSA-beacon\n", __func__); + } else if (ieee80211_csa_is_complete(vif)) { + wiphy_debug(hw->wiphy, + "%s CSA complete after %d beacons\n", + __func__, vp->csa_bcn_cnt); + ieee80211_csa_finish(vif); + vp->csa_finished = true; + } + } } static enum hrtimer_restart @@ -1700,6 +1716,20 @@ static void mac80211_hwsim_unassign_vif_chanctx(struct ieee80211_hw *hw, hwsim_check_chanctx_magic(ctx); } +static void mac80211_hwsim_channel_switch_beacon(struct ieee80211_hw *hw, + struct ieee80211_vif *vif, + struct cfg80211_chan_def *chandef) +{ + struct hwsim_vif_priv *vp = (void *)vif->drv_priv; + + hwsim_check_magic(vif); + vp->csa_finished = false; + vp->csa_bcn_cnt = 0; + wiphy_debug(hw->wiphy, "%s (freq=%d(%d - %d)/%s)\n", __func__, + chandef->chan->center_freq, chandef->center_freq1, + chandef->center_freq2, hwsim_chanwidths[chandef->width]); +} + static struct ieee80211_ops mac80211_hwsim_ops = { .tx = mac80211_hwsim_tx, @@ -1724,6 +1754,7 @@ static struct ieee80211_ops mac80211_hwsim_ops = .flush = mac80211_hwsim_flush, .get_tsf = mac80211_hwsim_get_tsf, .set_tsf = mac80211_hwsim_set_tsf, + .channel_switch_beacon = mac80211_hwsim_channel_switch_beacon, }; @@ -2366,7 +2397,9 @@ static int __init init_mac80211_hwsim(void) hw->wiphy->flags |= WIPHY_FLAG_SUPPORTS_TDLS | WIPHY_FLAG_HAS_REMAIN_ON_CHANNEL | - WIPHY_FLAG_AP_UAPSD; + WIPHY_FLAG_AP_UAPSD | + WIPHY_FLAG_HAS_CHANNEL_SWITCH; + hw->wiphy->features |= NL80211_FEATURE_ACTIVE_MONITOR; /* ask mac80211 to reserve space for magic */