linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* rtl8192cu beacon fix unreliable
@ 2015-02-13 10:48 Mike Turner
  2015-02-18 21:27 ` Larry Finger
  0 siblings, 1 reply; 4+ messages in thread
From: Mike Turner @ 2015-02-13 10:48 UTC (permalink / raw)
  To: linux-wireless

When using hostapd and an rtl8192cu Wireless USB adaptor the beacon 
doesn't start sometimes. This was tested with the 

kernel/git/davem/net-next.git repository

and

3423eb92315865d76cb8d488513bfef6ab9251d0

This behaviour is apparently random. If the beacon starts OK then it 
continues. If a beacon isn't generated then it never starts. Repeating 
cycles of hostapd stop/start may or may not generate a beacon. There are 
no specific error messages displayed either on console or in syslog. I 
have repeated hostapd stop/start a number of consecutive times and 
received a beacon each time, however I have also done this a number of 
times and never generated a beacon.

We have succesfully used the pvaret-rtl8192cu driver which is based on the 
vendor driver and used that in conjunction with the modified hostapd code 
that requires use of the rtl871xdrv driver interface and as far as we have 
seen it always generates a beacon. 

Platform is a custom designed Atmel-ARM CPU (AT91SAM9G25) with a D-Link 
DWA-121.


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

* Re: rtl8192cu beacon fix unreliable
  2015-02-13 10:48 rtl8192cu beacon fix unreliable Mike Turner
@ 2015-02-18 21:27 ` Larry Finger
       [not found]   ` <CALA4C6XecJ+zGGfWkO51red7S-2mNoVC6vkD0ama1AGat2QOHg@mail.gmail.com>
  2015-02-20 11:44   ` Mike Turner
  0 siblings, 2 replies; 4+ messages in thread
From: Larry Finger @ 2015-02-18 21:27 UTC (permalink / raw)
  To: Mike Turner, linux-wireless

On 02/13/2015 04:48 AM, Mike Turner wrote:
> When using hostapd and an rtl8192cu Wireless USB adaptor the beacon
> doesn't start sometimes. This was tested with the
>
> kernel/git/davem/net-next.git repository
>
> and
>
> 3423eb92315865d76cb8d488513bfef6ab9251d0
>
> This behaviour is apparently random. If the beacon starts OK then it
> continues. If a beacon isn't generated then it never starts. Repeating
> cycles of hostapd stop/start may or may not generate a beacon. There are
> no specific error messages displayed either on console or in syslog. I
> have repeated hostapd stop/start a number of consecutive times and
> received a beacon each time, however I have also done this a number of
> times and never generated a beacon.
>
> We have succesfully used the pvaret-rtl8192cu driver which is based on the
> vendor driver and used that in conjunction with the modified hostapd code
> that requires use of the rtl871xdrv driver interface and as far as we have
> seen it always generates a beacon.
>
> Platform is a custom designed Atmel-ARM CPU (AT91SAM9G25) with a D-Link
> DWA-121.

Is send_beacon_frame() being called even when the beacon fails to start? Adding 
a pr_info() at the start of the routine should answer that question.

Larry



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

* Re: rtl8192cu beacon fix unreliable
       [not found]   ` <CALA4C6XecJ+zGGfWkO51red7S-2mNoVC6vkD0ama1AGat2QOHg@mail.gmail.com>
@ 2015-02-19 18:19     ` Larry Finger
  0 siblings, 0 replies; 4+ messages in thread
From: Larry Finger @ 2015-02-19 18:19 UTC (permalink / raw)
  To: Mike Turner; +Cc: linux-wireless

[-- Attachment #1: Type: text/plain, Size: 715 bytes --]

On 02/19/2015 11:37 AM, Mike Turner wrote:
> Sorry,
>
> I know personal replies aren't liked, however couldn't see how to send a reply
> to your reply to my original post. (if you can tell me how to do that then I
> will in future)
>
> Anyway, I had already checked the send_beacon_frame() call and it gets called
> whether or not the beacon starts.

If you use the web interface at Gmail, you can enable "reply all" in 
Settings=>Settings.

One other thing. Most mailing lists prefer bottom, not top, posting. That way 
you can read the thread in chronological order.

There must be some kind of race condition that sometimes makes the beacon start 
fail. Please try the attached patch to see if it helps.

Larry


[-- Attachment #2: rtl8192cu_beacon_start --]
[-- Type: text/plain, Size: 2474 bytes --]

Index: wireless-drivers/drivers/net/wireless/rtlwifi/core.c
===================================================================
--- wireless-drivers.orig/drivers/net/wireless/rtlwifi/core.c
+++ wireless-drivers/drivers/net/wireless/rtlwifi/core.c
@@ -1010,8 +1010,7 @@ static int rtl_op_conf_tx(struct ieee802
 	return 0;
 }
 
-static void send_beacon_frame(struct ieee80211_hw *hw,
-			      struct ieee80211_vif *vif)
+void rtl_send_beacon_frame(struct ieee80211_hw *hw, struct ieee80211_vif *vif)
 {
 	struct rtl_priv *rtlpriv = rtl_priv(hw);
 	struct sk_buff *skb = ieee80211_beacon_get(hw, vif);
@@ -1019,6 +1018,7 @@ static void send_beacon_frame(struct iee
 	if (skb)
 		rtlpriv->intf_ops->adapter_tx(hw, NULL, skb, NULL);
 }
+EXPORT_SYMBOL(rtl_send_beacon_frame);
 
 static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
 				    struct ieee80211_vif *vif,
@@ -1050,7 +1050,7 @@ static void rtl_op_bss_info_changed(stru
 
 				if (rtlpriv->cfg->ops->linked_set_reg)
 					rtlpriv->cfg->ops->linked_set_reg(hw);
-				send_beacon_frame(hw, vif);
+				rtl_send_beacon_frame(hw, vif);
 			}
 		}
 		if ((changed & BSS_CHANGED_BEACON_ENABLED &&
Index: wireless-drivers/drivers/net/wireless/rtlwifi/core.h
===================================================================
--- wireless-drivers.orig/drivers/net/wireless/rtlwifi/core.h
+++ wireless-drivers/drivers/net/wireless/rtlwifi/core.h
@@ -85,5 +85,6 @@ void rtl_bb_delay(struct ieee80211_hw *h
 bool rtl_cmd_send_packet(struct ieee80211_hw *hw, struct sk_buff *skb);
 bool rtl_btc_status_false(void);
 void rtl_dm_diginit(struct ieee80211_hw *hw, u32 cur_igval);
+void rtl_send_beacon_frame(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
 
 #endif
Index: wireless-drivers/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
===================================================================
--- wireless-drivers.orig/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
+++ wireless-drivers/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c
@@ -30,6 +30,7 @@
 #include "../wifi.h"
 #include "../efuse.h"
 #include "../base.h"
+#include "../core.h"
 #include "../cam.h"
 #include "../ps.h"
 #include "../usb.h"
@@ -1529,6 +1530,7 @@ void rtl92cu_set_beacon_interval(struct
 	RT_TRACE(rtlpriv, COMP_BEACON, DBG_DMESG, "beacon_interval:%d\n",
 		 bcn_interval);
 	rtl_write_word(rtlpriv, REG_BCN_INTERVAL, bcn_interval);
+	rtl_send_beacon_frame(hw, mac->vif);
 }
 
 void rtl92cu_update_interrupt_mask(struct ieee80211_hw *hw,

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

* Re: rtl8192cu beacon fix unreliable
  2015-02-18 21:27 ` Larry Finger
       [not found]   ` <CALA4C6XecJ+zGGfWkO51red7S-2mNoVC6vkD0ama1AGat2QOHg@mail.gmail.com>
@ 2015-02-20 11:44   ` Mike Turner
  1 sibling, 0 replies; 4+ messages in thread
From: Mike Turner @ 2015-02-20 11:44 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless

On Wed, Feb 18, 2015 at 9:27 PM, Larry Finger <Larry.Finger@lwfinger.net> wrote:
> On 02/13/2015 04:48 AM, Mike Turner wrote:
>>
>> When using hostapd and an rtl8192cu Wireless USB adaptor the beacon
>> doesn't start sometimes. This was tested with the
>>
>> kernel/git/davem/net-next.git repository
>>
>> and
>>
>> 3423eb92315865d76cb8d488513bfef6ab9251d0
>>
>> This behaviour is apparently random. If the beacon starts OK then it
>> continues. If a beacon isn't generated then it never starts. Repeating
>> cycles of hostapd stop/start may or may not generate a beacon. There are
>> no specific error messages displayed either on console or in syslog. I
>> have repeated hostapd stop/start a number of consecutive times and
>> received a beacon each time, however I have also done this a number of
>> times and never generated a beacon.
>>
>> We have succesfully used the pvaret-rtl8192cu driver which is based on the
>> vendor driver and used that in conjunction with the modified hostapd code
>> that requires use of the rtl871xdrv driver interface and as far as we have
>> seen it always generates a beacon.
>>
>> Platform is a custom designed Atmel-ARM CPU (AT91SAM9G25) with a D-Link
>> DWA-121.
>
>
> Is send_beacon_frame() being called even when the beacon fails to start?
> Adding a pr_info() at the start of the routine should answer that question.
>
> Larry
>
>

Just tried your patch, however it failed on the 3rd restart - this is
a resend as it bounced from linux-wireless previously due to content
type.

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

end of thread, other threads:[~2015-02-20 11:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-13 10:48 rtl8192cu beacon fix unreliable Mike Turner
2015-02-18 21:27 ` Larry Finger
     [not found]   ` <CALA4C6XecJ+zGGfWkO51red7S-2mNoVC6vkD0ama1AGat2QOHg@mail.gmail.com>
2015-02-19 18:19     ` Larry Finger
2015-02-20 11:44   ` Mike Turner

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