aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb
diff options
context:
space:
mode:
authorAdrian Chadd <adrian@FreeBSD.org>2025-01-02 04:35:24 +0000
committerAdrian Chadd <adrian@FreeBSD.org>2025-02-26 19:29:18 +0000
commit7067450010931479f8dd97e51e4c5bf6a4d34c7e (patch)
treeb07671fe6cc2a58de0e72754b8033ba4b9f3e8d1 /sys/dev/usb
parent38075f7d5c87176f7b317c368712444a2f450a5e (diff)
Diffstat (limited to 'sys/dev/usb')
-rw-r--r--sys/dev/usb/wlan/if_mtw.c10
-rw-r--r--sys/dev/usb/wlan/if_rsu.c3
-rw-r--r--sys/dev/usb/wlan/if_rum.c2
-rw-r--r--sys/dev/usb/wlan/if_run.c7
-rw-r--r--sys/dev/usb/wlan/if_uath.c3
-rw-r--r--sys/dev/usb/wlan/if_ural.c2
-rw-r--r--sys/dev/usb/wlan/if_zyd.c2
7 files changed, 18 insertions, 11 deletions
diff --git a/sys/dev/usb/wlan/if_mtw.c b/sys/dev/usb/wlan/if_mtw.c
index 51398134ff9d..b42ed336d18e 100644
--- a/sys/dev/usb/wlan/if_mtw.c
+++ b/sys/dev/usb/wlan/if_mtw.c
@@ -2155,7 +2155,7 @@ mtw_iter_func(void *arg, struct ieee80211_node *ni)
uint32_t sta[3];
uint16_t(*wstat)[3];
int error, ridx;
-
+ uint8_t txrate = 0;
/* Check for special case */
if (sc->rvp_cnt <= 1 && vap->iv_opmode == IEEE80211_M_STA &&
@@ -2208,11 +2208,13 @@ mtw_iter_func(void *arg, struct ieee80211_node *ni)
ieee80211_ratectl_tx_update(vap, txs);
ieee80211_ratectl_rate(ni, NULL, 0);
+ txrate = ieee80211_node_get_txrate_dot11rate(ni);
+
/* XXX TODO: methodize with MCS rates */
for (ridx = 0; ridx < MTW_RIDX_MAX; ridx++) {
MTW_DPRINTF(sc, MTW_DEBUG_RATE, "ni_txrate=0x%x\n",
- ni->ni_txrate);
- if (rt2860_rates[ridx].rate == ni->ni_txrate) {
+ txrate);
+ if (rt2860_rates[ridx].rate == txrate) {
break;
}
}
@@ -2221,7 +2223,7 @@ fail:
MTW_UNLOCK(sc);
MTW_DPRINTF(sc, MTW_DEBUG_RATE, "rate=%d, ridx=%d\n",
- ni->ni_txrate, rn->amrr_ridx);
+ txrate, rn->amrr_ridx);
}
static void
diff --git a/sys/dev/usb/wlan/if_rsu.c b/sys/dev/usb/wlan/if_rsu.c
index c967435250ee..997a739562f6 100644
--- a/sys/dev/usb/wlan/if_rsu.c
+++ b/sys/dev/usb/wlan/if_rsu.c
@@ -1500,7 +1500,8 @@ rsu_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
ni = ieee80211_ref_node(vap->iv_bss);
rs = &ni->ni_rates;
/* Indicate highest supported rate. */
- ni->ni_txrate = rs->rs_rates[rs->rs_nrates - 1];
+ ieee80211_node_set_txrate_dot11rate(ni,
+ rs->rs_rates[rs->rs_nrates - 1]);
(void) rsu_set_fw_power_state(sc, RSU_PWR_SLEEP);
ieee80211_free_node(ni);
startcal = 1;
diff --git a/sys/dev/usb/wlan/if_rum.c b/sys/dev/usb/wlan/if_rum.c
index fc83409543ec..48674d84ffe3 100644
--- a/sys/dev/usb/wlan/if_rum.c
+++ b/sys/dev/usb/wlan/if_rum.c
@@ -1646,7 +1646,7 @@ rum_tx_data(struct rum_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
rate = tp->ucastrate;
else {
(void) ieee80211_ratectl_rate(ni, NULL, 0);
- rate = ni->ni_txrate;
+ rate = ieee80211_node_get_txrate_dot11rate(ni);
}
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
diff --git a/sys/dev/usb/wlan/if_run.c b/sys/dev/usb/wlan/if_run.c
index e709ceff8849..81f4d172241f 100644
--- a/sys/dev/usb/wlan/if_run.c
+++ b/sys/dev/usb/wlan/if_run.c
@@ -2685,6 +2685,7 @@ run_iter_func(void *arg, struct ieee80211_node *ni)
union run_stats sta[2];
uint16_t (*wstat)[3];
int error, ridx;
+ uint8_t dot11rate;
RUN_LOCK(sc);
@@ -2737,15 +2738,17 @@ run_iter_func(void *arg, struct ieee80211_node *ni)
ieee80211_ratectl_tx_update(vap, txs);
ieee80211_ratectl_rate(ni, NULL, 0);
/* XXX TODO: methodize with MCS rates */
+ dot11rate = ieee80211_node_get_txrate_dot11rate(ni);
for (ridx = 0; ridx < RT2860_RIDX_MAX; ridx++)
- if (rt2860_rates[ridx].rate == ni->ni_txrate)
+ if (rt2860_rates[ridx].rate == dot11rate)
break;
rn->amrr_ridx = ridx;
fail:
RUN_UNLOCK(sc);
- RUN_DPRINTF(sc, RUN_DEBUG_RATE, "rate=%d, ridx=%d\n", ni->ni_txrate, rn->amrr_ridx);
+ RUN_DPRINTF(sc, RUN_DEBUG_RATE, "rate=0x%02x, ridx=%d\n",
+ ieee80211_node_get_txrate_dot11rate(ni), rn->amrr_ridx);
}
static void
diff --git a/sys/dev/usb/wlan/if_uath.c b/sys/dev/usb/wlan/if_uath.c
index 10e3b50eaeb3..e4493ba50a30 100644
--- a/sys/dev/usb/wlan/if_uath.c
+++ b/sys/dev/usb/wlan/if_uath.c
@@ -2058,7 +2058,8 @@ uath_newstate(struct ieee80211vap *vap, enum ieee80211_state nstate, int arg)
* Tx rate is controlled by firmware, report the maximum
* negotiated rate in ifconfig output.
*/
- ni->ni_txrate = ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1];
+ ieee80211_node_set_txrate_dot11rate(ni,
+ ni->ni_rates.rs_rates[ni->ni_rates.rs_nrates-1]);
if (uath_write_associd(sc) != 0) {
device_printf(sc->sc_dev,
diff --git a/sys/dev/usb/wlan/if_ural.c b/sys/dev/usb/wlan/if_ural.c
index 6e01592da44f..c47b8cbeb3ae 100644
--- a/sys/dev/usb/wlan/if_ural.c
+++ b/sys/dev/usb/wlan/if_ural.c
@@ -1227,7 +1227,7 @@ ural_tx_data(struct ural_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
rate = tp->ucastrate;
else {
(void) ieee80211_ratectl_rate(ni, NULL, 0);
- rate = ni->ni_txrate;
+ rate = ieee80211_node_get_txrate_dot11rate(ni);
}
if (wh->i_fc[1] & IEEE80211_FC1_PROTECTED) {
diff --git a/sys/dev/usb/wlan/if_zyd.c b/sys/dev/usb/wlan/if_zyd.c
index 76e7d4312040..1815dc04cd09 100644
--- a/sys/dev/usb/wlan/if_zyd.c
+++ b/sys/dev/usb/wlan/if_zyd.c
@@ -2460,7 +2460,7 @@ zyd_tx_start(struct zyd_softc *sc, struct mbuf *m0, struct ieee80211_node *ni)
rate = tp->ucastrate;
else {
(void) ieee80211_ratectl_rate(ni, NULL, 0);
- rate = ni->ni_txrate;
+ rate = ieee80211_node_get_txrate_dot11rate(ni);
}
}