/****************************************************************************
*
*	Name:			SndRcv.h
*
*	Description:	E2 command sending and receiving part header file.
*
*	Copyright:		(c) 1999 Conexant Systems Inc.
*
*	Revision:	Date:		Author:				Description:
*
*	Linux-1.0	May 29 2002	Shen Wei Wang			Created.
*					shenwei.wang@conexant.com
*
*****************************************************************************
*	$Author:   Shen Wei Wang  $
*	$Revision:   1.0  $
*	$Modtime:   May 29 2002 11:09:58  $
****************************************************************************/

#ifndef SNDRCV_H
#define SNDRCV_H


typedef enum
{
   END_DEVICE_NOT_READY,
   END_DEVICE_READY,
   END_DEVICE_ERR_DOWNLOAD,
   END_DEVICE_UPLOAD_BLOCK,
   END_DEVICE_REBOOT_DOWNLOAD,
   END_DEVICE_SHUT_DOWN
} END_DEVICE_STATE;

typedef enum tagADDRESSType
{
	LOC_REBOOT_DOWNLOAD,
	LOC_ERR_DOWNLOAD,
	LOC_MEM_BLOCK_READ,
} ADDRESS_TYPE;

typedef struct _MemoryReadContext 
{
    ULONG CurrentAddress;   // in the device memory
    ULONG TotalBytes;
    ULONG BytesReceived;
        
    BYTE * pBuffer;
    ULONG Length;
    int Count;
}MemoryReadContext;



#define USB_TX_DATAGRAM_SIZE_MAX	(4 * 1024)
#define USB_RX_DATAGRAM_SIZE_MAX	(64 * 16)
#define USB_NUM_RX_DATAGRAMS    	16

#ifdef DEBUG1
#define TRACE printk
#define TRACE_FUNCTION printk
#else
#define TRACE(arg...)  
#define TRACE_FUNCTION(arg...)   
#endif

#if defined(MIDL_PASS)
typedef struct _LARGE_INTEGER {
#else // MIDL_PASS
typedef union _LARGE_INTEGER {
    struct {
        ULONG LowPart;
        LONG HighPart;
    };
    struct {
        ULONG LowPart;
        LONG HighPart;
    } u;
#endif //MIDL_PASS
    LONGLONG QuadPart;
} LARGE_INTEGER;

typedef LARGE_INTEGER *PLARGE_INTEGER;


#endif //SNDRCV_H

