|
@@ -3484,20 +3484,18 @@ int wlan_hdd_cfg80211_extscan_stop(struct wiphy *wiphy,
|
|
|
*/
|
|
|
static int
|
|
|
__wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev
|
|
|
- *wdev, const void *data,
|
|
|
- int data_len)
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data,
|
|
|
+ int data_len)
|
|
|
{
|
|
|
- tpSirExtScanResetBssidHotlistReqParams pReqMsg = NULL;
|
|
|
+ struct extscan_bssid_hotlist_reset_params params;
|
|
|
struct net_device *dev = wdev->netdev;
|
|
|
struct hdd_adapter *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
struct hdd_context *hdd_ctx = wiphy_priv(wiphy);
|
|
|
- struct nlattr *tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX +
|
|
|
- 1];
|
|
|
+ struct nlattr *tb[EXTSCAN_PARAM_MAX + 1];
|
|
|
struct hdd_ext_scan_context *context;
|
|
|
- uint32_t request_id;
|
|
|
QDF_STATUS status;
|
|
|
- int retval;
|
|
|
+ int id, retval;
|
|
|
unsigned long rc;
|
|
|
|
|
|
hdd_enter_dev(dev);
|
|
@@ -3515,42 +3513,35 @@ __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
|
|
|
hdd_err("extscan not supported");
|
|
|
return -ENOTSUPP;
|
|
|
}
|
|
|
- if (wlan_cfg80211_nla_parse(tb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX,
|
|
|
- data, data_len, wlan_hdd_extscan_config_policy)) {
|
|
|
+
|
|
|
+ if (wlan_cfg80211_nla_parse(tb, EXTSCAN_PARAM_MAX,
|
|
|
+ data, data_len,
|
|
|
+ wlan_hdd_extscan_config_policy)) {
|
|
|
hdd_err("Invalid ATTR");
|
|
|
return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- pReqMsg = qdf_mem_malloc(sizeof(*pReqMsg));
|
|
|
- if (!pReqMsg) {
|
|
|
- hdd_err("qdf_mem_malloc failed");
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
-
|
|
|
/* Parse and fetch request Id */
|
|
|
- if (!tb[QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]) {
|
|
|
+ id = QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID;
|
|
|
+ if (!tb[id]) {
|
|
|
hdd_err("attr request id failed");
|
|
|
- goto fail;
|
|
|
+ return -EINVAL;
|
|
|
}
|
|
|
|
|
|
- pReqMsg->requestId =
|
|
|
- nla_get_u32(tb
|
|
|
- [QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID]);
|
|
|
- pReqMsg->sessionId = adapter->session_id;
|
|
|
- hdd_debug("Req Id %d Session Id %d",
|
|
|
- pReqMsg->requestId, pReqMsg->sessionId);
|
|
|
+ params.request_id = nla_get_u32(tb[id]);
|
|
|
+ params.vdev_id = adapter->session_id;
|
|
|
+ hdd_debug("Req Id %d vdev Id %d", params.request_id, params.vdev_id);
|
|
|
|
|
|
context = &ext_scan_context;
|
|
|
spin_lock(&context->context_lock);
|
|
|
INIT_COMPLETION(context->response_event);
|
|
|
- context->request_id = request_id = pReqMsg->requestId;
|
|
|
+ context->request_id = params.request_id;
|
|
|
spin_unlock(&context->context_lock);
|
|
|
|
|
|
- status = sme_reset_bss_hotlist(hdd_ctx->mac_handle, pReqMsg);
|
|
|
+ status = sme_reset_bss_hotlist(hdd_ctx->mac_handle, ¶ms);
|
|
|
if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
hdd_err("sme_reset_bss_hotlist failed(err=%d)", status);
|
|
|
- goto fail;
|
|
|
+ return qdf_status_to_os_return(status);
|
|
|
}
|
|
|
|
|
|
/* request was sent -- wait for the response */
|
|
@@ -3562,7 +3553,7 @@ __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
|
|
|
retval = -ETIMEDOUT;
|
|
|
} else {
|
|
|
spin_lock(&context->context_lock);
|
|
|
- if (context->request_id == request_id)
|
|
|
+ if (context->request_id == params.request_id)
|
|
|
retval = context->response_status;
|
|
|
else
|
|
|
retval = -EINVAL;
|
|
@@ -3570,10 +3561,6 @@ __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
|
|
|
}
|
|
|
hdd_exit();
|
|
|
return retval;
|
|
|
-
|
|
|
-fail:
|
|
|
- qdf_mem_free(pReqMsg);
|
|
|
- return -EINVAL;
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -3586,14 +3573,15 @@ fail:
|
|
|
* Return: 0 on success, negative errno on failure
|
|
|
*/
|
|
|
int wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data, int data_len)
|
|
|
+ struct wireless_dev *wdev,
|
|
|
+ const void *data,
|
|
|
+ int data_len)
|
|
|
{
|
|
|
- int ret = 0;
|
|
|
+ int ret;
|
|
|
|
|
|
cds_ssr_protect(__func__);
|
|
|
ret = __wlan_hdd_cfg80211_extscan_reset_bssid_hotlist(wiphy, wdev,
|
|
|
- data, data_len);
|
|
|
+ data, data_len);
|
|
|
cds_ssr_unprotect(__func__);
|
|
|
|
|
|
return ret;
|