software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 * @brief Set sleep period
 *
 * @param priv     A pointer to moal_private structure
 * @param psleeppd A pointer to sleep period configuration structure
 *
 * @return         MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief Set sleep period
@param priv     A pointer to moal_private structure
@param psleeppd A pointer to sleep period configuration structure

@return         MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief Set sleep period @param priv A pointer to moal_private structure @param psleeppd A pointer to sleep period configuration structure @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_set_sleeppd(moal_private *priv, char *psleeppd)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	mlan_ds_pm_cfg *pm_cfg = NULL;
	mlan_ioctl_req *req = NULL;
	int sleeppd = 0;
	ENTER();
	if (MLAN_STATUS_SUCCESS != woal_atoi(&sleeppd, psleeppd)) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	PRINTM(MIOCTL, "set sleeppd=%d\n", sleeppd);
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_pm_cfg));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	pm_cfg = (mlan_ds_pm_cfg *)req->pbuf;
	pm_cfg->sub_command = MLAN_OID_PM_CFG_SLEEP_PD;
	req->req_id = MLAN_IOCTL_PM_CFG;
	if ((sleeppd <= MAX_SLEEP_PERIOD && sleeppd >= MIN_SLEEP_PERIOD) ||
	    (sleeppd == 0)
	    || (sleeppd == SLEEP_PERIOD_RESERVED_FF)
		) {
		req->action = MLAN_ACT_SET;
		pm_cfg->param.sleep_period = sleeppd;
	} else {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	ret = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
mlan_status woal_set_sleeppd ( moal_private * priv , char * psleeppd ) { mlan_status ret = MLAN_STATUS_SUCCESS ; mlan_ds_pm_cfg * pm_cfg = NULL ; mlan_ioctl_req * req = NULL ; int sleeppd = 0 ; ENTER ( ) ; if ( MLAN_STATUS_SUCCESS != woal_atoi ( & sleeppd , psleeppd ) ) { ret = MLAN_STATUS_FAILURE ; goto done ; } PRINTM ( MIOCTL , " \n " , sleeppd ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_pm_cfg ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } pm_cfg = ( mlan_ds_pm_cfg * ) req -> pbuf ; pm_cfg -> sub_command = MLAN_OID_PM_CFG_SLEEP_PD ; req -> req_id = MLAN_IOCTL_PM_CFG ; if ( ( sleeppd <= MAX_SLEEP_PERIOD && sleeppd >= MIN_SLEEP_PERIOD ) || ( sleeppd == 0 ) || ( sleeppd == SLEEP_PERIOD_RESERVED_FF ) ) { req -> action = MLAN_ACT_SET ; pm_cfg -> param . sleep_period = sleeppd ; } else { ret = MLAN_STATUS_FAILURE ; goto done ; } ret = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Set sleep period
 @param priv     A pointer to moal_private structure
 @param psleeppd A pointer to sleep period configuration structure
@brief Set sleep period @param priv A pointer to moal_private structure @param psleeppd A pointer to sleep period configuration structure