Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH] mac80211: make mode change to same mode always successful
@ 2007-04-10  2:45 Michael Wu
  2007-04-10  5:35 ` Johannes Berg
  0 siblings, 1 reply; 2+ messages in thread
From: Michael Wu @ 2007-04-10  2:45 UTC (permalink / raw)
  To: Jiri Benc; +Cc: linux-wireless, John Linville, Larry Finger, Johannes Berg


[-- Attachment #1.1: Type: text/plain, Size: 204 bytes --]

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

[-- Attachment #1.2: friendly-siwmode.diff --]
[-- Type: text/x-diff, Size: 1219 bytes --]

mac80211: make mode change to same mode always successful

From: Michael Wu <flamingice@sourmilk.net>

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@sourmilk.net>
---

 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 #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-04-10  5:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-10  2:45 [PATCH] mac80211: make mode change to same mode always successful Michael Wu
2007-04-10  5:35 ` Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox