View | Details | Raw Unified | Return to bug 3003
Collapse All | Expand All

(-)a/src/wifi/model/mac-low.cc (-3 / +176 lines)
 Lines 1145-1166    Link Here 
1145
  return m_stationManager->GetDataTxVector (to, hdr, packet);
1145
  return m_stationManager->GetDataTxVector (to, hdr, packet);
1146
}
1146
}
1147
1147
1148
WifiMode
1149
MacLow::GetControlAnswerMode (WifiMode reqMode) const
1150
{
1151
  /**
1152
   * The standard has relatively unambiguous rules for selecting a
1153
   * control response rate (the below is quoted from IEEE 802.11-2012,
1154
   * Section 9.7):
1155
   *
1156
   * To allow the transmitting STA to calculate the contents of the
1157
   * Duration/ID field, a STA responding to a received frame shall
1158
   * transmit its Control Response frame (either CTS or ACK), other
1159
   * than the BlockAck control frame, at the highest rate in the
1160
   * BSSBasicRateSet parameter that is less than or equal to the
1161
   * rate of the immediately previous frame in the frame exchange
1162
   * sequence (as defined in Annex G) and that is of the same
1163
   * modulation class (see Section 9.7.8) as the received frame...
1164
   */
1165
  NS_LOG_FUNCTION (this << reqMode);
1166
  WifiMode mode = m_stationManager->GetDefaultMode ();
1167
  bool found = false;
1168
  //First, search the BSS Basic Rate set
1169
  for (uint8_t i = 0; i < m_stationManager->GetNBasicModes (); i++)
1170
    {
1171
      WifiMode testMode = m_stationManager->GetBasicMode (i);
1172
      if ((!found || testMode.IsHigherDataRate (mode))
1173
          && (!testMode.IsHigherDataRate (reqMode))
1174
          && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), testMode.GetModulationClass ())))
1175
        {
1176
          mode = testMode;
1177
          //We've found a potentially-suitable transmit rate, but we
1178
          //need to continue and consider all the basic rates before
1179
          //we can be sure we've got the right one.
1180
          found = true;
1181
        }
1182
    }
1183
  if (m_stationManager->GetHtSupported () || m_stationManager->GetVhtSupported () || m_stationManager->GetHeSupported ())
1184
    {
1185
      if (!found)
1186
        {
1187
          mode = m_stationManager->GetDefaultMcs ();
1188
          for (uint8_t i = 0; i != m_stationManager->GetNBasicMcs (); i++)
1189
            {
1190
              WifiMode testMode = m_stationManager->GetBasicMcs (i);
1191
              if ((!found || testMode.IsHigherDataRate (mode))
1192
                  && (!testMode.IsHigherDataRate (reqMode))
1193
                  && (testMode.GetModulationClass () == reqMode.GetModulationClass ()))
1194
                {
1195
                  mode = testMode;
1196
                  //We've found a potentially-suitable transmit rate, but we
1197
                  //need to continue and consider all the basic rates before
1198
                  //we can be sure we've got the right one.
1199
                  found = true;
1200
                }
1201
            }
1202
        }
1203
    }
1204
  //If we found a suitable rate in the BSSBasicRateSet, then we are
1205
  //done and can return that mode.
1206
  if (found)
1207
    {
1208
      NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1209
      return mode;
1210
    }
1211
1212
  /**
1213
   * If no suitable basic rate was found, we search the mandatory
1214
   * rates. The standard (IEEE 802.11-2007, Section 9.6) says:
1215
   *
1216
   *   ...If no rate contained in the BSSBasicRateSet parameter meets
1217
   *   these conditions, then the control frame sent in response to a
1218
   *   received frame shall be transmitted at the highest mandatory
1219
   *   rate of the PHY that is less than or equal to the rate of the
1220
   *   received frame, and that is of the same modulation class as the
1221
   *   received frame. In addition, the Control Response frame shall
1222
   *   be sent using the same PHY options as the received frame,
1223
   *   unless they conflict with the requirement to use the
1224
   *   BSSBasicRateSet parameter.
1225
   *
1226
   * \todo Note that we're ignoring the last sentence for now, because
1227
   * there is not yet any manipulation here of PHY options.
1228
   */
1229
  for (uint8_t idx = 0; idx < m_phy->GetNModes (); idx++)
1230
    {
1231
      WifiMode thismode = m_phy->GetMode (idx);
1232
      /* If the rate:
1233
       *
1234
       *  - is a mandatory rate for the PHY, and
1235
       *  - is equal to or faster than our current best choice, and
1236
       *  - is less than or equal to the rate of the received frame, and
1237
       *  - is of the same modulation class as the received frame
1238
       *
1239
       * ...then it's our best choice so far.
1240
       */
1241
      if (thismode.IsMandatory ()
1242
          && (!found || thismode.IsHigherDataRate (mode))
1243
          && (!thismode.IsHigherDataRate (reqMode))
1244
          && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), thismode.GetModulationClass ())))
1245
        {
1246
          mode = thismode;
1247
          //As above; we've found a potentially-suitable transmit
1248
          //rate, but we need to continue and consider all the
1249
          //mandatory rates before we can be sure we've got the right one.
1250
          found = true;
1251
        }
1252
    }
1253
  if (m_stationManager->GetHtSupported () || m_stationManager->GetVhtSupported () || m_stationManager->GetHeSupported ())
1254
    {
1255
      for (uint8_t idx = 0; idx < m_phy->GetNMcs (); idx++)
1256
        {
1257
          WifiMode thismode = m_phy->GetMcs (idx);
1258
          if (thismode.IsMandatory ()
1259
              && (!found || thismode.IsHigherDataRate (mode))
1260
              && (!thismode.IsHigherCodeRate (reqMode))
1261
              && (thismode.GetModulationClass () == reqMode.GetModulationClass ()))
1262
            {
1263
              mode = thismode;
1264
              //As above; we've found a potentially-suitable transmit
1265
              //rate, but we need to continue and consider all the
1266
              //mandatory rates before we can be sure we've got the right one.
1267
              found = true;
1268
            }
1269
        }
1270
    }
1271
1272
  /**
1273
   * If we still haven't found a suitable rate for the response then
1274
   * someone has messed up the simulation config. This probably means
1275
   * that the WifiPhyStandard is not set correctly, or that a rate that
1276
   * is not supported by the PHY has been explicitly requested in a
1277
   * WifiRemoteStationManager (or descendant) configuration.
1278
   *
1279
   * Either way, it is serious - we can either disobey the standard or
1280
   * fail, and I have chosen to do the latter...
1281
   */
1282
  if (!found)
1283
    {
1284
      NS_FATAL_ERROR ("Can't find response rate for " << reqMode);
1285
    }
1286
1287
  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1288
  return mode;
