All of lore.kernel.org
 help / color / mirror / Atom feed
* [Question] Realtek USB 0bda:8176 as AP?
@ 2011-09-11  1:11 Steven A. Falco
  2011-09-11  3:51 ` Larry Finger
  0 siblings, 1 reply; 6+ messages in thread
From: Steven A. Falco @ 2011-09-11  1:11 UTC (permalink / raw)
  To: linux-wireless

I am attempting to use a Realtek USB dongle as an access point on
a PC running Fedora 15, with hostapd as the user-layer SW.

The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
device.

It works fine in station mode - I can connect to a WPA network.
It also works fine as an AP, but only with security disabled.
As soon as I enable WPA in the hostapd config file, I can no
longer connect.

I've logged both the hostapd and wpa_supplicant sides of the
conversation.  I'm using the same type of Realtek dongle for
both sides.

On the hostapd side, I see "sending 1/4 msg of 4-Way Handshake"

On the wpa_supplicant side, I see "RX message 1 of 4-Way Handshake"
followed by "Sending EAPOL-Key 2/4".

However, this message is not received by the hostapd side.  Instead
I see "WPA: EAPOL-Key timeout" and the association drops.

I went to the IRC group, and got the suggestion to sniff the
traffic from a third PC.  I've done that, and can make the trace
available if anyone wants to see it.  Basically, I can see the
EAPOL-Key 2/4 in Wireshark, but the packet as received on the AP
looks a bit garbled.

Here is what wireshark shows (and it decodes it as msg 2/4):

0000  00 00 1a 00 2f 48 00 00  84 c4 a2 82 00 00 00 00   ..../H.. ........
0010  10 6c 71 09 c0 00 d9 01  00 00 08 01 00 00 00 e0   .lq..... ........
0020  4c 05 d6 1f 00 e0 4c 05  de d6 00 e0 4c 05 d6 1f   L.....L. ....L...
0030  90 01 aa aa 03 00 00 00  88 8e 01 03 00 75 02 01   ........ .....u..
0040  0a 00 00 00 00 00 00 00  00 00 01 03 92 92 c7 23   ........ .......#
0050  6b 98 cb b3 05 a0 3a a3  28 4a 73 25 49 d7 2a bb   k.....:. (Js%I.*.
0060  b1 e5 0c d0 7c 4a d9 b7  af 21 bc 00 00 00 00 00   ....|J.. .!......
0070  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00   ........ ........
0080  00 00 00 00 00 00 00 00  00 00 00 03 35 84 ee 8c   ........ ....5...
0090  17 d3 83 13 e0 40 80 ca  96 c3 6e 00 16 30 14 01   .....@.. ..n..0..
00a0  00 00 0f ac 02 01 00 00  0f ac 04 01 00 00 0f ac   ........ ........
00b0  02 00 00 95 52 78 36                               ....Rx6          

and here is what hostapd sees (but it prints EAPOL-Key timeout):

00000000: 00 00 0d 00 04 80 02 00 6c 00 00 00 00 08 02 34 
00000010: 00 00 e0 4c 05 de d6 00 e0 4c 05 d6 1f 00 e0 4c 
00000020: 05 d6 1f e0 05 aa aa 03 00 00 00 88 8e 02 03 00 
00000030: 5f 02 00 8a 00 10 00 00 00 00 00 00 00 01 3f 42 
00000040: f6 a8 72 f2 68 22 e8 f4 4f 3f 44 21 7a 82 01 34 
00000050: fb 99 dd f0 60 dc f3 28 81 7e d4 ca 6f 35 00 00 
00000060: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

A lot of the data match up, but a lot don't.  I believe I have
synchronized the wireshark and hostapd logs, because the messages
before and after this one do match.  Also, wireshark shows four
attempts at EAPOL-Key 2/4, and hostapd shows four of these
strange frames.

Has anyone been successful with these chips in AP mode with security?

Any suggestions on things to try?  It was suggested to turn off HW
crypto, but that doesn't appear to be possible in the rtl8192cu driver,
although other rtl8192 devices do support it.

Or should I use a different chipset altogether?  Realtek Semi appears
to have helped the community, so I don't want to abandon them, but I
also need this to work. :-)

	Steve

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

* Re: [Question] Realtek USB 0bda:8176 as AP?
  2011-09-11  1:11 [Question] Realtek USB 0bda:8176 as AP? Steven A. Falco
@ 2011-09-11  3:51 ` Larry Finger
  2011-09-11 15:53   ` Steven A. Falco
  0 siblings, 1 reply; 6+ messages in thread
From: Larry Finger @ 2011-09-11  3:51 UTC (permalink / raw)
  To: Steven A. Falco; +Cc: linux-wireless

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

On 09/10/2011 08:11 PM, Steven A. Falco wrote:
> I am attempting to use a Realtek USB dongle as an access point on
> a PC running Fedora 15, with hostapd as the user-layer SW.
>
> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
> device.

What kernel are you running? The latest is in wireless-testing, but that will be 
difficult to clone as long as kernel.org is out of commission. In addition, 
there are two patches that were sent on 9/3, but have not yet been incorporated 
due to the k.o problems. They are attached.

I just got a Powermac G4 and I'm fixing the big-endian issues, but that is 
clearly not your problem.

Larry


[-- Attachment #2: 0001-rtlwifi-rtl8192cu-Fix-problem-connecting-to-HT-enabl.patch --]
[-- Type: text/x-patch, Size: 1705 bytes --]

>From b29f825b3c7a495ecf415d2810cae9d2f110f05f Mon Sep 17 00:00:00 2001
From: George <george0505@realtek.com>
Date: Sat, 3 Sep 2011 10:44:32 -0500
Subject: [PATCH 1/2] rtlwifi: rtl8192cu: Fix problem connecting to HT-enabled AP
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,chaoming_li@realsil.com.cn


The driver fails to connect to 802.11n-enabled APs. The patch fixes
Bug #42262.

Signed-off-by: George <george0505@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@kernel.org>        [2.6.39+]
---
 drivers/net/wireless/rtlwifi/rtl8192cu/trx.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
index a8e87ad..f875fed 100644
--- a/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
+++ b/drivers/net/wireless/rtlwifi/rtl8192cu/trx.c
@@ -546,15 +546,16 @@ void rtl92cu_tx_fill_desc(struct ieee80211_hw *hw,
 			       (tcb_desc->rts_use_shortpreamble ? 1 : 0)
 			       : (tcb_desc->rts_use_shortgi ? 1 : 0)));
 	if (mac->bw_40) {
-		if (tcb_desc->packet_bw) {
+		if (rate_flag & IEEE80211_TX_RC_DUP_DATA) {
 			SET_TX_DESC_DATA_BW(txdesc, 1);
 			SET_TX_DESC_DATA_SC(txdesc, 3);
+		} else if(rate_flag & IEEE80211_TX_RC_40_MHZ_WIDTH){
+			SET_TX_DESC_DATA_BW(txdesc, 1);
+			SET_TX_DESC_DATA_SC(txdesc, mac->cur_40_prime_sc);
 		} else {
 			SET_TX_DESC_DATA_BW(txdesc, 0);
-				if (rate_flag & IEEE80211_TX_RC_DUP_DATA)
-					SET_TX_DESC_DATA_SC(txdesc,
-							  mac->cur_40_prime_sc);
-			}
+			SET_TX_DESC_DATA_SC(txdesc, 0);
+		}
 	} else {
 		SET_TX_DESC_DATA_BW(txdesc, 0);
 		SET_TX_DESC_DATA_SC(txdesc, 0);
-- 
1.7.6.1


[-- Attachment #3: 0002-rtlwifi-Fix-problem-when-switching-connections.patch --]
[-- Type: text/x-patch, Size: 1477 bytes --]

>From 811462b15d9e9a23ee6d113ec652c57628230a7b Mon Sep 17 00:00:00 2001
From: George <george0505@realtek.com>
Date: Sat, 3 Sep 2011 10:47:14 -0500
Subject: [PATCH 2/2] rtlwifi: Fix problem when switching connections
To: linville@tuxdriver.com
Cc: linux-wireless@vger.kernel.org,chaoming_li@realsil.com.cn

The driver fails to clear encryption keys making it impossible
to switch connections.

Signed-off-by: George <george0505@realtek.com>
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Stable <stable@kernel.org>        [2.6.39+]
---
 drivers/net/wireless/rtlwifi/core.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/net/wireless/rtlwifi/core.c b/drivers/net/wireless/rtlwifi/core.c
index 1bdc1aa..04c4e9e 100644
--- a/drivers/net/wireless/rtlwifi/core.c
+++ b/drivers/net/wireless/rtlwifi/core.c
@@ -610,6 +610,11 @@ static void rtl_op_bss_info_changed(struct ieee80211_hw *hw,
 
 			mac->link_state = MAC80211_NOLINK;
 			memset(mac->bssid, 0, 6);
+
+			/* reset sec info */
+			rtl_cam_reset_sec_info(hw);
+
+			rtl_cam_reset_all_entry(hw);
 			mac->vendor = PEER_UNKNOWN;
 
 			RT_TRACE(rtlpriv, COMP_MAC80211, DBG_DMESG,
@@ -1063,6 +1068,9 @@ static int rtl_op_set_key(struct ieee80211_hw *hw, enum set_key_cmd cmd,
 		 *or clear all entry here.
 		 */
 		rtl_cam_delete_one_entry(hw, mac_addr, key_idx);
+
+		rtl_cam_reset_sec_info(hw);
+
 		break;
 	default:
 		RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
-- 
1.7.6.1


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

* Re: [Question] Realtek USB 0bda:8176 as AP?
  2011-09-11  3:51 ` Larry Finger
