software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief set power mode
 *
 *  @param priv                 A pointer to moal_private structure
 *  @param powermode            A pointer to powermode string.
 *
 *  @return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief set power mode
@param priv                 A pointer to moal_private structure
@param powermode            A pointer to powermode string.

@return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief set power mode @param priv A pointer to moal_private structure @param powermode A pointer to powermode string . @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_set_powermode(moal_private *priv, char *powermode)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	int disabled;
	ENTER();
	if (*powermode == '1') {
		PRINTM(MIOCTL, "Disable power save\n");
		disabled = 1;
	} else if (*powermode == '0') {
		PRINTM(MIOCTL, "Enable power save\n");
		disabled = 0;
	} else {
		PRINTM(MERROR, "unsupported power mode\n");
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	if (MLAN_STATUS_SUCCESS !=
	    woal_set_get_power_mgmt(priv, MLAN_ACT_SET, &disabled, 0,
				    MOAL_IOCTL_WAIT))
		ret = MLAN_STATUS_FAILURE;
done:
	LEAVE();
	return ret;
}
mlan_status woal_set_powermode ( moal_private * priv , char * powermode ) { mlan_status ret = MLAN_STATUS_SUCCESS ; int disabled ; ENTER ( ) ; if ( * powermode == ' ' ) { PRINTM ( MIOCTL , " \n " ) ; disabled = 1 ; } else if ( * powermode == ' ' ) { PRINTM ( MIOCTL , " \n " ) ; disabled = 0 ; } else { PRINTM ( MERROR , " \n " ) ; ret = MLAN_STATUS_FAILURE ; goto done ; } if ( MLAN_STATUS_SUCCESS != woal_set_get_power_mgmt ( priv , MLAN_ACT_SET , & disabled , 0 , MOAL_IOCTL_WAIT ) ) ret = MLAN_STATUS_FAILURE ; done : LEAVE ( ) ; return ret ; }
@brief set power mode
  @param priv                 A pointer to moal_private structure
  @param powermode            A pointer to powermode string.
@brief set power mode @param priv A pointer to moal_private structure @param powermode A pointer to powermode string .