⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wvlan_hcfcfg.h

📁 pcmcia source code
💻 H
📖 第 1 页 / 共 3 页
字号:
/************************************************************************************************/#if defined(__ppc) || defined(_AM29K) //|| (CPU == PPC860)#define HCF_AP						//AccesPoint characteristics#define MSF_COMPONENT_VAR       0#define MSF_COMPONENT_ID        0#define MSF_COMPONENT_MAJOR_VER 1#define MSF_COMPONENT_MINOR_VER 0#define FAR			// flat 32-bits code#define BASEDtypedef unsigned char				hcf_8;typedef unsigned short				hcf_16;typedef unsigned long				hcf_32;#define SwapBytes(t)    /*lint -e572*/(((t) >> 8) + (((t) & 0xff) << 8))/*lint +e572*/#if defined(__ppc) || (CPU == PPC860)    #ifndef __GNUC__        #define __asm__     asm    #endif    #if !defined(_lint)        #define EIEIO()     __asm__(" eieio")    #else        #define EIEIO()    #endif    hcf_8 IN_PORT_BYTE(int port) {        hcf_8 value = *(volatile hcf_8 *)(port); EIEIO();        return value;    }    hcf_16 IN_PORT_WORD(int port) {        hcf_16 value = *(volatile hcf_16 *)(port); EIEIO();        value = SwapBytes(value);        return value;    }    #define OUT_PORT_BYTE(port, value) { *(volatile hcf_8 *)(port) = (value); EIEIO(); }    #define OUT_PORT_WORD(port, value)      \            { *(volatile hcf_16 *)(port) = SwapBytes(value); EIEIO(); }#else    #define IN_PORT_BYTE(port) (*(volatile hcf_8 *)(port))    #define IN_PORT_WORD(port) (*(volatile hcf_16 *)(port))    #define OUT_PORT_BYTE(port, value) (*(volatile hcf_8 *)(port) = (value))    #define OUT_PORT_WORD(port, value) (*(volatile hcf_16 *)(port) = (value))#endif/***************************************************************************/#define IN_PORT_STRING( port, dest, len)        {                       \                        unsigned l = (len);                             \                        hcf_16 t, *d = (volatile hcf_16 *)(dest);       \                        while (l--) {                                   \                            t = IN_PORT_WORD(port);                     \                            *d++ = SwapBytes(t);                        \                        }                                               \                                                }#define OUT_PORT_STRING( port, src, len)        {                       \                        unsigned l = (len);                             \                        hcf_16 t, *s = (volatile hcf_16 *)(src);        \                        while (l--) {                                   \                            t = *s++;                                   \                            OUT_PORT_WORD(port, SwapBytes(t));          \                        }                                               \                                                }#if PRODUCT == 9150    #define HCF_AP    #define HCF_ASSERT    #undef MSF_COMPONENT_ID#endif#endif	/* MPC860 - Diab or High C 29K *//************************************************************************************************//***********************************  M A C  O S   **********************************************//************************************************************************************************/        /**********/#if 0   /* MAC_OS */        /**********/#define HCF_STA                     //station characteristics#define MSF_COMPONENT_ID            COMP_ID_MAC_OS#define MSF_COMPONENT_VAR           0#define MSF_COMPONENT_MAJOR_VER     3#define MSF_COMPONENT_MINOR_VER     0#define MAC_OS                      1#define FAR                         // flat 32-bits code#define BASED#undef  HCF_LITTLE_ENDIAN           // selects Little Endian (a.k.a. Intel), least significant byte first#define HCF_BIG_ENDIAN              // selects Big Endian (a.k.a. Motorola), most significant byte first#if defined(DEBUG)#define HCF_ASSERT                  1#endif // DEBUGtypedef unsigned char               hcf_8;typedef unsigned short              hcf_16;typedef unsigned long               hcf_32;#ifdef  __cplusplusextern "C" {#endifextern volatile unsigned char *MacIOaddr;extern hcf_8  IN_PORT_BYTE(hcf_16 port);extern void   OUT_PORT_BYTE(hcf_16 port, hcf_8 value);extern hcf_16 IN_PORT_WORD(hcf_16 port);extern void   OUT_PORT_WORD(hcf_16 port, hcf_16 value);extern void   IN_PORT_STRING(hcf_16 port, void *dest, hcf_16 len);extern void   OUT_PORT_STRING(hcf_16 port, void *src, hcf_16 len);#define SwapBytes(t)    (((t) >> 8) + (((t) & 0xff) << 8))#ifdef  __cplusplus}#endif#endif  /* MAC_OS *//************************************************************************************************//***********************************  W I N C E *************************************************//************************************************************************************************/                  /*********/#ifdef _WIN32_WCE /* WINCE */                  /*********/#define	MSF_COMPONENT_ID			COMP_ID_WIN_CE#define HCF_STA						//station characteristics#include <ndis.h>#include <version.h>#include <ntcompat.h>#define	MSF_COMPONENT_VAR			1#define	MSF_COMPONENT_MAJOR_VER		TPI_MAJOR_VERSION#define	MSF_COMPONENT_MINOR_VER		TPI_MINOR_VERSION#define BASED #undef  HCF_LITTLE_ENDIAN           // selects Little Endian (a.k.a. Intel), least significant byte first#undef  HCF_BIG_ENDIAN              // selects Big Endian (a.k.a. Motorola), most significant byte first#if defined(_SH3_) || defined (_SHx_) || defined(_MIPS_) || defined(_X86_)#define HCF_LITTLE_ENDIAN#endif#if defined(DEBUG) || defined(_WIN32_WCE_DEBUG)#define HCF_ASSERT                  1#endif // DEBUGtypedef UCHAR   hcf_8;typedef USHORT  hcf_16;typedef ULONG   hcf_32;#ifdef  __cplusplusextern "C" {#endif#define WCE_IO_OFFSET   0x40extern ULONG  WceIoAddr;extern hcf_8  IN_PORT_BYTE(hcf_16 port);extern void   OUT_PORT_BYTE(hcf_16 port, hcf_8 value);extern hcf_16 IN_PORT_WORD(hcf_16 port);extern void   OUT_PORT_WORD(hcf_16 port, hcf_16 value);extern void   IN_PORT_STRING(hcf_16 port, void *dest, hcf_16 len);extern void   OUT_PORT_STRING(hcf_16 port, void *src, hcf_16 len);#ifdef  __cplusplus}#endif#endif	/* _WIN32_WCE *//*  * * * * * * * * * * * * * * * * * * * * * *  IV  * * * * * * * * * * * * * * * * * * * * * * *//***************************************Compiler specific ****************************************/#ifdef __cplusplus#define EXTERN_C extern "C"#else#define EXTERN_C#endif //__cplusplus                                                                                                            /************************************************************************************************//********** M A C R O S derived of C O M P I L E R   S P E C I F I C   M A C R O S  *************//************************************************************************************************/typedef hcf_8  FAR *wci_bufp;			 // segmented 16-bits or flat 32-bits pointer to 8 bits unittypedef hcf_16 FAR *wci_recordp;		 // segmented 16-bits or flat 32-bits pointer to 16 bits unittypedef hcf_8  FAR *hcf_8fp;			 // segmented 16-bits or flat 32-bits pointer to 8 bits unittypedef hcf_16 FAR *hcf_16fp;			 // segmented 16-bits or flat 32-bits pointer to 16 bits unittypedef hcf_32 FAR *hcf_32fp;			 // segmented 16-bits or flat 32-bits pointer to 8 bits unit#if defined HCF_STA && defined HCF_AP#if defined WCITST#pragma message( "you should also test both in isolation" )#elseerror; define exactly one of these terms;#endif#endif#if ! defined HCF_STA && ! defined HCF_APerror; define exactly one of these terms;#endif/*  * * * * * * * * * * * * * * * * * * * * * *  V  * * * * * * * * * * * * * * * * * * * * * * */#if defined HCF_PORT_IO#if defined HCF_MEM_IOerror;#elsetypedef hcf_16 hcf_io;#endif //HCF_MEM_IO#endif //HCF_PORT_IO#if defined HCF_MEM_IO#if defined HCF_PORT_IOerror;#elsetypedef hcf_32 hcf_io;#endif //HCF_PORT_IO#endif //HCF_MEM_IO/* MSF_COMPONENT_ID is used to define the CFG_IDENTITY_STRCT in HCF.C * CFG_IDENTITY_STRCT is defined in HCF.C purely based on convenience arguments * The HCF can not have the knowledge to determine the ComponentId field of the * Identity record (aka as Version Record), therefore the MSF part of the Drivers * must supply this value via the System Constant MSF_COMPONENT_ID * There is a set of values predefined in MDD.H (format COMP_ID_.....) */#if defined	MSF_COMPONENT_ID#define	DUI_COMPAT_VAR				MSF_COMPONENT_ID#define	DUI_COMPAT_BOT              4#define	DUI_COMPAT_TOP              4#endif // MSF_COMPONENT_ID/************************************************************************************************//***************  E N V I R O N M E N T   S P E C I F I C   M A C R O S  ************************//************************************************************************************************/#if defined HCF_ASSERT	//the next line may need modification for a specific environmentextern int	BASED HCF_VAR_0; //Revision 2.0 gives an explanation of the need for HCF_VAR_0#endif#if defined HCF_PROFILING#endif/************************************************************************************************//******  M S F    S U P P O R T    F U N C T I O N S    P R O T O T Y P E S   *******************//************************************************************************************************/EXTERN_C void msf_assert ( wci_bufp file_namep, unsigned int line_number, hcf_16 trace, int qual );/* To increase portability, use unsigned char and unsigned char * when accessing parts of larger * types to convert their Endianess */#if defined HCF_BIG_ENDIAN#if defined HCF_LITTLE_ENDIAN	error#else	//************************************* B I G   E N D I A N *******************************************#define CNV_LITTLE_TO_INT(w)    ( ((hcf_16)(w) & 0x00ff) << 8 | ((hcf_16)(w) & 0xff00) >> 8 )#define CNV_BIG_TO_INT(w)		(w)		// No endianess conversion needed#define CNV_INT_TO_BIG_NP(addr)#define CNV_LITTLE_TO_INT_NP(addr) {							\	hcf_8 temp;													\	temp = ((hcf_8 FAR *)(addr))[0];							\	((hcf_8 FAR *)(addr))[0] = ((hcf_8 FAR *)(addr))[1];		\	((hcf_8 FAR *)(addr))[1] = temp;							\}#endif // HCF_LITTLE_ENDIAN#endif // HCF_BIG_ENDIAN#if defined HCF_LITTLE_ENDIAN#if defined HCF_BIG_ENDIAN	error; #else	//************************************* L I T T L E   E N D I A N *************************************#define CNV_LITTLE_TO_INT(w) 	(w)		// No endianess conversion needed#define CNV_BIG_TO_INT(w)       ( ((hcf_16)(w) & 0x00ff) << 8 | ((hcf_16)(w) & 0xff00) >> 8 )#define CNV_INT_TO_BIG_NP(addr) {								\	hcf_8 temp;													\	temp = ((hcf_8 FAR *)(addr))[0];							\	((hcf_8 FAR *)(addr))[0] = ((hcf_8 FAR *)(addr))[1];		\	((hcf_8 FAR *)(addr))[1] = temp;							\}#define CNV_LITTLE_TO_INT_NP(addr)#endif // HCF_BIG_ENDIAN#endif // HCF_LITTLE_ENDIAN// conversion macros which can be expressed in other macros#define CNV_INT_TO_LITTLE(w)	CNV_LITTLE_TO_INT(w)#define CNV_INT_TO_BIG(w)		CNV_BIG_TO_INT(w)#endif //HCFCFG_H//******************************************* A L I G N M E N T  **********************************************#if defined HCF_ALIGN #if HCF_ALIGN != 0 && HCF_ALIGN != 2	error;#endif // HCF_ALIGN != 0 && HCF_ALIGN != 2#else#define HCF_ALIGN 0			//default to no alignment#endif // HCF_ALIGN  /*  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *	 *	The routines ips and ops (short for InPutString and OutPutString) are created to use the  *	compiler to do the type checking. It turned out that it is too easy to accidentally pass *	a word pointer to the macros IN_PORT_STRING and OUT_PORT_STRING rather than a byte pointer. *	The "+2" as some macro implementations use, does not have the intended effect in those cases. *	The HCF_STRICT business can be ignored by MSF programmers. *	 *  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */#if defined HCF_STRICTvoid ips( hcf_io prt, wci_bufp dst, int n);void ops( hcf_io prt, wci_bufp src, int n);#endif //HCF_STRICT#if !defined HCF_MAX_CONFIG#define HCF_MAX_CONFIG		256		// maximum accumulated size in hcf_16 of LTV records used in hcf_put_config#endif#if !defined HCF_MAX_MSG#define HCF_MAX_MSG			2304	/* WaveLAN Pakket Size										*/#endif#if !defined HCF_MAX_NOTIFY		#define HCF_MAX_NOTIFY		6		// maximum size in bytes of "real" data in Notify command#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -