MCPcopy Create free account
hub / github.com/F-Stack/f-stack / setbasicrates

Function setbasicrates

freebsd/net80211/ieee80211_proto.c:1303–1335  ·  view source on GitHub ↗

* Mark the basic rates for the rate table based on the * operating mode. For real 11g we mark all the 11b rates * and 6, 12, and 24 OFDM. For 11b compatibility we mark only * 11b rates. There's also a pseudo 11a-mode used to mark only * the basic OFDM rates. */

Source from the content-addressed store, hash-verified

1301 * the basic OFDM rates.
1302 */
1303static void
1304setbasicrates(struct ieee80211_rateset *rs,
1305 enum ieee80211_phymode mode, int add)
1306{
1307 static const struct ieee80211_rateset basic[IEEE80211_MODE_MAX] = {
1308 [IEEE80211_MODE_11A] = { 3, { 12, 24, 48 } },
1309 [IEEE80211_MODE_11B] = { 2, { 2, 4 } },
1310 /* NB: mixed b/g */
1311 [IEEE80211_MODE_11G] = { 4, { 2, 4, 11, 22 } },
1312 [IEEE80211_MODE_TURBO_A] = { 3, { 12, 24, 48 } },
1313 [IEEE80211_MODE_TURBO_G] = { 4, { 2, 4, 11, 22 } },
1314 [IEEE80211_MODE_STURBO_A] = { 3, { 12, 24, 48 } },
1315 [IEEE80211_MODE_HALF] = { 3, { 6, 12, 24 } },
1316 [IEEE80211_MODE_QUARTER] = { 3, { 3, 6, 12 } },
1317 [IEEE80211_MODE_11NA] = { 3, { 12, 24, 48 } },
1318 /* NB: mixed b/g */
1319 [IEEE80211_MODE_11NG] = { 4, { 2, 4, 11, 22 } },
1320 /* NB: mixed b/g */
1321 [IEEE80211_MODE_VHT_2GHZ] = { 4, { 2, 4, 11, 22 } },
1322 [IEEE80211_MODE_VHT_5GHZ] = { 3, { 12, 24, 48 } },
1323 };
1324 int i, j;
1325
1326 for (i = 0; i < rs->rs_nrates; i++) {
1327 if (!add)
1328 rs->rs_rates[i] &= IEEE80211_RATE_VAL;
1329 for (j = 0; j < basic[mode].rs_nrates; j++)
1330 if (basic[mode].rs_rates[j] == rs->rs_rates[i]) {
1331 rs->rs_rates[i] |= IEEE80211_RATE_BASIC;
1332 break;
1333 }
1334 }
1335}
1336
1337/*
1338 * Set the basic rates in a rate set.

Callers 2

ieee80211_setbasicratesFunction · 0.85
ieee80211_addbasicratesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected