Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Use only one set of EDCA variables
details: https://anonhg.NetBSD.org/src/rev/e5b6943ba814
branches: trunk
changeset: 785811:e5b6943ba814
user: christos <christos%NetBSD.org@localhost>
date: Sat Mar 30 14:14:30 2013 +0000
description:
Use only one set of EDCA variables
diffstat:
sys/dev/ic/athnvar.h | 12 +++++-----
sys/dev/pci/if_iwnreg.h | 7 ++---
sys/dev/usb/if_athn_usb.c | 22 ++++++++++----------
sys/dev/usb/if_athn_usb.h | 4 +-
sys/dev/usb/if_otus.c | 48 +++++++++++++++++++++++-----------------------
sys/net80211/ieee80211.h | 28 ++++++++------------------
6 files changed, 55 insertions(+), 66 deletions(-)
diffs (truncated from 314 to 300 lines):
diff -r a42a3466f9de -r e5b6943ba814 sys/dev/ic/athnvar.h
--- a/sys/dev/ic/athnvar.h Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/dev/ic/athnvar.h Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: athnvar.h,v 1.1 2013/03/30 02:53:02 christos Exp $ */
+/* $NetBSD: athnvar.h,v 1.2 2013/03/30 14:14:30 christos Exp $ */
/* $OpenBSD: athnvar.h,v 1.33 2012/10/20 09:54:20 stsp Exp $ */
/*-
@@ -254,11 +254,11 @@
#define ATHN_QID_COUNT 8
/* Map Access Category to Tx queue Id. */
-static const uint8_t athn_ac2qid[EDCA_NUM_AC] = {
- ATHN_QID_AC_BE, /* EDCA_AC_BE */
- ATHN_QID_AC_BK, /* EDCA_AC_BK */
- ATHN_QID_AC_VI, /* EDCA_AC_VI */
- ATHN_QID_AC_VO /* EDCA_AC_VO */
+static const uint8_t athn_ac2qid[WME_NUM_AC] = {
+ ATHN_QID_AC_BE, /* WME_AC_BE */
+ ATHN_QID_AC_BK, /* WME_AC_BK */
+ ATHN_QID_AC_VI, /* WME_AC_VI */
+ ATHN_QID_AC_VO /* WME_AC_VO */
};
static const uint8_t athn_5ghz_chans[] = {
diff -r a42a3466f9de -r e5b6943ba814 sys/dev/pci/if_iwnreg.h
--- a/sys/dev/pci/if_iwnreg.h Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/dev/pci/if_iwnreg.h Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_iwnreg.h,v 1.10 2011/10/08 09:15:08 elric Exp $ */
+/* $NetBSD: if_iwnreg.h,v 1.11 2013/03/30 14:14:31 christos Exp $ */
/* $OpenBSD: if_iwnreg.h,v 1.40 2010/05/05 19:41:57 damien Exp $ */
/*-
@@ -19,7 +19,6 @@
*/
/* XXX Added for NetBSD */
-#define EDCA_NUM_AC 4
#define IEEE80211_TKIP_MICLEN 8
#define IWN_TX_RING_COUNT 256
@@ -536,7 +535,7 @@
uint8_t aifsn;
uint8_t reserved;
uint16_t txoplimit;
- } __packed ac[EDCA_NUM_AC];
+ } __packed ac[WME_NUM_AC];
} __packed;
/* Structure for command IWN_CMD_TIMING. */
@@ -687,7 +686,7 @@
uint8_t mimo;
uint8_t antmsk_1stream;
uint8_t antmsk_2stream;
- uint8_t ridx[EDCA_NUM_AC];
+ uint8_t ridx[WME_NUM_AC];
uint16_t ampdu_limit;
uint8_t ampdu_threshold;
uint8_t ampdu_max;
diff -r a42a3466f9de -r e5b6943ba814 sys/dev/usb/if_athn_usb.c
--- a/sys/dev/usb/if_athn_usb.c Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/dev/usb/if_athn_usb.c Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_athn_usb.c,v 1.2 2013/03/30 03:12:39 christos Exp $ */
+/* $NetBSD: if_athn_usb.c,v 1.3 2013/03/30 14:14:31 christos Exp $ */
/* $OpenBSD: if_athn_usb.c,v 1.12 2013/01/14 09:50:31 jsing Exp $ */
/*-
@@ -22,7 +22,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.2 2013/03/30 03:12:39 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_athn_usb.c,v 1.3 2013/03/30 14:14:31 christos Exp $");
#ifdef _KERNEL_OPT
#include "opt_inet.h"
@@ -134,7 +134,7 @@
Static void athn_usb_rx_frame(struct athn_usb_softc *, struct mbuf *);
Static void athn_usb_rx_radiotap(struct athn_softc *, struct mbuf *,
struct ar_rx_status *);
-Static void athn_usb_rx_wmi_ctrl(struct athn_usb_softc *, uint8_t *, int);
+Static void athn_usb_rx_wmi_ctrl(struct athn_usb_softc *, uint8_t *, size_t);
Static void athn_usb_rxeof(usbd_xfer_handle, usbd_private_handle,
usbd_status);
Static void athn_usb_start(struct ifnet *);
@@ -813,7 +813,7 @@
name = "athn-ar9271";
/* Read firmware image from the filesystem. */
- if ((error = firmware_open("if_athn", name, &fwh)) != 0) {
+ if ((error = firmware_open("if_athn_usb", name, &fwh)) != 0) {
aprint_error_dev(sc->sc_dev,
"failed to open firmware file %s (%d)\n", name, error);
return error;
@@ -938,19 +938,19 @@
if (error != 0)
return error;
error = athn_usb_htc_connect_svc(usc, AR_SVC_WMI_DATA_BE,
- AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[EDCA_AC_BE]);
+ AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[WME_AC_BE]);
if (error != 0)
return error;
error = athn_usb_htc_connect_svc(usc, AR_SVC_WMI_DATA_BK,
- AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[EDCA_AC_BK]);
+ AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[WME_AC_BK]);
if (error != 0)
return error;
error = athn_usb_htc_connect_svc(usc, AR_SVC_WMI_DATA_VI,
- AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[EDCA_AC_VI]);
+ AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[WME_AC_VI]);
if (error != 0)
return error;
error = athn_usb_htc_connect_svc(usc, AR_SVC_WMI_DATA_VO,
- AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[EDCA_AC_VO]);
+ AR_PIPE_TX_DATA, AR_PIPE_RX_DATA, &usc->usc_ep_data[WME_AC_VO]);
if (error != 0)
return error;
@@ -1833,7 +1833,7 @@
#endif
Static void
-athn_usb_rx_wmi_ctrl(struct athn_usb_softc *usc, uint8_t *buf, int len)
+athn_usb_rx_wmi_ctrl(struct athn_usb_softc *usc, uint8_t *buf, size_t len)
{
#ifdef ATHN_DEBUG
struct ar_wmi_evt_txrate *txrate;
@@ -1846,7 +1846,7 @@
DPRINTFN(DBG_FN, usc, "\n");
- if (__predict_false(len < (int)sizeof(*wmi)))
+ if (__predict_false(len < sizeof(*wmi)))
return;
wmi = (struct ar_wmi_cmd_hdr *)buf;
cmd_id = be16toh(wmi->cmd_id);
@@ -2293,7 +2293,7 @@
#endif /* notyet_edca */
{
tid = 0;
- qid = EDCA_AC_BE;
+ qid = WME_AC_BE;
}
/* XXX Change radiotap Tx header for USB (no txrate). */
diff -r a42a3466f9de -r e5b6943ba814 sys/dev/usb/if_athn_usb.h
--- a/sys/dev/usb/if_athn_usb.h Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/dev/usb/if_athn_usb.h Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_athn_usb.h,v 1.1 2013/03/30 02:53:02 christos Exp $ */
+/* $NetBSD: if_athn_usb.h,v 1.2 2013/03/30 14:14:31 christos Exp $ */
/* $OpenBSD: if_athn_usb.h,v 1.3 2012/11/10 14:35:06 mikeb Exp $ */
/*-
@@ -486,7 +486,7 @@
uint8_t usc_ep_cab;
uint8_t usc_ep_uapsd;
uint8_t usc_ep_mgmt;
- uint8_t usc_ep_data[EDCA_NUM_AC];
+ uint8_t usc_ep_data[WME_NUM_AC];
void (*usc_node_cleanup)(struct ieee80211_node *);
};
diff -r a42a3466f9de -r e5b6943ba814 sys/dev/usb/if_otus.c
--- a/sys/dev/usb/if_otus.c Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/dev/usb/if_otus.c Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: if_otus.c,v 1.23 2013/01/29 13:54:26 christos Exp $ */
+/* $NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $ */
/* $OpenBSD: if_otus.c,v 1.18 2010/08/27 17:08:00 jsg Exp $ */
/*-
@@ -23,7 +23,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.23 2013/01/29 13:54:26 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_otus.c,v 1.24 2013/03/30 14:14:31 christos Exp $");
#include <sys/param.h>
#include <sys/sockio.h>
@@ -1972,12 +1972,12 @@
qid = ieee80211_up_to_ac(ic, qos & IEEE80211_QOS_TID);
} else {
qos = 0;
- qid = EDCA_AC_BE;
+ qid = WME_AC_BE;
}
#else
hasqos = 0;
qos = 0;
- qid = EDCA_AC_BE;
+ qid = WME_AC_BE;
#endif
/* Pickup a rate index. */
@@ -2382,38 +2382,38 @@
/* Set CWmin/CWmax values. */
otus_write(sc, AR_MAC_REG_AC0_CW,
- EXP2(edca[EDCA_AC_BE].ac_ecwmax) << 16 |
- EXP2(edca[EDCA_AC_BE].ac_ecwmin));
+ EXP2(edca[WME_AC_BE].ac_ecwmax) << 16 |
+ EXP2(edca[WME_AC_BE].ac_ecwmin));
otus_write(sc, AR_MAC_REG_AC1_CW,
- EXP2(edca[EDCA_AC_BK].ac_ecwmax) << 16 |
- EXP2(edca[EDCA_AC_BK].ac_ecwmin));
+ EXP2(edca[WME_AC_BK].ac_ecwmax) << 16 |
+ EXP2(edca[WME_AC_BK].ac_ecwmin));
otus_write(sc, AR_MAC_REG_AC2_CW,
- EXP2(edca[EDCA_AC_VI].ac_ecwmax) << 16 |
- EXP2(edca[EDCA_AC_VI].ac_ecwmin));
+ EXP2(edca[WME_AC_VI].ac_ecwmax) << 16 |
+ EXP2(edca[WME_AC_VI].ac_ecwmin));
otus_write(sc, AR_MAC_REG_AC3_CW,
- EXP2(edca[EDCA_AC_VO].ac_ecwmax) << 16 |
- EXP2(edca[EDCA_AC_VO].ac_ecwmin));
+ EXP2(edca[WME_AC_VO].ac_ecwmax) << 16 |
+ EXP2(edca[WME_AC_VO].ac_ecwmin));
otus_write(sc, AR_MAC_REG_AC4_CW, /* Special TXQ. */
- EXP2(edca[EDCA_AC_VO].ac_ecwmax) << 16 |
- EXP2(edca[EDCA_AC_VO].ac_ecwmin));
+ EXP2(edca[WME_AC_VO].ac_ecwmax) << 16 |
+ EXP2(edca[WME_AC_VO].ac_ecwmin));
/* Set AIFSN values. */
otus_write(sc, AR_MAC_REG_AC1_AC0_AIFS,
- AIFS(edca[EDCA_AC_VI].ac_aifsn) << 24 |
- AIFS(edca[EDCA_AC_BK].ac_aifsn) << 12 |
- AIFS(edca[EDCA_AC_BE].ac_aifsn));
+ AIFS(edca[WME_AC_VI].ac_aifsn) << 24 |
+ AIFS(edca[WME_AC_BK].ac_aifsn) << 12 |
+ AIFS(edca[WME_AC_BE].ac_aifsn));
otus_write(sc, AR_MAC_REG_AC3_AC2_AIFS,
- AIFS(edca[EDCA_AC_VO].ac_aifsn) << 16 | /* Special TXQ. */
- AIFS(edca[EDCA_AC_VO].ac_aifsn) << 4 |
- AIFS(edca[EDCA_AC_VI].ac_aifsn) >> 8);
+ AIFS(edca[WME_AC_VO].ac_aifsn) << 16 | /* Special TXQ. */
+ AIFS(edca[WME_AC_VO].ac_aifsn) << 4 |
+ AIFS(edca[WME_AC_VI].ac_aifsn) >> 8);
/* Set TXOP limit. */
otus_write(sc, AR_MAC_REG_AC1_AC0_TXOP,
- edca[EDCA_AC_BK].ac_txoplimit << 16 |
- edca[EDCA_AC_BE].ac_txoplimit);
+ edca[WME_AC_BK].ac_txoplimit << 16 |
+ edca[WME_AC_BE].ac_txoplimit);
otus_write(sc, AR_MAC_REG_AC3_AC2_TXOP,
- edca[EDCA_AC_VO].ac_txoplimit << 16 |
- edca[EDCA_AC_VI].ac_txoplimit);
+ edca[WME_AC_VO].ac_txoplimit << 16 |
+ edca[WME_AC_VI].ac_txoplimit);
#undef AIFS
#undef EXP2
diff -r a42a3466f9de -r e5b6943ba814 sys/net80211/ieee80211.h
--- a/sys/net80211/ieee80211.h Sat Mar 30 11:07:40 2013 +0000
+++ b/sys/net80211/ieee80211.h Sat Mar 30 14:14:30 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ieee80211.h,v 1.25 2013/03/30 03:25:47 christos Exp $ */
+/* $NetBSD: ieee80211.h,v 1.26 2013/03/30 14:14:31 christos Exp $ */
/*-
* Copyright (c) 2001 Atsushi Onoe
* Copyright (c) 2002-2005 Sam Leffler, Errno Consulting
@@ -203,17 +203,6 @@
#define IEEE80211_QOS_TID 0x000f
/*
- * EDCA Access Categories.
- */
-enum ieee80211_edca_ac {
- EDCA_AC_BK = 1, /* Background */
- EDCA_AC_BE = 0, /* Best Effort */
- EDCA_AC_VI = 2, /* Video */
- EDCA_AC_VO = 3 /* Voice */
-};
-#define EDCA_NUM_AC 4
-
-/*
* WME/802.11e information element.
*/
struct ieee80211_wme_info {
@@ -263,7 +252,14 @@
u_int16_t acp_txop;
} __packed;
-#define WME_NUM_AC 4 /* 4 AC categories */
+/* WME stream classes */
+enum ieee80211_wme_ac {
+ WME_AC_BE = 0, /* best effort */
+ WME_AC_BK = 1, /* background */
+ WME_AC_VI = 2, /* video */
+ WME_AC_VO = 3, /* voice */
+};
+#define WME_NUM_AC 4 /* 4 AC categories */
#define WME_PARAM_ACI 0x60 /* Mask for ACI field */
Home |
Main Index |
Thread Index |
Old Index