summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2005-05-14 13:32:39 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2005-05-14 13:32:39 +0000
commit56a383f940720375d72fc2cd0afafa44b214a2e8 (patch)
tree8778862ab24ed03f00ab8b60abda49775abe1db4 /sys
parent7771cb798e27cd14d43b2c92e21eb5a9b0f55469 (diff)
don't copy the capinfo field from the ap. forge our own based on what
ieee80211_output.c does.
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/pci/if_iwi.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/sys/dev/pci/if_iwi.c b/sys/dev/pci/if_iwi.c
index b29d1e53186..bab2af7109d 100644
--- a/sys/dev/pci/if_iwi.c
+++ b/sys/dev/pci/if_iwi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_iwi.c,v 1.38 2005/05/13 20:52:51 damien Exp $ */
+/* $OpenBSD: if_iwi.c,v 1.39 2005/05/14 13:32:38 damien Exp $ */
/*-
* Copyright (c) 2004, 2005
@@ -1792,6 +1792,7 @@ iwi_auth_and_assoc(struct iwi_softc *sc)
struct iwi_configuration config;
struct iwi_associate assoc;
struct iwi_rateset rs;
+ u_int16_t capinfo;
u_int32_t data;
int error;
@@ -1843,7 +1844,18 @@ iwi_auth_and_assoc(struct iwi_softc *sc)
if (sc->authmode == IEEE80211_AUTH_SHARED)
assoc.auth = (ic->ic_wep_txkey << 4) | IWI_AUTH_SHARED;
bcopy(ni->ni_tstamp, assoc.tstamp, 8);
- assoc.capinfo = htole16(ni->ni_capinfo);
+
+ if (ic->ic_opmode == IEEE80211_M_IBSS)
+ capinfo = IEEE80211_CAPINFO_IBSS;
+ else
+ capinfo = IEEE80211_CAPINFO_ESS;
+ if (ic->ic_flags & IEEE80211_F_WEPON)
+ capinfo |= IEEE80211_CAPINFO_PRIVACY;
+ if ((ic->ic_flags & IEEE80211_F_SHPREAMBLE) &&
+ IEEE80211_IS_CHAN_2GHZ(ni->ni_chan))
+ capinfo |= IEEE80211_CAPINFO_SHORT_PREAMBLE;
+ assoc.capinfo = htole16(capinfo);
+
assoc.lintval = htole16(ic->ic_lintval);
assoc.intval = htole16(ni->ni_intval);
IEEE80211_ADDR_COPY(assoc.bssid, ni->ni_bssid);