Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143320410
D48099.id149215.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D48099.id149215.diff
View Options
diff --git a/sys/dev/rtwn/if_rtwn_ridx.h b/sys/dev/rtwn/if_rtwn_ridx.h
--- a/sys/dev/rtwn/if_rtwn_ridx.h
+++ b/sys/dev/rtwn/if_rtwn_ridx.h
@@ -54,6 +54,8 @@
*/
#define RTWN_RIDX_VHT_MCS_SHIFT 44
#define RTWN_RIDX_VHT_MCS(s, i) (RTWN_RIDX_VHT_MCS_SHIFT + ((10*(s)) + (i)))
+#define RTWN_RIDX_TO_VHT_NSS(s) (((s) - RTWN_RIDX_VHT_MCS_SHIFT) / 10)
+#define RTWN_RIDX_TO_VHT_MCS(s) (((s) - RTWN_RIDX_VHT_MCS_SHIFT) % 10)
/*
* The total amount of rate indexes, CCK, OFDM, HT MCS0..31,
diff --git a/sys/dev/rtwn/rtl8812a/r12a_rx.c b/sys/dev/rtwn/rtl8812a/r12a_rx.c
--- a/sys/dev/rtwn/rtl8812a/r12a_rx.c
+++ b/sys/dev/rtwn/rtl8812a/r12a_rx.c
@@ -105,13 +105,42 @@
R12A_TXRPTB0_LIFE_EXPIRE)) ? " not" : "", ntries);
txs.flags = IEEE80211_RATECTL_STATUS_LONG_RETRY |
- IEEE80211_RATECTL_STATUS_FINAL_RATE;
+ IEEE80211_RATECTL_STATUS_FINAL_RATE |
+ IEEE80211_RATECTL_STATUS_PHYTYPE;
txs.long_retries = ntries;
- if (RTWN_RATE_IS_HT(rpt->final_rate)) { /* MCS */
+ if (RTWN_RATE_IS_CCK(rpt->final_rate)) {
+ /* CCK - table lookup */
+ txs.final_rate = ridx2rate[rpt->final_rate];
+ txs.phytype = IEEE80211_T_CCK;
+ } else if RTWN_RATE_IS_OFDM(rpt->final_rate) {
+ /* CCK - table lookup */
+ txs.final_rate = ridx2rate[rpt->final_rate];
+ txs.phytype = IEEE80211_T_OFDM;
+ } else if (RTWN_RATE_IS_HT(rpt->final_rate)) {
+ /*
+ * Current; since current ratectl expects HT
+ * to return final_rate as a dot11rate.
+ */
txs.final_rate = RTWN_RIDX_TO_MCS(rpt->final_rate);
txs.final_rate |= IEEE80211_RATE_MCS;
- } else
- txs.final_rate = ridx2rate[rpt->final_rate];
+
+ /* New; report MCS directly */
+ txs.mcs = RTWN_RIDX_TO_MCS(rpt->final_rate);
+ txs.flags |= IEEE80211_RATECTL_STATUS_MCS;
+ txs.phytype = IEEE80211_T_HT;
+ } else if (RTWN_RATE_IS_VHT(rpt->final_rate)) {
+ txs.flags &= ~IEEE80211_RATECTL_STATUS_FINAL_RATE;
+ txs.final_rate = 0;
+ txs.flags |= IEEE80211_RATECTL_STATUS_MCS |
+ IEEE80211_RATECTL_STATUS_NSS;
+ txs.mcs = RTWN_RIDX_TO_VHT_MCS(rpt->final_rate);
+ txs.nss = RTWN_RIDX_TO_VHT_NSS(rpt->final_rate);
+ txs.phytype = IEEE80211_T_VHT;
+ } else {
+ txs.flags &= ~IEEE80211_RATECTL_STATUS_FINAL_RATE;
+ txs.final_rate = 0;
+ }
+
if (rpt->txrptb0 & R12A_TXRPTB0_RETRY_OVER)
txs.status = IEEE80211_RATECTL_TX_FAIL_LONG;
else if (rpt->txrptb0 & R12A_TXRPTB0_LIFE_EXPIRE)
@@ -301,9 +330,8 @@
IEEE80211_RATE_MCS | RTWN_RIDX_TO_MCS(rate);
rxs->c_pktflags |= IEEE80211_RX_F_HT;
} else if (RTWN_RATE_IS_VHT(rate)) {
- /* XXX: need to revisit VHT rate representation */
- rxs->c_vhtnss = (rate - RTWN_RIDX_VHT_MCS_SHIFT) / 10;
- rxs->c_rate = (rate - RTWN_RIDX_VHT_MCS_SHIFT) % 10;
+ rxs->c_vhtnss = RTWN_RIDX_TO_VHT_NSS(rate);
+ rxs->c_rate = RTWN_RIDX_TO_VHT_MCS(rate);
rxs->c_pktflags |= IEEE80211_RX_F_VHT;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 29, 8:47 PM (7 h, 37 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28089649
Default Alt Text
D48099.id149215.diff (2 KB)
Attached To
Mode
D48099: rtwn: add VHT information to TX rate completion
Attached
Detach File
Event Timeline
Log In to Comment