linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes.Sorensen@redhat.com
To: linux-wireless@vger.kernel.org
Cc: kvalo@codeaurora.org, Larry.Finger@lwfinger.net,
	Jes Sorensen <Jes.Sorensen@redhat.com>
Subject: [PATCH 4/7] rtl8xxxu: Fix rtl8192eu driver reload issue
Date: Fri, 18 Nov 2016 16:44:25 -0500	[thread overview]
Message-ID: <1479505468-29383-5-git-send-email-Jes.Sorensen@redhat.com> (raw)
In-Reply-To: <1479505468-29383-1-git-send-email-Jes.Sorensen@redhat.com>

From: Jes Sorensen <Jes.Sorensen@redhat.com>

The 8192eu suffered from two issues when reloading the driver.

The same problems as with the 8723bu where REG_RX_WAIT_CCA bits 22 and
23 didn't get set in rtl8192e_enable_rf().

In addition it also seems prone to issues when setting REG_RF_CTRL to
0 intead of just disabling the RF_ENABLE bit. Similar to what was
causing issues with the 8188eu.

With this patch I can successfully reload the driver and reassociate
to an APi with an 8192eu dongle.

Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
---
 drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
index df54d27..a793fed 100644
--- a/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
+++ b/drivers/net/wireless/realtek/rtl8xxxu/rtl8xxxu_8192e.c
@@ -1461,7 +1461,9 @@ static int rtl8192eu_active_to_emu(struct rtl8xxxu_priv *priv)
 	int count, ret = 0;
 
 	/* Turn off RF */
-	rtl8xxxu_write8(priv, REG_RF_CTRL, 0);
+	val8 = rtl8xxxu_read8(priv, REG_RF_CTRL);
+	val8 &= ~RF_ENABLE;
+	rtl8xxxu_write8(priv, REG_RF_CTRL, val8);
 
 	/* Switch DPDT_SEL_P output from register 0x65[2] */
 	val8 = rtl8xxxu_read8(priv, REG_LEDCFG2);
@@ -1593,6 +1595,10 @@ static void rtl8192e_enable_rf(struct rtl8xxxu_priv *priv)
 	u32 val32;
 	u8 val8;
 
+	val32 = rtl8xxxu_read32(priv, REG_RX_WAIT_CCA);
+	val32 |= (BIT(22) | BIT(23));
+	rtl8xxxu_write32(priv, REG_RX_WAIT_CCA, val32);
+
 	val8 = rtl8xxxu_read8(priv, REG_GPIO_MUXCFG);
 	val8 |= BIT(5);
 	rtl8xxxu_write8(priv, REG_GPIO_MUXCFG, val8);
-- 
2.7.4

  parent reply	other threads:[~2016-11-18 21:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-18 21:44 [PATCH 0/7] rtl8xxxu: Pending patches Jes.Sorensen
2016-11-18 21:44 ` [PATCH 1/7] rtl8xxxu: Fix memory leak in handling rxdesc16 packets Jes.Sorensen
2016-11-25  9:51   ` [1/7] " Kalle Valo
2016-11-18 21:44 ` [PATCH 2/7] rtl8xxxu: Fix big-endian problem reporting mactime Jes.Sorensen
2016-11-18 21:44 ` [PATCH 3/7] rtl8xxxu: Fix rtl8723bu driver reload issue Jes.Sorensen
2016-11-18 21:44 ` Jes.Sorensen [this message]
2016-11-18 21:44 ` [PATCH 5/7] rtl8xxxu: Obtain RTS rates from mac80211 Jes.Sorensen
2016-11-18 21:44 ` [PATCH 6/7] rtl8xxxu: Pass tx_info to fill_txdesc in order to have access to retry count Jes.Sorensen
2016-11-18 21:44 ` [PATCH 7/7] rtl8xxxu: Fix non static symbol warning Jes.Sorensen
2016-11-19  1:46 ` [PATCH 0/7] rtl8xxxu: Pending patches Barry Day
2016-11-19  2:00   ` Jes Sorensen
2016-11-19  2:38     ` Barry Day
2016-11-19 23:53       ` Jes Sorensen
2016-11-20  2:42         ` Barry Day
2016-11-21 16:59           ` Jes Sorensen
2016-11-22 12:26             ` Barry Day
2016-11-29  0:08               ` Jes Sorensen

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=1479505468-29383-5-git-send-email-Jes.Sorensen@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=kvalo@codeaurora.org \
    --cc=linux-wireless@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).