/****************************************************************************
*
*	Name:			FwInit.c
*
*	Description:	Firmware Initialization routines implementation.
*
*	Copyright:		(c) 1999 Conexant Systems Inc.
*
*	Revision:	Date:		Author:				Description:
*
*	00.00.0000	01/01/00	George G. Vlasov	Created.
*	Linux-1.0	May 29 2002	Shen Wei Wang			Modified.
*				shenwei.wang@conexant.com
*
*****************************************************************************
*	$Author:   Shen Wei Wang  $
*	$Revision:   1.0  $
*	$Modtime:   May 29 2002 10:30:48  $
****************************************************************************/

/****************************************************************************
*  Include files
****************************************************************************/
/*
#include "USBADSL.h"

#include "Pnp.h"

#include "FsSrv.h"
*/
#include <linux/module.h>
//#include <linux/malloc.h>
#include <asm/uaccess.h>

#include <linux/vmalloc.h> 

#include <linux/slab.h>
#include <linux/usb.h>

#include "hasbani.h"
#include "BlDefs.h"
#include "FwInit.h"

/****************************************************************************
*  Helper definitions
****************************************************************************/

#define DBG_ENABLED_BOOT_ROM_PATCH					(1)

#define P52					(1)
#define PLL_FAST_MODE		(1)	/* 1: 144MHz/100MHz, 0: 96MHz/75MHz */ 

/****************************************************************************
*  Constant definitions
****************************************************************************/

/****************************************************************************
  
THESE ARE THE P52 STACK POINTER FOR PATCHES WORKAROUND 
		
		
#define BSPSTARTADDRESS        				0x801000
											
#define PATCH_RAM_LOAD_ADDRESS				0x180600
											
#define RETURNSTACKADDRESS  				0x187f10
											
#define HOST_SIGNATURE_MEM   				0x180500 
#define HOST_SIGNATURE_VALUE				0XCAFE0572

****************************************************************************/

#define WB_SIGN 				(0xcb050572)
#define WB_SIGN_RM				(0xcb060572)

#ifdef P52
#define WB_SIGN_ADDRESS 		(0x00180500)
#else /* P50 */ 
#define WB_SIGN_ADDRESS 		(0x00000500)
#endif 

//#define	FW_IMAGE_FILE_NAME			L"\\SystemRoot\\System32\\Drivers\\CnxEtU.bin"
#define	FW_IMAGE_FILE_NAME_REG_KEY		L"FirmwareImageFile"

#define	FW_IMAGE				g_dwFirmwareImage
#define	FW_ADDRESS				(0x00801000)
#define	FW_START_DELAY			(1000)	/* Milliseconds */ 
								
#define	BR_IMAGE				g_dwBootRomImage
#define	BR_ADDRESS				(0x00180600)
#define	BR_STACK_ADDRESS		(0x00187f10)

//++++ The following section copied from plldef.h BSP file

/* PLL registers defines*/
#define PLL_F		   0x350068
#define PLL_B		   0x35006C

/* SDRAM control register defines */
#define EMCR         0x350010
#define SDRAM_ENABLE 0x1

#define HST_CTRL_REG		0x2d0000UL
#define SDRAM_2MB			0x00
#define SDRAM_8MB			0x08

/* FCLK/UCLK defines */
/* ARM and USB */
#define PLL_FAST_144MHZ_RM		0x00000005

#define PLL_FAST_144MHZ 	0x02D874DF  /* Divide by 3, F=144Mhz, U=72Mhz */
#define PLL_FAST_120MHZ    0x01D46164  /* Divide by 3, F=120Mhz, U=60Mhz */
#define PLL_FAST_96MHZ     0x0095BD38  /* Divide by 4, F=96Mhz,  U=48Mhz */

#ifdef P52
#define PLL_SLOW_144MHZ 	0x12D874DF  /* Slow down FCLK, divide by 3, F=72Mhz, U=72Mhz */
#define PLL_SLOW_120MHZ    0x11D46164  /* Slow down FCLK, divide by 3, F=60Mhz, U=60Mhz */
#define PLL_SLOW_96MHZ     0x1095BD38  /* Slow down FCLK, divide by 4, F=48Mhz, U=48Mhz */
#endif

/* BCLK/PCLK defines */
/* ASB and APB */
#define PLL_FAST_125MHZ 	0x02D53AC8  /* Divide by 3, B=125Mhz, P=62.5Mhz */


