software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief set/get wifi direct mode
 *
 *  @param priv         A pointer to moal_private structure
 *  @param action       set or get
 *  @param mode         A pointer to wifi direct mode
 *
 *  @return             MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief set/get wifi direct mode
@param priv         A pointer to moal_private structure
@param action       set or get
@param mode         A pointer to wifi direct mode

@return             MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief set / get wifi direct mode @param priv A pointer to moal_private structure @param action set or get @param mode A pointer to wifi direct mode @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_wifi_direct_mode_cfg(moal_private *priv, t_u16 action, t_u16 *mode)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	mlan_ioctl_req *req = NULL;
	mlan_ds_bss *bss = NULL;
	ENTER();
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_bss));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	bss = (mlan_ds_bss *)req->pbuf;
	bss->sub_command = MLAN_OID_WIFI_DIRECT_MODE;
	req->req_id = MLAN_IOCTL_BSS;
	req->action = action;
	if (action == MLAN_ACT_SET)
		bss->param.wfd_mode = *mode;
	ret = woal_request_ioctl(priv, req, MOAL_IOCTL_WAIT);
	if (ret == MLAN_STATUS_SUCCESS) {
		*mode = bss->param.wfd_mode;
		PRINTM(MIOCTL, "ACT=%d, wifi_direct_mode=%d\n", action, *mode);
	}
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
mlan_status woal_wifi_direct_mode_cfg ( moal_private * priv , t_u16 action , t_u16 * mode ) { mlan_status ret = MLAN_STATUS_SUCCESS ; mlan_ioctl_req * req = NULL ; mlan_ds_bss * bss = NULL ; ENTER ( ) ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_bss ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } bss = ( mlan_ds_bss * ) req -> pbuf ; bss -> sub_command = MLAN_OID_WIFI_DIRECT_MODE ; req -> req_id = MLAN_IOCTL_BSS ; req -> action = action ; if ( action == MLAN_ACT_SET ) bss -> param . wfd_mode = * mode ; ret = woal_request_ioctl ( priv , req , MOAL_IOCTL_WAIT ) ; if ( ret == MLAN_STATUS_SUCCESS ) { * mode = bss -> param . wfd_mode ; PRINTM ( MIOCTL , " \n " , action , * mode ) ; } done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief set/get wifi direct mode
  @param priv         A pointer to moal_private structure
  @param action       set or get
  @param mode         A pointer to wifi direct mode
@brief set / get wifi direct mode @param priv A pointer to moal_private structure @param action set or get @param mode A pointer to wifi direct mode