software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Get Deep Sleep
 *
 *  @param priv      Pointer to the moal_private driver data struct
 *  @param data      Pointer to return deep_sleep setting
 *
 *  @return          0 --success, otherwise fail
 */
@brief Get Deep Sleep
@param priv      Pointer to the moal_private driver data struct
@param data      Pointer to return deep_sleep setting

@return          0 --success, otherwise fail
@brief Get Deep Sleep @param priv Pointer to the moal_private driver data struct @param data Pointer to return deep_sleep setting @return 0 -- success otherwise fail
int
woal_get_deep_sleep(moal_private *priv, t_u32 *data)
{
	int ret = 0;
	mlan_ioctl_req *req = NULL;
	mlan_ds_pm_cfg *pm = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_pm_cfg));
	if (req == NULL) {
		LEAVE();
		return -ENOMEM;
	}
	pm = (mlan_ds_pm_cfg *)req->pbuf;
	pm->sub_command = MLAN_OID_PM_CFG_DEEP_SLEEP;
	req->req_id = MLAN_IOCTL_PM_CFG;
	req->action = MLAN_ACT_GET;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto done;
	}
	*data = pm->param.auto_deep_sleep.auto_ds;
	*(data + 1) = pm->param.auto_deep_sleep.idletime;
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
int woal_get_deep_sleep ( moal_private * priv , t_u32 * data ) { int ret = 0 ; mlan_ioctl_req * req = NULL ; mlan_ds_pm_cfg * pm = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_pm_cfg ) ) ; if ( req == NULL ) { LEAVE ( ) ; return - ENOMEM ; } pm = ( mlan_ds_pm_cfg * ) req -> pbuf ; pm -> sub_command = MLAN_OID_PM_CFG_DEEP_SLEEP ; req -> req_id = MLAN_IOCTL_PM_CFG ; req -> action = MLAN_ACT_GET ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } * data = pm -> param . auto_deep_sleep . auto_ds ; * ( data + 1 ) = pm -> param . auto_deep_sleep . idletime ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Get Deep Sleep
  @param priv      Pointer to the moal_private driver data struct
  @param data      Pointer to return deep_sleep setting
@brief Get Deep Sleep @param priv Pointer to the moal_private driver data struct @param data Pointer to return deep_sleep setting