1289
}
1290
1148
WifiTxVector
1291
WifiTxVector
1149
MacLow::GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const
1292
MacLow::GetCtsTxVector (Mac48Address to, WifiMode rtsTxMode) const
1150
{
1293
{
1151
  return m_stationManager->GetCtsTxVector (to, rtsTxMode);
1294
  NS_ASSERT (!to.IsGroup ());
1295
  WifiMode ctsMode = GetControlAnswerMode (rtsTxMode);
1296
  WifiTxVector v;
1297
  v.SetMode (ctsMode);
1298
  v.SetPreambleType (GetPreambleForTransmission (ctsMode.GetModulationClass (), m_stationManager->GetShortPreambleEnabled (), m_stationManager->UseGreenfieldForDestination (to)));
1299
  v.SetTxPowerLevel (m_stationManager->GetDefaultTxPowerLevel ());
1300
  v.SetChannelWidth (GetChannelWidthForTransmission (ctsMode, m_phy->GetChannelWidth ()));
1301
   uint16_t ctsTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ctsMode, m_phy->GetShortGuardInterval (), m_phy->GetGuardInterval ());
1302
  v.SetGuardInterval (ctsTxGuardInterval);
1303
  v.SetNss (1);
1304
  return v;
1152
}
1305
}
1153
1306
1154
WifiTxVector
1307
WifiTxVector
1155
MacLow::GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const
1308
MacLow::GetAckTxVector (Mac48Address to, WifiMode dataTxMode) const
1156
{
1309
{
1157
  return m_stationManager->GetAckTxVector (to, dataTxMode);
1310
  NS_ASSERT (!to.IsGroup ());
1311
  WifiMode ackMode = GetControlAnswerMode (dataTxMode);
1312
  WifiTxVector v;
1313
  v.SetMode (ackMode);
1314
  v.SetPreambleType (GetPreambleForTransmission (ackMode.GetModulationClass (), m_stationManager->GetShortPreambleEnabled (), m_stationManager->UseGreenfieldForDestination (to)));
1315
  v.SetTxPowerLevel (m_stationManager->GetDefaultTxPowerLevel ());
1316
  v.SetChannelWidth (GetChannelWidthForTransmission (ackMode, m_phy->GetChannelWidth ()));
1317
   uint16_t ackTxGuardInterval = ConvertGuardIntervalToNanoSeconds (ackMode, m_phy->GetShortGuardInterval (), m_phy->GetGuardInterval ());
1318
  v.SetGuardInterval (ackTxGuardInterval);
1319
  v.SetNss (1);
1320
  return v;
1158
}
1321
}
1159
1322
1160
WifiTxVector
1323
WifiTxVector
1161
MacLow::GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const
1324
MacLow::GetBlockAckTxVector (Mac48Address to, WifiMode dataTxMode) const
1162
{
1325
{
1163
  return m_stationManager->GetBlockAckTxVector (to, dataTxMode);
1326
  NS_ASSERT (!to.IsGroup ());
1327
  WifiMode blockAckMode = GetControlAnswerMode (dataTxMode);
1328
  WifiTxVector v;
1329
  v.SetMode (blockAckMode);
1330
  v.SetPreambleType (GetPreambleForTransmission (blockAckMode.GetModulationClass (), m_stationManager->GetShortPreambleEnabled (), m_stationManager->UseGreenfieldForDestination (to)));
1331
  v.SetTxPowerLevel (m_stationManager->GetDefaultTxPowerLevel ());
1332
  v.SetChannelWidth (GetChannelWidthForTransmission (blockAckMode, m_phy->GetChannelWidth ()));
1333
uint16_t blockAckTxGuardInterval = ConvertGuardIntervalToNanoSeconds (blockAckMode, m_phy->GetShortGuardInterval (), m_phy->GetGuardInterval ());
1334
  v.SetGuardInterval (blockAckTxGuardInterval);
1335
  v.SetNss (1);
1336
  return v;
1164
}
1337
}
1165
1338
1166
WifiTxVector
1339
WifiTxVector
(-)a/src/wifi/model/mac-low.h (+8 lines)
 Lines 542-547    Link Here 
542
   */
542
   */
543
  WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const;
543
  WifiTxVector GetAckTxVectorForData (Mac48Address to, WifiMode dataTxMode) const;
544
  /**
544
  /**
545
   * Get control answer mode function.
546
   *
547
   * \param reqMode request mode
548
   *
549
   * \return control answer mode
550
   */
551
  WifiMode GetControlAnswerMode (WifiMode reqMode) const;
552
  /**
545
   * Return the time required to transmit the CTS (including preamble and FCS).
553
   * Return the time required to transmit the CTS (including preamble and FCS).
546
   *
554
   *
547
   * \param ctsTxVector
555
   * \param ctsTxVector
(-)a/src/wifi/model/wifi-remote-station-manager.cc (-282 lines)
 Lines 1055-1342    Link Here 
1055
  return isLast;
1055
  return isLast;
1056
}
1056
}
1057
1057
1058
WifiMode
1059
WifiRemoteStationManager::GetControlAnswerMode (WifiMode reqMode)
1060
{
1061
  /**
1062
   * The standard has relatively unambiguous rules for selecting a
1063
   * control response rate (the below is quoted from IEEE 802.11-2012,
1064
   * Section 9.7):
1065
   *
1066
   * To allow the transmitting STA to calculate the contents of the
1067
   * Duration/ID field, a STA responding to a received frame shall
1068
   * transmit its Control Response frame (either CTS or ACK), other
1069
   * than the BlockAck control frame, at the highest rate in the
1070
   * BSSBasicRateSet parameter that is less than or equal to the
1071
   * rate of the immediately previous frame in the frame exchange
1072
   * sequence (as defined in Annex G) and that is of the same
1073
   * modulation class (see Section 9.7.8) as the received frame...
1074
   */
