|
@@ -112,503 +112,6 @@ enum extscan_report_events_type {
|
|
|
#define WMA_EXTSCAN_MAX_HOTLIST_ENTRIES 10
|
|
|
#endif
|
|
|
|
|
|
-/**
|
|
|
- * wma_is_mcc_24G() - check that if device is in 2.4GHz MCC
|
|
|
- * @handle: wma handle
|
|
|
- *
|
|
|
- * Return: true/false
|
|
|
- */
|
|
|
-static bool wma_is_mcc_24G(WMA_HANDLE handle)
|
|
|
-{
|
|
|
- tp_wma_handle wma_handle = (tp_wma_handle) handle;
|
|
|
- int32_t prev_chan = 0;
|
|
|
- int32_t i;
|
|
|
-
|
|
|
- if (NULL == wma_handle) {
|
|
|
- WMA_LOGE("%s: wma_handle is NULL", __func__);
|
|
|
- return false;
|
|
|
- }
|
|
|
- for (i = 0; i < wma_handle->max_bssid; i++) {
|
|
|
- if (wma_handle->interfaces[i].handle &&
|
|
|
- wma_is_vdev_up(i)) {
|
|
|
- if ((prev_chan != 0 &&
|
|
|
- prev_chan != wma_handle->interfaces[i].mhz) &&
|
|
|
- (wma_handle->interfaces[i].mhz <=
|
|
|
- CDS_CHAN_14_FREQ))
|
|
|
- return true;
|
|
|
- prev_chan = wma_handle->interfaces[i].mhz;
|
|
|
- }
|
|
|
- }
|
|
|
- return false;
|
|
|
-}
|
|
|
-
|
|
|
-static inline int wma_get_burst_duration(int max_ch_time, int miracast_value)
|
|
|
-{
|
|
|
- int burst_duration = 0;
|
|
|
-
|
|
|
- if (miracast_value) {
|
|
|
- /* When miracast is running, burst
|
|
|
- * duration needs to be minimum to avoid
|
|
|
- * any stutter or glitch in miracast
|
|
|
- * during station scan
|
|
|
- */
|
|
|
- if (max_ch_time <= WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION)
|
|
|
- burst_duration = max_ch_time;
|
|
|
- else
|
|
|
- burst_duration = WMA_GO_MIN_ACTIVE_SCAN_BURST_DURATION;
|
|
|
- } else {
|
|
|
- /* If miracast is not running, accommodate max
|
|
|
- * stations to make the scans faster
|
|
|
- */
|
|
|
- burst_duration = WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS *
|
|
|
- max_ch_time;
|
|
|
- if (burst_duration > WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION) {
|
|
|
- uint8_t channels = WMA_P2P_SCAN_MAX_BURST_DURATION /
|
|
|
- max_ch_time;
|
|
|
-
|
|
|
- if (channels)
|
|
|
- burst_duration = channels * max_ch_time;
|
|
|
- else
|
|
|
- burst_duration =
|
|
|
- WMA_GO_MAX_ACTIVE_SCAN_BURST_DURATION;
|
|
|
- }
|
|
|
- }
|
|
|
- return burst_duration;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * wma_get_buf_start_scan_cmd() - Fill start scan command
|
|
|
- * @wma_handle: wma handle
|
|
|
- * @scan_req: scan request
|
|
|
- * @cmd: wmi buffer to be filled in
|
|
|
- *
|
|
|
- * Fill individual elements of wmi_start_scan_req and TLV for
|
|
|
- * channel list, bssid, ssid etc.
|
|
|
- *
|
|
|
- * Return: QDF status
|
|
|
- */
|
|
|
-QDF_STATUS wma_get_buf_start_scan_cmd(tp_wma_handle wma_handle,
|
|
|
- tSirScanOffloadReq *scan_req,
|
|
|
- struct scan_req_params *cmd)
|
|
|
-{
|
|
|
- QDF_STATUS qdf_status = QDF_STATUS_E_FAILURE;
|
|
|
- uint32_t dwell_time;
|
|
|
- uint8_t SSID_num;
|
|
|
- int i;
|
|
|
- tpAniSirGlobal pMac = cds_get_context(QDF_MODULE_ID_PE);
|
|
|
-
|
|
|
- if (!pMac) {
|
|
|
- WMA_LOGP("%s: pMac is NULL!", __func__);
|
|
|
- return QDF_STATUS_E_FAILURE;
|
|
|
- }
|
|
|
-
|
|
|
- if (scan_req->uIEFieldLen > WLAN_SCAN_PARAMS_MAX_IE_LEN) {
|
|
|
- WMA_LOGD(FL("scan_ie_len (%d) greater than max (%d)"),
|
|
|
- scan_req->uIEFieldLen, WLAN_SCAN_PARAMS_MAX_IE_LEN);
|
|
|
- return QDF_STATUS_E_INVAL;
|
|
|
- }
|
|
|
-
|
|
|
- cmd->vdev_id = scan_req->sessionId;
|
|
|
- /*
|
|
|
- * host cycles through the lower 12 bits for scan id generation
|
|
|
- * and prefix 0xA000 to scan id
|
|
|
- */
|
|
|
- if (scan_req->scan_id < WMA_HOST_SCAN_REQID_PREFIX) {
|
|
|
- WMA_LOGE("Received scan_id 0x%x is wrong",
|
|
|
- cmd->scan_id);
|
|
|
- scan_req->scan_id = scan_req->scan_id & WMA_SCAN_ID_MASK;
|
|
|
- /* Appending the 0xA000 to scan Id*/
|
|
|
- cmd->scan_id = scan_req->scan_id | WMA_HOST_SCAN_REQID_PREFIX;
|
|
|
- } else {
|
|
|
- cmd->scan_id = scan_req->scan_id;
|
|
|
- }
|
|
|
- cmd->scan_priority = WMI_SCAN_PRIORITY_LOW;
|
|
|
- cmd->scan_req_id = scan_req->scan_requestor_id;
|
|
|
-
|
|
|
- if (PREAUTH_REQUESTOR_ID == cmd->scan_req_id)
|
|
|
- cmd->scan_priority = WMI_SCAN_PRIORITY_VERY_HIGH;
|
|
|
-
|
|
|
- /* Set the scan events which the driver is intereseted to receive */
|
|
|
- /* TODO: handle all the other flags also */
|
|
|
- cmd->scan_events = WMI_SCAN_EVENT_STARTED |
|
|
|
- WMI_SCAN_EVENT_START_FAILED |
|
|
|
- WMI_SCAN_EVENT_FOREIGN_CHANNEL |
|
|
|
- WMI_SCAN_EVENT_COMPLETED |
|
|
|
- WMI_SCAN_EVENT_DEQUEUED |
|
|
|
- WMI_SCAN_EVENT_PREEMPTED |
|
|
|
- WMI_SCAN_EVENT_RESTARTED;
|
|
|
-
|
|
|
- cmd->dwell_time_active = scan_req->maxChannelTime;
|
|
|
-
|
|
|
- if (scan_req->scanType == eSIR_ACTIVE_SCAN) {
|
|
|
- /* In Active scan case, the firmware has to do passive scan on
|
|
|
- * DFS channels So the passive scan duration should be updated
|
|
|
- * properly so that the duration will be sufficient enough to
|
|
|
- * receive the beacon from AP
|
|
|
- */
|
|
|
- if (wlan_cfg_get_int(pMac, WNI_CFG_PASSIVE_MAXIMUM_CHANNEL_TIME,
|
|
|
- &dwell_time) != eSIR_SUCCESS) {
|
|
|
- WMA_LOGE("Failed to get passive max channel value using default value");
|
|
|
- dwell_time = WMA_DWELL_TIME_PASSIVE_DEFAULT;
|
|
|
- }
|
|
|
- cmd->dwell_time_passive = dwell_time;
|
|
|
- } else
|
|
|
- cmd->dwell_time_passive = scan_req->maxChannelTime;
|
|
|
-
|
|
|
- /* Ensure correct number of probes are sent on active channel */
|
|
|
- cmd->repeat_probe_time =
|
|
|
- cmd->dwell_time_active / WMA_SCAN_NPROBES_DEFAULT;
|
|
|
-
|
|
|
- WMA_LOGD("Repeat probe time %d", cmd->repeat_probe_time);
|
|
|
- /* CSR sends min_rest_Time, max_rest_time and idle_time
|
|
|
- * for staying on home channel to continue data traffic.
|
|
|
- * Rome fw has facility to monitor the traffic
|
|
|
- * and move to next channel. Stay on the channel for min_rest_time
|
|
|
- * and then leave if there is no traffic.
|
|
|
- */
|
|
|
- cmd->min_rest_time = scan_req->min_rest_time;
|
|
|
- cmd->max_rest_time = scan_req->restTime;
|
|
|
-
|
|
|
- /* Check for traffic at idle_time interval after min_rest_time.
|
|
|
- * Default value is 25 ms to allow full use of max_rest_time
|
|
|
- * when voice packets are running at 20 ms interval.
|
|
|
- */
|
|
|
- cmd->idle_time = scan_req->idle_time;
|
|
|
-
|
|
|
-
|
|
|
- /* Large timeout value for full scan cycle, 30 seconds */
|
|
|
- cmd->max_scan_time = WMA_HW_DEF_SCAN_MAX_DURATION;
|
|
|
-
|
|
|
- /* add DS param IE in probe req frame */
|
|
|
- cmd->scan_f_add_ds_ie_in_probe = true;
|
|
|
-
|
|
|
- /* set flag to get chan stats */
|
|
|
- if (pMac->snr_monitor_enabled)
|
|
|
- cmd->scan_f_chan_stat_evnt = true;
|
|
|
-
|
|
|
- /* do not add OFDM rates in 11B mode */
|
|
|
- if (scan_req->dot11mode != WNI_CFG_DOT11_MODE_11B)
|
|
|
- cmd->scan_f_ofdm_rates = true;
|
|
|
- else
|
|
|
- WMA_LOGD("OFDM_RATES not included in 11B mode");
|
|
|
-
|
|
|
- if (scan_req->p2pScanType)
|
|
|
- cmd->adaptive_dwell_time_mode = WMI_DWELL_MODE_STATIC;
|
|
|
-
|
|
|
- /* Do not combine multiple channels in a single burst. Come back
|
|
|
- * to home channel for data traffic after every foreign channel.
|
|
|
- * By default, prefer throughput performance over scan cycle time.
|
|
|
- */
|
|
|
- cmd->burst_duration = 0;
|
|
|
-
|
|
|
- if (!scan_req->p2pScanType) {
|
|
|
- WMA_LOGD("Normal Scan request");
|
|
|
- cmd->scan_f_cck_rates = true;
|
|
|
- if (!scan_req->numSsid)
|
|
|
- cmd->scan_f_bcast_probe = true;
|
|
|
- if (scan_req->scanType == eSIR_PASSIVE_SCAN)
|
|
|
- cmd->scan_f_passive = true;
|
|
|
- cmd->scan_f_add_tpc_ie_in_probe = true;
|
|
|
- cmd->scan_f_filter_prb_req = true;
|
|
|
-
|
|
|
- if (pMac->sap.acs_with_more_param) {
|
|
|
- /* add chan stat info report tag */
|
|
|
- if (pMac->sme.currDeviceMode == QDF_SAP_MODE) {
|
|
|
- cmd->scan_f_chan_stat_evnt = true;
|
|
|
- WMA_LOGD("set ACS ctrl BIT");
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- /*
|
|
|
- * Decide burst_duration and dwell_time_active based on
|
|
|
- * what type of devices are active.
|
|
|
- */
|
|
|
- do {
|
|
|
- if (wma_is_sap_active(wma_handle) &&
|
|
|
- wma_is_p2p_go_active(wma_handle) &&
|
|
|
- wma_is_sta_active(wma_handle)) {
|
|
|
- if (scan_req->maxChannelTime <=
|
|
|
- WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION)
|
|
|
- cmd->burst_duration =
|
|
|
- scan_req->maxChannelTime;
|
|
|
- else
|
|
|
- cmd->burst_duration =
|
|
|
- WMA_3PORT_CONC_SCAN_MAX_BURST_DURATION;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (wma_handle->miracast_value &&
|
|
|
- wma_is_mcc_24G(wma_handle)) {
|
|
|
- cmd->max_rest_time =
|
|
|
- pMac->f_sta_miracast_mcc_rest_time_val;
|
|
|
- }
|
|
|
- if (wma_is_p2p_go_active(wma_handle)) {
|
|
|
- /* Background scan while GO is sending beacons.
|
|
|
- * Every off-channel transition has overhead of
|
|
|
- * 2 beacon intervals for NOA. Maximize number
|
|
|
- * of channels in every transition by using
|
|
|
- * burst scan.
|
|
|
- */
|
|
|
- cmd->burst_duration =
|
|
|
- wma_get_burst_duration(
|
|
|
- scan_req->maxChannelTime,
|
|
|
- wma_handle->miracast_value);
|
|
|
-
|
|
|
- break;
|
|
|
- }
|
|
|
- if (wma_is_sta_active(wma_handle) ||
|
|
|
- wma_is_p2p_cli_active(wma_handle)) {
|
|
|
- if (scan_req->burst_scan_duration)
|
|
|
- cmd->burst_duration =
|
|
|
- scan_req->burst_scan_duration;
|
|
|
- else
|
|
|
- /* Typical background scan.
|
|
|
- * Disable burst scan for now.
|
|
|
- */
|
|
|
- cmd->burst_duration = 0;
|
|
|
- break;
|
|
|
- }
|
|
|
- if (wma_is_ndi_active(wma_handle)) {
|
|
|
- cmd->burst_duration = wma_get_burst_duration(
|
|
|
- scan_req->maxChannelTime,
|
|
|
- wma_handle->miracast_value);
|
|
|
- WMA_LOGD("NDI Active, Burst duration: %x",
|
|
|
- cmd->burst_duration);
|
|
|
- break;
|
|
|
- }
|
|
|
- } while (0);
|
|
|
-
|
|
|
- } else {
|
|
|
- WMA_LOGD("P2P Scan");
|
|
|
- switch (scan_req->p2pScanType) {
|
|
|
- case P2P_SCAN_TYPE_LISTEN:
|
|
|
- WMA_LOGD("P2P_SCAN_TYPE_LISTEN");
|
|
|
- cmd->scan_f_passive = true;
|
|
|
- cmd->scan_events |=
|
|
|
- WMI_SCAN_EVENT_FOREIGN_CHANNEL;
|
|
|
- cmd->repeat_probe_time = 0;
|
|
|
- cmd->scan_priority = WMI_SCAN_PRIORITY_HIGH;
|
|
|
- break;
|
|
|
- case P2P_SCAN_TYPE_SEARCH:
|
|
|
- WMA_LOGD("P2P_SCAN_TYPE_SEARCH");
|
|
|
- cmd->scan_f_filter_prb_req = true;
|
|
|
- /* Default P2P burst duration of 120 ms will cover
|
|
|
- * 3 channels with default max dwell time 40 ms.
|
|
|
- * Cap limit will be set by
|
|
|
- * WMA_P2P_SCAN_MAX_BURST_DURATION. Burst duration
|
|
|
- * should be such that no channel is scanned less
|
|
|
- * than the dwell time in normal scenarios.
|
|
|
- */
|
|
|
- if (scan_req->channelList.numChannels ==
|
|
|
- P2P_SOCIAL_CHANNELS
|
|
|
- && (!(wma_handle->miracast_value)))
|
|
|
- cmd->repeat_probe_time =
|
|
|
- scan_req->maxChannelTime / 5;
|
|
|
- else
|
|
|
- cmd->repeat_probe_time =
|
|
|
- scan_req->maxChannelTime / 3;
|
|
|
-
|
|
|
- cmd->burst_duration =
|
|
|
- WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS *
|
|
|
- scan_req->maxChannelTime;
|
|
|
- if (cmd->burst_duration >
|
|
|
- WMA_P2P_SCAN_MAX_BURST_DURATION) {
|
|
|
- uint8_t channels =
|
|
|
- WMA_P2P_SCAN_MAX_BURST_DURATION /
|
|
|
- scan_req->maxChannelTime;
|
|
|
- if (channels)
|
|
|
- cmd->burst_duration =
|
|
|
- channels * scan_req->maxChannelTime;
|
|
|
- else
|
|
|
- cmd->burst_duration =
|
|
|
- WMA_P2P_SCAN_MAX_BURST_DURATION;
|
|
|
- }
|
|
|
- cmd->scan_priority = WMI_SCAN_PRIORITY_MEDIUM;
|
|
|
- break;
|
|
|
- default:
|
|
|
- WMA_LOGE("Invalid scan type");
|
|
|
- goto error;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (wma_is_sap_active(wma_handle)) {
|
|
|
- /* P2P/STA scan while SoftAP is sending beacons.
|
|
|
- * Max duration of CTS2self is 32 ms, which limits the
|
|
|
- * dwell time. If DBS is supported and if SAP is on 2G channel
|
|
|
- * then keep passive dwell time default.
|
|
|
- */
|
|
|
- cmd->dwell_time_active =
|
|
|
- QDF_MIN(scan_req->maxChannelTime,
|
|
|
- (WMA_CTS_DURATION_MS_MAX -
|
|
|
- WMA_ROAM_SCAN_CHANNEL_SWITCH_TIME));
|
|
|
- if (!policy_mgr_is_hw_dbs_capable(wma_handle->psoc) ||
|
|
|
- (policy_mgr_is_hw_dbs_capable(wma_handle->psoc) &&
|
|
|
- WLAN_REG_IS_5GHZ_CH(
|
|
|
- policy_mgr_get_channel(wma_handle->psoc,
|
|
|
- PM_SAP_MODE, NULL)))) {
|
|
|
- cmd->dwell_time_passive = cmd->dwell_time_active;
|
|
|
- }
|
|
|
- cmd->burst_duration = 0;
|
|
|
- if (wlan_reg_is_dfs_ch(wma_handle->pdev,
|
|
|
- policy_mgr_get_channel(wma_handle->psoc,
|
|
|
- PM_SAP_MODE, NULL)))
|
|
|
- cmd->burst_duration =
|
|
|
- WMA_BURST_SCAN_MAX_NUM_OFFCHANNELS *
|
|
|
- scan_req->maxChannelTime;
|
|
|
- WMA_LOGI("SAP: burst_duration: %d", cmd->burst_duration);
|
|
|
- }
|
|
|
-
|
|
|
- cmd->n_probes = (cmd->repeat_probe_time > 0) ?
|
|
|
- cmd->dwell_time_active / cmd->repeat_probe_time : 0;
|
|
|
-
|
|
|
- WMA_LOGD("Num Probes in each ch scan %d", cmd->n_probes);
|
|
|
- if (scan_req->channelList.numChannels) {
|
|
|
- cmd->chan_list.num_chan = scan_req->channelList.numChannels;
|
|
|
- for (i = 0; i < scan_req->channelList.numChannels; ++i) {
|
|
|
- cmd->chan_list.chan[i].freq =
|
|
|
- cds_chan_to_freq(scan_req->channelList.
|
|
|
- channelNumber[i]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (scan_req->numSsid > SIR_SCAN_MAX_NUM_SSID) {
|
|
|
- WMA_LOGE("Invalid value for numSsid");
|
|
|
- goto error;
|
|
|
- }
|
|
|
-
|
|
|
- cmd->num_ssids = scan_req->numSsid;
|
|
|
-
|
|
|
- if (scan_req->numSsid) {
|
|
|
- for (i = 0; i < scan_req->numSsid; ++i) {
|
|
|
- cmd->ssid[i].length = scan_req->ssId[i].length;
|
|
|
- qdf_mem_copy(cmd->ssid[i].ssid,
|
|
|
- scan_req->ssId[i].ssId,
|
|
|
- scan_req->ssId[i].length);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- if (!scan_req->p2pScanType) {
|
|
|
- if (wma_is_sap_active(wma_handle)) {
|
|
|
- SSID_num = cmd->num_ssids * cmd->num_bssid;
|
|
|
- cmd->repeat_probe_time = probe_time_dwell_time_map[
|
|
|
- QDF_MIN(SSID_num,
|
|
|
- WMA_DWELL_TIME_PROBE_TIME_MAP_SIZE
|
|
|
- - 1)].probe_time;
|
|
|
- cmd->n_probes = (cmd->repeat_probe_time > 0) ?
|
|
|
- cmd->dwell_time_active/
|
|
|
- cmd->repeat_probe_time : 0;
|
|
|
- }
|
|
|
- }
|
|
|
- WMA_LOGD("Scan Type 0x%x, Active dwell time %u, Passive dwell time %u",
|
|
|
- scan_req->scanType, cmd->dwell_time_active,
|
|
|
- cmd->dwell_time_passive);
|
|
|
- WMA_LOGD("Scan repeat_probe_time %u n_probes %u num_ssids %u num_bssid %u",
|
|
|
- cmd->repeat_probe_time, cmd->n_probes, cmd->num_ssids,
|
|
|
- cmd->num_bssid);
|
|
|
-
|
|
|
- cmd->num_bssid = 1;
|
|
|
- qdf_mem_copy(cmd->bssid_list, scan_req->bssId.bytes, QDF_MAC_ADDR_SIZE);
|
|
|
- cmd->extraie.len = scan_req->uIEFieldLen;
|
|
|
- cmd->extraie.ptr = (uint8_t *) scan_req +
|
|
|
- (scan_req->uIEFieldOffset);
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
-error:
|
|
|
- return qdf_status;
|
|
|
-}
|
|
|
-
|
|
|
-/**
|
|
|
- * wma_start_scan() - start scan command
|
|
|
- * @wma_handle: wma handle
|
|
|
- * @scan_req: scan request params
|
|
|
- * @msg_type: message time
|
|
|
- *
|
|
|
- * Send start scan command to fw.
|
|
|
- *
|
|
|
- * Return: QDF status
|
|
|
- */
|
|
|
-QDF_STATUS wma_start_scan(tp_wma_handle wma_handle,
|
|
|
- tSirScanOffloadReq *scan_req, uint16_t msg_type)
|
|
|
-{
|
|
|
- uint32_t vdev_id, scan_id;
|
|
|
- QDF_STATUS qdf_status = QDF_STATUS_SUCCESS;
|
|
|
- struct scan_req_params cmd = {0};
|
|
|
- tSirScanOffloadEvent *scan_event;
|
|
|
-
|
|
|
- if (scan_req->sessionId >= wma_handle->max_bssid) {
|
|
|
- WMA_LOGE("%s: Invalid vdev_id %d, msg_type : 0x%x", __func__,
|
|
|
- scan_req->sessionId, msg_type);
|
|
|
- goto error1;
|
|
|
- }
|
|
|
-
|
|
|
- /* Sanity check to find whether vdev id active or not */
|
|
|
- if (msg_type != WMA_START_SCAN_OFFLOAD_REQ &&
|
|
|
- !wma_handle->interfaces[scan_req->sessionId].handle) {
|
|
|
- WMA_LOGA("vdev id [%d] is not active", scan_req->sessionId);
|
|
|
- goto error1;
|
|
|
- }
|
|
|
-
|
|
|
- /* Fill individual elements of wmi_start_scan_req and
|
|
|
- * TLV for channel list, bssid, ssid etc ...
|
|
|
- */
|
|
|
- qdf_status = wma_get_buf_start_scan_cmd(wma_handle, scan_req,
|
|
|
- &cmd);
|
|
|
- if (qdf_status != QDF_STATUS_SUCCESS) {
|
|
|
- WMA_LOGE("Failed to get buffer for start scan cmd");
|
|
|
- goto error1;
|
|
|
- }
|
|
|
-
|
|
|
- WMA_LOGI("scan_id 0x%x, vdev_id %d, p2pScanType %d, msg_type 0x%x",
|
|
|
- cmd.scan_id, cmd.vdev_id, scan_req->p2pScanType, msg_type);
|
|
|
-
|
|
|
- /*
|
|
|
- * Cache vdev_id and scan_id because cmd is freed after calling
|
|
|
- * wmi_unified_cmd_send cmd. WMI internally frees cmd buffer after
|
|
|
- * getting TX complete from CE
|
|
|
- */
|
|
|
- vdev_id = cmd.vdev_id;
|
|
|
- scan_id = cmd.scan_id;
|
|
|
- WMA_LOGD("ActiveDwell %d, PassiveDwell %d, ScanFlags 0x%x NumChan %d",
|
|
|
- cmd.dwell_time_active, cmd.dwell_time_passive,
|
|
|
- cmd.scan_flags, cmd.chan_list.num_chan);
|
|
|
-
|
|
|
- /* Call the wmi api to request the scan */
|
|
|
- qdf_status = wmi_unified_scan_start_cmd_send(wma_handle->wmi_handle,
|
|
|
- &cmd);
|
|
|
- if (QDF_IS_STATUS_ERROR(qdf_status)) {
|
|
|
- WMA_LOGE("wmi_unified_cmd_send returned Error %d", qdf_status);
|
|
|
- goto error1;
|
|
|
- }
|
|
|
-
|
|
|
- WMA_LOGD("WMA --> WMI_START_SCAN_CMDID");
|
|
|
-
|
|
|
- return QDF_STATUS_SUCCESS;
|
|
|
-
|
|
|
-error1:
|
|
|
-
|
|
|
- /* Send completion event for only for start scan request */
|
|
|
- if (msg_type == WMA_START_SCAN_OFFLOAD_REQ) {
|
|
|
- scan_event =
|
|
|
- (tSirScanOffloadEvent *)
|
|
|
- qdf_mem_malloc(sizeof(tSirScanOffloadEvent));
|
|
|
- if (!scan_event) {
|
|
|
- WMA_LOGP("%s: Failed to allocate memory for scan rsp",
|
|
|
- __func__);
|
|
|
- return QDF_STATUS_E_NOMEM;
|
|
|
- }
|
|
|
- memset(scan_event, 0x00, sizeof(*scan_event));
|
|
|
- scan_event->event = WMI_SCAN_EVENT_COMPLETED;
|
|
|
- scan_event->reasonCode = eSIR_SME_SCAN_FAILED;
|
|
|
- scan_event->sessionId = scan_req->sessionId;
|
|
|
- scan_event->p2pScanType = scan_req->p2pScanType;
|
|
|
- scan_event->scanId = scan_req->scan_id;
|
|
|
- scan_event->requestor = scan_req->scan_requestor_id;
|
|
|
- wma_send_msg(wma_handle, WMA_RX_SCAN_EVENT, (void *)scan_event,
|
|
|
- 0);
|
|
|
- }
|
|
|
-
|
|
|
- return qdf_status;
|
|
|
-}
|
|
|
-
|
|
|
/**
|
|
|
* wma_update_channel_list() - update channel list
|
|
|
* @handle: wma handle
|