@ 2011-09-11 15:53   ` Steven A. Falco
  2011-09-11 21:18     ` Steven A. Falco
  0 siblings, 1 reply; 6+ messages in thread
From: Steven A. Falco @ 2011-09-11 15:53 UTC (permalink / raw)
  To: Larry Finger; +Cc: Steven A. Falco, linux-wireless

On 09/10/2011 11:51 PM, Larry Finger wrote:
> On 09/10/2011 08:11 PM, Steven A. Falco wrote:
>> I am attempting to use a Realtek USB dongle as an access point on
>> a PC running Fedora 15, with hostapd as the user-layer SW.
>>
>> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
>> device.
> 
> What kernel are you running? The latest is in wireless-testing, but that will be difficult to clone as long as kernel.org is out of commission. In addition, there are two patches that were sent on 9/3, but have not yet been incorporated due to the k.o problems. They are attached.
> 

I'm using kernel-3.1.0-0.rc3.git0.0.fc16.src.rpm from Fedora 16.
I'll apply the patches you provided and test a bit later today.

	Steve

> I just got a Powermac G4 and I'm fixing the big-endian issues, but that is clearly not your problem.
> 
> Larry
> 


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

* Re: [Question] Realtek USB 0bda:8176 as AP?
  2011-09-11 15:53   ` Steven A. Falco
@ 2011-09-11 21:18     ` Steven A. Falco
  0 siblings, 0 replies; 6+ messages in thread
From: Steven A. Falco @ 2011-09-11 21:18 UTC (permalink / raw)
  To: Larry Finger; +Cc: linux-wireless

On 09/11/2011 11:53 AM, Steven A. Falco wrote:
> On 09/10/2011 11:51 PM, Larry Finger wrote:
>> On 09/10/2011 08:11 PM, Steven A. Falco wrote:
>>> I am attempting to use a Realtek USB dongle as an access point on
>>> a PC running Fedora 15, with hostapd as the user-layer SW.
>>>
>>> The USB ID is 0bda:8176, which makes this an rtlwifi:rtl8192cu
>>> device.
>>
>> What kernel are you running? The latest is in wireless-testing, but that will be difficult to clone as long as kernel.org is out of commission. In addition, there are two patches that were sent on 9/3, but have not yet been incorporated due to the k.o problems. They are attached.
>>
> 
> I'm using kernel-3.1.0-0.rc3.git0.0.fc16.src.rpm from Fedora 16.
> I'll apply the patches you provided and test a bit later today.

I tried the patches.  They do not make a difference.  Actually,
that is not surprising, because the first patch relates to 802.11n
but I am using 802.11g, and the second patch has to do with switching
networks, but I am coming up cold on this network.

I should receive some USB dongles with different chipsets tomorrow.
Hopefully one of them will be better behaved.  But if there is more
data I can gather to help figure this out, I am happy to do so.

	Steve

