summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwn
diff options
context:
space:
mode:
authorrpaulo <rpaulo@FreeBSD.org>2010-04-07 15:29:13 +0000
committerrpaulo <rpaulo@FreeBSD.org>2010-04-07 15:29:13 +0000
commit69bf804b50328bc699737db57c5d38691d59780a (patch)
treeea8a3480b8652bfecee1f73168674b2f28571e3b /sys/dev/iwn
parent1db184691b1abeac975b128c17b5c4997b7bcf6c (diff)
downloadFreeBSD-src-69bf804b50328bc699737db57c5d38691d59780a.zip
FreeBSD-src-69bf804b50328bc699737db57c5d38691d59780a.tar.gz
net80211 rate control framework (net80211 ratectl).
This framework allows drivers to abstract the rate control algorithm and just feed the framework with the usable parameters. The rate control framework will now deal with passing the parameters to the selected algorithm. Right now we have AMRR (the default) and RSSADAPT but there's no way to select one with ifconfig, yet. The objective is to have more rate control algorithms in the net80211 stack so all drivers[0] can use it. Ideally, we'll have the well-known sample rate control algorithm in the net80211 at some point so all drivers can use it (not just ath). [0] all drivers that do rate control in software, that is. Reviewed by: bschmidt, thompsa, weyongo MFC after: 1 months
Diffstat (limited to 'sys/dev/iwn')
-rw-r--r--sys/dev/iwn/if_iwn.c32
-rw-r--r--sys/dev/iwn/if_iwnvar.h3
2 files changed, 13 insertions, 22 deletions
diff --git a/sys/dev/iwn/if_iwn.c b/sys/dev/iwn/if_iwn.c
index b6af7b8..ebafc9c 100644
--- a/sys/dev/iwn/if_iwn.c
+++ b/sys/dev/iwn/if_iwn.c
@@ -65,9 +65,9 @@ __FBSDID("$FreeBSD$");
#include <netinet/ip.h>
#include <net80211/ieee80211_var.h>
-#include <net80211/ieee80211_amrr.h>
#include <net80211/ieee80211_radiotap.h>
#include <net80211/ieee80211_regdomain.h>
+#include <net80211/ieee80211_ratectl.h>
#include <dev/iwn/if_iwnreg.h>
#include <dev/iwn/if_iwnvar.h>
@@ -755,11 +755,7 @@ iwn_vap_create(struct ieee80211com *ic,
ivp->iv_newstate = vap->iv_newstate;
vap->iv_newstate = iwn_newstate;
- ieee80211_amrr_init(&ivp->iv_amrr, vap,
- IEEE80211_AMRR_MIN_SUCCESS_THRESHOLD,
- IEEE80211_AMRR_MAX_SUCCESS_THRESHOLD,
- 500 /* ms */);
-
+ ieee80211_ratectl_init(vap);
/* Complete setup. */
ieee80211_vap_attach(vap, ieee80211_media_change,
ieee80211_media_status);
@@ -772,7 +768,7 @@ iwn_vap_delete(struct ieee80211vap *vap)
{
struct iwn_vap *ivp = IWN_VAP(vap);
- ieee80211_amrr_cleanup(&ivp->iv_amrr);
+ ieee80211_ratectl_deinit(vap);
ieee80211_vap_detach(vap);
free(ivp, M_80211_VAP);
}
@@ -1858,11 +1854,8 @@ iwn_node_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN])
void
iwn_newassoc(struct ieee80211_node *ni, int isnew)
{
- struct ieee80211vap *vap = ni->ni_vap;
- struct iwn_node *wn = (void *)ni;
-
- ieee80211_amrr_node_init(&IWN_VAP(vap)->iv_amrr,
- &wn->amn, ni);
+ /* XXX move */
+ ieee80211_ratectl_node_init(ni);
}
int
@@ -2291,9 +2284,9 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
struct ifnet *ifp = sc->sc_ifp;
struct iwn_tx_ring *ring = &sc->txq[desc->qid & 0xf];
struct iwn_tx_data *data = &ring->data[desc->idx];
- struct iwn_node *wn = (void *)data->ni;
struct mbuf *m;
struct ieee80211_node *ni;
+ struct ieee80211vap *vap;
KASSERT(data->ni != NULL, ("no node"));
@@ -2302,6 +2295,7 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
bus_dmamap_unload(ring->data_dmat, data->map);
m = data->m, data->m = NULL;
ni = data->ni, data->ni = NULL;
+ vap = ni->ni_vap;
if (m->m_flags & M_TXCB) {
/*
@@ -2331,11 +2325,11 @@ iwn_tx_done(struct iwn_softc *sc, struct iwn_rx_desc *desc, int ackfailcnt,
*/
if (status & 0x80) {
ifp->if_oerrors++;
- ieee80211_amrr_tx_complete(&wn->amn,
- IEEE80211_AMRR_FAILURE, ackfailcnt);
+ ieee80211_ratectl_tx_complete(vap, ni,
+ IEEE80211_RATECTL_TX_FAILURE, &ackfailcnt, NULL);
} else {
- ieee80211_amrr_tx_complete(&wn->amn,
- IEEE80211_AMRR_SUCCESS, ackfailcnt);
+ ieee80211_ratectl_tx_complete(vap, ni,
+ IEEE80211_RATECTL_TX_SUCCESS, &ackfailcnt, NULL);
}
m_freem(m);
ieee80211_free_node(ni);
@@ -2851,7 +2845,8 @@ iwn_tx_data(struct iwn_softc *sc, struct mbuf *m, struct ieee80211_node *ni,
else if (tp->ucastrate != IEEE80211_FIXED_RATE_NONE)
rate = tp->ucastrate;
else {
- (void) ieee80211_amrr_choose(ni, &wn->amn);
+ /* XXX pass pktlen */
+ (void) ieee80211_ratectl_rate(ni, NULL, 0);
rate = ni->ni_txrate;
}
ridx = iwn_plcp_signal(rate);
@@ -6434,4 +6429,3 @@ DRIVER_MODULE(iwn, pci, iwn_driver, iwn_devclass, 0, 0);
MODULE_DEPEND(iwn, pci, 1, 1, 1);
MODULE_DEPEND(iwn, firmware, 1, 1, 1);
MODULE_DEPEND(iwn, wlan, 1, 1, 1);
-MODULE_DEPEND(iwn, wlan_amrr, 1, 1, 1);
diff --git a/sys/dev/iwn/if_iwnvar.h b/sys/dev/iwn/if_iwnvar.h
index 98c9c94..fe68ec9 100644
--- a/sys/dev/iwn/if_iwnvar.h
+++ b/sys/dev/iwn/if_iwnvar.h
@@ -99,7 +99,6 @@ struct iwn_rx_ring {
struct iwn_node {
struct ieee80211_node ni; /* must be the first */
- struct ieee80211_amrr_node amn;
uint16_t disable_tid;
uint8_t id;
uint8_t ridx[IEEE80211_RATE_MAXSIZE];
@@ -193,8 +192,6 @@ struct iwn_hal {
struct iwn_vap {
struct ieee80211vap iv_vap;
- struct ieee80211_amrr iv_amrr;
- struct callout iv_amrr_to;
uint8_t iv_ridx;
int (*iv_newstate)(struct ieee80211vap *,
OpenPOWER on IntegriCloud