NetBSD Problem Report #37249
From martin@duskware.de Tue Oct 30 08:59:38 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
by narn.NetBSD.org (Postfix) with ESMTP id 78A5463B935
for <gnats-bugs@gnats.netbsd.org>; Tue, 30 Oct 2007 08:59:38 +0000 (UTC)
Message-Id: <20071030054000.03B2D63B935@narn.NetBSD.org>
Date: Tue, 30 Oct 2007 05:40:00 +0000 (UTC)
From: djb_netbsd@charter.net
Reply-To: djb_netbsd@charter.net
To: netbsd-bugs-owner@NetBSD.org
Subject: Prism HOSTAP will not do WEP on mini-PCI card (ISL3874)
X-Send-Pr-Version: www-1.0
>Number: 37249
>Category: kern
>Synopsis: Prism HOSTAP will not do WEP on mini-PCI card (ISL3874)
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: kern-bug-people
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Tue Oct 30 09:00:00 +0000 2007
>Last-Modified: Mon Dec 10 03:35:01 +0000 2007
>Originator: Dave J. Barnes
>Release: NetBSD 4.0_RC3
>Organization:
>Environment:
Broken on both Qube 2(mips) and i386.
>Description:
Mini-PCI PRISM 2.5 based card works OK everywhere except when in HOSTAP mode and you set a WEP key. The stations still associate but no mac activity is observed.
I didn't see any obvious differences between the ISL3873 PCMCIA MAC and the ISL3874 PCI MAC.
>How-To-Repeat:
Try to set up a mini-PCI Prism 2.5 card in HOSTAP mode with a WEP key.
>Fix:
?
>Audit-Trail:
From: "Dave J. Barnes" <djb_netbsd@charter.net>
To: gnats-bugs@NetBSD.org
Cc:
Subject: Re: kern/37249: Prism HOSTAP will not do WEP on mini-PCI card (ISL3874)
Date: Sun, 09 Dec 2007 21:05:01 -0600
Actually HOSTAP + WEP is broken regardless of interface.
From sys/dev/ic/wi.c
/*
* In HOSTAP mode, restore IEEE80211_F_DROPUNENC when operating
* with WEP enabled so that the AP drops unencoded frames at the
* 802.11 layer.
*
... But that causes the IEEE80211 layer to drop all received packets in
HOSTAP + WEP mode! Is that correct?
The WEP bit is stripped earlier so the IEEE80211 layer has no way to
know that we are in HOSTAP + WEP mode
and we just told the 80211 layer to drop unencoded packets.
Here's the patch I've been using to get HOSTAP + WEP packets:
===============================
--- dev/ic/wi.c.orig 2007-11-01 22:38:26.000000000 -0500
+++ dev/ic/wi.c 2007-11-01 23:40:23.000000000 -0500
@@ -3064,6 +3070,10 @@
* In HOSTAP mode, restore IEEE80211_F_DROPUNENC when operating
* with WEP enabled so that the AP drops unencoded frames at the
* 802.11 layer.
+ * NO! We tell the hardware to decrypt the packet and clear the WEP
+ * flag above. We also tell the hardware to EXCLUDE_UNENCRYPTED.
+ * Therefore we must also clear IEEE80211_F_DROPUNENC
+ * for HOSTAP otherwise the ieee80211 layer will drop good packets.
*
* In all other modes, clear IEEE80211_F_DROPUNENC when operating
* with WEP enabled so we don't drop unencoded frames at the 802.11
@@ -3078,8 +3088,7 @@
struct ieee80211com *ic = &sc->sc_ic;
if (nstate == IEEE80211_S_RUN &&
- (ic->ic_flags & IEEE80211_F_PRIVACY) != 0 &&
- ic->ic_opmode != IEEE80211_M_HOSTAP)
+ (ic->ic_flags & IEEE80211_F_PRIVACY) != 0 )
ic->ic_flags &= ~IEEE80211_F_DROPUNENC;
else
ic->ic_flags |= sc->sc_ic_flags;
==================================
I have no idea what is the correct way to use the DROPUNENC flag with
the 80211 layer.
++++++++
Also, there is some problem with transmitting packets while in HOSTAP +
WEP mode. It looks like the packets
are encrypted twice. The encryption firmware was fixed with versions
later than 1.49, so I've been using the
following patch to get transmitting working (should test for versions
newer than 1.49):
==================================
--- dev/ic/wi.c.orig 2007-11-01 22:38:26.000000000 -0500
+++ dev/ic/wi.c 2007-11-01 23:40:23.000000000 -0500
@@ -1202,6 +1202,7 @@
#ifndef IEEE80211_NO_HOSTAP
if (ic->ic_opmode == IEEE80211_M_HOSTAP)
frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_ALTRTRY);
+/*
if (ic->ic_opmode == IEEE80211_M_HOSTAP &&
(wh->i_fc[1] & IEEE80211_FC1_WEP)) {
if (ieee80211_crypto_encap(ic, ni, m0) == NULL) {
@@ -1209,8 +1210,11 @@
ifp->if_oerrors++;
goto next;
}
+
frmhdr.wi_tx_ctl |= htole16(WI_TXCNTL_NOCRYPT);
+
}
+*/
#endif /* !IEEE80211_NO_HOSTAP */
rateidx = wi_choose_rate(ic, ni, wh, m0->m_pkthdr.len);
@@ -2630,9 +2634,11 @@
/*
* Encryption firmware has a bug for HostAP mode.
*/
+
if (sc->sc_firmware_type == WI_INTERSIL &&
ic->ic_opmode == IEEE80211_M_HOSTAP)
- val |= HOST_ENCRYPT;
+ val |= IV_EVERY_FRAME;
+
#endif /* !IEEE80211_NO_HOSTAP */
} else {
wi_write_val(sc, WI_RID_CNFAUTHMODE,
=====================================
(Contact us)
$NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007
The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.