summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2006-12-17 16:24:01 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2006-12-17 16:24:01 +0000
commit6083f9277517b6ab275011110788a080c535a98e (patch)
tree6c98638b0aabb5edd2692a3b162e1c777b7588d5 /sys/dev
parentf37d64c3d21f9f09f39d98e43efa0a30b487fa96 (diff)
fix index of ERP information element in beacons.
still ugly, but correct.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/rt2560.c12
-rw-r--r--sys/dev/ic/rt2661.c12
2 files changed, 14 insertions, 10 deletions
diff --git a/sys/dev/ic/rt2560.c b/sys/dev/ic/rt2560.c
index 30fa917b646..c5d327643e0 100644
--- a/sys/dev/ic/rt2560.c
+++ b/sys/dev/ic/rt2560.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2560.c,v 1.28 2006/12/03 16:39:13 damien Exp $ */
+/* $OpenBSD: rt2560.c,v 1.29 2006/12/17 16:24:00 damien Exp $ */
/*-
* Copyright (c) 2005, 2006
@@ -1581,10 +1581,12 @@ rt2560_tx_bcn(struct rt2560_softc *sc, struct mbuf *m0,
sc->erp =
mtod(m0, uint8_t *) +
sizeof (struct ieee80211_frame) +
- 8 + 2 + 2 + 2 + ni->ni_esslen + 2 + 1 +
- ((ic->ic_opmode == IEEE80211_M_IBSS) ? 3 : 6) +
- 2 + ni->ni_rates.rs_nrates +
- ((ni->ni_rates.rs_nrates > IEEE80211_RATE_SIZE) ? 2 : 0) +
+ 8 + 2 + 2 +
+ ((ic->ic_flags & IEEE80211_F_HIDENWID) ?
+ 1 : 2 + ni->ni_esslen) +
+ 2 + min(ni->ni_rates.rs_nrates, IEEE80211_RATE_SIZE) +
+ 2 + 1 +
+ ((ic->ic_opmode == IEEE80211_M_IBSS) ? 4 : 6) +
2;
}
diff --git a/sys/dev/ic/rt2661.c b/sys/dev/ic/rt2661.c
index 49a571e2dba..ca383414cf8 100644
--- a/sys/dev/ic/rt2661.c
+++ b/sys/dev/ic/rt2661.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rt2661.c,v 1.33 2006/12/03 16:39:13 damien Exp $ */
+/* $OpenBSD: rt2661.c,v 1.34 2006/12/17 16:24:00 damien Exp $ */
/*-
* Copyright (c) 2006
@@ -2828,10 +2828,12 @@ rt2661_prepare_beacon(struct rt2661_softc *sc)
sc->erp_csr =
RT2661_HW_BEACON_BASE0 + 24 +
sizeof (struct ieee80211_frame) +
- 8 + 2 + 2 + 2 + ni->ni_esslen + 2 + 1 +
- ((ic->ic_opmode == IEEE80211_M_IBSS) ? 3 : 6) +
- 2 + ni->ni_rates.rs_nrates +
- ((ni->ni_rates.rs_nrates > IEEE80211_RATE_SIZE) ? 2 : 0) +
+ 8 + 2 + 2 +
+ ((ic->ic_flags & IEEE80211_F_HIDENWID) ?
+ 1 : 2 + ni->ni_esslen) +
+ 2 + min(ni->ni_rates.rs_nrates, IEEE80211_RATE_SIZE) +
+ 2 + 1 +
+ ((ic->ic_opmode == IEEE80211_M_IBSS) ? 4 : 6) +
2;
}