Skip to content

Commit 32946aa

Browse files
committed
1 parent eb51e02 commit 32946aa

File tree

4 files changed

+24
-9
lines changed

4 files changed

+24
-9
lines changed

core/rtw_ap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1797,7 +1797,7 @@ void start_bss_network(_adapter *padapter, struct createbss_parm *parm)
17971797
, pdvobj->padapters[i]->mlmeextpriv.cur_channel
17981798
, pdvobj->padapters[i]->mlmeextpriv.cur_bwmode
17991799
, pdvobj->padapters[i]->mlmeextpriv.cur_ch_offset
1800-
, ht_option);
1800+
, ht_option, 0);
18011801
}
18021802
}
18031803
#endif /* defined(CONFIG_IOCTL_CFG80211) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)) */

core/rtw_mlme_ext.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16128,7 +16128,7 @@ void rtw_join_done_chk_ch(_adapter *adapter, int join_res)
1612816128

1612916129
rtw_cfg80211_ch_switch_notify(iface
1613016130
, mlmeext->cur_channel, mlmeext->cur_bwmode, mlmeext->cur_ch_offset
16131-
, ht_option);
16131+
, ht_option, 0);
1613216132
#endif
1613316133
}
1613416134
}
@@ -16346,7 +16346,7 @@ int rtw_chk_start_clnt_join(_adapter *adapter, u8 *ch, u8 *bw, u8 *offset)
1634616346
the bss freq is updated by channel switch event.
1634716347
*/
1634816348
rtw_cfg80211_ch_switch_notify(adapter,
16349-
cur_ch, cur_bw, cur_ch_offset, ht_option);
16349+
cur_ch, cur_bw, cur_ch_offset, ht_option, 1);
1635016350
}
1635116351
#endif
1635216352
}

os_dep/linux/ioctl_cfg80211.c

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -424,21 +424,36 @@ bool rtw_cfg80211_allow_ch_switch_notify(_adapter *adapter)
424424
return 1;
425425
}
426426

427-
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht)
427+
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht, bool started)
428428
{
429429
struct wiphy *wiphy = adapter_to_wiphy(adapter);
430430
u8 ret = _SUCCESS;
431431

432432
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 8, 0))
433433
struct cfg80211_chan_def chdef = {};
434434

435-
if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
436-
goto exit;
437-
438435
ret = rtw_chbw_to_cfg80211_chan_def(wiphy, &chdef, ch, bw, offset, ht);
439436
if (ret != _SUCCESS)
440437
goto exit;
441-
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,3, 0))
438+
439+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0))
440+
if (started) {
441+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
442+
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false, 0);
443+
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
444+
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false);
445+
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0))
446+
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false);
447+
#else
448+
cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0);
449+
#endif
450+
goto exit;
451+
}
452+
#endif
453+
454+
if (!rtw_cfg80211_allow_ch_switch_notify(adapter))
455+
goto exit;
456+
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 3, 0))
442457
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0, 0);
443458
#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2))
444459
cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0);

os_dep/linux/ioctl_cfg80211.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,7 @@ void rtw_cfg80211_deinit_rfkill(struct wiphy *wiphy);
414414
#endif
415415

416416
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0))
417-
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht);
417+
u8 rtw_cfg80211_ch_switch_notify(_adapter *adapter, u8 ch, u8 bw, u8 offset, u8 ht, bool started);
418418
#endif
419419

420420
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 26)) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 7, 0))

0 commit comments

Comments
 (0)