software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Get esupp mode
 *
 *  @param priv     A pointer to moal_private structure
 *  @param wrq      A pointer to iwreq structure
 *
 *  @return         0 --success, otherwise fail
 */
@brief Get esupp mode
@param priv     A pointer to moal_private structure
@param wrq      A pointer to iwreq structure

@return         0 --success, otherwise fail
@brief Get esupp mode @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
static int
woal_get_esupp_mode(moal_private *priv, struct iwreq *wrq)
{
	int ret = 0;
	mlan_ds_sec_cfg *sec = NULL;
	mlan_ioctl_req *req = NULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_sec_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	sec = (mlan_ds_sec_cfg *)req->pbuf;
	sec->sub_command = MLAN_OID_SEC_CFG_ESUPP_MODE;
	req->req_id = MLAN_IOCTL_SEC_CFG;
	req->action = MLAN_ACT_GET;
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto done;
	}
	if (copy_to_user
	    (wrq->u.data.pointer, (t_u8 *)&sec->param.esupp_mode,
	     sizeof(int) * 3)) {
		ret = -EFAULT;
		goto done;
	}
	wrq->u.data.length = 3;
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_get_esupp_mode ( moal_private * priv , struct iwreq * wrq ) { int ret = 0 ; mlan_ds_sec_cfg * sec = NULL ; mlan_ioctl_req * req = NULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_sec_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } sec = ( mlan_ds_sec_cfg * ) req -> pbuf ; sec -> sub_command = MLAN_OID_SEC_CFG_ESUPP_MODE ; req -> req_id = MLAN_IOCTL_SEC_CFG ; req -> action = MLAN_ACT_GET ; status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } if ( copy_to_user ( wrq -> u . data . pointer , ( t_u8 * ) & sec -> param . esupp_mode , sizeof ( int ) * 3 ) ) { ret = - EFAULT ; goto done ; } wrq -> u . data . length = 3 ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Get esupp mode
  @param priv     A pointer to moal_private structure
  @param wrq      A pointer to iwreq structure
@brief Get esupp mode @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure