Search Linux Wireless

Re: [PATCH] mac80211: Be more careful when changing channels.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 01/28/2011 01:28 AM, Johannes Berg wrote:
On Thu, 2011-01-27 at 22:09 -0800, greearb@xxxxxxxxxxxxxxx wrote:
From: Ben Greear<greearb@xxxxxxxxxxxxxxx>

If we cannot set the channel type, set the channel back to the
original.

Don't update the driver hardware if nothing actually changed.

Good catch.


+	old_oper = local->oper_channel;
  	local->oper_channel = chan;

-	if (!ieee80211_set_channel_type(local, sdata, channel_type))
+	old_oper_type = local->_oper_channel_type;
+	if (!ieee80211_set_channel_type(local, sdata, channel_type)) {
+		local->oper_channel = old_oper;
  		return -EBUSY;
+	}
+
+	if ((old_oper != local->oper_channel) ||
+	    (old_oper_type != local->_oper_channel_type))
+		ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);

-	ieee80211_hw_config(local, IEEE80211_CONF_CHANGE_CHANNEL);
-	if (sdata&&  sdata->vif.type != NL80211_IFTYPE_MONITOR)
+	if ((sdata&&  sdata->vif.type != NL80211_IFTYPE_MONITOR)&&
+	    old_vif_oper_type != sdata->vif.bss_conf.channel_type)
  		ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_HT);

But why the complicated code? Couldn't you just swap the
set_channel_type() and oper_channel = chan around? set_channel_type()
doesn't need oper_channel set.

Yes, that would simplify the first part.  The extra checks at the bottom need to
remain as far as I can tell.

I'll send a new patch today.

Thanks,
Ben


johannes

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


--
Ben Greear <greearb@xxxxxxxxxxxxxxx>
Candela Technologies Inc  http://www.candelatech.com
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux