summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDamien Bergamini <damien@cvs.openbsd.org>2008-09-01 19:55:22 +0000
committerDamien Bergamini <damien@cvs.openbsd.org>2008-09-01 19:55:22 +0000
commitaff5f1e46fc7d647102fe4892378e6afb416d8c4 (patch)
treef46e7def44c6ca723ca3d01a19eab35a1596e900 /sys
parentd788ec32518c5bf5f153a579719bd38a357d1318 (diff)
add ic_tid_noack bitmap to indicate a per-TID ACK policy (1=no ack,
0=normal ack). all bits are currently set to 0. use this bitmap to set the ACK policy of the QoS control field of outgoing QoS frames.
Diffstat (limited to 'sys')
-rw-r--r--sys/net80211/ieee80211.h9
-rw-r--r--sys/net80211/ieee80211_output.c16
-rw-r--r--sys/net80211/ieee80211_var.h3
3 files changed, 19 insertions, 9 deletions
diff --git a/sys/net80211/ieee80211.h b/sys/net80211/ieee80211.h
index 75905996bfe..dce9b327d2c 100644
--- a/sys/net80211/ieee80211.h
+++ b/sys/net80211/ieee80211.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211.h,v 1.45 2008/08/27 10:58:01 damien Exp $ */
+/* $OpenBSD: ieee80211.h,v 1.46 2008/09/01 19:55:21 damien Exp $ */
/* $NetBSD: ieee80211.h,v 1.6 2004/04/30 23:51:53 dyoung Exp $ */
/*-
@@ -179,7 +179,12 @@ struct ieee80211_htframe_addr4 { /* 11n */
*/
#define IEEE80211_QOS_TXOP 0xff00
#define IEEE80211_QOS_AMSDU 0x0080 /* 11n */
-#define IEEE80211_QOS_ACKPOLICY 0x0060
+#define IEEE80211_QOS_ACK_POLICY_NORMAL 0
+#define IEEE80211_QOS_ACK_POLICY_NOACK 1
+#define IEEE80211_QOS_ACK_POLICY_NOEXPLACK 2
+#define IEEE80211_QOS_ACK_POLICY_BA 3
+#define IEEE80211_QOS_ACK_POLICY_MASK 0x0060
+#define IEEE80211_QOS_ACK_POLICY_SHIFT 5
#define IEEE80211_QOS_EOSP 0x0010
#define IEEE80211_QOS_TID 0x000f
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 514a024275e..4ac87deb5a2 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.75 2008/09/01 19:43:33 damien Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.76 2008/09/01 19:55:21 damien Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -347,7 +347,7 @@ static const struct ieee80211_edca_ac_params
enum ieee80211_edca_ac
ieee80211_up_to_ac(struct ieee80211com *ic, int up)
{
- /* IEEE Std 802.11e-2005, table 20i */
+ /* see Table 9-1 */
static const enum ieee80211_edca_ac up_to_ac[] = {
EDCA_AC_BE, /* BE */
EDCA_AC_BK, /* BK */
@@ -368,7 +368,7 @@ ieee80211_up_to_ac(struct ieee80211com *ic, int up)
#endif
/*
* We do not support the admission control procedure defined in
- * IEEE Std 802.11e-2005 section 9.9.3.1.2. The spec says that
+ * IEEE Std 802.11-2007 section 9.9.3.1.2. The spec says that
* non-AP QSTAs that don't support this procedure shall use EDCA
* parameters of a lower priority AC that does not require
* admission control.
@@ -590,8 +590,12 @@ ieee80211_encap(struct ifnet *ifp, struct mbuf *m, struct ieee80211_node **pni)
struct ieee80211_qosframe *qwh =
(struct ieee80211_qosframe *)wh;
qwh->i_fc[0] |= IEEE80211_FC0_SUBTYPE_QOS;
- qwh->i_qos[0] = tid & 0xf;
- qwh->i_qos[1] = 0; /* no TXOP requested */
+ qwh->i_qos[0] = tid;
+ if (ic->ic_tid_noack & (1 << tid)) {
+ qwh->i_qos[0] |= IEEE80211_QOS_ACK_POLICY_NOACK <<
+ IEEE80211_QOS_ACK_POLICY_SHIFT;
+ }
+ qwh->i_qos[1] = 0; /* unused/set by hardware */
*(u_int16_t *)&qwh->i_seq[0] =
htole16(ni->ni_qos_txseqs[tid] << IEEE80211_SEQ_SEQ_SHIFT);
ni->ni_qos_txseqs[tid]++;
@@ -1505,7 +1509,7 @@ ieee80211_beacon_alloc(struct ieee80211com *ic, struct ieee80211_node *ni)
((rs->rs_nrates > IEEE80211_RATE_SIZE) ?
2 + rs->rs_nrates - IEEE80211_RATE_SIZE : 0) +
(((ic->ic_flags & IEEE80211_F_RSNON) &&
- (ni->ni_rsnprotos & IEEE80211_PROTO_RSN)) ?
+ (ni->ni_rsnprotos & IEEE80211_PROTO_RSN)) ?
2 + IEEE80211_RSNIE_MAXLEN : 0) +
((ic->ic_flags & IEEE80211_F_QOS) ? 2 + 18 : 0) +
(((ic->ic_flags & IEEE80211_F_RSNON) &&
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index f327032d5e9..2bc9faef21c 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_var.h,v 1.51 2008/09/01 19:41:11 damien Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.52 2008/09/01 19:55:21 damien Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
@@ -276,6 +276,7 @@ struct ieee80211com {
*/
struct ieee80211_edca_ac_params ic_edca_ac[EDCA_NUM_AC];
u_int ic_edca_updtcount;
+ u_int16_t ic_tid_noack;
u_int8_t ic_globalcnt[EAPOL_KEY_NONCE_LEN];
u_int8_t ic_nonce[EAPOL_KEY_NONCE_LEN];
u_int8_t ic_psk[IEEE80211_PMK_LEN];