|
|
| 1002 |
//First, search the BSS Basic Rate set |
1002 |
//First, search the BSS Basic Rate set |
| 1003 |
for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++) |
1003 |
for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++) |
| 1004 |
{ |
1004 |
{ |
| 1005 |
if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1005 |
if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
| 1006 |
&& (i->GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1006 |
&& (i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
|
|
1007 |
&& (i->GetConstellationSize (1) <= reqMode.GetConstellationSize (1)) |
| 1007 |
&& ((i->GetModulationClass () == reqMode.GetModulationClass ()) |
1008 |
&& ((i->GetModulationClass () == reqMode.GetModulationClass ()) |
| 1008 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT) |
1009 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT) |
| 1009 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_VHT))) |
1010 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_VHT))) |
|
|
| 1023 |
mode = GetDefaultMcs (); |
1024 |
mode = GetDefaultMcs (); |
| 1024 |
for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++) |
1025 |
for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++) |
| 1025 |
{ |
1026 |
{ |
| 1026 |
if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1027 |
if ((!found || i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
| 1027 |
&& i->GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1028 |
&& i->GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
| 1028 |
//&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard |
1029 |
//&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard |
| 1029 |
{ |
1030 |
{ |
| 1030 |
mode = *i; |
1031 |
mode = *i; |
|
|
| 1075 |
* ...then it's our best choice so far. |
1076 |
* ...then it's our best choice so far. |
| 1076 |
*/ |
1077 |
*/ |
| 1077 |
if (thismode.IsMandatory () |
1078 |
if (thismode.IsMandatory () |
| 1078 |
&& (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1079 |
&& (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
| 1079 |
&& (thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1080 |
&& (thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
|
|
1081 |
&& (thismode.GetConstellationSize (1) <= reqMode.GetConstellationSize (1)) |
| 1080 |
&& ((thismode.GetModulationClass () == reqMode.GetModulationClass ()) |
1082 |
&& ((thismode.GetModulationClass () == reqMode.GetModulationClass ()) |
| 1081 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT) |
1083 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT) |
| 1082 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT))) |
1084 |
|| (reqMode.GetModulationClass () == WIFI_MOD_CLASS_HT))) |
|
|
| 1095 |
{ |
1097 |
{ |
| 1096 |
WifiMode thismode = m_wifiPhy->GetMcs (idx); |
1098 |
WifiMode thismode = m_wifiPhy->GetMcs (idx); |
| 1097 |
if (thismode.IsMandatory () |
1099 |
if (thismode.IsMandatory () |
| 1098 |
&& (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1)) |
1100 |
&& (!found || thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) > mode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1)) |
| 1099 |
&& thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), m_wifiPhy->GetGuardInterval (), 1) |
1101 |
&& thismode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) <= reqMode.GetPhyRate (m_wifiPhy->GetChannelWidth (), 0, 1) |
| 1100 |
&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) |
1102 |
//&& thismode.GetModulationClass () == reqMode.GetModulationClass ()) //TODO: check standard |
| 1101 |
{ |
1103 |
{ |
| 1102 |
mode = thismode; |
1104 |
mode = thismode; |
| 1103 |
//As above; we've found a potentially-suitable transmit |
1105 |
//As above; we've found a potentially-suitable transmit |