1075
  NS_LOG_FUNCTION (this << reqMode);
1076
  WifiMode mode = GetDefaultMode ();
1077
  bool found = false;
1078
  //First, search the BSS Basic Rate set
1079
  for (WifiModeListIterator i = m_bssBasicRateSet.begin (); i != m_bssBasicRateSet.end (); i++)
1080
    {
1081
      if ((!found || i->IsHigherDataRate (mode))
1082
          && (!i->IsHigherDataRate (reqMode))
1083
          && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), i->GetModulationClass ())))
1084
        {
1085
          mode = *i;
1086
          //We've found a potentially-suitable transmit rate, but we
1087
          //need to continue and consider all the basic rates before
1088
          //we can be sure we've got the right one.
1089
          found = true;
1090
        }
1091
    }
1092
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
1093
    {
1094
      if (!found)
1095
        {
1096
          mode = GetDefaultMcs ();
1097
          for (WifiModeListIterator i = m_bssBasicMcsSet.begin (); i != m_bssBasicMcsSet.end (); i++)
1098
            {
1099
              if ((!found || i->IsHigherDataRate (mode))
1100
                  && (!i->IsHigherDataRate (reqMode))
1101
                  && (i->GetModulationClass () == reqMode.GetModulationClass ()))
1102
                {
1103
                  mode = *i;
1104
                  //We've found a potentially-suitable transmit rate, but we
1105
                  //need to continue and consider all the basic rates before
1106
                  //we can be sure we've got the right one.
1107
                  found = true;
1108
                }
1109
            }
1110
        }
1111
    }
1112
  //If we found a suitable rate in the BSSBasicRateSet, then we are
1113
  //done and can return that mode.
1114
  if (found)
1115
    {
1116
      NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1117
      return mode;
1118
    }
1119
1120
  /**
1121
   * If no suitable basic rate was found, we search the mandatory
1122
   * rates. The standard (IEEE 802.11-2007, Section 9.6) says:
1123
   *
1124
   *   ...If no rate contained in the BSSBasicRateSet parameter meets
1125
   *   these conditions, then the control frame sent in response to a
1126
   *   received frame shall be transmitted at the highest mandatory
1127
   *   rate of the PHY that is less than or equal to the rate of the
1128
   *   received frame, and that is of the same modulation class as the
1129
   *   received frame. In addition, the Control Response frame shall
1130
   *   be sent using the same PHY options as the received frame,
1131
   *   unless they conflict with the requirement to use the
1132
   *   BSSBasicRateSet parameter.
1133
   *
1134
   * \todo Note that we're ignoring the last sentence for now, because
1135
   * there is not yet any manipulation here of PHY options.
1136
   */
1137
  for (uint8_t idx = 0; idx < m_wifiPhy->GetNModes (); idx++)
1138
    {
1139
      WifiMode thismode = m_wifiPhy->GetMode (idx);
1140
      /* If the rate:
1141
       *
1142
       *  - is a mandatory rate for the PHY, and
1143
       *  - is equal to or faster than our current best choice, and
1144
       *  - is less than or equal to the rate of the received frame, and
1145
       *  - is of the same modulation class as the received frame
1146
       *
1147
       * ...then it's our best choice so far.
1148
       */
1149
      if (thismode.IsMandatory ()
1150
          && (!found || thismode.IsHigherDataRate (mode))
1151
          && (!thismode.IsHigherDataRate (reqMode))
1152
          && (IsAllowedControlAnswerModulationClass (reqMode.GetModulationClass (), thismode.GetModulationClass ())))
1153
        {
1154
          mode = thismode;
1155
          //As above; we've found a potentially-suitable transmit
1156
          //rate, but we need to continue and consider all the
1157
          //mandatory rates before we can be sure we've got the right one.
1158
          found = true;
1159
        }
1160
    }
1161
  if (GetHtSupported () || GetVhtSupported () || GetHeSupported ())
