Add missing 5GHz channels

This commit is contained in:
astsam 2021-01-25 09:20:58 +03:00
parent 0893f2cead
commit 5e66b8754f
5 changed files with 23 additions and 14 deletions

View File

@ -58,6 +58,8 @@ u8 center_ch_5g_all[CENTER_CH_5G_ALL_NUM] = {
/* G02 */52, 54, 56,
58,
/* G03 */60, 62, 64,
68, 72, 76, 80,
84, 88, 92, 96,
/* G04 */100, 102, 104,
106,
/* G05 */108, 110, 112,
@ -82,6 +84,8 @@ u8 center_ch_5g_20m[CENTER_CH_5G_20M_NUM] = {
/* G01 */44, 48,
/* G02 */52, 56,
/* G03 */60, 64,
68, 72, 76, 80,
84, 88, 92, 96,
/* G04 */100, 104,
/* G05 */108, 112,
/* G06 */116, 120,
@ -111,6 +115,7 @@ u8 center_ch_5g_40m[CENTER_CH_5G_40M_NUM] = {
/* G13 */175
};
#if 0
u8 center_ch_5g_20m_40m[CENTER_CH_5G_20M_NUM + CENTER_CH_5G_40M_NUM] = {
/* G00 */36, 38, 40,
/* G01 */44, 46, 48,
@ -127,6 +132,7 @@ u8 center_ch_5g_20m_40m[CENTER_CH_5G_20M_NUM + CENTER_CH_5G_40M_NUM] = {
/* G12 */165, 167, 169,
/* G13 */173, 175, 177
};
#endif
u8 op_chs_of_cch_5g_40m[CENTER_CH_5G_40M_NUM][2] = {
{36, 40}, /* 38 */
@ -382,9 +388,9 @@ u8 rtw_get_ch_group(u8 ch, u8 *group, u8 *cck_group)
gp = 1;
else if (50 <= ch && ch <= 58)
gp = 2;
else if (60 <= ch && ch <= 64)
else if (60 <= ch && ch <= 80)
gp = 3;
else if (100 <= ch && ch <= 106)
else if (82 <= ch && ch <= 106)
gp = 4;
else if (108 <= ch && ch <= 114)
gp = 5;

View File

@ -595,7 +595,6 @@ void set_channel_bwmode(_adapter *padapter, unsigned char channel, unsigned char
RTW_INFO("[%s] ch = %d, offset = %d, bwmode = %d\n", __func__, channel, channel_offset, bwmode);
center_ch = rtw_get_center_ch(channel, bwmode, channel_offset);
if (bwmode == CHANNEL_WIDTH_80) {
if (center_ch > channel)
chnl_offset80 = HAL_PRIME_CHNL_OFFSET_LOWER;

View File

@ -1798,9 +1798,9 @@ phy_SwChnl8812(
/* fc_area */
if (36 <= channelToSW && channelToSW <= 48)
phy_set_bb_reg(pAdapter, rFc_area_Jaguar, 0x1ffe0000, 0x494);
else if (50 <= channelToSW && channelToSW <= 64)
else if (50 <= channelToSW && channelToSW <= 80)
phy_set_bb_reg(pAdapter, rFc_area_Jaguar, 0x1ffe0000, 0x453);
else if (100 <= channelToSW && channelToSW <= 116)
else if (82 <= channelToSW && channelToSW <= 116)
phy_set_bb_reg(pAdapter, rFc_area_Jaguar, 0x1ffe0000, 0x452);
else if (118 <= channelToSW)
phy_set_bb_reg(pAdapter, rFc_area_Jaguar, 0x1ffe0000, 0x412);
@ -1809,9 +1809,9 @@ phy_SwChnl8812(
for (eRFPath = 0; eRFPath < pHalData->NumTotalRFPath; eRFPath++) {
/* RF_MOD_AG */
if (36 <= channelToSW && channelToSW <= 64)
if (36 <= channelToSW && channelToSW <= 80)
phy_set_rf_reg(pAdapter, eRFPath, RF_CHNLBW_Jaguar, BIT18 | BIT17 | BIT16 | BIT9 | BIT8, 0x101); /* 5'b00101); */
else if (100 <= channelToSW && channelToSW <= 140)
else if (82 <= channelToSW && channelToSW <= 140)
phy_set_rf_reg(pAdapter, eRFPath, RF_CHNLBW_Jaguar, BIT18 | BIT17 | BIT16 | BIT9 | BIT8, 0x301); /* 5'b01101); */
else if (140 < channelToSW)
phy_set_rf_reg(pAdapter, eRFPath, RF_CHNLBW_Jaguar, BIT18 | BIT17 | BIT16 | BIT9 | BIT8, 0x501); /* 5'b10101); */
@ -1826,25 +1826,25 @@ phy_SwChnl8812(
/* <20130104, Kordan> APK for MP chip is done on initialization from folder. */
if (IS_HARDWARE_TYPE_8821U(pAdapter) && (!IS_NORMAL_CHIP(pHalData->version_id)) && channelToSW > 14) {
/* <20121116, Kordan> For better result of APK. Asked by AlexWang. */
if (36 <= channelToSW && channelToSW <= 64)
if (36 <= channelToSW && channelToSW <= 80)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x710E7);
else if (100 <= channelToSW && channelToSW <= 140)
else if (82 <= channelToSW && channelToSW <= 140)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x716E9);
else
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x714E9);
} else if (IS_HARDWARE_TYPE_8821S(pAdapter) && channelToSW > 14) {
/* <20130111, Kordan> For better result of APK. Asked by Willson. */
if (36 <= channelToSW && channelToSW <= 64)
if (36 <= channelToSW && channelToSW <= 80)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x714E9);
else if (100 <= channelToSW && channelToSW <= 140)
else if (82 <= channelToSW && channelToSW <= 140)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x110E9);
else
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x714E9);
} else if (IS_HARDWARE_TYPE_8821E(pAdapter) && channelToSW > 14) {
/* <20130613, Kordan> For better result of APK. Asked by Willson. */
if (36 <= channelToSW && channelToSW <= 64)
if (36 <= channelToSW && channelToSW <= 80)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x114E9);
else if (100 <= channelToSW && channelToSW <= 140)
else if (82 <= channelToSW && channelToSW <= 140)
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x110E9);
else
phy_set_rf_reg(pAdapter, eRFPath, RF_APK_Jaguar, bRFRegOffsetMask, 0x110E9);

View File

@ -25,7 +25,7 @@
#define CENTER_CH_2G_40M_NUM 9
#define CENTER_CH_2G_NUM 14
#define CENTER_CH_5G_20M_NUM 28 /* 20M center channels */
#define CENTER_CH_5G_20M_NUM (28+8) /* 20M center channels */
#define CENTER_CH_5G_40M_NUM 14 /* 40M center channels */
#define CENTER_CH_5G_80M_NUM 7 /* 80M center channels */
#define CENTER_CH_5G_160M_NUM 3 /* 160M center channels */
@ -43,7 +43,9 @@ u8 center_chs_2g(u8 bw, u8 id);
extern u8 center_ch_5g_20m[CENTER_CH_5G_20M_NUM];
extern u8 center_ch_5g_40m[CENTER_CH_5G_40M_NUM];
#if 0
extern u8 center_ch_5g_20m_40m[CENTER_CH_5G_20M_NUM + CENTER_CH_5G_40M_NUM];
#endif
extern u8 center_ch_5g_80m[CENTER_CH_5G_80M_NUM];
extern u8 center_ch_5g_all[CENTER_CH_5G_ALL_NUM];

View File

@ -204,6 +204,8 @@ static struct ieee80211_channel rtw_5ghz_a_channels[MAX_CHANNEL_NUM_5G] = {
CHAN5G(36, 0), CHAN5G(40, 0), CHAN5G(44, 0), CHAN5G(48, 0),
CHAN5G(52, 0), CHAN5G(56, 0), CHAN5G(60, 0), CHAN5G(64, 0),
CHAN5G(68, 0), CHAN5G(72, 0), CHAN5G(76, 0), CHAN5G(80, 0),
CHAN5G(84, 0), CHAN5G(88, 0), CHAN5G(92, 0), CHAN5G(96, 0),
CHAN5G(100, 0), CHAN5G(104, 0), CHAN5G(108, 0), CHAN5G(112, 0),
CHAN5G(116, 0), CHAN5G(120, 0), CHAN5G(124, 0), CHAN5G(128, 0),