📄 r8180_type.h
字号:
/* r8180_type.h: Part of Linux wireless lan driver for RTL8180. *//* Written 2002-2003 by ShuChen. This file is distributed according to the terms of the GNU General Public License (GPL). The original author may be reached as shuchen@realtek.com.tw*/#ifndef _INCLUDE_RTL8180_TYPE_H_#define _INCLUDE_RTL8180_TYPE_H_#include <linux/module.h>#include <linux/kernel.h>#include <linux/config.h>#include <linux/init.h>#include <linux/ioport.h>#include <linux/sched.h>#include <linux/types.h>#include <linux/slab.h>#include <linux/netdevice.h>#include <linux/pci.h>#include <linux/etherdevice.h>#include <linux/delay.h>#include <linux/rtnetlink.h>#include <linux/wireless.h>#include <linux/timer.h>#include <linux/proc_fs.h> // Necessary because we use the proc fs#include <linux/circ_buf.h>#include <asm/io.h>//----------------------------------------------------------------------------------------------// Endian//----------------------------------------------------------------------------------------------//#define RTL_BIG_ENDIAN 1//#define RTL_LITTLE_ENDIAN 1#if !defined(RTL_BIG_ENDIAN) && !defined(RTL_LITTLE_ENDIAN)#error "Big/Little endian have NOT been defined!\n"#endif//----------------------------------------------------------------------------------------------// Get/Set unsigned 16 bit integer.//----------------------------------------------------------------------------------------------#define GetUint16(ptr) ( (unsigned short)( (ptr[1]<<8) | ptr[0] ) )#define SetUint16(ptr,val16) { ((unsigned char *)ptr)[0]=(val16 & 0x00FF); \ ((unsigned char *)ptr)[1]=((val16>>8) & 0x00FF);}//----------------------------------------------------------------------------------------------// Enable Rx skb (socket buffer) debugging//----------------------------------------------------------------------------------------------#define ENABLE_RTL_SKB_STATS//----------------------------------------------------------------------------------------------// Enable assert debugging//----------------------------------------------------------------------------------------------#define ENABLE_RTL_ASSERT_DEBUG //enable assert() debugging//----------------------------------------------------------------------------------------------// Enable proc file system debugging//----------------------------------------------------------------------------------------------#define ENABLE_RTL_PROC_DEBUG//----------------------------------------------------------------------------------------------// Driver parameters//----------------------------------------------------------------------------------------------#define MAX_SSID_LEN 32#define MAX_NAME_LEN 32/*=====================================================================================type definition.=====================================================================================*/typedef struct timer_list timer_t;#define rtl_bool unsigned char#define rtl_uint8 unsigned char#define rtl_uint16 unsigned short#define rtl_uint32 unsigned long#undef RTL_R8#undef RTL_R16#undef RTL_R32#undef RTL_W8#undef RTL_W16#undef RTL_W32#ifdef RTL_IO_MAP/* write/read PIO register */# define RTL_W8(reg, val8) outb ((val8), ioaddr + (reg))# define RTL_W16(reg, val16) outw ((val16), ioaddr + (reg))# define RTL_W32(reg, val32) outl ((val32), ioaddr + (reg))# define RTL_R8(reg) inb (ioaddr + (reg))# define RTL_R16(reg) inw (ioaddr + (reg))# define RTL_R32(reg) ((unsigned long) inl (ioaddr + (reg)))#else/* write/read MMIO register */# define RTL_W8(reg, val8) writeb ((val8), ioaddr + (reg))# define RTL_W16(reg, val16) writew ((val16), ioaddr + (reg))# define RTL_W32(reg, val32) writel ((val32), ioaddr + (reg))# define RTL_R8(reg) readb (ioaddr + (reg))# define RTL_R16(reg) readw (ioaddr + (reg))# define RTL_R32(reg) ((unsigned long) readl (ioaddr + (reg)))#endif //end #ifdef RTL_IO_MAP#ifdef RTL8180_ASSERT_DEBUG_ENABLE# define assert(expr) \ if(!(expr)) { \ printk( "Assertion failed! %s at ......\n", #expr); \ printk( " ......%s,%s,line=%d\n",__FILE__,__FUNCTION__,__LINE__); \ }#else# define assert(expr) do {} while (0)#endif#define PRINT_DATA(desc,pData,len)\{\ int i;\ printk("RTL8180: -- %s", desc);\ for(i=0;i<len;i++){\ if((i%16)==0)printk("\n ");\ printk("0x%02x ", (pData)[i]);\ }\ printk("\n");\}//----------------------------------------------------------------------------------------------// Define debug printk//----------------------------------------------------------------------------------------------#define RTL_DDEBUG_FUNC 0x01#define RTL_DDEBUG_ERR0 0x02#define RTL_DDEBUG_ERR 0x04#define RTL_DDEBUG_STATS 0x08#define RTL_DDEBUG_INFO 0x10#define RTL_DDEBUG_OUTINFO 0x20extern char wlan_debug;//----------------------------------------------------------------------------------------------#define MLME_DPRINTK_INFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_INFO)printk("wlan0_MLME-" __FUNCTION__ fmt, ## args);#define MLME_DPRINTK_OUTINFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_OUTINFO)printk("RTL8180: " fmt, ## args);#define MLME_DPRINTK_ERR( fmt, args...) if(wlan_debug & RTL_DDEBUG_ERR)printk("wlan0_MLME-"__FUNCTION__ fmt, ## args);#define RX_DPRINTK_INFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_INFO)printk("wlan0_RX-"__FUNCTION__ fmt, ## args);#define RX_DPRINTK_OUTINFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_OUTINFO)printk("RTL8180: " fmt, ## args);#define RX_DPRINTK_ERR( fmt, args...) if(wlan_debug & RTL_DDEBUG_ERR)printk("wlan0_RX-"__FUNCTION__ fmt, ## args);#define TX_DPRINTK_INFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_INFO)printk("wlan0_TX-"__FUNCTION__ fmt, ## args);#define TX_DPRINTK_OUTINFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_OUTINFO)printk("RTL8180: " fmt, ## args);#define TX_DPRINTK_ERR( fmt, args...) if(wlan_debug & RTL_DDEBUG_ERR)printk("wlan0_TX-"__FUNCTION__ fmt, ## args);#define DPRINTK_INFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_INFO)printk("wlan0:"__FUNCTION__ fmt, ## args );#define DPRINTK_OUTINFO( fmt, args...) if(wlan_debug & RTL_DDEBUG_OUTINFO)printk("RTL8180: " fmt, ## args);#define DPRINTK_ERR( fmt, args...) if(wlan_debug & RTL_DDEBUG_ERR)printk("wlan0:"__FUNCTION__ fmt, ## args);//----------------------------------------------------------------------------------------------#endif //end #ifndef _INCLUDE_RTL8180_TYPE_H_
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -