software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 * @brief Set/Get WMM IE QoS configuration
 *
 * @param priv     A pointer to moal_private structure
 *  @param action  Action set or get
 * @param qos_cfg  A pointer to QoS configuration structure
 *
 * @return         MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief Set/Get WMM IE QoS configuration
@param priv     A pointer to moal_private structure
@param action  Action set or get
@param qos_cfg  A pointer to QoS configuration structure

@return         MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief Set / Get WMM IE QoS configuration @param priv A pointer to moal_private structure @param action Action set or get @param qos_cfg A pointer to QoS configuration structure @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_priv_qos_cfg(moal_private *priv, t_u32 action, char *qos_cfg)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	mlan_ds_wmm_cfg *cfg = NULL;
	mlan_ioctl_req *req = NULL;
	int qosinfo = 0;
	ENTER();
	if (qos_cfg == NULL) {
		PRINTM(MERROR, "QOS info buffer is null\n");
		return MLAN_STATUS_FAILURE;
	}
	if ((action == MLAN_ACT_SET) &&
	    (MLAN_STATUS_SUCCESS != woal_atoi(&qosinfo, qos_cfg))) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_wmm_cfg));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	cfg = (mlan_ds_wmm_cfg *)req->pbuf;
	cfg->sub_command = MLAN_OID_WMM_CFG_QOS;
	req->req_id = MLAN_IOCTL_WMM_CFG;
	req->action = action;
	if (action == MLAN_ACT_SET) {
		cfg->param.qos_cfg = (t_u8)qosinfo;
		PRINTM(MIOCTL, "set qosinfo=%d\n", qosinfo);
	}
	ret = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (action == MLAN_ACT_GET)
		*qos_cfg = cfg->param.qos_cfg;
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
mlan_status woal_priv_qos_cfg ( moal_private * priv , t_u32 action , char * qos_cfg ) { mlan_status ret = MLAN_STATUS_SUCCESS ; mlan_ds_wmm_cfg * cfg = NULL ; mlan_ioctl_req * req = NULL ; int qosinfo = 0 ; ENTER ( ) ; if ( qos_cfg == NULL ) { PRINTM ( MERROR , " \n " ) ; return MLAN_STATUS_FAILURE ; } if ( ( action == MLAN_ACT_SET ) && ( MLAN_STATUS_SUCCESS != woal_atoi ( & qosinfo , qos_cfg ) ) ) { ret = MLAN_STATUS_FAILURE ; goto done ; } req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_wmm_cfg ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } cfg = ( mlan_ds_wmm_cfg * ) req -> pbuf ; cfg -> sub_command = MLAN_OID_WMM_CFG_QOS ; req -> req_id = MLAN_IOCTL_WMM_CFG ; req -> action = action ; if ( action == MLAN_ACT_SET ) { cfg -> param . qos_cfg = ( t_u8 ) qosinfo ; PRINTM ( MIOCTL , " \n " , qosinfo ) ; } ret = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( action == MLAN_ACT_GET ) * qos_cfg = cfg -> param . qos_cfg ; done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Set/Get WMM IE QoS configuration
 @param priv     A pointer to moal_private structure
  @param action  Action set or get
 @param qos_cfg  A pointer to QoS configuration structure
@brief Set / Get WMM IE QoS configuration @param priv A pointer to moal_private structure @param action Action set or get @param qos_cfg A pointer to QoS configuration structure