software/drivers/sd8887/src/wlan/mlan/mlan_uap_ioctl.c
/**
 *  @brief Set WAPI IE
 *
 *  @param priv         A pointer to mlan_private structure
 *  @param pioctl_req	A pointer to ioctl request buffer
 *
 *  @return             MLAN_STATUS_PENDING --success, otherwise fail
 */
@brief Set WAPI IE
@param priv         A pointer to mlan_private structure
@param pioctl_req   A pointer to ioctl request buffer

@return             MLAN_STATUS_PENDING --success, otherwise fail
@brief Set WAPI IE @param priv A pointer to mlan_private structure @param pioctl_req A pointer to ioctl request buffer @return MLAN_STATUS_PENDING -- success otherwise fail
static mlan_status
wlan_uap_set_wapi_ie(mlan_private *priv, pmlan_ioctl_req pioctl_req)
{
	mlan_ds_misc_cfg *misc = MNULL;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	ENTER();
	misc = (mlan_ds_misc_cfg *)pioctl_req->pbuf;
	if (misc->param.gen_ie.len) {
		if (misc->param.gen_ie.len > sizeof(priv->wapi_ie)) {
			PRINTM(MWARN, "failed to copy WAPI IE, too big\n");
			pioctl_req->status_code = MLAN_ERROR_INVALID_PARAMETER;
			LEAVE();
			return MLAN_STATUS_FAILURE;
		}
		memcpy(priv->adapter, priv->wapi_ie, misc->param.gen_ie.ie_data,
		       misc->param.gen_ie.len);
		priv->wapi_ie_len = misc->param.gen_ie.len;
		PRINTM(MIOCTL, "Set wapi_ie_len=%d IE=%#x\n", priv->wapi_ie_len,
		       priv->wapi_ie[0]);
		DBG_HEXDUMP(MCMD_D, "wapi_ie", priv->wapi_ie,
			    priv->wapi_ie_len);
		if (priv->wapi_ie[0] == WAPI_IE)
			priv->sec_info.wapi_enabled = MTRUE;
	} else {
		memset(priv->adapter, priv->wapi_ie, 0, sizeof(priv->wapi_ie));
		priv->wapi_ie_len = misc->param.gen_ie.len;
		PRINTM(MINFO, "Reset wapi_ie_len=%d IE=%#x\n",
		       priv->wapi_ie_len, priv->wapi_ie[0]);
		priv->sec_info.wapi_enabled = MFALSE;
	}
	ret = wlan_prepare_cmd(priv, HOST_CMD_APCMD_SYS_CONFIGURE,
			       HostCmd_ACT_GEN_SET, 0, (t_void *)pioctl_req,
			       MNULL);
	if (ret == MLAN_STATUS_SUCCESS)
		ret = MLAN_STATUS_PENDING;
	LEAVE();
	return ret;
}
static mlan_status wlan_uap_set_wapi_ie ( mlan_private * priv , pmlan_ioctl_req pioctl_req ) { mlan_ds_misc_cfg * misc = MNULL ; mlan_status ret = MLAN_STATUS_SUCCESS ; ENTER ( ) ; misc = ( mlan_ds_misc_cfg * ) pioctl_req -> pbuf ; if ( misc -> param . gen_ie . len ) { if ( misc -> param . gen_ie . len > sizeof ( priv -> wapi_ie ) ) { PRINTM ( MWARN , " \n " ) ; pioctl_req -> status_code = MLAN_ERROR_INVALID_PARAMETER ; LEAVE ( ) ; return MLAN_STATUS_FAILURE ; } memcpy ( priv -> adapter , priv -> wapi_ie , misc -> param . gen_ie . ie_data , misc -> param . gen_ie . len ) ; priv -> wapi_ie_len = misc -> param . gen_ie . len ; PRINTM ( MIOCTL , " \n " , priv -> wapi_ie_len , priv -> wapi_ie [ 0 ] ) ; DBG_HEXDUMP ( MCMD_D , " " , priv -> wapi_ie , priv -> wapi_ie_len ) ; if ( priv -> wapi_ie [ 0 ] == WAPI_IE ) priv -> sec_info . wapi_enabled = MTRUE ; } else { memset ( priv -> adapter , priv -> wapi_ie , 0 , sizeof ( priv -> wapi_ie ) ) ; priv -> wapi_ie_len = misc -> param . gen_ie . len ; PRINTM ( MINFO , " \n " , priv -> wapi_ie_len , priv -> wapi_ie [ 0 ] ) ; priv -> sec_info . wapi_enabled = MFALSE ; } ret = wlan_prepare_cmd ( priv , HOST_CMD_APCMD_SYS_CONFIGURE , HostCmd_ACT_GEN_SET , 0 , ( t_void * ) pioctl_req , MNULL ) ; if ( ret == MLAN_STATUS_SUCCESS ) ret = MLAN_STATUS_PENDING ; LEAVE ( ) ; return ret ; }
@brief Set WAPI IE
  @param priv         A pointer to mlan_private structure
  @param pioctl_req   A pointer to ioctl request buffer
@brief Set WAPI IE @param priv A pointer to mlan_private structure @param pioctl_req A pointer to ioctl request buffer
/* Send request to firmware */