qcacld-3.0: Add API to notify channel switch to EasyMesh

When the channel of AP is changed, notify the new channel to
EasyMesh.

Change-Id: If38306110d5b69cb4d5211b49ea484ce4f6626bb
CRs-Fixed: 3371337
This commit is contained in:
Bing Sun
2023-01-09 19:34:40 +08:00
committed by Madan Koyyalamudi
parent a476ae0197
commit 1c4eb765df
3 changed files with 52 additions and 1 deletions

View File

@@ -2797,6 +2797,8 @@ QDF_STATUS hdd_hostapd_sap_event_cb(struct sap_event *sap_event,
hdd_debug("set hw mode change not done");
}
hdd_son_deliver_chan_change_event(
adapter, sap_event->sapevt.sap_ch_selected.pri_ch_freq);
return hdd_hostapd_chan_change(adapter, sap_event);
case eSAP_ACS_SCAN_SUCCESS_EVENT:
return hdd_handle_acs_scan_event(sap_event, adapter);

View File

@@ -2698,6 +2698,39 @@ void hdd_son_deliver_peer_authorize_event(struct hdd_adapter *adapter,
hdd_objmgr_put_vdev_by_user(vdev, WLAN_SON_ID);
}
int hdd_son_deliver_chan_change_event(struct hdd_adapter *adapter,
qdf_freq_t freq)
{
int ret = -EINVAL;
struct wlan_objmgr_vdev *vdev;
struct son_ald_chan_change_info chan_info;
struct wlan_objmgr_pdev *pdev;
if (!adapter) {
hdd_err("null adapter");
return ret;
}
vdev = hdd_objmgr_get_vdev_by_user(adapter, WLAN_SON_ID);
if (!vdev) {
hdd_err("null vdev");
return ret;
}
pdev = wlan_vdev_get_pdev(vdev);
if (!pdev) {
hdd_err("null pdev");
hdd_objmgr_put_vdev_by_user(vdev, WLAN_SON_ID);
return ret;
}
chan_info.freq = freq;
chan_info.chan_num = wlan_reg_freq_to_chan(pdev, freq);
ret = os_if_son_deliver_ald_event(vdev, NULL,
MLME_EVENT_CHAN_CHANGE,
&chan_info);
hdd_objmgr_put_vdev_by_user(vdev, WLAN_SON_ID);
return ret;
}
int hdd_son_send_set_wifi_generic_command(struct wiphy *wiphy,
struct wireless_dev *wdev,
struct nlattr **tb)

View File

@@ -1,6 +1,6 @@
/*
* Copyright (c) 2021, The Linux Foundation. All rights reserved.
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
*
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -122,6 +122,16 @@ int hdd_son_send_get_wifi_generic_command(struct wiphy *wiphy,
*/
uint32_t hdd_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
struct wlan_objmgr_peer *peer);
/**
* hdd_son_deliver_chan_change_event() - send chan change to SON
* @adapter: pointer to adapter
* @freq: new operating channel frequency
*
* Return: 0 on success
*/
int hdd_son_deliver_chan_change_event(struct hdd_adapter *adapter,
qdf_freq_t freq);
#else
static inline void hdd_son_register_callbacks(struct hdd_context *hdd_ctx)
@@ -179,5 +189,11 @@ uint32_t hdd_son_get_peer_max_mcs_idx(struct wlan_objmgr_vdev *vdev,
return 0;
}
static inline
int hdd_son_deliver_chan_change_event(struct hdd_adapter *adapter,
qdf_freq_t freq)
{
return 0;
}
#endif /* WLAN_FEATURE_SON */
#endif