From: Michael Wu <flamingice@sourmilk.net>
To: Jiri Benc <jbenc@suse.cz>
Cc: linux-wireless@vger.kernel.org,
John Linville <linville@tuxdriver.com>,
Larry Finger <Larry.Finger@lwfinger.net>,
Johannes Berg <johannes@sipsolutions.net>
Subject: [PATCH] mac80211: make mode change to same mode always successful
Date: Mon, 9 Apr 2007 22:45:45 -0400 [thread overview]
Message-ID: <200704092245.49798.flamingice@sourmilk.net> (raw)
[-- 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 --]
next reply other threads:[~2007-04-10 2:48 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-10 2:45 Michael Wu [this message]
2007-04-10 5:35 ` [PATCH] mac80211: make mode change to same mode always successful Johannes Berg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200704092245.49798.flamingice@sourmilk.net \
--to=flamingice@sourmilk.net \
--cc=Larry.Finger@lwfinger.net \
--cc=jbenc@suse.cz \
--cc=johannes@sipsolutions.net \
--cc=linux-wireless@vger.kernel.org \
--cc=linville@tuxdriver.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox