rt2570sw.h

来自「AMLOGIC DPF source code」· C头文件 代码 · 共 1,922 行 · 第 1/5 页

H
1,922
字号
/***************************************************************************  * RT2x00 SourceForge Project - http://rt2x00.sourceforge.net              *  *                                                                         *  *   This program is free software; you can redistribute it and/or modify  *  *   it under the terms of the GNU General Public License as published by  *  *   the Free Software Foundation; either version 2 of the License, or     *  *   (at your option) any later version.                                   *  *                                                                         *  *   This program is distributed in the hope that it will be useful,       *  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *  *   GNU General Public License for more details.                          *  *                                                                         *  *   You should have received a copy of the GNU General Public License     *  *   along with this program; if not, write to the                         *  *   Free Software Foundation, Inc.,                                       *  *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *  *                                                                         *  *   Licensed under the GNU GPL                                            *  *   Original code supplied under license from RaLink Inc, 2004.           *  ***************************************************************************//***************************************************************************  *	Module Name:	rt2570sw.h * *	Abstract: * *	Revision History: *	Who		When		What *	--------	----------	------------------------------------ *	Name		Date		Modification logs *	Jan Lee		2005-06-01	Release *	Ivo		02-06-2005	Debug flag fix *	FelipeaA	02-06-2005	Added Conceptronic C54RU *	MathiasK	02-06-2005	Added F5D7050,UB801R *	MarkW		02-08-2005	Added MSI 6861 *	PeterF		27-06-2005	Added GN-WBKG *	zak		03-07-2005	Added second GN-WBKG *	PedroP          04-07-2005      Added EMINENT 3035 *      MarkW		06-12-2005	Added Linksys@Home   ***************************************************************************/#ifndef __vnetsw_h_OK__#define __vnetsw_h_OK__#ifndef AVOS#if LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0)#include <linux/kthread.h>#endif#endif  // AOVS//red,extern	unsigned long	NIC_VENDOR_DRIVER_VERSION;//blue////////////////////////////////////////////////////////////////////////////// Frame Sizes////////////////////////////////////////////////////////////////////////////#define MAC_ADDRESS_LENGTH              6#define HEADER_SIZE                     14#define MAXIMUM_PACKET_SIZE             1500#define MAX_QUEUE_SIZE                  100#define USB_TX_HEADER_SIZE              8//WLength+TxRate+PaddingBytes+Reserved#define USB_RX_HEADER_SIZE              12#define WIRELESS_HEADER_OVERHEAD        18#define MAX_TX_PADDING_BYTES            50#define MAX_RX_PADDING_BYTES            66#define CRC32_BYTES                     4#define MAX_WIRELESS_SIZE               WIRELESS_HEADER_OVERHEAD + HEADER_SIZE + MAXIMUM_PACKET_SIZE + CRC32_BYTESextern unsigned long flagg;typedef UCHAR ADDRESS[MAC_ADDRESS_LENGTH];////////////////////////////////////////////////////////////////////////////// NDIS related definitions////////////////////////////////////////////////////////////////////////////#define MAX_MULTICAST_ADDRESSES         32#define MAX_LOOKAHEAD_SIZE              MAXIMUM_PACKET_SIZE + HEADER_SIZE#define TRANSMIT_BUFFER_SPACE           0x3000#define RECEIVE_BUFFER_SPACE            0x4000#define MAXIMUM_SEND_PACKETS            8#define OPER_RATE_SIZE                  4#define SUPPORTED_RATES_SET_1           0#define SUPPORTED_RATES_SET_2           1////////////////////////////////////////////////////////////////////////////// Memory Macros////////////////////////////////////////////////////////////////////////////#define FreeMemory(_buffer) kfree(_buffer)////////////////////////////////////////////////////////////////////////////// 802,11 related definitions////////////////////////////////////////////////////////////////////////////#define ESS_ID_SIZE                             32#define AD_HOC_MODE                             1#define INFRASTRUCTURE_MODE                     2#define WEP_KEY_SIZE                            13 //128-bit encryption#define PREAMBLE_TYPE_LONG                      0#define PREAMBLE_TYPE_SHORT                     1////////////////////////////////////////////////////////////////////////////// used to track information on usb pipes in use////////////////////////////////////////////////////////////////////////////typedef struct __BULKUSB_PIPEINFO {    BOOLEAN fPipeOpened;} BULKUSB_PIPEINFO, *PBULKUSB_PIPEINFO;//#pragma pack (push, 1)#define RTUSB_DEVICES {                                 \	{ USB_DEVICE_DECL(0x0411, 0x0066)},	/* Melco */		\	{ USB_DEVICE_DECL(0x0411, 0x0067)},	/* Melco */		\	{ USB_DEVICE_DECL(0x050d, 0x7050)},	/* Belkin */		\	{ USB_DEVICE_DECL(0x050d, 0x7051)},	/* Belkin */		\	{ USB_DEVICE_DECL(0x050d, 0x705a)},  /* Belkin */		\	{ USB_DEVICE_DECL(0x06f8, 0xe000)}, /* GUILLEMOT */		\	{ USB_DEVICE_DECL(0x0707, 0xee13)},	/* SMC */		\	{ USB_DEVICE_DECL(0x0b05, 0x1706)},	/* ASUS */		\	{ USB_DEVICE_DECL(0x0b05, 0x1707)},	/* ASUS */		\	{ USB_DEVICE_DECL(0x0db0, 0x6861)},	/* MSI */		\	{ USB_DEVICE_DECL(0x0db0, 0x6865)},	/* MSI */		\	{ USB_DEVICE_DECL(0x0db0, 0x6869)},	/* MSI */		\	{ USB_DEVICE_DECL(0x1044, 0x8001)},	/* Gigabyte */		\	{ USB_DEVICE_DECL(0x1044, 0x8007)},	/* Gigabyte */		\	{ USB_DEVICE_DECL(0x114b, 0x0110)},	/* Spairon */		\	{ USB_DEVICE_DECL(0x13b1, 0x000d)},	/* Cisco Systems */	\	{ USB_DEVICE_DECL(0x13b1, 0x0011)},	/* Cisco Systems */	\	{ USB_DEVICE_DECL(0x13b1, 0x001a)},  /* Cisco Systems */	\	{ USB_DEVICE_DECL(0x148f, 0x1706)},	/* Ralink */		\	{ USB_DEVICE_DECL(0x148f, 0x2570)},	/* Ralink */		\	{ USB_DEVICE_DECL(0x148f, 0x2573)},	/* CNET CWD-854 */	\	{ USB_DEVICE_DECL(0x148f, 0x9020)},	/* Ralink */		\	{ USB_DEVICE_DECL(0x14b2, 0x3c02)},	/* Conceptronic */	\	{ USB_DEVICE_DECL(0x14f8, 0x2570)},	/* Eminent */		\	{ USB_DEVICE_DECL(0x2001, 0x3c00)},	/* D-LINK Rev B1*/	\	{ USB_DEVICE_DECL(0x07d1, 0x3c03)},	/* D-LINK Rev C1*/	\	{ USB_DEVICE_DECL(0x0411, 0x008b)},	/* Nintendo */		\	{ USB_DEVICE_DECL(0x5a57, 0x0260)},  /* Zinwell */		\	{ USB_DEVICE_DECL(0x0eb0, 0x9020)},  /* Novatech */		\	{0,}							\}typedef struct urb *purbb_t;typedef struct usb_ctrlrequest devctrlrequest;// for vendor-specific control operations#define CONTROL_TIMEOUT_MS	(500)			/* msec */#ifdef AVOS#define CONTROL_TIMEOUT_JIFFIES USB_CTRL_SET_TIMEOUT#else  // AVOS#define CONTROL_TIMEOUT_JIFFIES ((CONTROL_TIMEOUT_MS * HZ)/1000)#endif // AVOS/* map devrequest fields onto usb_ctrlrequest's */#define DEVREQ_REQUEST(x) ((x)->bRequest)#define DEVREQ_REQUESTTYPE(x) ((x)->bRequestType)#define DEVREQ_VALUE(x) ((x)->wValue)#define DEVREQ_INDEX(x) ((x)->wIndex)#define DEVREQ_LENGTH(x) ((x)->wLength)#define PURB	purbb_t#define PIRP	PVOID#define PMDL PVOID#define NDIS_OID UINT       ////  MACRO for debugging information//#ifdef RT2570_DBGextern ULONG    rt2570_debug;#ifdef AVOS//#define DBGPRINT(Level, args...)     printk( args )//#define DBGPRINT_RAW(Level, args...) printk( args )#define DBGPRINT(Level, args...)        if (Level <= rt2570_debug) printk(args)#define DBGPRINT_RAW(Level, args...)    if (Level <= rt2570_debug) printk(args)#endif // AVOS#if 0#define DBGPRINT(Level, args...) 		        \{									            \	if (Level <= debug)						    \	{								            \		printk(KERN_DEBUG NIC_DBG_STRING args); \	}								            \}#define DBGPRINT_RAW(Level, args...)    \  {									    \	if (Level <= debug)					\	{								    \		printk(args);				    \	}								    \}#endif#else /* RT2570_DBG */#define DBGPRINT(Level, fmt, args...)#define DBGPRINT_RAW(Level, fmt, args...)#endif /* RT2570_DBG */#ifndef AVOS#  define assert(expr) \        if(unlikely(!(expr))) {				        \        printk(KERN_ERR "Assertion failed! %s,%s,%s,line=%d\n",	\        #expr,__FILE__,__FUNCTION__,__LINE__);		        \        }#endif  // ! AVOS//// Defines the state of the LAN media//typedef enum _NDIS_MEDIA_STATE{    NdisMediaStateConnected,    NdisMediaStateDisconnected} NDIS_MEDIA_STATE, *PNDIS_MEDIA_STATE;#define NdisMSetInformationComplete(handle, status)		\{					\}#define NdisMIndicateStatusComplete(handle)		\{					\}#define NdisMIndicateStatus(_M, _G, _SB, _BS)		\{						\}////	The following structure defines the device power states.//typedef enum _NDIS_DEVICE_POWER_STATE{	NdisDeviceStateUnspecified = 0,	NdisDeviceStateD0,	NdisDeviceStateD1,	NdisDeviceStateD2,	NdisDeviceStateD3,	NdisDeviceStateMaximum} NDIS_DEVICE_POWER_STATE, *PNDIS_DEVICE_POWER_STATE;#define ETH_LENGTH_OF_ADDRESS	6#define STATUS_SUCCESS	0x00#define STATUS_UNSUCCESSFUL 0x01typedef LONG NTSTATUS;typedef NTSTATUS *PNTSTATUS;#ifdef AVOS#define	NdisAllocateSpinLock(lock)  #define NdisAcquireSpinLock(lock)   local_irq_save(*(lock))#define NdisReleaseSpinLock(lock)   local_irq_restore(*(lock))#define RTUSBFreeSkbBuffer(skb)		pbuf_free(skb)#else  // AVOS////	spin_lock enhanced for Nested spin lock//#define	NdisAllocateSpinLock(lock)		\{									\	spin_lock_init(lock);				\}#define NdisReleaseSpinLock(lock)						\{										\	if (in_interrupt())				\{										\		spin_unlock_irqrestore(lock, flagg);			\}	\	else						\{										\		spin_unlock(lock);			\}	\}#define NdisAcquireSpinLock(lock)			\{							\	if (in_interrupt())				\		spin_lock_irqsave(lock, flagg);			\	else						\		spin_lock(lock);			\}#define RTUSBFreeSkbBuffer(skb)				\{											\	dev_kfree_skb_any(skb);					\}#endif // AVOS#ifdef AVOS#define RTUSBUp(pAd, semaphore) \{				                \	if(pAd->MLMEThr_pid>0)	    \    AVSemPost(*(semaphore));    \}#define RTUSBCMDUp(pAd, semaphore) \{	                               \	if(pAd->RTUSBCmdThr_pid>0)	   \    AVSemPost(*(semaphore));       \}#else  // AVOS#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 5, 0)#define RTUSBUp(pAd, semaphore)	\{				\	if(pAd->MLMEThr_pid>0)	\	up(semaphore);		\}#define RTUSBCMDUp(pAd, semaphore)	\{	\	if(pAd->RTUSBCmdThr_pid>0)	\	up(semaphore);	\}#else#define RTUSBUp(pAd, semaphore)	\{				\	if(pAd->MLMEThr_active)	\	up(semaphore);		\}#define RTUSBCMDUp(pAd, semaphore)	\{	\	if(pAd->RTUSBCmdThr_active)	\	up(semaphore);	\}#endif#endif  // AVOS//Setup Packet used in Ctrl urb's filler....#define FILL_REQUEST(a,aa,ab,ac,ad,ae)\  do {\      (a)->devreq->request = aa;\      (a)->devreq->requesttype = ab;\      (a)->devreq->value = cpu_to_le16(ac);\      (a)->devreq->index = cpu_to_le16(ad);\      (a)->devreq->length = cpu_to_le16(ae);\  }while(0);// direction is specified in TransferFlags#define URB_FUNCTION_RESERVED0                      0x0016//// These are for sending vendor and class commands// on the default pipe//// direction is specified in TransferFlags//#define URB_FUNCTION_VENDOR_DEVICE                   0x0017#define URB_FUNCTION_VENDOR_INTERFACE                0x0018#define URB_FUNCTION_VENDOR_ENDPOINT                 0x0019#define URB_FUNCTION_VENDOR_OTHER                    0x0020#define URB_FUNCTION_CLASS_DEVICE                    0x001A#define URB_FUNCTION_CLASS_INTERFACE                 0x001B#define URB_FUNCTION_CLASS_ENDPOINT                  0x001C#define URB_FUNCTION_CLASS_OTHER                     0x001F//// Reserved function codes//                                                                                                        #define URB_FUNCTION_RESERVED                        0x001D

⌨️ 快捷键说明

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