>> I just got a Powermac G4 and I'm fixing the big-endian issues, but that is clearly not your 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
> 


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

* Re: [Question] Realtek USB 0bda:8176 as AP?
  2012-01-01 13:00 John Williams
@ 2012-01-03 19:49 ` Larry Finger
  0 siblings, 0 replies; 6+ messages in thread
From: Larry Finger @ 2012-01-03 19:49 UTC (permalink / raw)
  To: John Williams; +Cc: linux-wireless

On 01/01/2012 07:00 AM, John Williams wrote:
> Hello list,
>
> I see there was a discussion on this list about three months ago about
> using an RTL8192CU (usb 0bda:8176) in access point mode. I've just
> bought one and I've got the same problem: hostapd just prints this in a
> loop until it gives up:
>
> WPA: 00:24:23:0c:9c:2f WPA_PTK entering state PTKSTART
> wlan0: STA 00:24:23:0c:9c:2f WPA: sending 1/4 msg of 4-Way Handshake
> WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8
>    kde_len=0 keyidx=0 encr=0)
> IEEE 802.1X: 00:24:23:0c:9c:2f TX status -version=2 type=3
>    length=95 - ack=1
> wlan0: STA 00:24:23:0c:9c:2f
> WPA: EAPOL-Key timeout
>
> This is with the driver from compat_wireless as of 2011-12-29.
>
> It works fine with the driver downloaded from the realtek website
> (provided that I also use their patched version of hostapd), so it's
> not a hardware problem.
>
> If anyone could point me to the area in the driver where it is supposed
> to receive the missing message, I would be happy to have a go at
> debugging it.

I do not know what the problem with using the kernel versions of 
rtl8192{ce,cu,se,de} as an AP. I have been going through the differences between 
the version available on the Realtek web site and the kernel sources. Sorting 
out the differences is mind numbing, and will take a while to complete.

Patches will be posted on the wireless ML when I get a fix.

Larry


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

* Re: [Question] Realtek USB 0bda:8176 as AP?
@ 2012-01-01 13:00 John Williams
  2012-01-03 19:49 ` Larry Finger
  0 siblings, 1 reply; 6+ messages in thread
From: John Williams @ 2012-01-01 13:00 UTC (permalink / raw)
  To: linux-wireless

Hello list,

I see there was a discussion on this list about three months ago about
using an RTL8192CU (usb 0bda:8176) in access point mode. I've just
bought one and I've got the same problem: hostapd just prints this in a
loop until it gives up:

WPA: 00:24:23:0c:9c:2f WPA_PTK entering state PTKSTART
wlan0: STA 00:24:23:0c:9c:2f WPA: sending 1/4 msg of 4-Way Handshake
WPA: Send EAPOL(version=2 secure=0 mic=0 ack=1 install=0 pairwise=8
  kde_len=0 keyidx=0 encr=0) 
IEEE 802.1X: 00:24:23:0c:9c:2f TX status -version=2 type=3 
  length=95 - ack=1 
wlan0: STA 00:24:23:0c:9c:2f
WPA: EAPOL-Key timeout

This is with the driver from compat_wireless as of 2011-12-29.

It works fine with the driver downloaded from the realtek website
(provided that I also use their patched version of hostapd), so it's
not a hardware problem.

If anyone could point me to the area in the driver where it is supposed
to receive the missing message, I would be happy to have a go at
debugging it.

Regards,
John Williams

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

end of thread, other threads:[~2012-01-03 19:49 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-11  1:11 [Question] Realtek USB 0bda:8176 as AP? Steven A. Falco
2011-09-11  3:51 ` Larry Finger
2011-09-11 15:53   ` Steven A. Falco
2011-09-11 21:18     ` Steven A. Falco
2012-01-01 13:00 John Williams
2012-01-03 19:49 ` Larry Finger

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.