summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstsp <stsp@openbsd.org>2017-01-09 16:24:20 +0000
committerstsp <stsp@openbsd.org>2017-01-09 16:24:20 +0000
commite8f8f56c76122bbd5fc5a0b2292d06a88841ba1d (patch)
tree56ee96e8d6732ae926b61d9ea8dcb7e3d87d1383
parentAvoid leaking conninfo servername. (diff)
downloadwireguard-openbsd-e8f8f56c76122bbd5fc5a0b2292d06a88841ba1d.tar.xz
wireguard-openbsd-e8f8f56c76122bbd5fc5a0b2292d06a88841ba1d.zip
Make the net80211 stack send EDCA parameters to the driver in hostap mode.
Fixes problems with timing of frame transmissions which caused packet loss. tested by myself and tb@ ok phessler@ mpi@ tb@
-rw-r--r--sys/net80211/ieee80211_node.c19
-rw-r--r--sys/net80211/ieee80211_output.c4
-rw-r--r--sys/net80211/ieee80211_var.h5
3 files changed, 24 insertions, 4 deletions
diff --git a/sys/net80211/ieee80211_node.c b/sys/net80211/ieee80211_node.c
index f255e0d1a2a..d691eef17b7 100644
--- a/sys/net80211/ieee80211_node.c
+++ b/sys/net80211/ieee80211_node.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_node.c,v 1.109 2017/01/09 12:40:00 stsp Exp $ */
+/* $OpenBSD: ieee80211_node.c,v 1.110 2017/01/09 16:24:20 stsp Exp $ */
/* $NetBSD: ieee80211_node.c,v 1.14 2004/05/09 09:18:47 dyoung Exp $ */
/*-
@@ -354,6 +354,10 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
if (ic->ic_flags & IEEE80211_F_WEPON)
ni->ni_capinfo |= IEEE80211_CAPINFO_PRIVACY;
if (ic->ic_flags & IEEE80211_F_HTON) {
+ const struct ieee80211_edca_ac_params *ac_qap;
+ struct ieee80211_edca_ac_params *ac;
+ int aci;
+
/*
* Default to non-member HT protection until we have a way
* of picking up information from the environment (such as
@@ -362,6 +366,19 @@ ieee80211_create_ibss(struct ieee80211com* ic, struct ieee80211_channel *chan)
*/
ni->ni_htop1 = IEEE80211_HTPROT_NONMEMBER;
ic->ic_protmode = IEEE80211_PROT_RTSCTS;
+
+ /* Configure QoS EDCA parameters. */
+ for (aci = 0; aci < EDCA_NUM_AC; aci++) {
+ ac = &ic->ic_edca_ac[aci];
+ ac_qap = &ieee80211_qap_edca_table[ic->ic_curmode][aci];
+ ac->ac_acm = ac_qap->ac_acm;
+ ac->ac_aifsn = ac_qap->ac_aifsn;
+ ac->ac_ecwmin = ac_qap->ac_ecwmin;
+ ac->ac_ecwmax = ac_qap->ac_ecwmax;
+ ac->ac_txoplimit = ac_qap->ac_txoplimit;
+ }
+ if (ic->ic_updateedca)
+ (*ic->ic_updateedca)(ic);
}
if (ic->ic_flags & IEEE80211_F_RSNON) {
struct ieee80211_key *k;
diff --git a/sys/net80211/ieee80211_output.c b/sys/net80211/ieee80211_output.c
index 0c1ac3964f9..96fe0b6838d 100644
--- a/sys/net80211/ieee80211_output.c
+++ b/sys/net80211/ieee80211_output.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_output.c,v 1.113 2017/01/09 13:01:37 stsp Exp $ */
+/* $OpenBSD: ieee80211_output.c,v 1.114 2017/01/09 16:24:20 stsp Exp $ */
/* $NetBSD: ieee80211_output.c,v 1.13 2004/05/31 11:02:55 dyoung Exp $ */
/*-
@@ -306,7 +306,7 @@ static const struct ieee80211_edca_ac_params
#endif
#ifndef IEEE80211_STA_ONLY
-static const struct ieee80211_edca_ac_params
+const struct ieee80211_edca_ac_params
ieee80211_qap_edca_table[IEEE80211_MODE_MAX][EDCA_NUM_AC] = {
[IEEE80211_MODE_11B] = {
[EDCA_AC_BK] = { 5, 10, 7, 0 },
diff --git a/sys/net80211/ieee80211_var.h b/sys/net80211/ieee80211_var.h
index a43979fd53c..d4ae1e77ec7 100644
--- a/sys/net80211/ieee80211_var.h
+++ b/sys/net80211/ieee80211_var.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: ieee80211_var.h,v 1.74 2017/01/09 12:40:00 stsp Exp $ */
+/* $OpenBSD: ieee80211_var.h,v 1.75 2017/01/09 16:24:20 stsp Exp $ */
/* $NetBSD: ieee80211_var.h,v 1.7 2004/05/06 03:07:10 dyoung Exp $ */
/*-
@@ -160,6 +160,9 @@ struct ieee80211_edca_ac_params {
u_int8_t ac_acm;
};
+extern const struct ieee80211_edca_ac_params
+ ieee80211_qap_edca_table[IEEE80211_MODE_MAX][EDCA_NUM_AC];
+
#define IEEE80211_DEFRAG_SIZE 3 /* must be >= 3 according to spec */
/*
* Entry in the fragment cache.