1162
    {
1163
      for (uint8_t idx = 0; idx < m_wifiPhy->GetNMcs (); idx++)
1164
        {
1165
          WifiMode thismode = m_wifiPhy->GetMcs (idx);
1166
          if (thismode.IsMandatory ()
1167
              && (!found || thismode.IsHigherDataRate (mode))
1168
              && (!thismode.IsHigherCodeRate (reqMode))
1169
              && (thismode.GetModulationClass () == reqMode.GetModulationClass ()))
1170
            {
1171
              mode = thismode;
1172
              //As above; we've found a potentially-suitable transmit
1173
              //rate, but we need to continue and consider all the
1174
              //mandatory rates before we can be sure we've got the right one.
1175
              found = true;
1176
            }
1177
        }
1178
    }
1179
1180
  /**
1181
   * If we still haven't found a suitable rate for the response then
1182
   * someone has messed up the simulation config. This probably means
1183
   * that the WifiPhyStandard is not set correctly, or that a rate that
1184
   * is not supported by the PHY has been explicitly requested in a
1185
   * WifiRemoteStationManager (or descendant) configuration.
1186
   *
1187
   * Either way, it is serious - we can either disobey the standard or
1188
   * fail, and I have chosen to do the latter...
1189
   */
1190
  if (!found)
1191
    {
1192
      NS_FATAL_ERROR ("Can't find response rate for " << reqMode);
1193
    }
1194
1195
  NS_LOG_DEBUG ("WifiRemoteStationManager::GetControlAnswerMode returning " << mode);
1196
  return mode;
