software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Cancel pending scan
 *
 *  @param priv                 A pointer to moal_private structure
 *  @return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief Cancel pending scan
@param priv                 A pointer to moal_private structure
@return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief Cancel pending scan @param priv A pointer to moal_private structure @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_cancel_scan(moal_private *priv, t_u8 wait_option)
{
	mlan_ioctl_req *req = NULL;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	moal_handle *handle = priv->phandle;
	moal_private *scan_priv = handle->scan_priv;
#ifdef STA_CFG80211
	unsigned long flags;
#endif
	if (!handle->scan_pending_on_block || !scan_priv)
		return ret;
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_scan));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	req->req_id = MLAN_IOCTL_SCAN;
	req->action = MLAN_ACT_SET;
	((mlan_ds_scan *)req->pbuf)->sub_command = MLAN_OID_SCAN_CANCEL;
	ret = woal_request_ioctl(scan_priv, req, wait_option);
	handle->scan_pending_on_block = MFALSE;
	MOAL_REL_SEMAPHORE(&handle->async_sem);
#ifdef STA_CFG80211
	spin_lock_irqsave(&handle->scan_req_lock, flags);
	if (IS_STA_CFG80211(cfg80211_wext) && handle->scan_request) {
		if (scan_priv->bss_type == MLAN_BSS_TYPE_STA)
			woal_cfg80211_scan_done(handle->scan_request, MTRUE);
		else
			woal_cfg80211_scan_done(handle->scan_request, MFALSE);
		handle->scan_request = NULL;
	}
	spin_unlock_irqrestore(&handle->scan_req_lock, flags);
#endif
	woal_sched_timeout(10);
	handle->scan_priv = NULL;
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	return ret;
}
mlan_status woal_cancel_scan ( moal_private * priv , t_u8 wait_option ) { mlan_ioctl_req * req = NULL ; mlan_status ret = MLAN_STATUS_SUCCESS ; moal_handle * handle = priv -> phandle ; moal_private * scan_priv = handle -> scan_priv ; #ifdef STA_CFG80211 unsigned long flags ; #endif if ( ! handle -> scan_pending_on_block || ! scan_priv ) return ret ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_scan ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } req -> req_id = MLAN_IOCTL_SCAN ; req -> action = MLAN_ACT_SET ; ( ( mlan_ds_scan * ) req -> pbuf ) -> sub_command = MLAN_OID_SCAN_CANCEL ; ret = woal_request_ioctl ( scan_priv , req , wait_option ) ; handle -> scan_pending_on_block = MFALSE ; MOAL_REL_SEMAPHORE ( & handle -> async_sem ) ; #ifdef STA_CFG80211 spin_lock_irqsave ( & handle -> scan_req_lock , flags ) ; if ( IS_STA_CFG80211 ( cfg80211_wext ) && handle -> scan_request ) { if ( scan_priv -> bss_type == MLAN_BSS_TYPE_STA ) woal_cfg80211_scan_done ( handle -> scan_request , MTRUE ) ; else woal_cfg80211_scan_done ( handle -> scan_request , MFALSE ) ; handle -> scan_request = NULL ; } spin_unlock_irqrestore ( & handle -> scan_req_lock , flags ) ; #endif woal_sched_timeout ( 10 ) ; handle -> scan_priv = NULL ; done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; return ret ; }
@brief Cancel pending scan
  @param priv                 A pointer to moal_private structure
  @return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief Cancel pending scan @param priv A pointer to moal_private structure @return MLAN_STATUS_SUCCESS -- success otherwise fail
/* If scan is in process, cancel the scan command */ /** some supplicant can not handle SCAN abort event */ /* add 10ms delay, incase firmware delay 0x7f event after scan cancel command response */