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

@return         0 -- success, otherwise fail
@brief Set / Get Mgmt Frame passthru mask @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
static int
woal_mgmt_frame_passthru_ctrl(moal_private *priv, struct iwreq *wrq)
{
	int ret = 0, data_length = wrq->u.data.length;
	mlan_ioctl_req *req = NULL;
	mlan_ds_misc_cfg *mgmt_cfg = NULL;
	int mask = 0;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	if (data_length > 1) {
		PRINTM(MERROR, "Invalid no of arguments!\n");
		ret = -EINVAL;
		goto done;
	}
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	mgmt_cfg = (mlan_ds_misc_cfg *)req->pbuf;
	req->req_id = MLAN_IOCTL_MISC_CFG;
	mgmt_cfg->sub_command = MLAN_OID_MISC_RX_MGMT_IND;
	if (data_length) {	
		if (copy_from_user(&mask, wrq->u.data.pointer, sizeof(int))) {
			PRINTM(MERROR, "copy from user failed\n");
			ret = -EFAULT;
			goto done;
		}
		mgmt_cfg->param.mgmt_subtype_mask = mask;
		req->action = MLAN_ACT_SET;
	} else {
		req->action = MLAN_ACT_GET;
	}
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto done;
	}
	mask = mgmt_cfg->param.mgmt_subtype_mask;
	if (copy_to_user(wrq->u.data.pointer, &mask, sizeof(int))) {
		ret = -EFAULT;
		goto done;
	}
	wrq->u.data.length = 1;
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_mgmt_frame_passthru_ctrl ( moal_private * priv , struct iwreq * wrq ) { int ret = 0 , data_length = wrq -> u . data . length ; mlan_ioctl_req * req = NULL ; mlan_ds_misc_cfg * mgmt_cfg = NULL ; int mask = 0 ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; if ( data_length > 1 ) { PRINTM ( MERROR , " \n " ) ; ret = - EINVAL ; goto done ; } req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_misc_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } mgmt_cfg = ( mlan_ds_misc_cfg * ) req -> pbuf ; req -> req_id = MLAN_IOCTL_MISC_CFG ; mgmt_cfg -> sub_command = MLAN_OID_MISC_RX_MGMT_IND ; if ( data_length ) { if ( copy_from_user ( & mask , wrq -> u . data . pointer , sizeof ( int ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } mgmt_cfg -> param . mgmt_subtype_mask = mask ; req -> action = MLAN_ACT_SET ; } else { req -> action = MLAN_ACT_GET ; } status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } mask = mgmt_cfg -> param . mgmt_subtype_mask ; if ( copy_to_user ( wrq -> u . data . pointer , & mask , sizeof ( int ) ) ) { ret = - EFAULT ; goto done ; } wrq -> u . data . length = 1 ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief Set/Get Mgmt Frame passthru mask
  @param priv     A pointer to moal_private structure
  @param wrq      A pointer to iwreq structure
@brief Set / Get Mgmt Frame passthru mask @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure
/* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* SET */ /* Send IOCTL request to MLAN */