software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief arpfilter ioctl function
 *
 *  @param priv     A pointer to moal_private structure
 *  @param wrq      A pointer to iwreq structure
 *  @return         0 --success, otherwise fail
 */
@brief arpfilter ioctl function
@param priv     A pointer to moal_private structure
@param wrq      A pointer to iwreq structure
@return         0 --success, otherwise fail
@brief arpfilter ioctl function @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
static int
woal_arp_filter(moal_private *priv, struct iwreq *wrq)
{
	int ret = 0;
	mlan_ds_misc_cfg *misc = NULL;
	mlan_ioctl_req *req = NULL;
	int data_length = wrq->u.data.length, copy_len;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	copy_len =
		MIN(sizeof(misc->param.gen_ie.ie_data),
		    sizeof(int) * data_length);
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	misc = (mlan_ds_misc_cfg *)req->pbuf;
	misc->sub_command = MLAN_OID_MISC_GEN_IE;
	req->req_id = MLAN_IOCTL_MISC_CFG;
	req->action = MLAN_ACT_SET;
	misc->param.gen_ie.type = MLAN_IE_TYPE_ARP_FILTER;
	misc->param.gen_ie.len = data_length;
	if (copy_from_user
	    (misc->param.gen_ie.ie_data, wrq->u.data.pointer, copy_len)) {
		PRINTM(MERROR, "copy from user failed\n");
		ret = -EFAULT;
		goto done;
	}
	status = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (status != MLAN_STATUS_SUCCESS) {
		ret = -EFAULT;
		goto done;
	}
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
static int woal_arp_filter ( moal_private * priv , struct iwreq * wrq ) { int ret = 0 ; mlan_ds_misc_cfg * misc = NULL ; mlan_ioctl_req * req = NULL ; int data_length = wrq -> u . data . length , copy_len ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; copy_len = MIN ( sizeof ( misc -> param . gen_ie . ie_data ) , sizeof ( int ) * data_length ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_misc_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } misc = ( mlan_ds_misc_cfg * ) req -> pbuf ; misc -> sub_command = MLAN_OID_MISC_GEN_IE ; req -> req_id = MLAN_IOCTL_MISC_CFG ; req -> action = MLAN_ACT_SET ; misc -> param . gen_ie . type = MLAN_IE_TYPE_ARP_FILTER ; misc -> param . gen_ie . len = data_length ; if ( copy_from_user ( misc -> param . gen_ie . ie_data , wrq -> u . data . pointer , copy_len ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } status = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( status != MLAN_STATUS_SUCCESS ) { ret = - EFAULT ; goto done ; } done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief arpfilter ioctl function
  @param priv     A pointer to moal_private structure
  @param wrq      A pointer to iwreq structure
  @return         0 --success, otherwise fail
@brief arpfilter ioctl function @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
/* get the whole command from user */