#define PLL_FAST_100MHZ_RM		0x00000003

#define PLL_FAST_100MHZ 	0x0196A51A  /* Divide by 4, B=100Mhz, P=50Mhz   */
#define PLL_FAST_75MHZ     0x0090FBD4  /* Divide by 4, B=75Mhz,  P=37.5Mhz */

#ifdef P52
#define PLL_SLOW_125MHZ 	0x12D53AC8  /* Divide by 3, B=62.5Mhz, P=31.25Mhz */
#define PLL_SLOW_100MHZ 	0x1196A51A  /* Divide by 4, B=50Mhz,   P=25Mhz   */
#endif

//---- End of section

/****************************************************************************
*  Macro definitions
****************************************************************************/

/****************************************************************************
*  Type definitions
****************************************************************************/

/****************************************************************************
*  Function prototypes
****************************************************************************/

PCWSTR 
FwImageGetFileName
(
	PDEVICE_OBJECT	DeviceObject
);

BOOLEAN
FwImageFileLoad
(
	PCWSTR	pwszFileName, 
	DWORD**	ppdwFwImage, 
	ULONG*	pulFwImageSize
);

static ULONG CalculateChecksum
(
	UCHAR	*pBuffer, 
	ULONG	uSize
);
void E2ToLower(char * src);
int FsFileGetSize (struct file *hFsFile);
int FsFileRead (struct file *hFsFile, UCHAR* pBuffer, LONG lSize );
int udsl_print_packet (const unsigned char *data, int len);
extern char *g_FwFileName;
/****************************************************************************
*  Object definitions
****************************************************************************/

DWORD	g_dwFirmwareImage[] = 
{
//#include "vxWorks.hex"
#include "WBoot.hex"
};

DWORD	g_dwBootRomImage[] = 
{
#include "WBoot.hex"
};

/****************************************************************************
*  Function implementations
****************************************************************************/

/****************************************************************************
*
*	Name:			FwPreLoad
*
*	Description:	Preload initialization.
*
*	Inputs:			PDEVICE_OBJECT	DeviceObject	-	pointer to Device Object
*
*	Outputs:		Returns TRUE if successful, otherwise FALSE.
*
****************************************************************************/

BOOLEAN
FwPreLoad
(
	IN PDEVICE_OBJECT	DeviceObject
)
{
	DWORD   dwPLLF=PLL_FAST_144MHZ;
	DWORD	dwPLLB=PLL_FAST_100MHZ;
	DWORD	dwTemp;
	BYTE	cTemp;

	BOOLEAN	bResult	= FALSE;

	DBG_PRINT00("FwPreLoad: ++{\n");

#if (PLL_FAST_MODE)

	if (DeviceObject->DevType == DEV_E2RM)
	{
		dwPLLF = PLL_FAST_144MHZ_RM;
		dwPLLB = PLL_FAST_100MHZ_RM;
	}
	
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, PLL_F, dwPLLF, &dwTemp))
	{
		/* Error! */ 
	}
	else
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, PLL_B, dwPLLB, &dwTemp))
	{
		/* Error! */ 
	}
	else
#else /* (PLL_FAST_MODE) */ 	
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, PLL_F, PLL_FAST_96MHZ, &dwTemp))
	{
		/* Error! */ 
	}
	else
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, PLL_B, PLL_FAST_75MHZ, &dwTemp))
	{
		/* Error! */ 
	}
	else
#endif /* (PLL_FAST_MODE) */ 
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, EMCR, SDRAM_ENABLE, &dwTemp))
	{
		/* Error! */ 
	}
	else
	{
		/* Success. */ 

		bResult = TRUE;
	}
	//status = MemoryWriteByte(HST_CTRL_REG, SDRAM_8MB);	
	BL_MEMORY_WRITE_BYTE(DeviceObject, HST_CTRL_REG, SDRAM_8MB, &cTemp);
	
	DBG_PRINT10("FwPreLoad: bResult = 0x%08X\n", bResult);

	DBG_PRINT00("FwPreLoad: }--\n");

	return bResult;
}

/****************************************************************************
*
*	Name:			FwPostLoad
*
*	Description:	Postload initialization.
*
*	Inputs:			PDEVICE_OBJECT	DeviceObject	-	pointer to Device Object
*
*	Outputs:		Returns TRUE if successful, otherwise FALSE.
*
****************************************************************************/

BOOLEAN
FwPostLoad
(
	IN PDEVICE_OBJECT	DeviceObject
)
{
//	FDO_DEVICE_EXTENSION*	pFdx	= NULL;
	DWORD					dwSign;
	DWORD					dwTemp;

	BOOLEAN					bResult	= FALSE;

	DBG_PRINT00("FwPostLoad: ++{\n");

//	pFdx = (FDO_DEVICE_EXTENSION*)DeviceObject->DeviceExtension;

//	dwSign = (pFdx->Pid << 16) | pFdx->Vid;
	if(DeviceObject->DevType == DEV_E2RM)
	    dwSign = WB_SIGN_RM;
	else
	    dwSign = WB_SIGN;

	DBG_PRINT10("FwPostLoad: dwSign = 0x%08X\n", (int)dwSign);

	// Write worm boot signature
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, WB_SIGN_ADDRESS, dwSign, &dwTemp))
	{
		/* Error! */ 
	}
	else
#if (DBG_ENABLED_BOOT_ROM_PATCH)
	// Start firmware. Patch return address.
	if ( DeviceObject->DevType == DEV_E2RM )
	{
	    if(!BlGoToAddress(DeviceObject, FW_ADDRESS))
	    {
		bResult = FALSE;
	    }
	    else
		bResult = TRUE;
	    
	    BlDelay(FW_START_DELAY);
	}
	else
	if (!BL_MEMORY_WRITE_DWORD(DeviceObject, BR_STACK_ADDRESS, BR_ADDRESS, &dwTemp))
	{
		/* Error! */ 
	}
	else
#else /* (DBG_ENABLED_BOOT_ROM_PATCH) */ 
	// Start firmware.
	if (!BlGoToAddress(DeviceObject, FW_ADDRESS))
	{
		/* Error! */ 
	}
	else
#endif /* (DBG_ENABLED_BOOT_ROM_PATCH) */ 
	// Wait a second.
	{
		//need to be implemented later 2001.9.7

		BlDelay(FW_START_DELAY);
		
		//end
		/* Success. */ 

		bResult = TRUE;
	}

	DBG_PRINT10("FwPostLoad: bResult = 0x%08X\n", bResult);

	DBG_PRINT00("FwPostLoad: }--\n");

	return bResult;
}

/****************************************************************************
*
*	Name:			FwLoad
*
*	Description:	Loads firmware (BSP) code.
*
*	Inputs:			PDEVICE_OBJECT	DeviceObject	-	pointer to Device Object
*
*	Outputs:		Returns TRUE if successful, otherwise FALSE.
*
****************************************************************************/

BOOLEAN
FwLoad
(
	IN PDEVICE_OBJECT	DeviceObject
)
{
	PCWSTR	pwszFileName	= NULL; 
	BOOLEAN	bFwImageLoaded	= FALSE;
	DWORD*	pdwFwImage		= NULL;
	ULONG	ulFwImageSize	= 0;
//	char pfilename[] = "/tmp/hasbani/DrvTest/CnxE2Fw.bin";
	char pfilename[] = FIRMWARE_FILE_NAME;
	BOOLEAN	bResult 		= FALSE;

	DBG_PRINT00("FwLoad: ++{\n");

// FwImageGetFileName needs to be modified for Linux later. 

	//if ((pwszFileName = FwImageGetFileName(DeviceObject)) == NULL)
	if ((pwszFileName = pfilename) == NULL)
	{
		/* Error! */ 
		DBG_PRINT00("\n\n\nFwLoad:FwImageGetFileName Failed\n\n\n");	
	}
	else
	if 
	(!(
		bFwImageLoaded = FwImageFileLoad
			(
				pwszFileName, //FW_IMAGE_FILE_NAME, 
				&pdwFwImage, 
				&ulFwImageSize
			)
	))
	{
		/* Error! */ 
	}
	else
	{
		/* Success. */ 
	}
	
	if (!bFwImageLoaded)
	{
		/* Load default image. */ 

		pdwFwImage = FW_IMAGE;
		ulFwImageSize = sizeof(FW_IMAGE);
	}
//	udsl_print_packet( &((char *)pdwFwImage)[ulFwImageSize -8], 8);
//	BlDelay(5*1000);
	else if (!BlMemoryWrite(DeviceObject, FW_ADDRESS, pdwFwImage, ulFwImageSize, MA_DWORD))
	{
		/* Error! */ 
	}
	else
	if 
	(
		!BlVerifyChecksum
		(
			DeviceObject, 
			//BlCalculateChecksum((PBYTE)FW_IMAGE, sizeof(FW_IMAGE)),
			BlCalculateChecksum((PBYTE)pdwFwImage, sizeof(ulFwImageSize)),
			FW_ADDRESS, 
			sizeof(ulFwImageSize)
		)
	)
	{
		/* Error! */ 
	}
	else
#if (DBG_ENABLED_BOOT_ROM_PATCH)
	if (!BlMemoryWrite(DeviceObject, BR_ADDRESS, BR_IMAGE, sizeof(BR_IMAGE), MA_DWORD))
	{
		/* Error! */ 
	}
	else
#endif /* (DBG_ENABLED_BOOT_ROM_PATCH) */ 
	{
		/* Success. */ 

		bResult = TRUE;
	}

	if (bFwImageLoaded)
	{
		MEMORY_VFREE(pdwFwImage);
		bResult = TRUE;	
	}

	if (pwszFileName != NULL)
	{
		//MEMORY_FREE(pwszFileName);
	}
	
	DBG_PRINT10("FwLoad: bResult = 0x%08X\n", (int)bResult);

	DBG_PRINT00("FwLoad: }--\n");

	return bResult;
}

