linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
@ 2009-08-21  0:16 Herton Ronaldo Krzesinski
  2009-08-21  1:07 ` Larry Finger
  0 siblings, 1 reply; 5+ messages in thread
From: Herton Ronaldo Krzesinski @ 2009-08-21  0:16 UTC (permalink / raw)
  To: linux-wireless; +Cc: John W. Linville, Larry Finger, Hin-Tak Leung

RTL8187B always needs MSR_LINK_ENEDCA flag to be set even when it is in
no link mode, otherwise it'll not be able to associate when this flag is
not set after the change "mac80211: fix managed mode BSSID handling"
(commit 9cef8737).

By accident, setting BSSID of AP before association makes 8187B to
successfuly associate even when ENEDCA flag isn't set, which was the
case before the mac80211 change. But now the BSSID of AP we are trying
to associate is only available after association is successful, and
any attempt to associate without the needed flag doesn't work.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
---
 drivers/net/wireless/rtl818x/rtl8187_dev.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

This is a bug fix that should be sent too for 2.6.31-rcX

diff --git a/drivers/net/wireless/rtl818x/rtl8187_dev.c b/drivers/net/wireless/rtl818x/rtl8187_dev.c
index 90f3835..5830f6c 100644
--- a/drivers/net/wireless/rtl818x/rtl8187_dev.c
+++ b/drivers/net/wireless/rtl818x/rtl8187_dev.c
@@ -870,6 +870,9 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev)
 	priv->aifsn[3] = 3; /* AIFSN[AC_BE] */
 	rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0);
 
+	/* ENEDCA flag must always be set, transmit issues? */
+	rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_ENEDCA);
+
 	return 0;
 }
 
@@ -1174,13 +1177,16 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
 			rtl818x_iowrite8(priv, &priv->map->BSSID[i],
 					 info->bssid[i]);
 
+		if (priv->is_rtl8187b)
+			reg = RTL818X_MSR_ENEDCA;
+		else
+			reg = 0;
+
 		if (is_valid_ether_addr(info->bssid)) {
-			reg = RTL818X_MSR_INFRA;
-			if (priv->is_rtl8187b)
-				reg |= RTL818X_MSR_ENEDCA;
+			reg |= RTL818X_MSR_INFRA;
 			rtl818x_iowrite8(priv, &priv->map->MSR, reg);
 		} else {
-			reg = RTL818X_MSR_NO_LINK;
+			reg |= RTL818X_MSR_NO_LINK;
 			rtl818x_iowrite8(priv, &priv->map->MSR, reg);
 		}
 
-- 
1.6.4


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

* Re: [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
  2009-08-21  0:16 [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B Herton Ronaldo Krzesinski
@ 2009-08-21  1:07 ` Larry Finger
  2009-08-21  3:54   ` Hin-Tak Leung
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2009-08-21  1:07 UTC (permalink / raw)
  To: Herton Ronaldo Krzesinski
  Cc: linux-wireless, John W. Linville, Hin-Tak Leung, Rafael J. Wysocki

Herton Ronaldo Krzesinski wrote:
> RTL8187B always needs MSR_LINK_ENEDCA flag to be set even when it is in
> no link mode, otherwise it'll not be able to associate when this flag is
> not set after the change "mac80211: fix managed mode BSSID handling"
> (commit 9cef8737).
> 
> By accident, setting BSSID of AP before association makes 8187B to
> successfuly associate even when ENEDCA flag isn't set, which was the
> case before the mac80211 change. But now the BSSID of AP we are trying
> to associate is only available after association is successful, and
> any attempt to associate without the needed flag doesn't work.
> 
> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
> ---

Tested-by: Larry Finger <Larry.Finger@lwfinger.net>

I had just finished bisecting the problem reported in Bug #13960 when
this patch from Herton appeared in my mailbox, and it fixed the problem.

Larry

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

* Re: [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
  2009-08-21  1:07 ` Larry Finger
@ 2009-08-21  3:54   ` Hin-Tak Leung
  2009-08-21 12:29     ` Larry Finger
  0 siblings, 1 reply; 5+ messages in thread
From: Hin-Tak Leung @ 2009-08-21  3:54 UTC (permalink / raw)
  To: Larry Finger
  Cc: Herton Ronaldo Krzesinski, linux-wireless, John W. Linville,
	Hin-Tak Leung, Rafael J. Wysocki

On Fri, Aug 21, 2009 at 2:07 AM, Larry Finger<Larry.Finger@lwfinger.net> wrote:
> Herton Ronaldo Krzesinski wrote:
>> RTL8187B always needs MSR_LINK_ENEDCA flag to be set even when it is in
>> no link mode, otherwise it'll not be able to associate when this flag is
>> not set after the change "mac80211: fix managed mode BSSID handling"
>> (commit 9cef8737).
>>
>> By accident, setting BSSID of AP before association makes 8187B to
>> successfuly associate even when ENEDCA flag isn't set, which was the
>> case before the mac80211 change. But now the BSSID of AP we are trying
>> to associate is only available after association is successful, and
>> any attempt to associate without the needed flag doesn't work.
>>
>> Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
>> ---
>
> Tested-by: Larry Finger <Larry.Finger@lwfinger.net>

