software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Private IOCTL entry to get/set a specified AC Queue's parameters
 *
 *  Receive a AC Queue configuration command which is used to get, set, or
 *    default the parameters associated with a specific WMM AC Queue.
 *
 *  @param priv    Pointer to the mlan_private driver data struct
 *  @param wrq     A pointer to iwreq structure containing the
 *                 wlan_ioctl_wmm_queue_config_t struct
 *
 *  @return        0 if successful; IOCTL error code otherwise
 */
@brief Private IOCTL entry to get/set a specified AC Queue's parameters
Receive a AC Queue configuration command which is used to get, set, or
default the parameters associated with a specific WMM AC Queue.

@param priv    Pointer to the mlan_private driver data struct
@param wrq     A pointer to iwreq structure containing the
wlan_ioctl_wmm_queue_config_t struct

@return        0 if successful; IOCTL error code otherwise
@brief Private IOCTL entry to get / set a specified AC Queue ' s parameters Receive a AC Queue configuration command which is used to get set or default the parameters associated with a specific WMM AC Queue . @param priv Pointer to the mlan_private driver data struct @param wrq A pointer to iwreq structure containing the wlan_ioctl_wmm_queue_config_t struct @return 0 if successful ; IOCTL error code otherwise
static int
woal_wmm_queue_config_ioctl(moal_private *priv, struct iwreq *wrq)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_wmm_cfg *pwmm = NULL;
	mlan_ds_wmm_queue_config *pqcfg = NULL;
	wlan_ioctl_wmm_queue_config_t qcfg_ioctl;
	int ret = 0;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_wmm_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	req->req_id = MLAN_IOCTL_WMM_CFG;
	pwmm = (mlan_ds_wmm_cfg *)req->pbuf;
	pwmm->sub_command = MLAN_OID_WMM_CFG_QUEUE_CONFIG;
	memset(&qcfg_ioctl, 0x00, sizeof(qcfg_ioctl));
	pqcfg = (mlan_ds_wmm_queue_config *)&pwmm->param.q_cfg;
	if (wrq->u.data.length) {
		if (copy_from_user(&qcfg_ioctl, wrq->u.data.pointer,
				   MIN(wrq->u.data.length,
				       sizeof(qcfg_ioctl)))) {
			PRINTM(MERROR, "QCONFIG: copy from user failed\n");
			ret = -EFAULT;
			goto done;
		}
		pqcfg->action = qcfg_ioctl.action;
		pqcfg->access_category = qcfg_ioctl.access_category;
		pqcfg->msdu_lifetime_expiry = qcfg_ioctl.msdu_lifetime_expiry;
		status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
		if (status != MLAN_STATUS_SUCCESS) {
			ret = -EFAULT;
			goto done;
		}
		memset(&qcfg_ioctl, 0x00, sizeof(qcfg_ioctl));
		qcfg_ioctl.action = pqcfg->action;
		qcfg_ioctl.access_category = pqcfg->access_category;
		qcfg_ioctl.msdu_lifetime_expiry = pqcfg->msdu_lifetime_expiry;
		wrq->u.data.length = sizeof(qcfg_ioctl);
		if (copy_to_user
		    (wrq->u.data.pointer, &qcfg_ioctl, wrq->u.data.length)) {
			PRINTM(MERROR, "QCONFIG: copy to user failed\n");
			ret = -EFAULT;
			goto done;
		}
	}
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_wmm_queue_config_ioctl ( moal_private * priv , struct iwreq * wrq ) { mlan_ioctl_req * req = NULL ; mlan_ds_wmm_cfg * pwmm = NULL ; mlan_ds_wmm_queue_config * pqcfg = NULL ; wlan_ioctl_wmm_queue_config_t qcfg_ioctl ; int ret = 0 ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_wmm_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } req -> req_id = MLAN_IOCTL_WMM_CFG ; pwmm = ( mlan_ds_wmm_cfg * ) req -> pbuf ; pwmm -> sub_command = MLAN_OID_WMM_CFG_QUEUE_CONFIG ; memset ( & qcfg_ioctl , 0x00 , sizeof ( qcfg_ioctl ) ) ; pqcfg = ( mlan_ds_wmm_queue_config * ) & pwmm -> param . q_cfg ; if ( wrq -> u . data . length ) { if ( copy_from_user ( & qcfg_ioctl , wrq -> u . data . pointer , MIN ( wrq -> u . data . length , sizeof ( qcfg_ioctl ) ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } pqcfg -> action = qcfg_ioctl . action ; pqcfg -> access_category = qcfg_ioctl . access_category ; pqcfg -> msdu_lifetime_expiry = qcfg_ioctl . msdu_lifetime_expiry ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } memset ( & qcfg_ioctl , 0x00 , sizeof ( qcfg_ioctl ) ) ; qcfg_ioctl . action = pqcfg -> action ; qcfg_ioctl . access_category = pqcfg -> access_category ; qcfg_ioctl . msdu_lifetime_expiry = pqcfg -> msdu_lifetime_expiry ; wrq -> u . data . length = sizeof ( qcfg_ioctl ) ; if ( copy_to_user ( wrq -> u . data . pointer , & qcfg_ioctl , wrq -> u . data . length ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } } done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Private IOCTL entry to get/set a specified AC Queue's parameters
  Receive a AC Queue configuration command which is used to get, set, or
    default the parameters associated with a specific WMM AC Queue.
@brief Private IOCTL entry to get / set a specified AC Queue ' s parameters Receive a AC Queue configuration command which is used to get set or default the parameters associated with a specific WMM AC Queue .