1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-08 20:25:11 +00:00

Enable the channel 14 and 80 MHz width channels in the regdom

This commit is contained in:
kimocoder 2019-11-13 20:40:05 +01:00
parent ee2beb3494
commit b5fb4d6830

View File

@ -53,26 +53,26 @@ static struct country_code_to_enum_rd allCountries[] = {
/* 5G chan 36 - chan 64 */ /* 5G chan 36 - chan 64 */
#define RTW_5GHZ_5150_5350 \ #define RTW_5GHZ_5150_5350 \
REG_RULE(5150-10, 5350+10, 40, 0, 30, \ REG_RULE(5150-10, 5350+10, 80, 0, 30, \
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
/* 5G chan 100 - chan 165 */ /* 5G chan 100 - chan 165 */
#define RTW_5GHZ_5470_5850 \ #define RTW_5GHZ_5470_5850 \
REG_RULE(5470-10, 5850+10, 40, 0, 30, \ REG_RULE(5470-10, 5850+10, 80, 0, 30, \
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
/* 5G chan 149 - chan 165 */ /* 5G chan 149 - chan 165 */
#define RTW_5GHZ_5725_5850 \ #define RTW_5GHZ_5725_5850 \
REG_RULE(5725-10, 5850+10, 40, 0, 30, \ REG_RULE(5725-10, 5850+10, 80, 0, 30, \
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
/* 5G chan 36 - chan 165 */ /* 5G chan 36 - chan 165 */
#define RTW_5GHZ_5150_5850 \ #define RTW_5GHZ_5150_5850 \
REG_RULE(5150-10, 5850+10, 40, 0, 30, \ REG_RULE(5150-10, 5850+10, 80, 0, 30, \
NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS) NL80211_RRF_PASSIVE_SCAN | NL80211_RRF_NO_IBSS)
static const struct ieee80211_regdomain rtw_regdom_rd = { static const struct ieee80211_regdomain rtw_regdom_rd = {
.n_reg_rules = 3, .n_reg_rules = 4,
.alpha2 = "99", .alpha2 = "99",
.reg_rules = { .reg_rules = {
RTW_2GHZ_CH01_11, RTW_2GHZ_CH01_11,
@ -82,6 +82,7 @@ static const struct ieee80211_regdomain rtw_regdom_rd = {
} }
}; };
#if 0
static const struct ieee80211_regdomain rtw_regdom_11 = { static const struct ieee80211_regdomain rtw_regdom_11 = {
.n_reg_rules = 1, .n_reg_rules = 1,
.alpha2 = "99", .alpha2 = "99",
@ -141,6 +142,7 @@ static const struct ieee80211_regdomain rtw_regdom_14 = {
} }
}; };
#endif
#if 0 #if 0
static struct rtw_regulatory *rtw_regd; static struct rtw_regulatory *rtw_regd;
#endif #endif
@ -257,15 +259,15 @@ static void _rtw_reg_apply_active_scan_flags(struct wiphy *wiphy,
void rtw_regd_apply_flags(struct wiphy *wiphy) void rtw_regd_apply_flags(struct wiphy *wiphy)
{ {
struct dvobj_priv *dvobj = wiphy_to_dvobj(wiphy); struct dvobj_priv *dvobj = wiphy_to_dvobj(wiphy);
struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj); //struct rf_ctl_t *rfctl = dvobj_to_rfctl(dvobj);
RT_CHANNEL_INFO *channel_set = rfctl->channel_set; //RT_CHANNEL_INFO *channel_set = rfctl->channel_set;
u8 max_chan_nums = rfctl->max_chan_nums; //u8 max_chan_nums = rfctl->max_chan_nums;
struct ieee80211_supported_band *sband; struct ieee80211_supported_band *sband;
struct ieee80211_channel *ch; struct ieee80211_channel *ch;
unsigned int i, j; unsigned int i, j;
u16 channel; u16 channel;
u32 freq; //u32 freq;
/* all channels disable */ /* all channels disable */
for (i = 0; i < NUM_NL80211_BANDS; i++) { for (i = 0; i < NUM_NL80211_BANDS; i++) {
@ -276,12 +278,14 @@ void rtw_regd_apply_flags(struct wiphy *wiphy)
ch = &sband->channels[j]; ch = &sband->channels[j];
if (ch) if (ch)
ch->flags = IEEE80211_CHAN_DISABLED; ch->flags &= ~(IEEE80211_CHAN_DISABLED|IEEE80211_CHAN_NO_HT40PLUS|IEEE80211_CHAN_NO_HT40MINUS);
//ch->flags = IEEE80211_CHAN_DISABLED;
} }
} }
} }
/* channels apply by channel plans. */ /* channels apply by channel plans. */
/*
for (i = 0; i < max_chan_nums; i++) { for (i = 0; i < max_chan_nums; i++) {
channel = channel_set[i].ChannelNum; channel = channel_set[i].ChannelNum;
freq = rtw_ch2freq(channel); freq = rtw_ch2freq(channel);
@ -316,8 +320,9 @@ void rtw_regd_apply_flags(struct wiphy *wiphy)
ch->flags |= IEEE80211_CHAN_NO_IR; ch->flags |= IEEE80211_CHAN_NO_IR;
#endif #endif
} }
#endif /* CONFIG_DFS */ #endif CONFIG_DFS
} }
*/
} }
static const struct ieee80211_regdomain *_rtw_regdomain_select(struct static const struct ieee80211_regdomain *_rtw_regdomain_select(struct