📄 vnet_linux.h
字号:
/**************************************************************************//* *//* Copyright (c) 1999-2000 by Atmel Corporation *//* *//* This software is copyrighted by and is the sole property of Atmel *//* Corporation. All rights, title, ownership, or other interests *//* in the software remain the property of Atmel Corporation. This *//* software may only be used in accordance with the corresponding */ /* license agreement. Any un-authorized use, duplication, transmission, *//* distribution, or disclosure of this software is expressly forbidden. *//* *//* This Copyright notice may not be removed or modified without prior *//* written consent of Atmel Corporation. *//* *//* Atmel Corporation, Inc. reserves the right to modify this software *//* without notice. *//* *//* Atmel Corporation. *//* 2325 Orchard Parkway literature@atmel.com *//* San Jose, CA 95131 http://www.atmel.com *//* *//**************************************************************************//***************************************************************************//***************************************************************************//** *//** ATMEL FastVNET (PCMCIA) Driver *//** *//** linux specific *//** *//***************************************************************************//***************************************************************************/#ifndef __Vnet_Linux_h_OK__#define __Vnet_Linux_h_OK__#include <linux/config.h>#include <linux/version.h>#ifndef KERNEL_VERSION#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))#endif#ifdef __IN_PCMCIA_PACKAGE__#include <pcmcia/config.h>#include <pcmcia/k_compat.h>#endif#include <linux/kernel.h>#include <linux/sched.h>#include <linux/ptrace.h>#include <linux/malloc.h>#include <linux/string.h>#include <linux/timer.h>#include <asm/io.h>#include <asm/system.h>#include <pcmcia/version.h>#include <pcmcia/cs_types.h>#include <pcmcia/cs.h>#include <pcmcia/cistpl.h>#include <pcmcia/cisreg.h>#include <pcmcia/ds.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/skbuff.h>#include <linux/if_arp.h>#include <linux/ioport.h>#include <linux/fcntl.h>#ifdef HAS_WIRELESS_EXTENSIONS#include <linux/wireless.h>#if WIRELESS_EXT < 5#error "Wireless extension v5 or newer required"#endif#endif#ifdef PCMCIA_DEBUG#define DBG 1extern int pc_debug;#define IF_VNetDEBUG(f) if (pc_debug & (f))#endif#ifdef MODULE#ifdef MODVERSIONS#include <linux/modversions.h>#endif#include <linux/module.h>#endiftypedef unsigned char UCHAR;typedef unsigned short USHORT;typedef unsigned long ULONG;typedef unsigned int UINT;typedef unsigned char* PUCHAR;typedef unsigned short* PUSHORT;typedef unsigned long* PULONG;typedef int BOOLEAN;typedef void VOID;typedef void* PVOID;#define TRUE 1#define FALSE 0#define MGMT_JIFFIES (256 * HZ / 100)#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,43))#define netif_stop_queue(dev) set_bit(0, (void *)&(dev)->tbusy)#define netif_start_queue(dev) clear_bit(0, (void *)&(dev)->tbusy)#define netif_wake_queue(dev) \ do { netif_start_queue(dev); mark_bh(NET_BH); } while (0)#define netif_device_attach(dev) \ do { (dev)->start = 1; netif_start_queue(dev); } while (0)#define netif_device_detach(dev) \ do { (dev)->start = 0; netif_stop_queue(dev); } while (0)#define netif_device_present(dev) ((dev)->start)#define netif_running(dev) ((dev)->start)#define netif_mark_up(dev) do { (dev)->start = 1; } while (0)#define netif_mark_down(dev) do { (dev)->start = 0; } while (0)#define netif_carrier_on(dev) do { dev->flags |= IFF_RUNNING; } while (0)#define netif_carrier_off(dev) do { dev->flags &= ~IFF_RUNNING; } while (0)#define netif_queue_stopped(dev) ((dev)->tbusy)#define tx_timeout_check(dev, tx_timeout) \ do { if (test_and_set_bit(0, (void *)&(dev)->tbusy) != 0) { \ if (jiffies - (dev)->trans_start < TX_TIMEOUT) return 1; \ tx_timeout(dev); \ } } while (0)#define dev_kfree_skb_irq(skb) DEV_KFREE_SKB(skb)#else#define netif_mark_up(dev) do { } while (0)#define netif_mark_down(dev) do { } while (0)#define tx_timeout_check(d,h) netif_stop_queue(d)#endif#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,3,99))#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,2,0))/* A nasty hack: we only need to set up dev->init on 2.0.* kernels, and this is a convenient place to bury it */#define init_dev_name(dev, node) \ do { static int __dummy(struct net_device *dev) { return 0; } \ dev->init = &__dummy; (dev)->name = (node).dev_name; \ } while (0)#else#define init_dev_name(dev, node) (dev)->name = (node).dev_name#endif#define copy_dev_name(node, dev) do { } while (0)#else#define init_dev_name(dev, node) do { } while (0)#define copy_dev_name(node, dev) strcpy((node).dev_name, (dev)->name)#endif#endif // __Vnet_Linux_h_OK__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -