software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Send get ext cap info request to MLAN
 *
 *  @param priv             A pointer to moal_private structure
 *  @param buf              data buffer
 *  @param len              data buffer length
 *
 *  @return                 number of bytes of extended capability -- success, otherwise error
 */
@brief Send get ext cap info request to MLAN
@param priv             A pointer to moal_private structure
@param buf              data buffer
@param len              data buffer length

@return                 number of bytes of extended capability -- success, otherwise error
@brief Send get ext cap info request to MLAN @param priv A pointer to moal_private structure @param buf data buffer @param len data buffer length @return number of bytes of extended capability -- success otherwise error
int
woal_request_extcap(moal_private *priv, t_u8 *buf, t_u8 len)
{
	int ret = 0;
	mlan_ioctl_req *req = NULL;
	mlan_ds_misc_cfg *cfg = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	if (buf == NULL || len <= 0 || len < sizeof(ExtCap_t)) {
		ret = -EINVAL;
		goto out;
	}
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto out;
	}
	cfg = (mlan_ds_misc_cfg *)req->pbuf;
	cfg->sub_command = MLAN_OID_MISC_EXT_CAP_CFG;
	req->req_id = MLAN_IOCTL_MISC_CFG;
	req->action = MLAN_ACT_GET;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto out;
	}
	memset(buf, 0, len);
	memcpy(buf, &cfg->param.ext_cap, sizeof(ExtCap_t));
	ret = sizeof(ExtCap_t);
out:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
int woal_request_extcap ( moal_private * priv , t_u8 * buf , t_u8 len ) { int ret = 0 ; mlan_ioctl_req * req = NULL ; mlan_ds_misc_cfg * cfg = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; if ( buf == NULL || len <= 0 || len < sizeof ( ExtCap_t ) ) { ret = - EINVAL ; goto out ; } req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_misc_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto out ; } cfg = ( mlan_ds_misc_cfg * ) req -> pbuf ; cfg -> sub_command = MLAN_OID_MISC_EXT_CAP_CFG ; req -> req_id = MLAN_IOCTL_MISC_CFG ; req -> action = MLAN_ACT_GET ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto out ; } memset ( buf , 0 , len ) ; memcpy ( buf , & cfg -> param . ext_cap , sizeof ( ExtCap_t ) ) ; ret = sizeof ( ExtCap_t ) ; out : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Send get ext cap info request to MLAN
  @param priv             A pointer to moal_private structure
  @param buf              data buffer
  @param len              data buffer length
@brief Send get ext cap info request to MLAN @param priv A pointer to moal_private structure @param buf data buffer @param len data buffer length