1197
}
1198
1199
WifiTxVector
1200
WifiRemoteStationManager::GetCtsTxVector (Mac48Address address, WifiMode rtsMode)
1201
{
1202
  NS_ASSERT (!address.IsGroup ());
1203
  WifiMode ctsMode = GetControlAnswerMode (rtsMode);
1204
  WifiTxVector v;
1205
  v.SetMode (ctsMode);
1206
  v.SetPreambleType (GetPreambleForTransmission (ctsMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1207
  v.SetTxPowerLevel (DoGetCtsTxPowerLevel (address, ctsMode));
1208
  v.SetChannelWidth (GetChannelWidthForTransmission (ctsMode, DoGetCtsTxChannelWidth (address, ctsMode)));
1209
  v.SetGuardInterval (DoGetCtsTxGuardInterval (address, ctsMode));
1210
  v.SetNss (DoGetCtsTxNss (address, ctsMode));
1211
  v.SetNess (DoGetCtsTxNess (address, ctsMode));
1212
  v.SetStbc (0);
1213
  return v;
1214
}
1215
1216
WifiTxVector
1217
WifiRemoteStationManager::GetAckTxVector (Mac48Address address, WifiMode dataMode)
1218
{
1219
  NS_ASSERT (!address.IsGroup ());
1220
  WifiMode ackMode = GetControlAnswerMode (dataMode);
1221
  WifiTxVector v;
1222
  v.SetMode (ackMode);
1223
  v.SetPreambleType (GetPreambleForTransmission (ackMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1224
  v.SetTxPowerLevel (DoGetAckTxPowerLevel (address, ackMode));
1225
  v.SetChannelWidth (GetChannelWidthForTransmission (ackMode, DoGetAckTxChannelWidth (address, ackMode)));
1226
  v.SetGuardInterval (DoGetAckTxGuardInterval (address, ackMode));
1227
  v.SetNss (DoGetAckTxNss (address, ackMode));
1228
  v.SetNess (DoGetAckTxNess (address, ackMode));
1229
  v.SetStbc (0);
1230
  return v;
1231
}
1232
1233
WifiTxVector
1234
WifiRemoteStationManager::GetBlockAckTxVector (Mac48Address address, WifiMode blockAckReqMode)
1235
{
1236
  NS_ASSERT (!address.IsGroup ());
1237
  WifiMode blockAckMode = GetControlAnswerMode (blockAckReqMode);
1238
  WifiTxVector v;
1239
  v.SetMode (blockAckMode);
1240
  v.SetPreambleType (GetPreambleForTransmission (blockAckMode.GetModulationClass (), GetShortPreambleEnabled (), UseGreenfieldForDestination (address)));
1241
  v.SetTxPowerLevel (DoGetBlockAckTxPowerLevel (address, blockAckMode));
1242
  v.SetChannelWidth (GetChannelWidthForTransmission (blockAckMode, DoGetBlockAckTxChannelWidth (address, blockAckMode)));
1243
  v.SetGuardInterval (DoGetBlockAckTxGuardInterval (address, blockAckMode));
1244
  v.SetNss (DoGetBlockAckTxNss (address, blockAckMode));
1245
  v.SetNess (DoGetBlockAckTxNess (address, blockAckMode));
1246
  v.SetStbc (0);
1247
  return v;
1248
}
1249
1250
uint8_t
1251
WifiRemoteStationManager::DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode)
1252
{
1253
  return m_defaultTxPowerLevel;
1254
}
1255
1256
uint16_t
1257
WifiRemoteStationManager::DoGetCtsTxChannelWidth (Mac48Address address, WifiMode ctsMode)
1258
{
1259
  return m_wifiPhy->GetChannelWidth ();
1260
}
1261
1262
uint16_t
1263
WifiRemoteStationManager::DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode)
1264
{
1265
  return ConvertGuardIntervalToNanoSeconds (ctsMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1266
}
1267
1268
uint8_t
1269
WifiRemoteStationManager::DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode)
1270
{
1271
  return 1;
1272
}
1273
1274
uint8_t
1275
WifiRemoteStationManager::DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode)
1276
{
1277
  return 0;
1278
}
1279
1280
uint8_t
1281
WifiRemoteStationManager::DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode)
1282
{
1283
  return m_defaultTxPowerLevel;
1284
}
1285
1286
uint16_t
1287
WifiRemoteStationManager::DoGetAckTxChannelWidth (Mac48Address address, WifiMode ctsMode)
1288
{
1289
  return m_wifiPhy->GetChannelWidth ();
1290
}
1291
1292
uint16_t
1293
WifiRemoteStationManager::DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode)
1294
{
1295
  return ConvertGuardIntervalToNanoSeconds (ackMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1296
}
1297
1298
uint8_t
1299
WifiRemoteStationManager::DoGetAckTxNss (Mac48Address address, WifiMode ackMode)
1300
{
1301
  return 1;
1302
}
1303
1304
uint8_t
1305
WifiRemoteStationManager::DoGetAckTxNess (Mac48Address address, WifiMode ackMode)
1306
{
1307
  return 0;
1308
}
1309
1310
uint8_t
1311
WifiRemoteStationManager::DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode)
1312
{
1313
  return m_defaultTxPowerLevel;
1314
}
1315
1316
uint16_t
1317
WifiRemoteStationManager::DoGetBlockAckTxChannelWidth (Mac48Address address, WifiMode ctsMode)
1318
{
1319
  return m_wifiPhy->GetChannelWidth ();
1320
}
1321
1322
uint16_t
1323
WifiRemoteStationManager::DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode)
1324
{
1325
  return ConvertGuardIntervalToNanoSeconds (blockAckMode, DynamicCast<WifiNetDevice> (m_wifiPhy->GetDevice ()));
1326
}
1327
1328
uint8_t
1329
WifiRemoteStationManager::DoGetBlockAckTxNss (Mac48Address address, WifiMode blockAckMode)
1330
{
1331
  return 1;
1332
}
1333
1334
uint8_t
1335
WifiRemoteStationManager::DoGetBlockAckTxNess (Mac48Address address, WifiMode blockAckMode)
1336
{
1337
  return 0;
1338
}
1339
1340
uint8_t
1058
uint8_t
1341
WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const
1059
WifiRemoteStationManager::GetDefaultTxPowerLevel (void) const
1342
{
1060
{
(-)a/src/wifi/model/wifi-remote-station-manager.h (-144 / +8 lines)
 Lines 849-875    Link Here 
849
                       Ptr<const Packet> packet, uint32_t fragmentNumber);
849
                       Ptr<const Packet> packet, uint32_t fragmentNumber);
