|
|
| 390 |
return item->modClass; |
390 |
return item->modClass; |
| 391 |
} |
391 |
} |
| 392 |
|
392 |
|
|
|
393 |
uint64_t |
| 394 |
WifiMode::GetNonHtReferenceRate (uint8_t nss) const |
| 395 |
{ |
| 396 |
uint64_t dataRate; |
| 397 |
struct WifiModeFactory::WifiModeItem *item = WifiModeFactory::GetFactory ()->Get (m_uid); |
| 398 |
if (item->modClass == WIFI_MOD_CLASS_HT || item->modClass == WIFI_MOD_CLASS_VHT) |
| 399 |
{ |
| 400 |
WifiCodeRate codeRate = GetCodeRate(nss); |
| 401 |
switch(GetConstellationSize(nss)) |
| 402 |
{ |
| 403 |
case 2: |
| 404 |
if (codeRate == WIFI_CODE_RATE_1_2) |
| 405 |
dataRate = 6000000; |
| 406 |
else if (codeRate == WIFI_CODE_RATE_3_4) |
| 407 |
dataRate = 9000000; |
| 408 |
else |
| 409 |
NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of coding rate and modulation"); |
| 410 |
break; |
| 411 |
case 4: |
| 412 |
if (codeRate == WIFI_CODE_RATE_1_2) |
| 413 |
dataRate = 12000000; |
| 414 |
else if (codeRate == WIFI_CODE_RATE_3_4) |
| 415 |
dataRate = 18000000; |
| 416 |
else |
| 417 |
NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of coding rate and modulation"); |
| 418 |
break; |
| 419 |
case 16: |
| 420 |
if (codeRate == WIFI_CODE_RATE_1_2) |
| 421 |
dataRate = 24000000; |
| 422 |
else if (codeRate == WIFI_CODE_RATE_3_4) |
| 423 |
dataRate = 36000000; |
| 424 |
else |
| 425 |
NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of coding rate and modulation"); |
| 426 |
break; |
| 427 |
case 64: |
| 428 |
if (codeRate == WIFI_CODE_RATE_1_2 || codeRate == WIFI_CODE_RATE_2_3) |
| 429 |
dataRate = 48000000; |
| 430 |
else if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6) |
| 431 |
dataRate = 54000000; |
| 432 |
else |
| 433 |
NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of coding rate and modulation"); |
| 434 |
break; |
| 435 |
case 256: |
| 436 |
if (codeRate == WIFI_CODE_RATE_3_4 || codeRate == WIFI_CODE_RATE_5_6) |
| 437 |
dataRate = 54000000; |
| 438 |
else |
| 439 |
NS_FATAL_ERROR ("Trying to get reference rate for a MCS with wrong combination of coding rate and modulation"); |
| 440 |
break; |
| 441 |
default: |
| 442 |
NS_FATAL_ERROR ("Wrong constellation size"); |
| 443 |
} |
| 444 |
} |
| 445 |
else |
| 446 |
NS_FATAL_ERROR ("Trying to get reference rate for a non-HT rate"); |
| 447 |
|
| 448 |
return dataRate; |
| 449 |
} |
| 450 |
|
| 393 |
WifiMode::WifiMode () |
451 |
WifiMode::WifiMode () |
| 394 |
: m_uid (0) |
452 |
: m_uid (0) |
| 395 |
{ |
453 |
{ |