software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Private IOCTL entry to get the status of the WMM Traffic Streams
 *
 *  @param priv    Pointer to the moal_private driver data struct
 *  @param wrq     A pointer to iwreq structure containing the
 *                 wlan_ioctl_wmm_ts_status_t struct for request
 *
 *  @return        0 if successful; IOCTL error code otherwise
 */
@brief Private IOCTL entry to get the status of the WMM Traffic Streams
@param priv    Pointer to the moal_private driver data struct
@param wrq     A pointer to iwreq structure containing the
wlan_ioctl_wmm_ts_status_t struct for request

@return        0 if successful; IOCTL error code otherwise
@brief Private IOCTL entry to get the status of the WMM Traffic Streams @param priv Pointer to the moal_private driver data struct @param wrq A pointer to iwreq structure containing the wlan_ioctl_wmm_ts_status_t struct for request @return 0 if successful ; IOCTL error code otherwise
static int
woal_wmm_ts_status_ioctl(moal_private *priv, struct iwreq *wrq)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_wmm_cfg *pwmm = NULL;
	wlan_ioctl_wmm_ts_status_t ts_status_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_TS_STATUS;
	memset(&ts_status_ioctl, 0x00, sizeof(ts_status_ioctl));
	if (wrq->u.data.length == sizeof(ts_status_ioctl)) {
		if (copy_from_user(&ts_status_ioctl, wrq->u.data.pointer,
				   MIN(wrq->u.data.length,
				       sizeof(ts_status_ioctl)))) {
			PRINTM(MERROR, "TS_STATUS: copy from user failed\n");
			ret = -EFAULT;
			goto done;
		}
		memset(&pwmm->param.ts_status, 0x00, sizeof(ts_status_ioctl));
		pwmm->param.ts_status.tid = ts_status_ioctl.tid;
		status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
		if (status != MLAN_STATUS_SUCCESS) {
			ret = -EFAULT;
			goto done;
		}
		memset(&ts_status_ioctl, 0x00, sizeof(ts_status_ioctl));
		memcpy((void *)&ts_status_ioctl, (void *)&pwmm->param.ts_status,
		       sizeof(ts_status_ioctl));
		wrq->u.data.length = sizeof(ts_status_ioctl);
	} else {
		wrq->u.data.length = 0;
	}
	if (copy_to_user
	    (wrq->u.data.pointer, &ts_status_ioctl, wrq->u.data.length)) {
		PRINTM(MERROR, "TS_STATUS: copy to user failed\n");
		ret = -EFAULT;
		goto done;
	}
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_wmm_ts_status_ioctl ( moal_private * priv , struct iwreq * wrq ) { mlan_ioctl_req * req = NULL ; mlan_ds_wmm_cfg * pwmm = NULL ; wlan_ioctl_wmm_ts_status_t ts_status_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_TS_STATUS ; memset ( & ts_status_ioctl , 0x00 , sizeof ( ts_status_ioctl ) ) ; if ( wrq -> u . data . length == sizeof ( ts_status_ioctl ) ) { if ( copy_from_user ( & ts_status_ioctl , wrq -> u . data . pointer , MIN ( wrq -> u . data . length , sizeof ( ts_status_ioctl ) ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } memset ( & pwmm -> param . ts_status , 0x00 , sizeof ( ts_status_ioctl ) ) ; pwmm -> param . ts_status . tid = ts_status_ioctl . tid ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } memset ( & ts_status_ioctl , 0x00 , sizeof ( ts_status_ioctl ) ) ; memcpy ( ( void * ) & ts_status_ioctl , ( void * ) & pwmm -> param . ts_status , sizeof ( ts_status_ioctl ) ) ; wrq -> u . data . length = sizeof ( ts_status_ioctl ) ; } else { wrq -> u . data . length = 0 ; } if ( copy_to_user ( wrq -> u . data . pointer , & ts_status_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 the status of the WMM Traffic Streams
  @param priv    Pointer to the moal_private driver data struct
  @param wrq     A pointer to iwreq structure containing the
                 wlan_ioctl_wmm_ts_status_t struct for request
@brief Private IOCTL entry to get the status of the WMM Traffic Streams @param priv Pointer to the moal_private driver data struct @param wrq A pointer to iwreq structure containing the wlan_ioctl_wmm_ts_status_t struct for request