software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Set/Get Transmit buffer size
 *
 *  @param priv     Pointer to the moal_private driver data struct
 *  @param wrq      A pointer to iwreq structure
 *
 *  @return         0 --success, otherwise fail
 */
@brief Set/Get Transmit buffer size
@param priv     Pointer to the moal_private driver data struct
@param wrq      A pointer to iwreq structure

@return         0 --success, otherwise fail
@brief Set / Get Transmit buffer size @param priv Pointer to the moal_private driver data struct @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
static int
woal_txbuf_cfg(moal_private *priv, struct iwreq *wrq)
{
	int buf_size;
	mlan_ioctl_req *req = NULL;
	mlan_ds_11n_cfg *cfg_11n = NULL;
	int ret = 0;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_11n_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	cfg_11n = (mlan_ds_11n_cfg *)req->pbuf;
	cfg_11n->sub_command = MLAN_OID_11N_CFG_MAX_TX_BUF_SIZE;
	req->req_id = MLAN_IOCTL_11N_CFG;
	if (wrq->u.data.length == 0) {
		req->action = MLAN_ACT_GET;
	} else {
		ret = -EINVAL;
		PRINTM(MERROR,
		       "Don't support set Tx buffer size after driver loaded!\n");
		goto done;
	}
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto done;
	}
	buf_size = cfg_11n->param.tx_buf_size;
	if (copy_to_user(wrq->u.data.pointer, &buf_size, sizeof(buf_size))) {
		PRINTM(MERROR, "Copy to user failed\n");
		ret = -EFAULT;
		goto done;
	}
	wrq->u.data.length = 1;
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_txbuf_cfg ( moal_private * priv , struct iwreq * wrq ) { int buf_size ; mlan_ioctl_req * req = NULL ; mlan_ds_11n_cfg * cfg_11n = NULL ; int ret = 0 ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_11n_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } cfg_11n = ( mlan_ds_11n_cfg * ) req -> pbuf ; cfg_11n -> sub_command = MLAN_OID_11N_CFG_MAX_TX_BUF_SIZE ; req -> req_id = MLAN_IOCTL_11N_CFG ; if ( wrq -> u . data . length == 0 ) { req -> action = MLAN_ACT_GET ; } else { ret = - EINVAL ; PRINTM ( MERROR , " \n " ) ; goto done ; } status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } buf_size = cfg_11n -> param . tx_buf_size ; if ( copy_to_user ( wrq -> u . data . pointer , & buf_size , sizeof ( buf_size ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } wrq -> u . data . length = 1 ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Set/Get Transmit buffer size
  @param priv     Pointer to the moal_private driver data struct
  @param wrq      A pointer to iwreq structure
@brief Set / Get Transmit buffer size @param priv Pointer to the moal_private driver data struct @param wrq A pointer to iwreq structure
/* Get Tx buffer size from MLAN */