PCWSTR 
FwImageGetFileName
(
	PDEVICE_OBJECT	DeviceObject
)
{
/*
	PDEVICE_OBJECT	pFdo			= DeviceObject;
	PWSTR			pwszFileName	= NULL;

	DBG_PRINT10(("FwImageGetFileName: ++{"));

	DBG_PRINT10(("FwImageGetFileName: DeviceObject = 0x%08X", DeviceObject));

	pwszFileName = FdoQueryDriverText
		(
			pFdo, 
			FW_IMAGE_FILE_NAME_REG_KEY, 
			NULL, 
			FALSE
		);

	if (pwszFileName == NULL)
	{
		// Error!  

		DBG_PRINT10(("FwImageGetFileName: QueryDriverText: (pwszFileName == NULL)"));
	}
	else
	{
		// Success.  

		DBG_PRINT10(("FwImageGetFileName: pwszFileName = %ws", pwszFileName));
	}

	DBG_PRINT10(("FwImageGetFileName: pwszFileName = 0x%08X", pwszFileName));

	DBG_PRINT10(("FwImageGetFileName: }--"));

	return pwszFileName;
*/
	return NULL;
}

BOOLEAN
FwImageFileLoad
(
	PCWSTR	pwszFileName, 
	DWORD**	ppdwFwImage, 
	ULONG*	pulFwImageSize
)
{

	struct file *	hFsFile		= NULL;
	int orgfsuid,orgfsgid;
	mm_segment_t orgfs;
	
	UCHAR*			pBuffer		= NULL;
	LONG			lFileSize	= 0;
	ULONG			lBufferSize	= 0;
	LONG			lLength		= 0;

	BOOLEAN			bResult		= FALSE;

	DBG_PRINT10("FwImageFileLoad: ++{\n");

	DBG_PRINT10("FwImageFileLoad: pwszFileName = \"%s\"\n", pwszFileName);

	*ppdwFwImage = NULL;
	*pulFwImageSize = 0;
	
 	 /* Save uid and gid used for filesystem access.
	  * Set user and group to 0 (root)
 	  */
	  orgfsuid=current->fsuid;
	  orgfsgid=current->fsgid;
	  current->fsuid=current->fsgid=0;
	  /* save FS register and set FS register to kernel
	   * space, needed for read and write to accept
	   * buffer in kernel space.
	   */
 	 orgfs=get_fs();
	 set_fs(KERNEL_DS);	

//	if ((hFsFile = FsFileCreate(pwszFileName)) == NULL)
	hFsFile = filp_open(pwszFileName, O_RDONLY, 0);
	DBG_PRINT10("FwImageFileLoad: filp_open hFsFile=%p\n", hFsFile);
	DBG_PRINT10("File size = %d\n", FsFileGetSize(hFsFile));
	if (IS_ERR (hFsFile))
	{
		// Error!  
		hFsFile = NULL;
		printk("Firmware image file does not exist.\n");
		printk("Please check if the file \"%s\" exists. The file name is case sensitive.\n", pwszFileName);
		DBG_PRINT10("FwImageFileLoad: FsFileCreate: (hFsFile == NULL)\n");
	}
	else
	if ((lFileSize = FsFileGetSize(hFsFile)) == -1)
	{
		// Error!  

		DBG_PRINT10("FwImageFileLoad: FsFileGetSize: (lFileSize == -1)\n");
	}
	else
	if 
	(
		//(lBufferSize = ROUND(lFileSize, sizeof(DWORD))),
		//((pBuffer = MEMORY_ALLOCATE(lBufferSize)) == NULL)
		(lBufferSize = ROUND(lFileSize, sizeof(DWORD))),
		((pBuffer = MEMORY_ALLOCATE (lBufferSize+1)) == NULL)
		
	)
	{
		// Error!  

		DBG_PRINT10("FwImageFileLoad: MEMORY_ALLOCATE: (pBuffer == NULL)\n");
	}
	else
	if 
	(
		(MEMORY_ZERO(pBuffer, lBufferSize+1)), 
		((lLength = FsFileRead(hFsFile, pBuffer, lFileSize)) != lFileSize)
	)
	{
		// Error!  

		DBG_PRINT10("FwImageFileLoad: FsFileRead: (lLength != lFileSize)\n");
	}
	else
	{
		// Success.  

		bResult = TRUE;
	}

	if (hFsFile != NULL)
	{
		filp_close(hFsFile, NULL);
	}

	if (!bResult)
	{
		if (pBuffer != NULL)
		{
			MEMORY_FREE(pBuffer);

			pBuffer = NULL;
		}
	}
	else
	{
		*ppdwFwImage = (DWORD*)pBuffer;
		*pulFwImageSize = lFileSize;//lBufferSize;

		if (1) DBG_PRINT10("\n\nFirmwareImageFile loaded successfully:\n");
		if (1) DBG_PRINT10("Name: %s\n", (char *)pwszFileName);
		if (1) DBG_PRINT10("Size: %u\n\n", (unsigned int)*pulFwImageSize);
	}

	DBG_PRINT10("FwImageFileLoad: *ppdwFwImage = 0x%p\n", *ppdwFwImage);
	DBG_PRINT10("FwImageFileLoad: *pulFwImageSize = 0x%08X\n", (unsigned int)*pulFwImageSize);

	DBG_PRINT10("FwImageFileLoad: bResult = 0x%08X\n", bResult);

	DBG_PRINT10("FwImageFileLoad: }--\n");
 	set_fs(orgfs);
  	current->fsuid=orgfsuid;
 	current->fsgid=orgfsgid;
	
	return bResult;

}

int FsFileRead (struct file *hFsFile, UCHAR* pBuffer, LONG lSize )
{
	int ret = 0;
	DBG_PRINT10("FsFileRead: Entering...\n");
	if ( IS_ERR(hFsFile) )
		return -1;
	DBG_PRINT10("FsFileRead: f_op->read=%p...\n", hFsFile->f_op->read);
	DBG_PRINT10("FsFileRead: f_op=%p...\n", hFsFile->f_op);
	if ( hFsFile->f_op->read )
	{
		ret = hFsFile->f_op->read (hFsFile, pBuffer, lSize, &hFsFile->f_pos);
		DBG_PRINT10("FsFileRead: bResult = %d\n", ret);
	}
	
	if ( ret < 0 )
		DBG_PRINT10("FsFileRead: bResult = %d\n", ret);
		
	DBG_PRINT10("FsFileRead: Leaving...\n");
	return ret;
}


int FsFileGetSize (struct file *hFsFile) 
{
	int ret=0;
	DBG_PRINT10("FsFileGetSize: Enter...\n");
	if (IS_ERR (hFsFile))
		return -1;
	ret = hFsFile->f_dentry->d_inode->i_size;
	

	DBG_PRINT10("FsFileGetSize: Leaving ret=%d...\n", ret);
	return ret;
}

/****************************************************************************
*
*	Name:			CalculateChecksum
*
*	Description:	Calculates checksum.
*
*	Inputs:			
*
*	Outputs:		Returns TRUE if successful, otherwise FALSE.
*
****************************************************************************/

static ULONG CalculateChecksum
(
	UCHAR	*pBuffer, 
	ULONG	uSize
)
{
	ULONG	dwChecksum	= 0;
	ULONG	*pdwBuffer	= (ULONG *)pBuffer;
	ULONG	n			= uSize / sizeof(ULONG);
	ULONG	m			= uSize % sizeof(ULONG);

	while (n--) 
	{
		dwChecksum += *pdwBuffer++;
	}

	if (m)
	{
		dwChecksum += *pdwBuffer & (0xFFFFFFFF >> (8 * (sizeof(ULONG) - m)));
	}

	return dwChecksum;
}


int udsl_print_packet (const unsigned char *data, int len) {
  unsigned char buffer[256];
  int i=0, j=0;
  
  for (i = 0; i < len ; ) {
    buffer[0] = '\0';
    sprintf(buffer,"%.3x :", i);
    for (j = 0; (j < 16) && (i< len) ; j++, i++) {
      sprintf(buffer, "%s %2.2x", buffer, data[i]);
      }
    PDEBUG("%s\n", buffer);
    }
  return i;
  };
 void E2ToLower(char * src)
 {
    char i= 'A'-'a';
    while(src)
    {
	if('A'<=(*src)< 'a')
	    *src += i;
    }
    
 }
  
/*
BOOLEAN
FwImageFileLoad
(
	PCWSTR	pwszFileName, 
	DWORD**	ppdwFwImage, 
	ULONG*	pulFwImageSize
)
{

	FS_FILE_HANDLE	hFsFile		= NULL;

	UCHAR*			pBuffer		= NULL;
	LONG			lFileSize	= 0;
	LONG			lBufferSize	= 0;
	LONG			lLength		= 0;

	BOOLEAN			bResult		= FALSE;

	DBG_PRINT10(("FwImageFileLoad: ++{"));

	DBG_PRINT10(("FwImageFileLoad: pwszFileName = \"%ws\"", pwszFileName));

	*ppdwFwImage = NULL;
	*pulFwImageSize = 0;

	if ((hFsFile = FsFileCreate(pwszFileName)) == NULL)
	{
		// Error!  

		DBG_PRINT10(("FwImageFileLoad: FsFileCreate: (hFsFile == NULL)"));
	}
	else
	if ((lFileSize = FsFileGetSize(hFsFile)) == -1)
	{
		// Error!  

		DBG_PRINT10(("FwImageFileLoad: FsFileGetSize: (lFileSize == -1)"));
	}
	else
	if 
	(
		(lBufferSize = ROUND(lFileSize, sizeof(DWORD))),
		((pBuffer = MEMORY_ALLOCATE(lBufferSize)) == NULL)
	)
	{
		// Error!  

		DBG_PRINT10(("FwImageFileLoad: MEMORY_ALLOCATE: (pBuffer == NULL)"));
	}
	else
	if 
	(
		(MEMORY_ZERO(pBuffer, lBufferSize)), 
		((lLength = FsFileRead(hFsFile, pBuffer, lFileSize)) != lFileSize)
	)
	{
		// Error!  

		DBG_PRINT10(("FwImageFileLoad: FsFileRead: (lLength != lFileSize)"));
	}
	else
	{
		// Success.  

		bResult = TRUE;
	}

	if (hFsFile != NULL)
	{
		FsFileClose(hFsFile);
	}

	if (!bResult)
	{
		if (pBuffer != NULL)
		{
			MEMORY_FREE(pBuffer);

			pBuffer = NULL;
		}
	}
	else
	{
		*ppdwFwImage = (DWORD*)pBuffer;
		*pulFwImageSize = lBufferSize;

		if (0) DbgPrint("\n\nFirmwareImageFile loaded successfully:\n");
		if (0) DbgPrint("Name: %ws\n", pwszFileName);
		if (0) DbgPrint("Size: %u\n\n", *pulFwImageSize);
	}

	DBG_PRINT10(("FwImageFileLoad: *ppdwFwImage = 0x%08X", *ppdwFwImage));
	DBG_PRINT10(("FwImageFileLoad: *pulFwImageSize = 0x%08X", *pulFwImageSize));

	DBG_PRINT10(("FwImageFileLoad: bResult = 0x%08X", bResult));

	DBG_PRINT10(("FwImageFileLoad: }--"));

	return bResult;

	return FALSE;
}
*/
