Skip to content

Commit 9ae6b0c

Browse files
Update dynamic auto MCS selection logic to align with reference table
- Adjust MCS indices 24 to 31 to match spec table's modulation (BPSK to 64-QAM) and coding rates (1/2 to 5/6). - Revise signal strength thresholds (-45 to -75 dBm) to reflect realistic SNR requirements for each modulation scheme. - Preserve random signal generation logic using rand_int_smooth. - Ensure consistency with the reference table's structure and parameters.
1 parent ee69f9e commit 9ae6b0c

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

vwifi.c

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,9 +1435,8 @@ static int vwifi_get_station(struct wiphy *wiphy,
14351435
* MCS table, Data Rate Formula :
14361436
* https://semfionetworks.com/blog/mcs-table-updated-with-80211ax-data-rates/
14371437
* IEEE 802.11n : https://zh.wikipedia.org/zh-tw/IEEE_802.11n
1438-
*/
1439-
1440-
/* Check vif->manual_mcs_set to use vif->manual_mcs if set;
1438+
*
1439+
* Check vif->manual_mcs_set to use vif->manual_mcs if set;
14411440
* Assign modulation string for manual MCS ; else auto change based
14421441
* on signal strength
14431442
*/
@@ -1489,15 +1488,31 @@ static int vwifi_get_station(struct wiphy *wiphy,
14891488
pr_info("vwifi: Station %pM using manual MCS %d (%s, %s)\n", mac,
14901489
mcs_index, modulation, coding_rate);
14911490
} else {
1492-
if (sinfo->signal > -50) {
1491+
if (sinfo->signal > -45) {
14931492
mcs_index = 31;
14941493
modulation = "64-QAM";
14951494
coding_rate = "5/6";
1496-
} else if (sinfo->signal > -70 && sinfo->signal <= -50) {
1495+
} else if (sinfo->signal > -50 && sinfo->signal <= -45) {
1496+
mcs_index = 30;
1497+
modulation = "64-QAM";
1498+
coding_rate = "3/4";
1499+
} else if (sinfo->signal > -55 && sinfo->signal <= -50) {
1500+
mcs_index = 29;
1501+
modulation = "64-QAM";
1502+
coding_rate = "2/3";
1503+
} else if (sinfo->signal > -60 && sinfo->signal <= -55) {
14971504
mcs_index = 28;
14981505
modulation = "16-QAM";
14991506
coding_rate = "3/4";
1500-
} else if (sinfo->signal > -90 && sinfo->signal <= -70) {
1507+
} else if (sinfo->signal > -65 && sinfo->signal <= -60) {
1508+
mcs_index = 27;
1509+
modulation = "16-QAM";
1510+
coding_rate = "1/2";
1511+
} else if (sinfo->signal > -70 && sinfo->signal <= -65) {
1512+
mcs_index = 26;
1513+
modulation = "QPSK";
1514+
coding_rate = "3/4";
1515+
} else if (sinfo->signal > -75 && sinfo->signal <= -70) {
15011516
mcs_index = 25;
15021517
modulation = "QPSK";
15031518
coding_rate = "1/2";

0 commit comments

Comments
 (0)