📄 wvlan_hcfcfg.h
字号:
#define OUT_PORT_STRING( prt, dst, n) { ops( prt, dst, n); }#elif 0 // C implementation#define IN_PORT_STRING( prt, dst, n) while ( n-- ) { *(hcf_16 FAR*)dst = IN_PORT_WORD( prt ); dst += 2; }#define OUT_PORT_STRING( prt, src, n) while ( n-- ) { OUT_PORT_WORD( prt, *(hcf_16 FAR*)src ) ; src += 2; }//;? WHY hcf_16 FAR*)src and not unsigned char FAR*)src#else // Assembler implementation#define IN_PORT_STRING( port, dest, len) __asm \{ \ __asm push di \ __asm push es \ __asm mov cx,len \ __asm les di,dest \ __asm mov dx,port \ __asm rep insw \ __asm pop es \ __asm pop di \}#define OUT_PORT_STRING( port, src, len) __asm \{ \ __asm push si \ __asm push ds \ __asm mov cx,len \ __asm lds si,src \ __asm mov dx,port \ __asm rep outsw \ __asm pop ds \ __asm pop si \}#endif // Asm or C implementation#endif /* WVLAN_43, WVLAN_42 (DOS ODI, Packet Driver) *//************************************************************************************************//************************************* W C I T S T *********************************************//************************************************************************************************/#if defined WCITST#pragma warning ( disable: 4001 ) #define HCF_STA //station characteristics#define HCF_AP //AccesPoint characteristics#if _CONSOLE#define FAR // flat 32 bits mode (also defined in WINDEF.H)#define BASED #else#define FAR __far // segmented 16 bits mode#if defined _M_I86TM#define BASED __based(__segname("_CODE"))#else#define BASED #endif // _M_I86TM#endif //_CONSOLEtypedef unsigned char hcf_8;typedef unsigned short hcf_16;typedef unsigned long hcf_32;#include <stdio.h>#include <conio.h>#ifndef _DEBUG#pragma intrinsic( _inp, _inpw, _outp, _outpw )#endif // _DEBUG#ifdef LOGextern FILE* utm_logfile;hcf_16 ipw( hcf_16 port );hcf_8 ipb( hcf_16 port );void opw( hcf_16 port, hcf_16 value );void opb( hcf_16 port, hcf_8 value );#define IN_PORT_BYTE(port) ipb( (hcf_io)(port) )#define IN_PORT_WORD(port) ipw( (hcf_io)(port) )#define OUT_PORT_BYTE(port, value) opb( (hcf_io)(port), (hcf_8)(value) )#define OUT_PORT_WORD(port, value) opw( (hcf_io)(port), (hcf_16)(value) )#else //LOG#define IN_PORT_BYTE(port) ((hcf_8)_inp( (hcf_io)(port) ))#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))#define OUT_PORT_BYTE(port, value) ((void)_outp( (hcf_io)(port), value ))#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))#endif //LOG#define toch_maar_geen_asm#if defined(toch_maar_asm) && !defined(__DA_C__) //;? temporary solution to satisfy DA-C#define IN_PORT_STRING( port, dest, len) __asm \{ \ __asm push di \ __asm push es \ __asm mov cx,len \ __asm les di,dest \ __asm mov dx,port \ __asm rep insw \ __asm pop es \ __asm pop di \}#define OUT_PORT_STRING( port, src, len) __asm \{ \ __asm push si \ __asm push ds \ __asm mov cx,len \ __asm lds si,src \ __asm mov dx,port \ __asm rep outsw \ __asm pop ds \ __asm pop si \}#else //toch_maar_asm && !__DA_C__#define IN_PORT_STRING( prt, dst, n) while ( n-- ) { *(hcf_16 FAR*)dst = IN_PORT_WORD( prt ); dst += 2; }#define OUT_PORT_STRING( prt, src, n) while ( n-- ) { OUT_PORT_WORD( prt, *(hcf_16 FAR*)src ) ; src += 2; }//;? WHY hcf_16 FAR*)src and not unsigned char FAR*)src#endif //toch_maar_asm && !__DA_C__#endif /* WCITST *//************************************************************************************************//******************************************** W S U *******************************************//************************************************************************************************/#if 0 //;? conflicts with WIN_CE _MSC_VER >= 1000 /* Microsoft Visual C ++ 4.x, 5.x */// Note:// Visual C++ 4.0 : _MSC_VER == 1000// Visual C++ 4.2 : _MSC_VER == 1020 #pragma warning ( disable: 4001 ) #define HCF_STA //station characteristics//#if defined WVLAN_43//#define MSF_COMPONENT_ID COMP_ID_ODI_16//#else if defined WVLAN_42//#define MSF_COMPONENT_ID COMP_ID_PACKET//#endif //WVLAN_xx #if !defined FAR//#if _CONSOLE//#define FAR // flat 32 bits mode (also defined in WINDEF.H)//#define BASED //#else#define FAR // far is an obsolete key in Visual C++ 4.x//#if defined _M_I86TM//#define BASED __based(__segname("_CODE"))//#else#define BASED //#endif // _M_I86TM//#endif //_CONSOLE#endif //!defined FARtypedef unsigned char hcf_8;typedef unsigned short hcf_16;typedef unsigned long hcf_32;#include <stdio.h>#include <conio.h>#define IN_PORT_BYTE(port) ((hcf_8)_inp( (hcf_io)(port) ))#define IN_PORT_WORD(port) ((hcf_16)_inpw( (hcf_io)(port) ))#define OUT_PORT_BYTE(port, value) ((void)_outp( (hcf_io)(port), value ))#define OUT_PORT_WORD(port, value) ((void)_outpw( (hcf_io)(port), value ))#define toch_maar_geen_asm#if defined(toch_maar_asm)#define IN_PORT_STRING( port, dest, len) __asm \{ \ __asm push di \ __asm push es \ __asm mov cx,len \ __asm les di,dest \ __asm mov dx,port \ __asm rep insw \ __asm pop es \ __asm pop di \}#define OUT_PORT_STRING( port, src, len) __asm \{ \ __asm push si \ __asm push ds \ __asm mov cx,len \ __asm lds si,src \ __asm mov dx,port \ __asm rep outsw \ __asm pop ds \ __asm pop si \}#else //toch_maar_asm#define IN_PORT_STRING( prt, dst, n) while ( n-- ) { *(hcf_16 FAR*)dst = IN_PORT_WORD( prt ); dst += 2; }#define OUT_PORT_STRING( prt, src, n) while ( n-- ) { OUT_PORT_WORD( prt, *(hcf_16 FAR*)src ) ; src += 2; }//;? WHY hcf_16 FAR*)src and not unsigned char FAR*)src#endif //toch_maar_asm#endif /* _MSC_VER >= 1000 (Microsoft Visual C++ 4.0 ) *//************************************************************************************************//****************************************** L I N U X *****************************************//************************************************************************************************/#if defined __linux__#define HCF_STA //station characteristics#define MSF_COMPONENT_ID COMP_ID_LINUX#define MSF_COMPONENT_VAR 1#define MSF_COMPONENT_MAJOR_VER 0#define MSF_COMPONENT_MINOR_VER 4#include <asm/io.h>#define FAR // flat 32-bits code#define BASED typedef unsigned char hcf_8;typedef unsigned short hcf_16;typedef unsigned long hcf_32;#define IN_PORT_BYTE(port) ((hcf_8)inb((hcf_io)(port)))#define IN_PORT_WORD(port) ((hcf_16)inw((hcf_io)(port)))#define OUT_PORT_BYTE(port, value) outb((hcf_8)(value), (hcf_io)(port))#define OUT_PORT_WORD(port, value) outw((hcf_16)(value), (hcf_io)(port))#define IN_PORT_STRING insw#define OUT_PORT_STRING outsw#endif /* LINUX *//************************************************************************************************//********************************** S C O U N I X ********************************************//************************************************************************************************/#if 0#define HCF_STA //station characteristics#define MSF_COMPONENT_ID//#define CNV_LITTLE_TO_INT(x) // No endianess conversion needed #define FAR // flat 32-bits code#define BASED typedef unsigned char hcf_8;typedef unsigned short hcf_16;typedef unsigned long hcf_32;#define IN_PORT_BYTE(port) ((hcf_8)inb( (hcf_io)(port) ))#define IN_PORT_WORD(port) ((hcf_16)inw( (hcf_io)(port) ))#define OUT_PORT_BYTE(port, value) (outb( (hcf_io)(port), (hcf_8) (value) ))#define OUT_PORT_WORD(port, value) (outw( (hcf_io)(port), (hcf_16) (value) ))#define FAR // flat 32-bits code#define BASED #endif /* SCO UNIX *//************************************************************************************************//********************************* M I N I P O R T ********************************************//************************************************************************************************/#if 0#define MSF_COMPONENT_ID COMP_ID_MINIPORT#define HCF_STA //station characteristics#include <ndis.h>#include <version.h>#define MSF_COMPONENT_VAR 1#define MSF_COMPONENT_MAJOR_VER TPI_MAJOR_VERSION#define MSF_COMPONENT_MINOR_VER TPI_MINOR_VERSION//#define CNV_LITTLE_TO_INT(x) // No endianess conversion needed #if !defined FAR#define FAR // flat 32-bits code#endif //!defined FAR#define BASED __inline UCHAR NDIS_IN_BYTE( ULONG port ){ UCHAR value; NdisRawReadPortUchar(port , &value); return (value);}__inline USHORT NDIS_IN_WORD( ULONG port ){ USHORT value; NdisRawReadPortUshort(port , &value); return (value);}#define IN_PORT_BYTE(port) NDIS_IN_BYTE( (ULONG) (port) )#define IN_PORT_WORD(port) NDIS_IN_WORD( (ULONG) (port) )#define OUT_PORT_BYTE(port, value) NdisRawWritePortUchar( (ULONG) (port) , (UCHAR) (value))#define OUT_PORT_WORD(port, value) NdisRawWritePortUshort((ULONG) (port) , (USHORT) (value))#define IN_PORT_STRING(port, addr, len) NdisRawReadPortBufferUshort(port, addr, (len));#define OUT_PORT_STRING(port, addr, len) NdisRawWritePortBufferUshort(port, addr, (len));typedef UCHAR hcf_8;typedef USHORT hcf_16;typedef ULONG hcf_32;#endif /* MINIPORT *//************************************************************************************************//********************************* W A V E P O I N T ******************************************//************************************************************************************************/#if defined WVLAN_81 /* BORLANDC */#define HCF_AP //access point characteristics#define MSF_COMPONENT_ID COMP_ID_AP1#define MSF_COMPONENT_VAR 1#define MSF_COMPONENT_MAJOR_VER 3#define MSF_COMPONENT_MINOR_VER 34#include <dos.h>//#define CNV_LITTLE_TO_INT(x) // No endianess conversion needed typedef unsigned char hcf_8;typedef unsigned short hcf_16;typedef unsigned long hcf_32;//#define HCF_ASSERT 0 /* debug build only */#if !defined FAR#define FAR far // segmented 16 bits mode#endif //!defined FAR#define BASED #define IN_PORT_BYTE(port) (inportb( (hcf_io)(port) ))#define IN_PORT_WORD(port) (inport( (hcf_io)(port) ))#define OUT_PORT_BYTE(port, value) (outportb( (hcf_io)(port), value ))#define OUT_PORT_WORD(port, value) (outport( (hcf_io)(port), value ))#define IN_PORT_STRING(port, addr, len) \ asm { push di; push es; mov cx,len; les di,addr; mov dx,port; rep insw; pop es; pop di }#define OUT_PORT_STRING(port, addr, len) \ asm { push si; push ds; mov cx,len; lds si,addr; mov dx,port; rep outsw; pop ds; pop si }#endif /* WavePoint *//************************************************************************************************//************************** MPC860 - Diab or High C 29K **************************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -