Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ec483781 authored by Michael Buesch's avatar Michael Buesch Committed by John W. Linville
Browse files

[PATCH] bcm43xx: don't set the channel on a device, which is down.



Initial patch by David Woodhouse and Michael Marineau.
Locking fix by me.

Signed-off-by: default avatarMichael Buesch <mbuesch@freenet.de>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent adc40e97
Loading
Loading
Loading
Loading
+9 −3
Original line number Diff line number Diff line
@@ -3530,12 +3530,18 @@ static void bcm43xx_ieee80211_set_chan(struct net_device *net_dev,
				       u8 channel)
{
	struct bcm43xx_private *bcm = bcm43xx_priv(net_dev);
	struct bcm43xx_radioinfo *radio;
	unsigned long flags;

	bcm43xx_lock_mmio(bcm, flags);
	if (bcm->initialized) {
		bcm43xx_mac_suspend(bcm);
		bcm43xx_radio_selectchannel(bcm, channel, 0);
		bcm43xx_mac_enable(bcm);
	} else {
		radio = bcm43xx_current_radio(bcm);
		radio->initial_channel = channel;
	}
	bcm43xx_unlock_mmio(bcm, flags);
}