Search Linux Wireless

[PATCH] mac80211: make mode change to same mode always successful

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

 



I suspect wireless mode change failure is the cause of many wpa_supplicant and 
NM problems. Anyone who is having issues with wpa_supplicant and/or NM - 
please try this patch.

Thanks,
-Michael Wu
mac80211: make mode change to same mode always successful

From: Michael Wu <flamingice@xxxxxxxxxxxx>

This patch makes ieee80211_ioctl_siwmode always return success if the new
mode is the same as the current mode.

Signed-off-by: Michael Wu <flamingice@xxxxxxxxxxxx>
---

 net/mac80211/ieee80211_ioctl.c |   14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diff --git a/net/mac80211/ieee80211_ioctl.c b/net/mac80211/ieee80211_ioctl.c
index d139d97..bb3852c 100644
--- a/net/mac80211/ieee80211_ioctl.c
+++ b/net/mac80211/ieee80211_ioctl.c
@@ -1738,8 +1738,6 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
 
 	if (sdata->type == IEEE80211_IF_TYPE_VLAN)
 		return -EOPNOTSUPP;
-	if (netif_running(dev))
-		return -EBUSY;
 
 	switch (*mode) {
 	case IW_MODE_MASTER:
@@ -1761,10 +1759,14 @@ static int ieee80211_ioctl_siwmode(struct net_device *dev,
 		return -EINVAL;
 	}
 
-	if (type != sdata->type) {
-		ieee80211_if_reinit(dev);
-		ieee80211_if_set_type(dev, type);
-	}
+	if (type == sdata->type)
+		return 0;
+	if (netif_running(dev))
+		return -EBUSY;
+
+	ieee80211_if_reinit(dev);
+	ieee80211_if_set_type(dev, type);
+
 	return 0;
 }
 

Attachment: pgpdceTqvy3dt.pgp
Description: PGP signature


[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