software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief Send get FW info request to MLAN
 *
 *  @param priv             A pointer to moal_private structure
 *  @param wait_option      Wait option
 *  @param fw_info          FW information
 *
 *  @return                 MLAN_STATUS_SUCCESS/MLAN_STATUS_PENDING -- success, otherwise fail
 */
@brief Send get FW info request to MLAN
@param priv             A pointer to moal_private structure
@param wait_option      Wait option
@param fw_info          FW information


@brief Send get FW info request to MLAN @param priv A pointer to moal_private structure @param wait_option Wait option @param fw_info FW information
mlan_status
woal_request_get_fw_info(moal_private *priv, t_u8 wait_option,
			 mlan_fw_info *fw_info)
{
	mlan_ioctl_req *req = NULL;
	mlan_ds_get_info *info;
	mlan_status status;
	ENTER();
	memset(priv->current_addr, 0xff, ETH_ALEN);
	req = (mlan_ioctl_req *)
		woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_get_info));
	if (req == NULL) {
		status = MLAN_STATUS_FAILURE;
		goto done;
	}
	info = (mlan_ds_get_info *)req->pbuf;
	req->req_id = MLAN_IOCTL_GET_INFO;
	req->action = MLAN_ACT_GET;
	info->sub_command = MLAN_OID_GET_FW_INFO;
	status = woal_request_ioctl(priv, req, wait_option);
	if (status == MLAN_STATUS_SUCCESS) {
		priv->phandle->fw_release_number = info->param.fw_info.fw_ver;
		priv->phandle->fw_ecsa_enable = info->param.fw_info.ecsa_enable;
		priv->phandle->fw_getlog_enable =
			info->param.fw_info.getlog_enable;
		if (priv->current_addr[0] == 0xff)
			memcpy(priv->current_addr,
			       &info->param.fw_info.mac_addr,
			       sizeof(mlan_802_11_mac_addr));
		memcpy(priv->netdev->dev_addr, priv->current_addr, ETH_ALEN);
		if (fw_info)
			memcpy(fw_info, &info->param.fw_info,
			       sizeof(mlan_fw_info));
		DBG_HEXDUMP(MCMD_D, "mac", priv->current_addr, 6);
	} else
		PRINTM(MERROR,
		       "get fw info failed! status=%d, error_code=0x%x\n",
		       status, req->status_code);
done:
	if (status != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return status;
}
mlan_status woal_request_get_fw_info ( moal_private * priv , t_u8 wait_option , mlan_fw_info * fw_info ) { mlan_ioctl_req * req = NULL ; mlan_ds_get_info * info ; mlan_status status ; ENTER ( ) ; memset ( priv -> current_addr , 0xff , ETH_ALEN ) ; req = ( mlan_ioctl_req * ) woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_get_info ) ) ; if ( req == NULL ) { status = MLAN_STATUS_FAILURE ; goto done ; } info = ( mlan_ds_get_info * ) req -> pbuf ; req -> req_id = MLAN_IOCTL_GET_INFO ; req -> action = MLAN_ACT_GET ; info -> sub_command = MLAN_OID_GET_FW_INFO ; status = woal_request_ioctl ( priv , req , wait_option ) ; if ( status == MLAN_STATUS_SUCCESS ) { priv -> phandle -> fw_release_number = info -> param . fw_info . fw_ver ; priv -> phandle -> fw_ecsa_enable = info -> param . fw_info . ecsa_enable ; priv -> phandle -> fw_getlog_enable = info -> param . fw_info . getlog_enable ; if ( priv -> current_addr [ 0 ] == 0xff ) memcpy ( priv -> current_addr , & info -> param . fw_info . mac_addr , sizeof ( mlan_802_11_mac_addr ) ) ; memcpy ( priv -> netdev -> dev_addr , priv -> current_addr , ETH_ALEN ) ; if ( fw_info ) memcpy ( fw_info , & info -> param . fw_info , sizeof ( mlan_fw_info ) ) ; DBG_HEXDUMP ( MCMD_D , " " , priv -> current_addr , 6 ) ; } else PRINTM ( MERROR , " \n " , status , req -> status_code ) ; done : if ( status != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return status ; }
@brief Send get FW info request to MLAN
  @param priv             A pointer to moal_private structure
  @param wait_option      Wait option
  @param fw_info          FW information
@brief Send get FW info request to MLAN @param priv A pointer to moal_private structure @param wait_option Wait option @param fw_info FW information
/* Allocate an IOCTL request buffer */ /* Fill request buffer */ /* Send IOCTL request to MLAN */