aboutsummaryrefslogtreecommitdiff
path: root/sys/compat
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2022-12-31 00:33:34 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2023-01-18 13:25:57 +0000
commitd42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45 (patch)
tree538c585b7990243c77103798e49841c1149a3ca6 /sys/compat
parentca6485cbf42038c3575e2acaf17fb7f7b048e477 (diff)
downloadsrc-d42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45.tar.gz
src-d42205c0ba27c2d223d5dbd6bec3d30e1d4e8c45.zip
LinuxKPI: 802.11: set sta supported legacy rates
When initializing the sta set the per-band supported legacy rates as some drivers take the information from there. Sponsored by: The FreeBSD Foundation (cherry picked from commit b6b352e4c7125e7d85ba382f05b1bad8454b6233)
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/linuxkpi/common/src/linux_80211.c22
1 files changed, 21 insertions, 1 deletions
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 947878449db4..170f6162cd6b 100644
--- a/sys/compat/linuxkpi/common/src/linux_80211.c
+++ b/sys/compat/linuxkpi/common/src/linux_80211.c
@@ -192,7 +192,7 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN],
struct lkpi_vif *lvif;
struct ieee80211_vif *vif;
struct ieee80211_sta *sta;
- int tid;
+ int band, i, tid;
lsta = malloc(sizeof(*lsta) + hw->sta_data_size, M_LKPI80211,
M_NOWAIT | M_ZERO);
@@ -216,6 +216,8 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN],
sta = LSTA_TO_STA(lsta);
IEEE80211_ADDR_COPY(sta->addr, mac);
+
+ /* TXQ */
for (tid = 0; tid < nitems(sta->txq); tid++) {
struct lkpi_txq *ltxq;
@@ -243,6 +245,24 @@ lkpi_lsta_alloc(struct ieee80211vap *vap, const uint8_t mac[IEEE80211_ADDR_LEN],
sta->txq[tid] = &ltxq->txq;
}
+ /* Deflink information. */
+ for (band = 0; band < NUM_NL80211_BANDS; band++) {
+ struct ieee80211_supported_band *supband;
+
+ supband = hw->wiphy->bands[band];
+ if (supband == NULL)
+ continue;
+
+ for (i = 0; i < supband->n_bitrates; i++) {
+
+ IMPROVE("Further supband->bitrates[i]* checks?");
+ /* or should we get them from the ni? */
+ sta->deflink.supp_rates[band] |= BIT(i);
+ }
+ }
+ IMPROVE("ht, vht, he, ... bandwidth, smps_mode, ..");
+ /* bandwidth = IEEE80211_STA_RX_... */
+
/* Deferred TX path. */
mtx_init(&lsta->txq_mtx, "lsta_txq", NULL, MTX_DEF);
TASK_INIT(&lsta->txq_task, 0, lkpi_80211_txq_task, lsta);