/****************************************************************************
*
*	Name:			ntdef.h
*
*	Description:	Common type define 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 _NTDEF_H_
#define _NTDEF_H_

// begin_ntndis begin_windbgkd

#ifndef IN
#define IN
#endif

#ifndef OUT
#define OUT
#endif

#ifndef CONST
#define CONST               const
#endif

typedef unsigned long DWORD;
typedef unsigned long * PDWORD;

typedef unsigned short WORD;
typedef unsigned short * PWORD;

typedef unsigned char BYTE;
typedef unsigned char * PBYTE;

typedef unsigned char * PCHAR;

typedef void * PVOID;
 
#ifndef VOID
#define VOID void
typedef char CHAR;
typedef short SHORT;
typedef long LONG;
#endif


typedef unsigned char UCHAR;
typedef unsigned short USHORT;
typedef unsigned long ULONG;


typedef unsigned short WCHAR;    // wc,   16-bit UNICODE character


typedef WCHAR *PWCHAR;
typedef WCHAR *LPWCH, *PWCH;
typedef CONST WCHAR *LPCWCH, *PCWCH;
typedef WCHAR *NWPSTR;
typedef WCHAR *LPWSTR, *PWSTR;

//typedef CONST WCHAR *LPCWSTR, *PCWSTR;
typedef char * PCWSTR;

//
// Boolean
//

typedef UCHAR BOOLEAN;           // winnt
typedef BOOLEAN *PBOOLEAN;       // winnt

//
// Constants
//

#define FALSE   0
#define TRUE    1

#ifndef NULL
#ifdef __cplusplus
#define NULL    0
#define NULL64  0
#else
#define NULL    ((void *)0)
#define NULL64  ((void * POINTER_64)0)
#endif
#endif // NULL


typedef double LONGLONG;
typedef double ULONGLONG;

typedef LONGLONG *PLONGLONG;
typedef ULONGLONG *PULONGLONG;

//
// NTSTATUS
//

typedef LONG NTSTATUS;
/*lint -save -e624 */  // Don't complain about different typedefs.
typedef NTSTATUS *PNTSTATUS;
/*lint -restore */  // Resume checking for different typedefs.

//
//  Status values are 32 bit values layed out as follows:
//
//   3 3 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1
//   1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0
//  +---+-+-------------------------+-------------------------------+
//  |Sev|C|       Facility          |               Code            |
//  +---+-+-------------------------+-------------------------------+
//
//  where
//
//      Sev - is the severity code
//
//          00 - Success
//          01 - Informational
//          10 - Warning
//          11 - Error
//
//      C - is the Customer code flag
//
//      Facility - is the facility code
//
//      Code - is the facility's status code
//

//
// Generic test for success on any status value (non-negative numbers
// indicate success).
//
#define STATUS_SUCCESS                          ((NTSTATUS)0x00000000L) // ntsubauth

#define NT_SUCCESS(Status) ((NTSTATUS)(Status) >= 0)


#define STATUS_PENDING                   ((NTSTATUS)0x00000103L)    // winnt
#define STATUS_UNSUCCESSFUL              ((NTSTATUS)0xC0000001L)
#define STATUS_NO_MEMORY                 ((NTSTATUS)0xC0000017L)    // winnt

/****************************************************************************
*  Macro definitions
****************************************************************************/
#define MEMSET(pDst, uFill, uLength) \
		memset((pDst), \
		(uFill), (uLength))

#define MEMZERO(pDst, uLength) \
		memset((pDst), \
		0, (uLength))
				
#define MEMCPY(pDst, pSrc, uLength) \
		memcpy((pDst), \
		(pSrc), (uLength))

#define MEMORY_FREE(m)					\
{										\
	kfree((m));					\
}	

#define MIN(x, y) (((x) < (y)) ? (x) : (y))

#define		MINIPORTCOMPLETIONROUTINE	usb_complete_t

//#define PDEVICE_OBJECT struct cnxt_instance_data *
typedef struct hsb_usb_device * PDEVICE_OBJECT;

#ifdef DEBUG
#define PDEBUG(arg...)  printk("CNXT USB: " arg) //printk(KERN_DEBUG "CNXT USB: " arg)
#else
#define PDEBUG(arg...)
#endif

#endif

