mirror of
https://github.com/aircrack-ng/rtl8812au.git
synced 2024-11-26 07:04:12 +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:
commit
e9699df823
@ -6100,7 +6100,6 @@ static int cfg80211_rtw_set_channel(struct wiphy *wiphy
|
|||||||
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
|
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 35))
|
||||||
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
RTW_INFO(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
switch (channel_type) {
|
switch (channel_type) {
|
||||||
case NL80211_CHAN_NO_HT:
|
case NL80211_CHAN_NO_HT:
|
||||||
case NL80211_CHAN_HT20:
|
case NL80211_CHAN_HT20:
|
||||||
@ -6151,36 +6150,17 @@ static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wd
|
|||||||
if (!ndev)
|
if (!ndev)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
offset = rtw_get_oper_choffset(padapter);
|
offset = rtw_get_oper_choffset(padapter);
|
||||||
//channel = adapter_to_dvobj(padapter)->oper_channel;
|
bandWidth = rtw_get_oper_bw(padapter);
|
||||||
channel = pHalData->current_channel;
|
channel = rtw_get_oper_ch(padapter);
|
||||||
if(channel >= 1){
|
if(channel >= 1){
|
||||||
if(channel <= 14)
|
if(channel <= 14)
|
||||||
band = NL80211_BAND_2GHZ;
|
band = NL80211_BAND_2GHZ;
|
||||||
else
|
else
|
||||||
band = NL80211_BAND_5GHZ;
|
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);
|
control_freq = ieee80211_channel_to_frequency(channel, band);
|
||||||
|
|
||||||
dvobj = adapter_to_dvobj(padapter);
|
switch(bandWidth){
|
||||||
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){
|
|
||||||
case CHANNEL_WIDTH_5:
|
case CHANNEL_WIDTH_5:
|
||||||
width = NL80211_CHAN_WIDTH_5;
|
width = NL80211_CHAN_WIDTH_5;
|
||||||
center_freq = control_freq;
|
center_freq = control_freq;
|
||||||
|
Loading…
Reference in New Issue
Block a user