|
@@ -1293,150 +1293,6 @@ fail:
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
-/**
|
|
|
- * wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind() -
|
|
|
- * Handle an SSID hotlist match event
|
|
|
- * @ctx: HDD context registered with SME
|
|
|
- * @event: The SSID hotlist match event
|
|
|
- *
|
|
|
- * This function will take an SSID match event that was generated by
|
|
|
- * firmware and will convert it into a cfg80211 vendor event which is
|
|
|
- * sent to userspace.
|
|
|
- * This callback execute in atomic context and must not invoke any
|
|
|
- * blocking calls.
|
|
|
- *
|
|
|
- * Return: none
|
|
|
- */
|
|
|
-static void
|
|
|
-wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind(void *ctx,
|
|
|
- tpSirWifiScanResultEvent event)
|
|
|
-{
|
|
|
- hdd_context_t *hdd_ctx = ctx;
|
|
|
- struct sk_buff *skb;
|
|
|
- uint32_t i, index;
|
|
|
- int flags = cds_get_gfp_flags();
|
|
|
-
|
|
|
- ENTER();
|
|
|
-
|
|
|
- if (wlan_hdd_validate_context(hdd_ctx))
|
|
|
- return;
|
|
|
- if (!event) {
|
|
|
- hdd_err("event is null");
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- if (event->ap_found) {
|
|
|
- index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_FOUND_INDEX;
|
|
|
- hdd_notice("SSID hotlist found");
|
|
|
- } else {
|
|
|
- index = QCA_NL80211_VENDOR_SUBCMD_EXTSCAN_HOTLIST_SSID_LOST_INDEX;
|
|
|
- hdd_notice("SSID hotlist lost");
|
|
|
- }
|
|
|
-
|
|
|
- skb = cfg80211_vendor_event_alloc(hdd_ctx->wiphy,
|
|
|
- NULL,
|
|
|
- EXTSCAN_EVENT_BUF_SIZE + NLMSG_HDRLEN,
|
|
|
- index, flags);
|
|
|
-
|
|
|
- if (!skb) {
|
|
|
- hdd_err("cfg80211_vendor_event_alloc failed");
|
|
|
- return;
|
|
|
- }
|
|
|
- hdd_notice("Req Id %u, Num results %u, More Data %u",
|
|
|
- event->requestId, event->numOfAps, event->moreData);
|
|
|
-
|
|
|
- for (i = 0; i < event->numOfAps; i++) {
|
|
|
- hdd_notice("[i=%d] Timestamp %llu "
|
|
|
- "Ssid: %s "
|
|
|
- "Bssid (" MAC_ADDRESS_STR ") "
|
|
|
- "Channel %u "
|
|
|
- "Rssi %d "
|
|
|
- "RTT %u "
|
|
|
- "RTT_SD %u",
|
|
|
- i,
|
|
|
- event->ap[i].ts,
|
|
|
- event->ap[i].ssid,
|
|
|
- MAC_ADDR_ARRAY(event->ap[i].bssid.bytes),
|
|
|
- event->ap[i].channel,
|
|
|
- event->ap[i].rssi,
|
|
|
- event->ap[i].rtt,
|
|
|
- event->ap[i].rtt_sd);
|
|
|
- }
|
|
|
-
|
|
|
- if (nla_put_u32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_REQUEST_ID,
|
|
|
- event->requestId) ||
|
|
|
- nla_put_u32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_NUM_RESULTS_AVAILABLE,
|
|
|
- event->numOfAps)) {
|
|
|
- hdd_err("put fail");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- if (event->numOfAps) {
|
|
|
- struct nlattr *aps;
|
|
|
- aps = nla_nest_start(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_LIST);
|
|
|
- if (!aps) {
|
|
|
- hdd_err("nest fail");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- for (i = 0; i < event->numOfAps; i++) {
|
|
|
- struct nlattr *ap;
|
|
|
-
|
|
|
- ap = nla_nest_start(skb, i);
|
|
|
- if (!ap) {
|
|
|
- hdd_err("nest fail");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- if (hdd_wlan_nla_put_u64(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_TIME_STAMP,
|
|
|
- event->ap[i].ts) ||
|
|
|
- nla_put(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_SSID,
|
|
|
- sizeof(event->ap[i].ssid),
|
|
|
- event->ap[i].ssid) ||
|
|
|
- nla_put(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_BSSID,
|
|
|
- sizeof(event->ap[i].bssid),
|
|
|
- event->ap[i].bssid.bytes) ||
|
|
|
- nla_put_u32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_CHANNEL,
|
|
|
- event->ap[i].channel) ||
|
|
|
- nla_put_s32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RSSI,
|
|
|
- event->ap[i].rssi) ||
|
|
|
- nla_put_u32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT,
|
|
|
- event->ap[i].rtt) ||
|
|
|
- nla_put_u32(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_RTT_SD,
|
|
|
- event->ap[i].rtt_sd)) {
|
|
|
- hdd_err("put fail");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- nla_nest_end(skb, ap);
|
|
|
- }
|
|
|
- nla_nest_end(skb, aps);
|
|
|
-
|
|
|
- if (nla_put_u8(skb,
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_RESULTS_SCAN_RESULT_MORE_DATA,
|
|
|
- event->moreData)) {
|
|
|
- hdd_err("put fail");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- cfg80211_vendor_event(skb, flags);
|
|
|
- return;
|
|
|
-
|
|
|
-fail:
|
|
|
- kfree_skb(skb);
|
|
|
- return;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* wlan_hdd_cfg80211_extscan_generic_rsp() -
|
|
|
* Handle a generic ExtScan Response message
|
|
@@ -1539,11 +1395,6 @@ void wlan_hdd_cfg80211_extscan_callback(void *ctx, const uint16_t evType,
|
|
|
(struct pno_match_found *)pMsg);
|
|
|
break;
|
|
|
|
|
|
- case eSIR_EXTSCAN_HOTLIST_SSID_MATCH_IND:
|
|
|
- wlan_hdd_cfg80211_extscan_hotlist_ssid_match_ind(ctx,
|
|
|
- (tpSirWifiScanResultEvent)pMsg);
|
|
|
- break;
|
|
|
-
|
|
|
case eSIR_EXTSCAN_SCAN_PROGRESS_EVENT_IND:
|
|
|
wlan_hdd_cfg80211_extscan_scan_progress_event(ctx,
|
|
|
(tpSirExtScanOnScanEventIndParams) pMsg);
|
|
@@ -4419,397 +4270,6 @@ int wlan_hdd_cfg80211_reset_passpoint_list(struct wiphy *wiphy,
|
|
|
return ret;
|
|
|
}
|
|
|
|
|
|
-/*
|
|
|
- * define short names for the global vendor params
|
|
|
- * used by __wlan_hdd_cfg80211_extscan_set_ssid_hotlist()
|
|
|
- */
|
|
|
-#define PARAM_MAX \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
|
|
|
-#define PARAM_REQUEST_ID \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
|
|
|
-#define PARAMS_LOST_SSID_SAMPLE_SIZE \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_LOST_SSID_SAMPLE_SIZE
|
|
|
-#define PARAMS_NUM_SSID \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_HOTLIST_PARAMS_NUM_SSID
|
|
|
-#define THRESHOLD_PARAM \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM
|
|
|
-#define PARAM_SSID \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_SSID
|
|
|
-#define PARAM_BAND \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_BAND
|
|
|
-#define PARAM_RSSI_LOW \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_LOW
|
|
|
-#define PARAM_RSSI_HIGH \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SSID_THRESHOLD_PARAM_RSSI_HIGH
|
|
|
-
|
|
|
-/**
|
|
|
- * __wlan_hdd_cfg80211_extscan_set_ssid_hotlist() - set ssid hot list
|
|
|
- * @wiphy: Pointer to wireless phy
|
|
|
- * @wdev: Pointer to wireless device
|
|
|
- * @data: Pointer to data
|
|
|
- * @data_len: Data length
|
|
|
- *
|
|
|
- * Return: 0 on success, negative errno on failure
|
|
|
- */
|
|
|
-static int
|
|
|
-__wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data,
|
|
|
- int data_len)
|
|
|
-{
|
|
|
- struct sir_set_ssid_hotlist_request *request;
|
|
|
- struct net_device *dev = wdev->netdev;
|
|
|
- hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
- hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
|
|
|
- struct nlattr *tb[PARAM_MAX + 1];
|
|
|
- struct nlattr *tb2[PARAM_MAX + 1];
|
|
|
- struct nlattr *ssids;
|
|
|
- struct hdd_ext_scan_context *context;
|
|
|
- uint32_t request_id;
|
|
|
- char ssid_string[SIR_MAC_MAX_SSID_LENGTH + 1];
|
|
|
- int ssid_len, i, rem, ssid_str_len;
|
|
|
- QDF_STATUS status;
|
|
|
- int retval;
|
|
|
- unsigned long rc;
|
|
|
-
|
|
|
- ENTER_DEV(dev);
|
|
|
-
|
|
|
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
- hdd_err("Command not allowed in FTM mode");
|
|
|
- return -EPERM;
|
|
|
- }
|
|
|
-
|
|
|
- retval = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (0 != retval)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- if (!hdd_ctx->config->extscan_enabled) {
|
|
|
- hdd_err("extscan not supported");
|
|
|
- return -ENOTSUPP;
|
|
|
- }
|
|
|
- if (nla_parse(tb, PARAM_MAX,
|
|
|
- data, data_len,
|
|
|
- wlan_hdd_extscan_config_policy)) {
|
|
|
- hdd_err("Invalid ATTR");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- request = qdf_mem_malloc(sizeof(*request));
|
|
|
- if (!request) {
|
|
|
- hdd_err("qdf_mem_malloc failed");
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- /* Parse and fetch request Id */
|
|
|
- if (!tb[PARAM_REQUEST_ID]) {
|
|
|
- hdd_err("attr request id failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- request->request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
|
|
|
- hdd_notice("Request Id %d", request->request_id);
|
|
|
-
|
|
|
- /* Parse and fetch lost SSID sample size */
|
|
|
- if (!tb[PARAMS_LOST_SSID_SAMPLE_SIZE]) {
|
|
|
- hdd_err("attr number of Ssid failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- request->lost_ssid_sample_size =
|
|
|
- nla_get_u32(tb[PARAMS_LOST_SSID_SAMPLE_SIZE]);
|
|
|
- hdd_notice("Lost SSID Sample Size %d",
|
|
|
- request->lost_ssid_sample_size);
|
|
|
-
|
|
|
- /* Parse and fetch number of hotlist SSID */
|
|
|
- if (!tb[PARAMS_NUM_SSID]) {
|
|
|
- hdd_err("attr number of Ssid failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- request->ssid_count = nla_get_u32(tb[PARAMS_NUM_SSID]);
|
|
|
- hdd_notice("Number of SSID %d", request->ssid_count);
|
|
|
-
|
|
|
- request->session_id = adapter->sessionId;
|
|
|
- hdd_notice("Session Id %d", request->session_id);
|
|
|
-
|
|
|
- i = 0;
|
|
|
- nla_for_each_nested(ssids, tb[THRESHOLD_PARAM], rem) {
|
|
|
- if (i >= WLAN_EXTSCAN_MAX_HOTLIST_SSIDS) {
|
|
|
- hdd_err("Too Many SSIDs, %d exceeds %d",
|
|
|
- i, WLAN_EXTSCAN_MAX_HOTLIST_SSIDS);
|
|
|
- break;
|
|
|
- }
|
|
|
- if (nla_parse(tb2, PARAM_MAX,
|
|
|
- nla_data(ssids), nla_len(ssids),
|
|
|
- wlan_hdd_extscan_config_policy)) {
|
|
|
- hdd_err("nla_parse failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- /* Parse and fetch SSID */
|
|
|
- if (!tb2[PARAM_SSID]) {
|
|
|
- hdd_err("attr ssid failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- ssid_str_len = nla_strlcpy(ssid_string,
|
|
|
- tb2[PARAM_SSID],
|
|
|
- sizeof(ssid_string));
|
|
|
- if (ssid_str_len > SIR_MAC_MAX_SSID_LENGTH) {
|
|
|
- hdd_err("Invalid length exceeds max ssid length");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- hdd_notice("SSID %s",
|
|
|
- ssid_string);
|
|
|
- ssid_len = strlen(ssid_string);
|
|
|
- memcpy(request->ssids[i].ssid.ssId, ssid_string, ssid_len);
|
|
|
- request->ssids[i].ssid.length = ssid_len;
|
|
|
-
|
|
|
- /* Parse and fetch low RSSI */
|
|
|
- if (!tb2[PARAM_BAND]) {
|
|
|
- hdd_err("attr band failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- request->ssids[i].band = nla_get_u8(tb2[PARAM_BAND]);
|
|
|
- hdd_notice("band %d", request->ssids[i].band);
|
|
|
-
|
|
|
- /* Parse and fetch low RSSI */
|
|
|
- if (!tb2[PARAM_RSSI_LOW]) {
|
|
|
- hdd_err("attr low RSSI failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- request->ssids[i].rssi_low = nla_get_s32(tb2[PARAM_RSSI_LOW]);
|
|
|
- hdd_notice("RSSI low %d", request->ssids[i].rssi_low);
|
|
|
-
|
|
|
- /* Parse and fetch high RSSI */
|
|
|
- if (!tb2[PARAM_RSSI_HIGH]) {
|
|
|
- hdd_err("attr high RSSI failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
- request->ssids[i].rssi_high = nla_get_u32(tb2[PARAM_RSSI_HIGH]);
|
|
|
- hdd_notice("RSSI high %d", request->ssids[i].rssi_high);
|
|
|
- i++;
|
|
|
- }
|
|
|
-
|
|
|
- context = &ext_scan_context;
|
|
|
- spin_lock(&context->context_lock);
|
|
|
- INIT_COMPLETION(context->response_event);
|
|
|
- context->request_id = request_id = request->request_id;
|
|
|
- spin_unlock(&context->context_lock);
|
|
|
-
|
|
|
- status = sme_set_ssid_hotlist(hdd_ctx->hHal, request);
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
- hdd_err("sme_set_ssid_hotlist failed(err=%d)", status);
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- qdf_mem_free(request);
|
|
|
-
|
|
|
- /* request was sent -- wait for the response */
|
|
|
- rc = wait_for_completion_timeout(&context->response_event,
|
|
|
- msecs_to_jiffies
|
|
|
- (WLAN_WAIT_TIME_EXTSCAN));
|
|
|
- if (!rc) {
|
|
|
- hdd_err("sme_set_ssid_hotlist timed out");
|
|
|
- retval = -ETIMEDOUT;
|
|
|
- } else {
|
|
|
- spin_lock(&context->context_lock);
|
|
|
- if (context->request_id == request_id)
|
|
|
- retval = context->response_status;
|
|
|
- else
|
|
|
- retval = -EINVAL;
|
|
|
- spin_unlock(&context->context_lock);
|
|
|
- }
|
|
|
-
|
|
|
- return retval;
|
|
|
-
|
|
|
-fail:
|
|
|
- qdf_mem_free(request);
|
|
|
- return -EINVAL;
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * done with short names for the global vendor params
|
|
|
- * used by wlan_hdd_cfg80211_extscan_set_ssid_hotlist()
|
|
|
- */
|
|
|
-#undef PARAM_MAX
|
|
|
-#undef PARAM_REQUEST_ID
|
|
|
-#undef PARAMS_NUM_SSID
|
|
|
-#undef THRESHOLD_PARAM
|
|
|
-#undef PARAM_SSID
|
|
|
-#undef PARAM_BAND
|
|
|
-#undef PARAM_RSSI_LOW
|
|
|
-#undef PARAM_RSSI_HIGH
|
|
|
-
|
|
|
-/**
|
|
|
- * wlan_hdd_cfg80211_extscan_set_ssid_hotlist() - set ssid hot list
|
|
|
- * @wiphy: Pointer to wireless phy
|
|
|
- * @wdev: Pointer to wireless device
|
|
|
- * @data: Pointer to data
|
|
|
- * @data_len: Data length
|
|
|
- *
|
|
|
- * Return: 0 on success, negative errno on failure
|
|
|
- */
|
|
|
-int
|
|
|
-wlan_hdd_cfg80211_extscan_set_ssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data,
|
|
|
- int data_len)
|
|
|
-{
|
|
|
- int ret;
|
|
|
-
|
|
|
- cds_ssr_protect(__func__);
|
|
|
- ret = __wlan_hdd_cfg80211_extscan_set_ssid_hotlist(wiphy, wdev, data,
|
|
|
- data_len);
|
|
|
- cds_ssr_unprotect(__func__);
|
|
|
-
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * define short names for the global vendor params
|
|
|
- * used by __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist()
|
|
|
- */
|
|
|
-#define PARAM_MAX \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_MAX
|
|
|
-#define PARAM_REQUEST_ID \
|
|
|
- QCA_WLAN_VENDOR_ATTR_EXTSCAN_SUBCMD_CONFIG_PARAM_REQUEST_ID
|
|
|
-
|
|
|
-/**
|
|
|
- * __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist() - reset ssid hot list
|
|
|
- * @wiphy: Pointer to wireless phy
|
|
|
- * @wdev: Pointer to wireless device
|
|
|
- * @data: Pointer to data
|
|
|
- * @data_len: Data length
|
|
|
- *
|
|
|
- * Return: 0 on success, negative errno on failure
|
|
|
- */
|
|
|
-static int
|
|
|
-__wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data,
|
|
|
- int data_len)
|
|
|
-{
|
|
|
- struct sir_set_ssid_hotlist_request *request;
|
|
|
- struct net_device *dev = wdev->netdev;
|
|
|
- hdd_adapter_t *adapter = WLAN_HDD_GET_PRIV_PTR(dev);
|
|
|
- hdd_context_t *hdd_ctx = wiphy_priv(wiphy);
|
|
|
- struct nlattr *tb[PARAM_MAX + 1];
|
|
|
- struct hdd_ext_scan_context *context;
|
|
|
- uint32_t request_id;
|
|
|
- QDF_STATUS status;
|
|
|
- int retval;
|
|
|
- unsigned long rc;
|
|
|
-
|
|
|
- ENTER_DEV(dev);
|
|
|
-
|
|
|
- if (QDF_GLOBAL_FTM_MODE == hdd_get_conparam()) {
|
|
|
- hdd_err("Command not allowed in FTM mode");
|
|
|
- return -EPERM;
|
|
|
- }
|
|
|
-
|
|
|
- retval = wlan_hdd_validate_context(hdd_ctx);
|
|
|
- if (0 != retval)
|
|
|
- return -EINVAL;
|
|
|
-
|
|
|
- if (!hdd_ctx->config->extscan_enabled) {
|
|
|
- hdd_err("extscan not supported");
|
|
|
- return -ENOTSUPP;
|
|
|
- }
|
|
|
- if (nla_parse(tb, PARAM_MAX,
|
|
|
- data, data_len,
|
|
|
- wlan_hdd_extscan_config_policy)) {
|
|
|
- hdd_err("Invalid ATTR");
|
|
|
- return -EINVAL;
|
|
|
- }
|
|
|
-
|
|
|
- request = qdf_mem_malloc(sizeof(*request));
|
|
|
- if (!request) {
|
|
|
- hdd_err("qdf_mem_malloc failed");
|
|
|
- return -ENOMEM;
|
|
|
- }
|
|
|
-
|
|
|
- /* Parse and fetch request Id */
|
|
|
- if (!tb[PARAM_REQUEST_ID]) {
|
|
|
- hdd_err("attr request id failed");
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- request->request_id = nla_get_u32(tb[PARAM_REQUEST_ID]);
|
|
|
- hdd_notice("Request Id %d", request->request_id);
|
|
|
-
|
|
|
- request->session_id = adapter->sessionId;
|
|
|
- hdd_notice("Session Id %d", request->session_id);
|
|
|
-
|
|
|
- request->lost_ssid_sample_size = 0;
|
|
|
- request->ssid_count = 0;
|
|
|
-
|
|
|
- context = &ext_scan_context;
|
|
|
- spin_lock(&context->context_lock);
|
|
|
- INIT_COMPLETION(context->response_event);
|
|
|
- context->request_id = request_id = request->request_id;
|
|
|
- spin_unlock(&context->context_lock);
|
|
|
-
|
|
|
- status = sme_set_ssid_hotlist(hdd_ctx->hHal, request);
|
|
|
- if (!QDF_IS_STATUS_SUCCESS(status)) {
|
|
|
- hdd_err("sme_reset_ssid_hotlist failed(err=%d)", status);
|
|
|
- goto fail;
|
|
|
- }
|
|
|
-
|
|
|
- qdf_mem_free(request);
|
|
|
-
|
|
|
- /* request was sent -- wait for the response */
|
|
|
- rc = wait_for_completion_timeout(&context->response_event,
|
|
|
- msecs_to_jiffies
|
|
|
- (WLAN_WAIT_TIME_EXTSCAN));
|
|
|
- if (!rc) {
|
|
|
- hdd_err("sme_reset_ssid_hotlist timed out");
|
|
|
- retval = -ETIMEDOUT;
|
|
|
- } else {
|
|
|
- spin_lock(&context->context_lock);
|
|
|
- if (context->request_id == request_id)
|
|
|
- retval = context->response_status;
|
|
|
- else
|
|
|
- retval = -EINVAL;
|
|
|
- spin_unlock(&context->context_lock);
|
|
|
- }
|
|
|
-
|
|
|
- return retval;
|
|
|
-
|
|
|
-fail:
|
|
|
- qdf_mem_free(request);
|
|
|
- return -EINVAL;
|
|
|
-}
|
|
|
-
|
|
|
-/*
|
|
|
- * done with short names for the global vendor params
|
|
|
- * used by wlan_hdd_cfg80211_extscan_reset_ssid_hotlist()
|
|
|
- */
|
|
|
-#undef PARAM_MAX
|
|
|
-#undef PARAM_REQUEST_ID
|
|
|
-
|
|
|
-/**
|
|
|
- * wlan_hdd_cfg80211_extscan_reset_ssid_hotlist() - reset ssid hot list
|
|
|
- * @wiphy: Pointer to wireless phy
|
|
|
- * @wdev: Pointer to wireless device
|
|
|
- * @data: Pointer to data
|
|
|
- * @data_len: Data length
|
|
|
- *
|
|
|
- * Return: 0 on success, negative errno on failure
|
|
|
- */
|
|
|
-int
|
|
|
-wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(struct wiphy *wiphy,
|
|
|
- struct wireless_dev *wdev,
|
|
|
- const void *data,
|
|
|
- int data_len)
|
|
|
-{
|
|
|
- int ret;
|
|
|
-
|
|
|
- cds_ssr_protect(__func__);
|
|
|
- ret = __wlan_hdd_cfg80211_extscan_reset_ssid_hotlist(wiphy, wdev,
|
|
|
- data, data_len);
|
|
|
- cds_ssr_unprotect(__func__);
|
|
|
-
|
|
|
- return ret;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* wlan_hdd_init_completion_extwow() - Initialize ext wow variable
|
|
|
* @hdd_ctx: Global HDD context
|