This commit is contained in:
dbudor 2022-11-15 16:36:42 +01:00 committed by GitHub
commit 43fb499f2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 69 additions and 0 deletions

View file

@ -1140,7 +1140,11 @@ int woal_cfg80211_change_virtual_intf(struct wiphy *wiphy,
#endif /* WIFI_DIRECT_SUPPORT */
#if defined(STA_SUPPORT) && defined(UAP_SUPPORT)
if (priv->bss_type == MLAN_BSS_TYPE_UAP) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
woal_cfg80211_del_beacon(wiphy, dev, 0);
#else
woal_cfg80211_del_beacon(wiphy, dev);
#endif
bss_role = MLAN_BSS_ROLE_STA;
woal_cfg80211_bss_role_cfg(priv, MLAN_ACT_SET,
&bss_role);
@ -2107,6 +2111,9 @@ done:
* @return 0 -- success, otherwise fail
*/
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
const u8 *peer,
const struct cfg80211_bitrate_mask *mask)
{
@ -4781,7 +4788,11 @@ void woal_cfg80211_notify_channel(moal_private *priv,
#if KERNEL_VERSION(3, 8, 0) <= CFG80211_VERSION_CODE
if (MLAN_STATUS_SUCCESS ==
woal_chandef_create(priv, &chandef, pchan_info)) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &chandef, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &chandef);
#endif
priv->channel = pchan_info->channel;
#ifdef UAP_CFG80211
moal_memcpy_ext(priv->phandle, &priv->chan, &chandef,

View file

@ -156,6 +156,9 @@ int woal_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev);
#endif
int woal_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
const u8 *peer,
const struct cfg80211_bitrate_mask *mask);
#if KERNEL_VERSION(2, 6, 38) <= CFG80211_VERSION_CODE
@ -418,7 +421,12 @@ int woal_cfg80211_set_beacon(struct wiphy *wiphy, struct net_device *dev,
struct beacon_parameters *params);
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id);
#else
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev);
#endif
int woal_cfg80211_del_station(struct wiphy *wiphy, struct net_device *dev,
#if KERNEL_VERSION(3, 19, 0) <= CFG80211_VERSION_CODE
struct station_del_parameters *param);

View file

@ -21,6 +21,7 @@
*
*/
/********************************************************
Change log:
10/21/2008: initial version
@ -963,7 +964,11 @@ static void woal_hang_work_queue(struct work_struct *work)
#ifdef STA_CFG80211
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev &&
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
priv->wdev->u.ibss.current_bss) {
#else
priv->wdev->current_bss) {
#endif
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
if (priv->host_mlme)
woal_host_mlme_disconnect(
@ -5682,7 +5687,11 @@ int woal_close(struct net_device *dev)
woal_cancel_scan(priv, MOAL_IOCTL_WAIT);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev->u.ibss.current_bss) {
#else
if (IS_STA_CFG80211(cfg80211_wext) && priv->wdev->current_bss) {
#endif
priv->cfg_disconnect = MTRUE;
cfg80211_disconnected(priv->netdev, 0, NULL, 0,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(4, 2, 0)
@ -8637,7 +8646,11 @@ t_void woal_send_disconnect_to_system(moal_private *priv,
if (IS_STA_CFG80211(cfg80211_wext)) {
spin_lock_irqsave(&priv->connect_lock, flags);
if (!priv->cfg_disconnect && !priv->cfg_connect && priv->wdev &&
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
priv->wdev->u.ibss.current_bss) {
#else
priv->wdev->current_bss) {
#endif
PRINTM(MMSG,
"wlan: Disconnected from " MACSTR
": Reason code %d\n",

View file

@ -2512,3 +2512,5 @@ static moal_if_ops sdiommc_ops = {
.reg_dbg = woal_sdiommc_reg_dbg,
.is_second_mac = woal_sdiommc_is_second_mac,
};
MODULE_DEVICE_TABLE(sdio, wlan_ids);

View file

@ -3367,7 +3367,12 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PRINTM(MMSG,
"Channel Under Nop: notify cfg80211 new channel=%d\n",
priv->channel);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
#endif
priv->chan_under_nop = MFALSE;
}
#endif
@ -3688,7 +3693,11 @@ mlan_status moal_recv_event(t_void *pmoal, pmlan_event pmevent)
PRINTM(MEVENT,
"HostMlme %s: Receive deauth/disassociate\n",
priv->netdev->name);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (!priv->wdev->u.ibss.current_bss) {
#else
if (!priv->wdev->current_bss) {
#endif
PRINTM(MEVENT,
"HostMlme: Drop deauth/disassociate, current_bss = null\n");
break;

View file

@ -103,6 +103,9 @@ static int woal_cfg80211_dump_survey(struct wiphy *wiphy,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef);
#endif
static int woal_cfg80211_set_power_mgmt(struct wiphy *wiphy,
@ -5300,7 +5303,11 @@ static int woal_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
if (priv->media_connected == MFALSE) {
PRINTM(MMSG, " Already disconnected\n");
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
if (priv->wdev->u.ibss.current_bss &&
#else
if (priv->wdev->current_bss &&
#endif
(priv->wdev->iftype == NL80211_IFTYPE_STATION ||
priv->wdev->iftype == NL80211_IFTYPE_P2P_CLIENT)) {
priv->cfg_disconnect = MTRUE;
@ -5628,6 +5635,9 @@ done:
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 8, 0)
static int woal_cfg80211_get_channel(struct wiphy *wiphy,
struct wireless_dev *wdev,
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
unsigned int link_id,
#endif
struct cfg80211_chan_def *chandef)
{
moal_private *priv = (moal_private *)woal_get_netdev_priv(wdev->netdev);

View file

@ -2336,6 +2336,13 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy,
}
}
if (vir_priv && vir_priv->bss_type == MLAN_BSS_TYPE_UAP) {
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
woal_cfg80211_del_beacon(wiphy, dev, 0);
vir_priv->wdev->u.ibss.beacon_interval = 0;
memset(&vir_priv->wdev->u.ibss.chandef, 0,
sizeof(vir_priv->wdev->u.ibss.chandef));
vir_priv->wdev->u.ibss.ssid_len = 0;
#else
woal_cfg80211_del_beacon(wiphy, dev);
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(3, 0, 0)
vir_priv->wdev->beacon_interval = 0;
@ -2345,6 +2352,7 @@ int woal_cfg80211_del_virtual_intf(struct wiphy *wiphy,
#endif
#endif
vir_priv->wdev->ssid_len = 0;
#endif
PRINTM(MMSG, "Skip del UAP virtual interface %s",
dev->name);
}
@ -2619,7 +2627,11 @@ done:
*
* @return 0 -- success, otherwise fail
*/
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev, unsigned int link_id)
#else
int woal_cfg80211_del_beacon(struct wiphy *wiphy, struct net_device *dev)
#endif
{
moal_private *priv = (moal_private *)woal_get_netdev_priv(dev);
int ret = 0;
@ -3309,7 +3321,11 @@ static void woal_switch_uap_channel(moal_private *priv, t_u8 wait_option)
priv->channel = uap_channel.channel;
moal_memcpy_ext(priv->phandle, &priv->chan, &priv->csa_chan,
sizeof(struct cfg80211_chan_def), sizeof(priv->chan));
#if CFG80211_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)
cfg80211_ch_switch_notify(priv->netdev, &priv->chan, 0);
#else
cfg80211_ch_switch_notify(priv->netdev, &priv->chan);
#endif
if (priv->uap_tx_blocked) {
if (!netif_carrier_ok(priv->netdev))
netif_carrier_on(priv->netdev);