850
850
851
  /**
851
  /**
852
   * \param address remote address
853
   * \param rtsMode the transmission mode used to send an RTS we just received
854
   *
855
   * \return the transmission mode to use for the CTS to complete the RTS/CTS handshake.
856
   */
857
  WifiTxVector GetCtsTxVector (Mac48Address address, WifiMode rtsMode);
858
  /**
859
   * \param address
860
   * \param dataMode the transmission mode used to send an ACK we just received
861
   *
862
   * \return the transmission mode to use for the ACK to complete the data/ACK handshake.
863
   */
864
  WifiTxVector GetAckTxVector (Mac48Address address, WifiMode dataMode);
865
  /**
866
   * \param address
867
   * \param dataMode the transmission mode used to send an ACK we just received
868
   *
869
   * \return the transmission mode to use for the ACK to complete the data/ACK handshake.
870
   */
871
  WifiTxVector GetBlockAckTxVector (Mac48Address address, WifiMode dataMode);
872
  /**
873
   * \return the default transmission power
852
   * \return the default transmission power
874
   */
853
   */
875
  uint8_t GetDefaultTxPowerLevel (void) const;
854
  uint8_t GetDefaultTxPowerLevel (void) const;
 Lines 893-898    Link Here 
893
   * \return the maximum number of spatial streams supported by the phy layer
872
   * \return the maximum number of spatial streams supported by the phy layer
894
   */
873
   */
895
  uint8_t GetMaxNumberOfTransmitStreams (void) const;
874
  uint8_t GetMaxNumberOfTransmitStreams (void) const;
875
  /**
876
   * \returns whether HT greenfield should be used for a given destination address.
877
   *
878
   * \param dest the destination address
879
   *
880
   * \return whether HT greenfield should be used for a given destination address
881
   */
882
  bool UseGreenfieldForDestination (Mac48Address dest) const;
896
883
897
  /**
884
  /**
898
   * TracedCallback signature for power change events.
885
   * TracedCallback signature for power change events.
 Lines 1071-1084    Link Here 
1071
   * \return the number of Ness the station has
1058
   * \return the number of Ness the station has
1072
   */
1059
   */
1073
  uint8_t GetNess (const WifiRemoteStation *station) const;
1060
  uint8_t GetNess (const WifiRemoteStation *station) const;
1074
  /**
1075
   * \returns whether HT greenfield should be used for a given destination address.
1076
   *
1077
   * \param dest the destination address
1078
   *
1079
   * \return whether HT greenfield should be used for a given destination address
1080
   */
1081
  bool UseGreenfieldForDestination (Mac48Address dest) const;
1082
1061
1083
  /**
1062
  /**
1084
   * Return the WifiPhy.
1063
   * Return the WifiPhy.
 Lines 1163-1274    Link Here 
1163
   *       to decide which transmission mode to use for the rts.
1142
   *       to decide which transmission mode to use for the rts.
1164
   */
1143
   */
1165
  virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) = 0;
1144
  virtual WifiTxVector DoGetRtsTxVector (WifiRemoteStation *station) = 0;
1166
  /**
1167
   * \param address the address of the recipient of the CTS
1168
   * \param ctsMode the mode to be used for the CTS
1169
   *
1170
   * \return the power level to be used to send the CTS
1171
   */
1172
  virtual uint8_t DoGetCtsTxPowerLevel (Mac48Address address, WifiMode ctsMode);
1173
  /**
1174
   * \param address the address of the recipient of the ACK
1175
   * \param ackMode the mode to be used for the ACK
1176
   *
1177
   * \return the power level to be used to send the ACK
1178
   */
1179
  virtual uint8_t DoGetAckTxPowerLevel (Mac48Address address, WifiMode ackMode);
1180
  /**
1181
   * \param address the address of the recipient of the Block ACK
1182
   * \param blockAckMode the mode to be used for the Block ACK
1183
   *
1184
   * \return the power level to be used to send the Block ACK
1185
   */
1186
  virtual uint8_t DoGetBlockAckTxPowerLevel (Mac48Address address, WifiMode blockAckMode);
1187
1188
  /**
1189
   * \param address the address of the recipient
1190
   * \param ctsMode the mode to be used
1191
   *
1192
   * \return the CTS transmit channel width
1193
   */
