software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 *  @brief Control WPS Session Enable/Disable
 *
 *  @param priv     Pointer to the moal_private driver data struct
 *  @param wrq      Pointer to the iwreq structure
 *
 *  @return         0 --success, otherwise fail
 */
@brief Control WPS Session Enable/Disable
@param priv     Pointer to the moal_private driver data struct
@param wrq      Pointer to the iwreq structure

@return         0 --success, otherwise fail
@brief Control WPS Session Enable / Disable @param priv Pointer to the moal_private driver data struct @param wrq Pointer to the iwreq structure @return 0 -- success otherwise fail
static int
woal_wps_cfg_ioctl(moal_private *priv, struct iwreq *wrq)
{
	int ret = 0;
	mlan_ds_wps_cfg *pwps = NULL;
	mlan_ioctl_req *req = NULL;
	char buf[8];
	struct iwreq *wreq = (struct iwreq *)wrq;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	PRINTM(MINFO, "WOAL_WPS_SESSION\n");
	memset(buf, 0, sizeof(buf));
	if (copy_from_user(buf, wreq->u.data.pointer,
			   MIN(sizeof(buf) - 1, wreq->u.data.length))) {
		PRINTM(MERROR, "Copy from user failed\n");
		ret = -EFAULT;
		goto done;
	}
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_wps_cfg));
	if (req == NULL) {
		ret = -ENOMEM;
		goto done;
	}
	pwps = (mlan_ds_wps_cfg *)req->pbuf;
	req->req_id = MLAN_IOCTL_WPS_CFG;
	req->action = MLAN_ACT_SET;
	pwps->sub_command = MLAN_OID_WPS_CFG_SESSION;
	if (buf[0] == 1)
		pwps->param.wps_session = MLAN_WPS_CFG_SESSION_START;
	else
		pwps->param.wps_session = MLAN_WPS_CFG_SESSION_END;
	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_wps_cfg_ioctl ( moal_private * priv , struct iwreq * wrq ) { int ret = 0 ; mlan_ds_wps_cfg * pwps = NULL ; mlan_ioctl_req * req = NULL ; char buf [ 8 ] ; struct iwreq * wreq = ( struct iwreq * ) wrq ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; PRINTM ( MINFO , " \n " ) ; memset ( buf , 0 , sizeof ( buf ) ) ; if ( copy_from_user ( buf , wreq -> u . data . pointer , MIN ( sizeof ( buf ) - 1 , wreq -> u . data . length ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_wps_cfg ) ) ; if ( req == NULL ) { ret = - ENOMEM ; goto done ; } pwps = ( mlan_ds_wps_cfg * ) req -> pbuf ; req -> req_id = MLAN_IOCTL_WPS_CFG ; req -> action = MLAN_ACT_SET ; pwps -> sub_command = MLAN_OID_WPS_CFG_SESSION ; if ( buf [ 0 ] == 1 ) pwps -> param . wps_session = MLAN_WPS_CFG_SESSION_START ; else pwps -> param . wps_session = MLAN_WPS_CFG_SESSION_END ; 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 Control WPS Session Enable/Disable
  @param priv     Pointer to the moal_private driver data struct
  @param wrq      Pointer to the iwreq structure
@brief Control WPS Session Enable / Disable @param priv Pointer to the moal_private driver data struct @param wrq Pointer to the iwreq structure