software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Wait mlan ioctl complete
 *
 *  @param priv         A pointer to moal_private structure
 *  @param req          A pointer to mlan_ioctl_req structure
 *  @param wait_option  Wait option
 *
 *  @return             N/A
 */
@brief Wait mlan ioctl complete
@param priv         A pointer to moal_private structure
@param req          A pointer to mlan_ioctl_req structure
@param wait_option  Wait option

@return             N/A
@brief Wait mlan ioctl complete @param priv A pointer to moal_private structure @param req A pointer to mlan_ioctl_req structure @param wait_option Wait option @return N / A
static inline mlan_status
woal_wait_ioctl_complete(moal_private *priv, mlan_ioctl_req *req,
			 t_u8 wait_option)
{
	mlan_status status;
	wait_queue *wait = (wait_queue *)req->reserved_1;
	unsigned long flags;
	ENTER();
	priv->phandle->ioctl_timeout = MFALSE;
	switch (wait_option) {
	case MOAL_NO_WAIT:
		break;
	case MOAL_IOCTL_WAIT:
		while (wait_event_interruptible_exclusive
		       (wait->wait, wait->condition)
		       == -ERESTARTSYS && wait->retry < MAX_RETRY_CNT) {
			wait->retry++;
		}
		break;
	case MOAL_IOCTL_WAIT_TIMEOUT:
		wait_event_timeout(wait->wait, wait->condition,
				   MOAL_IOCTL_TIMEOUT);
		break;
	}
	spin_lock_irqsave(&priv->phandle->driver_lock, flags);
	if (wait->condition == MFALSE) {
		if (wait_option == MOAL_IOCTL_WAIT_TIMEOUT) {
			priv->phandle->ioctl_timeout = MTRUE;
			PRINTM(MMSG,
			       "wlan: IOCTL timeout %p id=0x%x, sub_id=0x%x, wait_option=%d, action=%d\n",
			       req, req->req_id, (*(t_u32 *)req->pbuf),
			       wait_option, (int)req->action);
		} else {
			PRINTM(MMSG,
			       "wlan: IOCTL by signal %p id=0x%x, sub_id=0x%x, wait_option=%d, action=%d\n",
			       req, req->req_id, (*(t_u32 *)req->pbuf),
			       wait_option, (int)req->action);
		}
		req->reserved_1 = 0;
		status = MLAN_STATUS_PENDING;
	} else {
		status = wait->status;
	}
	spin_unlock_irqrestore(&priv->phandle->driver_lock, flags);
	LEAVE();
	return status;
}
static inline mlan_status woal_wait_ioctl_complete ( moal_private * priv , mlan_ioctl_req * req , t_u8 wait_option ) { mlan_status status ; wait_queue * wait = ( wait_queue * ) req -> reserved_1 ; unsigned long flags ; ENTER ( ) ; priv -> phandle -> ioctl_timeout = MFALSE ; switch ( wait_option ) { case MOAL_NO_WAIT : break ; case MOAL_IOCTL_WAIT : while ( wait_event_interruptible_exclusive ( wait -> wait , wait -> condition ) == - ERESTARTSYS && wait -> retry < MAX_RETRY_CNT ) { wait -> retry ++ ; } break ; case MOAL_IOCTL_WAIT_TIMEOUT : wait_event_timeout ( wait -> wait , wait -> condition , MOAL_IOCTL_TIMEOUT ) ; break ; } spin_lock_irqsave ( & priv -> phandle -> driver_lock , flags ) ; if ( wait -> condition == MFALSE ) { if ( wait_option == MOAL_IOCTL_WAIT_TIMEOUT ) { priv -> phandle -> ioctl_timeout = MTRUE ; PRINTM ( MMSG , " \n " , req , req -> req_id , ( * ( t_u32 * ) req -> pbuf ) , wait_option , ( int ) req -> action ) ; } else { PRINTM ( MMSG , " \n " , req , req -> req_id , ( * ( t_u32 * ) req -> pbuf ) , wait_option , ( int ) req -> action ) ; } req -> reserved_1 = 0 ; status = MLAN_STATUS_PENDING ; } else { status = wait -> status ; } spin_unlock_irqrestore ( & priv -> phandle -> driver_lock , flags ) ; LEAVE ( ) ; return status ; }
@brief Wait mlan ioctl complete
  @param priv         A pointer to moal_private structure
  @param req          A pointer to mlan_ioctl_req structure
  @param wait_option  Wait option
@brief Wait mlan ioctl complete @param priv A pointer to moal_private structure @param req A pointer to mlan_ioctl_req structure @param wait_option Wait option