diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2004-03-02 21:55:08 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2004-03-02 21:55:08 +0000 |
commit | be183945808dc571ec451958926d2ba1981e6ab2 (patch) | |
tree | 84f613bac8b92b37f7168422d05656b7f897e0b6 | |
parent | ef107641f97c305c5344f49027a155fc7038b771 (diff) |
Make HostAP work Prism cards with newer firmware (1.7.0 and higher).
Accept probe packets that Lucent cards send when the associated AP
disapears; this speeds up reassocication with those cards. Don't
advertise HostAP as being available for firmware 1.4.2. I added a
note about this in the man pages a while ago but forgot to update
the driver itself. OK mickey@
-rw-r--r-- | sys/dev/ic/if_wi.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/if_wi_hostap.c | 17 | ||||
-rw-r--r-- | sys/dev/ic/if_wi_ieee.h | 11 |
3 files changed, 31 insertions, 14 deletions
diff --git a/sys/dev/ic/if_wi.c b/sys/dev/ic/if_wi.c index dd148354b5c..4716c2a8ffe 100644 --- a/sys/dev/ic/if_wi.c +++ b/sys/dev/ic/if_wi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi.c,v 1.103 2004/02/27 21:34:58 millert Exp $ */ +/* $OpenBSD: if_wi.c,v 1.104 2004/03/02 21:55:07 millert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -126,7 +126,7 @@ u_int32_t widebug = WIDEBUG; #if !defined(lint) && !defined(__OpenBSD__) static const char rcsid[] = - "$OpenBSD: if_wi.c,v 1.103 2004/02/27 21:34:58 millert Exp $"; + "$OpenBSD: if_wi.c,v 1.104 2004/03/02 21:55:07 millert Exp $"; #endif /* lint */ #ifdef foo @@ -291,7 +291,8 @@ wi_attach(struct wi_softc *sc, struct wi_funcs *funcs) sc->wi_flags |= WI_FLAGS_HAS_ROAMING; if (sc->sc_sta_firmware_ver >= 800) { #ifndef SMALL_KERNEL - sc->wi_flags |= WI_FLAGS_HAS_HOSTAP; + if (sc->sc_sta_firmware_ver != 10402) + sc->wi_flags |= WI_FLAGS_HAS_HOSTAP; #endif sc->wi_flags |= WI_FLAGS_HAS_IBSS; sc->wi_flags |= WI_FLAGS_HAS_CREATE_IBSS; @@ -518,7 +519,7 @@ wi_rxeof(sc) struct ether_header *eh; struct mbuf *m; caddr_t olddata; - u_int16_t msg_type; + u_int16_t ftype; int maxlen; int id; @@ -627,8 +628,8 @@ wi_rxeof(sc) return; } - /* Stash message type in host byte order for later use */ - msg_type = letoh16(rx_frame.wi_status) & WI_RXSTAT_MSG_TYPE; + /* Stash frame type in host byte order for later use */ + ftype = letoh16(rx_frame.wi_frame_ctl) & WI_FCTL_FTYPE; MGETHDR(m, M_DONTWAIT, MT_DATA); if (m == NULL) { @@ -651,7 +652,7 @@ wi_rxeof(sc) maxlen = MCLBYTES - (m->m_data - olddata); m->m_pkthdr.rcvif = ifp; - if (msg_type == WI_STAT_MGMT && + if (ftype == WI_FTYPE_MGMT && sc->wi_ptype == WI_PORTTYPE_HOSTAP) { u_int16_t rxlen = letoh16(rx_frame.wi_dat_len); @@ -689,7 +690,7 @@ wi_rxeof(sc) return; } - switch (msg_type) { + switch (letoh16(rx_frame.wi_status) & WI_RXSTAT_MSG_TYPE) { case WI_STAT_1042: case WI_STAT_TUNNEL: case WI_STAT_WMP_MSG: diff --git a/sys/dev/ic/if_wi_hostap.c b/sys/dev/ic/if_wi_hostap.c index adf0064eb22..20373622106 100644 --- a/sys/dev/ic/if_wi_hostap.c +++ b/sys/dev/ic/if_wi_hostap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_hostap.c,v 1.27 2003/09/21 11:22:24 fgsch Exp $ */ +/* $OpenBSD: if_wi_hostap.c,v 1.28 2004/03/02 21:55:07 millert Exp $ */ /* * Copyright (c) 2002 @@ -1108,12 +1108,19 @@ wihap_data_input(struct wi_softc *sc, struct wi_frame *rxfrm, struct mbuf *m) struct wihap_info *whi = &sc->wi_hostap_info; struct wihap_sta_info *sta; int mcast, s; + u_int16_t fctl; - /* TODS flag must be set. */ - if (!(rxfrm->wi_frame_ctl & htole16(WI_FCTL_TODS))) { + /* + * TODS flag must be set. However, Lucent cards set NULLFUNC but + * not TODS when probing an AP to see if it is alive after it has + * been down for a while. We accept these probe packets and send a + * disassoc packet later on if the station is not already associated. + */ + fctl = letoh16(rxfrm->wi_frame_ctl); + if (!(fctl & WI_FCTL_TODS) && !(fctl & WI_STYPE_NULLFUNC)) { if (ifp->if_flags & IFF_DEBUG) - printf("wihap_data_input: no TODS src=%s\n", - ether_sprintf(rxfrm->wi_addr2)); + printf("wihap_data_input: no TODS src=%s, fctl=0x%x\n", + ether_sprintf(rxfrm->wi_addr2), fctl); m_freem(m); return (1); } diff --git a/sys/dev/ic/if_wi_ieee.h b/sys/dev/ic/if_wi_ieee.h index 9a888d5b486..1fbb986c321 100644 --- a/sys/dev/ic/if_wi_ieee.h +++ b/sys/dev/ic/if_wi_ieee.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_wi_ieee.h,v 1.19 2003/10/26 15:34:15 drahn Exp $ */ +/* $OpenBSD: if_wi_ieee.h,v 1.20 2004/03/02 21:55:07 millert Exp $ */ /* * Copyright (c) 1997, 1998, 1999 @@ -131,6 +131,15 @@ struct wi_80211_hdr { #define WI_STYPE_CTL_CFEND 0x00E0 #define WI_STYPE_CTL_CFENDACK 0x00F0 +#define WI_STYPE_DATA 0x0000 +#define WI_STYPE_DATA_CFACK 0x0010 +#define WI_STYPE_DATA_CFPOLL 0x0020 +#define WI_STYPE_DATA_CFACKPOLL 0x0030 +#define WI_STYPE_NULLFUNC 0x0040 +#define WI_STYPE_CFACK 0x0050 +#define WI_STYPE_CFPOLL 0x0060 +#define WI_STYPE_CFACKPOLL 0x0070 + struct wi_mgmt_hdr { u_int16_t frame_ctl; u_int16_t duration; |