git: b6b352e4c712 - main - LinuxKPI: 802.11: set sta supported legacy rates
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 31 Dec 2022 02:32:59 UTC
The branch main has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=b6b352e4c7125e7d85ba382f05b1bad8454b6233
commit b6b352e4c7125e7d85ba382f05b1bad8454b6233
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2022-12-31 00:33:34 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2022-12-31 00:33:34 +0000
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
MFC after: 10 days
---
sys/compat/linuxkpi/common/src/linux_80211.c | 22 +++++++++++++++++++++-
1 file changed, 21 insertions(+), 1 deletion(-)
diff --git a/sys/compat/linuxkpi/common/src/linux_80211.c b/sys/compat/linuxkpi/common/src/linux_80211.c
index 998b39127993..949f9157fe35 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] = <xq->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);