Merge "cfg80211: use same IR permissive rules for 6GHz band"
This commit is contained in:
commit
08373630d2
6 changed files with 38 additions and 5 deletions
|
@ -4499,6 +4499,7 @@ enum nl80211_txrate_gi {
|
|||
* @NL80211_BAND_2GHZ: 2.4 GHz ISM band
|
||||
* @NL80211_BAND_5GHZ: around 5 GHz band (4.9 - 5.7 GHz)
|
||||
* @NL80211_BAND_60GHZ: around 60 GHz band (58.32 - 64.80 GHz)
|
||||
* @NL80211_BAND_6GHZ: around 6 GHz band (5.9 - 7.2 GHz)
|
||||
* @NUM_NL80211_BANDS: number of bands, avoid using this in userspace
|
||||
* since newer kernel versions may support more bands
|
||||
*/
|
||||
|
@ -4506,6 +4507,7 @@ enum nl80211_band {
|
|||
NL80211_BAND_2GHZ,
|
||||
NL80211_BAND_5GHZ,
|
||||
NL80211_BAND_60GHZ,
|
||||
NL80211_BAND_6GHZ,
|
||||
|
||||
NUM_NL80211_BANDS,
|
||||
};
|
||||
|
|
|
@ -166,6 +166,7 @@ static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,
|
|||
break;
|
||||
}
|
||||
case NL80211_BAND_5GHZ:
|
||||
case NL80211_BAND_6GHZ:
|
||||
if (r->flags & IEEE80211_RATE_MANDATORY_A)
|
||||
mrate = r->bitrate;
|
||||
break;
|
||||
|
|
|
@ -1050,7 +1050,8 @@ static bool cfg80211_ir_permissive_chan(struct wiphy *wiphy,
|
|||
if (chan == other_chan)
|
||||
return true;
|
||||
|
||||
if (chan->band != NL80211_BAND_5GHZ)
|
||||
if (chan->band != NL80211_BAND_5GHZ &&
|
||||
chan->band != NL80211_BAND_6GHZ)
|
||||
continue;
|
||||
|
||||
r1 = cfg80211_get_unii(chan->center_freq);
|
||||
|
|
|
@ -3829,8 +3829,9 @@ void wiphy_regulatory_deregister(struct wiphy *wiphy)
|
|||
}
|
||||
|
||||
/*
|
||||
* See http://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii, for
|
||||
* UNII band definitions
|
||||
* See FCC notices for UNII band definitions
|
||||
* 5GHz: https://www.fcc.gov/document/5-ghz-unlicensed-spectrum-unii
|
||||
* 6GHz: https://www.fcc.gov/document/fcc-proposes-more-spectrum-unlicensed-use-0
|
||||
*/
|
||||
int cfg80211_get_unii(int freq)
|
||||
{
|
||||
|
@ -3854,6 +3855,22 @@ int cfg80211_get_unii(int freq)
|
|||
if (freq > 5725 && freq <= 5825)
|
||||
return 4;
|
||||
|
||||
/* UNII-5 */
|
||||
if (freq > 5925 && freq <= 6425)
|
||||
return 5;
|
||||
|
||||
/* UNII-6 */
|
||||
if (freq > 6425 && freq <= 6525)
|
||||
return 6;
|
||||
|
||||
/* UNII-7 */
|
||||
if (freq > 6525 && freq <= 6875)
|
||||
return 7;
|
||||
|
||||
/* UNII-8 */
|
||||
if (freq > 6875 && freq <= 7125)
|
||||
return 8;
|
||||
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
|
|
@ -3222,10 +3222,11 @@ TRACE_EVENT(rdev_set_mcast_rate,
|
|||
sizeof(int) * NUM_NL80211_BANDS);
|
||||
),
|
||||
TP_printk(WIPHY_PR_FMT ", " NETDEV_PR_FMT ", "
|
||||
"mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 60GHz=0x%x]",
|
||||
"mcast_rates [2.4GHz=0x%x, 5.2GHz=0x%x, 6GHz=0x%x, 60GHz=0x%x]",
|
||||
WIPHY_PR_ARG, NETDEV_PR_ARG,
|
||||
__entry->mcast_rate[NL80211_BAND_2GHZ],
|
||||
__entry->mcast_rate[NL80211_BAND_5GHZ],
|
||||
__entry->mcast_rate[NL80211_BAND_6GHZ],
|
||||
__entry->mcast_rate[NL80211_BAND_60GHZ])
|
||||
);
|
||||
|
||||
|
|
|
@ -87,6 +87,11 @@ int ieee80211_channel_to_frequency(int chan, enum nl80211_band band)
|
|||
else
|
||||
return 5000 + chan * 5;
|
||||
break;
|
||||
case NL80211_BAND_6GHZ:
|
||||
/* see 802.11ax D4.1 27.3.22.2 */
|
||||
if (chan <= 253)
|
||||
return 5940 + chan * 5;
|
||||
break;
|
||||
case NL80211_BAND_60GHZ:
|
||||
if (chan < 5)
|
||||
return 56160 + chan * 2160;
|
||||
|
@ -107,8 +112,11 @@ int ieee80211_frequency_to_channel(int freq)
|
|||
return (freq - 2407) / 5;
|
||||
else if (freq >= 4910 && freq <= 4980)
|
||||
return (freq - 4000) / 5;
|
||||
else if (freq <= 45000) /* DMG band lower limit */
|
||||
else if (freq < 5940)
|
||||
return (freq - 5000) / 5;
|
||||
else if (freq <= 45000) /* DMG band lower limit */
|
||||
/* see 802.11ax D4.1 27.3.22.2 */
|
||||
return (freq - 5940) / 5;
|
||||
else if (freq >= 58320 && freq <= 64800)
|
||||
return (freq - 56160) / 2160;
|
||||
else
|
||||
|
@ -1481,6 +1489,9 @@ bool ieee80211_operating_class_to_band(u8 operating_class,
|
|||
case 128 ... 130:
|
||||
*band = NL80211_BAND_5GHZ;
|
||||
return true;
|
||||
case 131 ... 135:
|
||||
*band = NL80211_BAND_6GHZ;
|
||||
return true;
|
||||
case 81:
|
||||
case 82:
|
||||
case 83:
|
||||
|
|
Loading…
Reference in a new issue