summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Chua <jeff.chua.linux@gmail.com>2011-04-27 11:25:14 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-06-03 09:32:10 +0900
commit9edb40ddd05b47703bb1b5757ba36e96c77d1fdd (patch)
tree9d46ae15165c6c7e1072721034622b87b8928fe7
parentd13ae39a34fb711bf0add4bfd25e08b2f7aba104 (diff)
downloadlinux-stable-9edb40ddd05b47703bb1b5757ba36e96c77d1fdd.tar.gz
linux-stable-9edb40ddd05b47703bb1b5757ba36e96c77d1fdd.tar.bz2
linux-stable-9edb40ddd05b47703bb1b5757ba36e96c77d1fdd.zip
staging: r8712u: Fix driver to support ad-hoc mode
commit 62819fd9481021db7f87d5f61f2e2fd2be1dfcfa upstream. Driver r8712u is unable to handle ad-hoc mode. The issue is that when the driver first starts, there will not be an SSID for association. The fix is to always call the "select and join from scan" routine when in ad-hoc mode. Note: Ad-hoc mode worked intermittently before. If the driver had previously been associated, then things were OK. Signed-off-by: Jeff Chua <jeff.chua.linux@gmail.com> Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/staging/rtl8712/rtl871x_ioctl_set.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
index 8b1451d03069..8486eb1503cc 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
@@ -68,7 +68,10 @@ static u8 do_join(struct _adapter *padapter)
pmlmepriv->fw_state |= _FW_UNDER_LINKING;
pmlmepriv->pscanned = plist;
pmlmepriv->to_join = true;
- if (_queue_empty(queue) == true) {
+
+ /* adhoc mode will start with an empty queue, but skip checking */
+ if (!check_fwstate(pmlmepriv, WIFI_ADHOC_STATE) &&
+ _queue_empty(queue)) {
if (pmlmepriv->fw_state & _FW_UNDER_LINKING)
pmlmepriv->fw_state ^= _FW_UNDER_LINKING;
/* when set_ssid/set_bssid for do_join(), but scanning queue