Skip to content

Commit 18a3569

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

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

vwifi.c

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1489,15 +1489,31 @@ static int vwifi_get_station(struct wiphy *wiphy,
14891489
pr_info("vwifi: Station %pM using manual MCS %d (%s, %s)\n", mac,
14901490
mcs_index, modulation, coding_rate);
14911491
} else {
1492-
if (sinfo->signal > -50) {
1492+
if (sinfo->signal > -45) {
14931493
mcs_index = 31;
14941494
modulation = "64-QAM";
14951495
coding_rate = "5/6";
1496-
} else if (sinfo->signal > -70 && sinfo->signal <= -50) {
1496+
} else if (sinfo->signal > -50 && sinfo->signal <= -45) {
1497+
mcs_index = 30;
1498+
modulation = "64-QAM";
1499+
coding_rate = "3/4";
1500+
} else if (sinfo->signal > -55 && sinfo->signal <= -50) {
1501+
mcs_index = 29;
1502+
modulation = "64-QAM";
1503+
coding_rate = "2/3";
1504+
} else if (sinfo->signal > -60 && sinfo->signal <= -55) {
14971505
mcs_index = 28;
14981506
modulation = "16-QAM";
14991507
coding_rate = "3/4";
1500-
} else if (sinfo->signal > -90 && sinfo->signal <= -70) {
1508+
} else if (sinfo->signal > -65 && sinfo->signal <= -60) {
1509+
mcs_index = 27;
1510+
modulation = "16-QAM";
1511+
coding_rate = "1/2";
1512+
} else if (sinfo->signal > -70 && sinfo->signal <= -65) {
1513+
mcs_index = 26;
1514+
modulation = "QPSK";
1515+
coding_rate = "3/4";
1516+
} else if (sinfo->signal > -75 && sinfo->signal <= -70) {
15011517
mcs_index = 25;
15021518
modulation = "QPSK";
15031519
coding_rate = "1/2";

0 commit comments

Comments
 (0)