Acked-by: Hin-Tak Leung <htl10@users.sourceforge.net>

>
> I had just finished bisecting the problem reported in Bug #13960 when
> this patch from Herton appeared in my mailbox, and it fixed the problem.
>
> Larry
> --
> To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

This seems to be related to a problem I reported a while back - see
the "compat-wireless won't associate on 2nd load" thread, I wrote on
May 31. Supposedly I had that problem about a week before that, the
date on the patch from Johannes is May 14, but I just went back to
look at the mailing list archive and it looks like there were some
problem with applying and John did some fix on 20th. So it seems that
it might be the source of my not being able to load compat-wireless a
2nd time; and the description of the problem sounds like it too.

Sorry I haven't been doing much with compat-wireless lately, so I have
no firm data whether I have the same problem or not since May - that
problem only happens if I switch from one compat-wireless to another
compat-wireless, without rebooting - while I have tried
compat-wireless in the last two months, I don't think I have followed
compat-wireless as closely as I should to have two successive
compat-wireless. I probably should go and have a try now.

Thanks for hunting this down!

Hin-Tak

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

* Re: [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
  2009-08-21  3:54   ` Hin-Tak Leung
@ 2009-08-21 12:29     ` Larry Finger
  2009-08-22 22:06       ` Hin-Tak Leung
  0 siblings, 1 reply; 5+ messages in thread
From: Larry Finger @ 2009-08-21 12:29 UTC (permalink / raw)
  To: Hin-Tak Leung
  Cc: Herton Ronaldo Krzesinski, linux-wireless, John W. Linville,
	Hin-Tak Leung, Rafael J. Wysocki

Hin-Tak Leung wrote:
> 
> This seems to be related to a problem I reported a while back - see
> the "compat-wireless won't associate on 2nd load" thread, I wrote on
> May 31. Supposedly I had that problem about a week before that, the
> date on the patch from Johannes is May 14, but I just went back to
> look at the mailing list archive and it looks like there were some
> problem with applying and John did some fix on 20th. So it seems that
> it might be the source of my not being able to load compat-wireless a
> 2nd time; and the description of the problem sounds like it too.
> 
> Sorry I haven't been doing much with compat-wireless lately, so I have
> no firm data whether I have the same problem or not since May - that
> problem only happens if I switch from one compat-wireless to another
> compat-wireless, without rebooting - while I have tried
> compat-wireless in the last two months, I don't think I have followed
> compat-wireless as closely as I should to have two successive
> compat-wireless. I probably should go and have a try now.

This problem was quite strange. My system would fail when the RTL8187B
was inserted when the system booted. Unloading the driver did not
help, but removing/reinstalling the card fixed the problem. As all my
testing had been to install the card after booting, I never saw the
failure.


Larry



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

* Re: [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
  2009-08-21 12:29     ` Larry Finger
@ 2009-08-22 22:06       ` Hin-Tak Leung
  0 siblings, 0 replies; 5+ messages in thread
From: Hin-Tak Leung @ 2009-08-22 22:06 UTC (permalink / raw)
  To: Larry Finger
  Cc: Herton Ronaldo Krzesinski, linux-wireless, John W. Linville,
	Hin-Tak Leung, Rafael J. Wysocki

On Fri, Aug 21, 2009 at 1:29 PM, Larry Finger<Larry.Finger@lwfinger.net> wrote:
> Hin-Tak Leung wrote:
>>

> This problem was quite strange. My system would fail when the RTL8187B
> was inserted when the system booted. Unloading the driver did not
> help, but removing/reinstalling the card fixed the problem. As all my
> testing had been to install the card after booting, I never saw the
> failure.

Removing/reinstalling the card also reset the usb hub driver, I think,
and does more than unloading the driver. I don't have that ability
(rtl8187 built-in), but suspend/resume on my system also works around
the 'can't load 2nd time' problem.

Anyway, the 'can't load compat-wireless 2nd time' problem seems to
have gone away - I just loaded it a 2nd time testing the rkfill patch.

Hin-Tak

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

end of thread, other threads:[~2009-08-22 22:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-21  0:16 [PATCH] rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B Herton Ronaldo Krzesinski
2009-08-21  1:07 ` Larry Finger
2009-08-21  3:54   ` Hin-Tak Leung
2009-08-21 12:29     ` Larry Finger
2009-08-22 22:06       ` Hin-Tak Leung

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).