qcacld-3.0: Remove wlan_hdd_check_remain_on_channel() API

The wlan_hdd_check_remain_on_channel() is a wrapper API around
wlan_hdd_cancel_existing_remain_on_channel() with an additional
opmode check. Perform this opmode check to caller.

The wlan_hdd_cancel_existing_remain_on_channel() reimplements
wlan_hdd_cleanup_remain_on_channel_ctx(), so remove this API
and move existing callers to wlan_hdd_cleanup_remain_on_channel_ctx().

Change-Id: Ia23f4f22d6fb8ed5009ad973fd63012b259d308f
CRs-Fixed: 3462426
This commit is contained in:
Vinod Kumar Pirla
2023-02-24 02:40:29 -08:00
committed by Rahul Choudhary
parent a1e6ae1e71
commit d46e086cc6
4 changed files with 11 additions and 38 deletions

View File

@@ -77,9 +77,6 @@ void hdd_indicate_mgmt_frame_to_user(struct hdd_adapter *adapter,
int8_t rx_rssi,
enum rxmgmt_flags rx_flags);
int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter);
void wlan_hdd_cancel_existing_remain_on_channel(struct hdd_adapter *adapter);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 14, 0))
int wlan_hdd_mgmt_tx(struct wiphy *wiphy, struct wireless_dev *wdev,
struct cfg80211_mgmt_tx_params *params, u64 *cookie);

View File

@@ -14359,8 +14359,8 @@ static int __wlan_hdd_cfg80211_set_probable_oper_channel(struct wiphy *wiphy,
return -EINVAL;
}
if (0 != wlan_hdd_check_remain_on_channel(adapter))
hdd_warn("Remain On Channel Pending");
if (QDF_P2P_GO_MODE != adapter->device_mode)
wlan_hdd_cleanup_remain_on_channel_ctx(adapter->deflink);
if (wlan_hdd_change_hw_mode_for_given_chnl(adapter, ch_freq,
POLICY_MGR_UPDATE_REASON_SET_OPER_CHAN)) {
@@ -20980,6 +20980,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
int errno;
uint8_t mac_addr[QDF_MAC_ADDR_SIZE];
bool eht_capab;
struct wlan_hdd_link_info *link_info = adapter->deflink;
hdd_enter();
@@ -21001,7 +21002,7 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
qdf_mtrace(QDF_MODULE_ID_HDD, QDF_MODULE_ID_HDD,
TRACE_CODE_HDD_CFG80211_CHANGE_IFACE,
adapter->deflink->vdev_id, type);
link_info->vdev_id, type);
status = hdd_nl_to_qdf_iface_type(type, &new_mode);
if (QDF_IS_STATUS_ERROR(status))
@@ -21042,13 +21043,12 @@ static int __wlan_hdd_cfg80211_change_iface(struct wiphy *wiphy,
}
} else if (hdd_is_ap_mode(new_mode)) {
if (new_mode == QDF_P2P_GO_MODE)
wlan_hdd_cancel_existing_remain_on_channel
(adapter);
wlan_hdd_cleanup_remain_on_channel_ctx(link_info);
hdd_stop_adapter(hdd_ctx, adapter);
hdd_deinit_adapter(hdd_ctx, adapter, true);
memset(&adapter->deflink->session, 0,
sizeof(adapter->deflink->session));
memset(&link_info->session, 0,
sizeof(link_info->session));
adapter->device_mode = new_mode;
status = ucfg_mlme_get_ap_random_bssid_enable(

View File

@@ -7965,11 +7965,13 @@ static int __wlan_hdd_cfg80211_start_ap(struct wiphy *wiphy,
if (adapter->device_mode == QDF_P2P_GO_MODE) {
struct hdd_adapter *p2p_adapter;
struct wlan_hdd_link_info *p2p_link_info;
p2p_adapter = hdd_get_adapter(hdd_ctx, QDF_P2P_DEVICE_MODE);
if (p2p_adapter) {
hdd_debug("Cancel active p2p device ROC before GO starting");
wlan_hdd_cancel_existing_remain_on_channel(p2p_adapter);
hdd_debug("Cleanup active p2p device ROC before GO starting");
p2p_link_info = p2p_adapter->deflink;
wlan_hdd_cleanup_remain_on_channel_ctx(p2p_link_info);
}
}

View File

@@ -61,32 +61,6 @@
#define MS_TO_TU_MUS(x) ((x) * 1024)
#define MAX_MUS_VAL (INT_MAX / 1024)
void wlan_hdd_cancel_existing_remain_on_channel(struct hdd_adapter *adapter)
{
struct wlan_objmgr_vdev *vdev;
if (!adapter) {
hdd_err("null adapter");
return;
}
vdev = hdd_objmgr_get_vdev_by_user(adapter->deflink, WLAN_OSIF_P2P_ID);
if (!vdev) {
hdd_err("vdev is NULL");
return;
}
ucfg_p2p_cleanup_roc_by_vdev(vdev);
hdd_objmgr_put_vdev_by_user(vdev, WLAN_OSIF_P2P_ID);
}
int wlan_hdd_check_remain_on_channel(struct hdd_adapter *adapter)
{
if (QDF_P2P_GO_MODE != adapter->device_mode)
wlan_hdd_cancel_existing_remain_on_channel(adapter);
return 0;
}
/* Clean up RoC context at hdd_stop_adapter*/
void
wlan_hdd_cleanup_remain_on_channel_ctx(struct wlan_hdd_link_info *link_info)