summaryrefslogtreecommitdiffstats
path: root/sys/dev/usb/wlan/if_run.c
diff options
context:
space:
mode:
authoradrian <adrian@FreeBSD.org>2015-10-03 22:33:45 +0000
committeradrian <adrian@FreeBSD.org>2015-10-03 22:33:45 +0000
commit1971635d2c5adabeb936139368dc2fb2a72beb67 (patch)
treea6847fa4b9b37ed0080837f331e8cd4d44e8957d /sys/dev/usb/wlan/if_run.c
parentd6b5b38ff0c000f5f0e137081d22d4cc43354a70 (diff)
downloadFreeBSD-src-1971635d2c5adabeb936139368dc2fb2a72beb67.zip
FreeBSD-src-1971635d2c5adabeb936139368dc2fb2a72beb67.tar.gz
run(4): fix WME support (untested).
Now run(4) fetches parameters from ic->ic_wme.wme_params array, which is never initialized (and can be safely removed). This patch replaces &ic->ic_wme.wme_params with &ic->ic_wme.wme_chanParams.cap_wmeParams (contains parameters for local station; used by other drivers with WME support). Tested: * me: STA: run0: MAC/BBP RT5390 (rev 0x0502), RF RT5370 (MIMO 1T1R), address 38:83:45:11:78:ae
Diffstat (limited to 'sys/dev/usb/wlan/if_run.c')
-rw-r--r--sys/dev/usb/wlan/if_run.c43
1 files changed, 22 insertions, 21 deletions
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index 635b5ae..3b348b2 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -2162,7 +2162,8 @@ run_wme_update_cb(void *arg)
{
struct ieee80211com *ic = arg;
struct run_softc *sc = ic->ic_softc;
- struct ieee80211_wme_state *wmesp = &ic->ic_wme;
+ const struct wmeParams (*ac)[WME_NUM_AC] =
+ &ic->ic_wme.wme_chanParams.cap_wmeParams;
int aci, error = 0;
RUN_LOCK_ASSERT(sc, MA_OWNED);
@@ -2170,39 +2171,39 @@ run_wme_update_cb(void *arg)
/* update MAC TX configuration registers */
for (aci = 0; aci < WME_NUM_AC; aci++) {
error = run_write(sc, RT2860_EDCA_AC_CFG(aci),
- wmesp->wme_params[aci].wmep_logcwmax << 16 |
- wmesp->wme_params[aci].wmep_logcwmin << 12 |
- wmesp->wme_params[aci].wmep_aifsn << 8 |
- wmesp->wme_params[aci].wmep_txopLimit);
+ ac[aci]->wmep_logcwmax << 16 |
+ ac[aci]->wmep_logcwmin << 12 |
+ ac[aci]->wmep_aifsn << 8 |
+ ac[aci]->wmep_txopLimit);
if (error) goto err;
}
/* update SCH/DMA registers too */
error = run_write(sc, RT2860_WMM_AIFSN_CFG,
- wmesp->wme_params[WME_AC_VO].wmep_aifsn << 12 |
- wmesp->wme_params[WME_AC_VI].wmep_aifsn << 8 |
- wmesp->wme_params[WME_AC_BK].wmep_aifsn << 4 |
- wmesp->wme_params[WME_AC_BE].wmep_aifsn);
+ ac[WME_AC_VO]->wmep_aifsn << 12 |
+ ac[WME_AC_VI]->wmep_aifsn << 8 |
+ ac[WME_AC_BK]->wmep_aifsn << 4 |
+ ac[WME_AC_BE]->wmep_aifsn);
if (error) goto err;
error = run_write(sc, RT2860_WMM_CWMIN_CFG,
- wmesp->wme_params[WME_AC_VO].wmep_logcwmin << 12 |
- wmesp->wme_params[WME_AC_VI].wmep_logcwmin << 8 |
- wmesp->wme_params[WME_AC_BK].wmep_logcwmin << 4 |
- wmesp->wme_params[WME_AC_BE].wmep_logcwmin);
+ ac[WME_AC_VO]->wmep_logcwmin << 12 |
+ ac[WME_AC_VI]->wmep_logcwmin << 8 |
+ ac[WME_AC_BK]->wmep_logcwmin << 4 |
+ ac[WME_AC_BE]->wmep_logcwmin);
if (error) goto err;
error = run_write(sc, RT2860_WMM_CWMAX_CFG,
- wmesp->wme_params[WME_AC_VO].wmep_logcwmax << 12 |
- wmesp->wme_params[WME_AC_VI].wmep_logcwmax << 8 |
- wmesp->wme_params[WME_AC_BK].wmep_logcwmax << 4 |
- wmesp->wme_params[WME_AC_BE].wmep_logcwmax);
+ ac[WME_AC_VO]->wmep_logcwmax << 12 |
+ ac[WME_AC_VI]->wmep_logcwmax << 8 |
+ ac[WME_AC_BK]->wmep_logcwmax << 4 |
+ ac[WME_AC_BE]->wmep_logcwmax);
if (error) goto err;
error = run_write(sc, RT2860_WMM_TXOP0_CFG,
- wmesp->wme_params[WME_AC_BK].wmep_txopLimit << 16 |
- wmesp->wme_params[WME_AC_BE].wmep_txopLimit);
+ ac[WME_AC_BK]->wmep_txopLimit << 16 |
+ ac[WME_AC_BE]->wmep_txopLimit);
if (error) goto err;
error = run_write(sc, RT2860_WMM_TXOP1_CFG,
- wmesp->wme_params[WME_AC_VO].wmep_txopLimit << 16 |
- wmesp->wme_params[WME_AC_VI].wmep_txopLimit);
+ ac[WME_AC_VO]->wmep_txopLimit << 16 |
+ ac[WME_AC_VI]->wmep_txopLimit);
err:
if (error)
OpenPOWER on IntegriCloud