1194
  virtual uint16_t DoGetCtsTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1195
  /**
1196
   * \param address the address of the recipient
1197
   * \param ctsMode the mode to be used
1198
   *
1199
   * \return the CTS transmit guard interval
1200
   */
1201
  virtual uint16_t DoGetCtsTxGuardInterval (Mac48Address address, WifiMode ctsMode);
1202
  /**
1203
   * \param address the address of the recipient
1204
   * \param ctsMode the mode to be used
1205
   *
1206
   * \return the CTS transmit NSS
1207
   */
1208
  virtual uint8_t DoGetCtsTxNss (Mac48Address address, WifiMode ctsMode);
1209
  /**
1210
   * \param address the address of the recipient
1211
   * \param ctsMode the mode to be used
1212
   *
1213
   * \return the CTS transmit NESS
1214
   */
1215
  virtual uint8_t DoGetCtsTxNess (Mac48Address address, WifiMode ctsMode);
1216
  /**
1217
   * \param address the address of the recipient
1218
   * \param ctsMode the mode to be used
1219
   *
1220
   * \return the ack transmit channel width
1221
   */
1222
  virtual uint16_t DoGetAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1223
  /**
1224
   * \param address the address of the recipient
1225
   * \param ackMode the mode to be used
1226
   *
1227
   * \return the ack transmit guard interval
1228
   */
1229
  virtual uint16_t DoGetAckTxGuardInterval (Mac48Address address, WifiMode ackMode);
1230
  /**
1231
   * \param address the address of the recipient
1232
   * \param ackMode the mode to be used
1233
   *
1234
   * \return the ack transmit NSS
1235
   */
1236
  virtual uint8_t DoGetAckTxNss (Mac48Address address, WifiMode ackMode);
1237
  /**
1238
   * \param address the address of the recipient
1239
   * \param ackMode the mode to be used
1240
   *
1241
   * \return the ack transmit NESS
1242
   */
1243
  virtual uint8_t DoGetAckTxNess (Mac48Address address, WifiMode ackMode);
1244
  /**
1245
   * \param address the address of the recipient
1246
   * \param ctsMode the mode to be used
1247
   *
1248
   * \return the block ack transmit channel width
1249
   */
1250
  virtual uint16_t DoGetBlockAckTxChannelWidth (Mac48Address address, WifiMode ctsMode);
1251
  /**
1252
   * \param address the address of the recipient
1253
   * \param blockAckMode the mode to be used
1254
   *
1255
   * \return the block ack transmit guard interval
1256
   */
1257
  virtual uint16_t DoGetBlockAckTxGuardInterval (Mac48Address address, WifiMode blockAckMode);
1258
  /**
1259
   * \param address the address of the recipient
1260
   * \param blockAckMode the mode to be used
1261
   *
1262
   * \return the block ack transmit NSS
1263
   */
1264
  virtual uint8_t DoGetBlockAckTxNss (Mac48Address address, WifiMode blockAckMode);
1265
  /**
1266
   * \param address the address of the recipient
1267
   * \param blockAckMode the mode to be used
1268
   *
1269
   * \return the block ack transmit NESS
1270
   */
1271
  virtual uint8_t DoGetBlockAckTxNess (Mac48Address address, WifiMode blockAckMode);
1272
1145
1273
  /**
1146
  /**
1274
   * This method is a pure virtual method that must be implemented by the sub-class.
1147
   * This method is a pure virtual method that must be implemented by the sub-class.
 Lines 1374-1388    Link Here 
1374
  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1247
  WifiRemoteStation* Lookup (Mac48Address address, const WifiMacHeader *header) const;
1375
1248
1376
  /**
1249
  /**
1377
   * Get control answer mode function.
1378
   *
1379
   * \param reqMode request mode
1380
   *
1381
   * \return control answer mode
1382
   */
1383
  WifiMode GetControlAnswerMode (WifiMode reqMode);
1384
1385
  /**
1386
   * Actually sets the fragmentation threshold, it also checks the validity of
1250
   * Actually sets the fragmentation threshold, it also checks the validity of
1387
   * the given threshold.
1251
   * the given threshold.
1388
   *
1252
   *

Return to bug 3003