1
0
mirror of https://github.com/aircrack-ng/rtl8812au.git synced 2024-11-09 23:57:00 +00:00

Merge pull request #1053 from astsam2/v5.6.4.2

Fix control channel frequency in the cfg80211_rtw_get_channel() for 40 MHz channels
This commit is contained in:
Christian Bremvåg 2023-03-13 23:29:06 +01:00 committed by GitHub
commit e9699df823
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6100,7 +6100,6 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
#endif
switch (channel_type) {
case NL80211_CHAN_NO_HT:
case NL80211_CHAN_HT20:
@ -6151,36 +6150,17 @@ static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wd
if (!ndev)
return -ENODEV;
offset = rtw_get_oper_choffset(padapter);
//channel = adapter_to_dvobj(padapter)->oper_channel;
channel = pHalData->current_channel;
bandWidth = rtw_get_oper_bw(padapter);
channel = rtw_get_oper_ch(padapter);
if(channel >= 1){
if(channel <= 14)
band = NL80211_BAND_2GHZ;
else
band = NL80211_BAND_5GHZ;
#if 0
switch(pHalData->current_band_type){
case 0:
band = NL80211_BAND_2GHZ;
break;
case 1:
band = NL80211_BAND_5GHZ;
break;
default:
return -EINVAL;
}
#endif
control_freq = ieee80211_channel_to_frequency(channel, band);
dvobj = adapter_to_dvobj(padapter);
if(dvobj != NULL){
bandWidth = adapter_to_dvobj(padapter)->oper_bwmode;
RTW_INFO("%s bw %d\n", __func__, adapter_to_dvobj(padapter)->oper_bwmode);
}else{
bandWidth = pHalData->current_channel_bw;
RTW_INFO("%s dvobj null\n", __func__);
}
switch(pHalData->current_channel_bw){
switch(bandWidth){
case CHANNEL_WIDTH_5:
width = NL80211_CHAN_WIDTH_5;
center_freq = control_freq;