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

📄 kcompat.h

📁 grub源码分析文档
💻 H
📖 第 1 页 / 共 3 页
字号:
/*******************************************************************************  Intel PRO/1000 Linux driver  Copyright(c) 1999 - 2008 Intel Corporation.  This program is free software; you can redistribute it and/or modify it  under the terms and conditions of the GNU General Public License,  version 2, as published by the Free Software Foundation.  This program is distributed in the hope 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.,  51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.  The full GNU General Public License is included in this distribution in  the file called "COPYING".  Contact Information:  Linux NICS <linux.nics@intel.com>  e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************/#ifndef _KCOMPAT_H_#define _KCOMPAT_H_#include <linux/version.h>#include <linux/init.h>#include <linux/types.h>#include <linux/errno.h>#include <linux/module.h>#include <linux/pci.h>#include <linux/netdevice.h>#include <linux/etherdevice.h>#include <linux/skbuff.h>#include <linux/ioport.h>#include <linux/slab.h>#include <linux/list.h>#include <linux/delay.h>#include <linux/sched.h>#include <linux/in.h>#include <linux/ip.h>#include <linux/udp.h>#include <linux/mii.h>#include <asm/io.h>/* NAPI enable/disable flags here */#ifdef _E1000_H_#ifdef CONFIG_E1000_NAPI#define NAPI#endif#ifdef E1000_NAPI#undef NAPI#define NAPI#endif#ifdef E1000_NO_NAPI#undef NAPI#endif#endif#ifdef _IGB_H_#define NAPI#endif#ifdef _IXGB_H_#ifdef CONFIG_IXGB_NAPI#define NAPI#endif#ifdef IXGB_NAPI#undef NAPI#define NAPI#endif#ifdef IXGB_NO_NAPI#undef NAPI#endif#endif#ifdef DRIVER_E1000#define adapter_struct e1000_adapter#endif#ifdef DRIVER_E1000E#define adapter_struct e1000_adapter#define NAPI#endif/* and finally set defines so that the code sees the changes */#ifdef NAPI#ifndef CONFIG_E1000_NAPI#define CONFIG_E1000_NAPI#endif#ifndef CONFIG_IXGB_NAPI#define CONFIG_IXGB_NAPI#endif#else#undef CONFIG_E1000_NAPI#undef CONFIG_IXGB_NAPI#endif/* packet split disable/enable */#ifdef DISABLE_PACKET_SPLIT#undef CONFIG_E1000_DISABLE_PACKET_SPLIT#define CONFIG_E1000_DISABLE_PACKET_SPLIT#endif/* MSI compatibility code for all kernels and drivers */#ifdef DISABLE_PCI_MSI#undef CONFIG_PCI_MSI#endif#ifndef CONFIG_PCI_MSI#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,8) )struct msix_entry {	u16 vector; /* kernel uses to write allocated vector */	u16 entry;  /* driver uses to specify entry, OS writes */};#endif#define pci_enable_msi(a) -ENOTSUPP#define pci_disable_msi(a) do {} while (0)#define pci_enable_msix(a, b, c) -ENOTSUPP#define pci_disable_msix(a) do {} while (0)#define msi_remove_pci_irq_vectors(a) do {} while (0)#endif /* CONFIG_PCI_MSI */#ifdef DISABLE_PM#undef CONFIG_PM#endif#ifdef DISABLE_NET_POLL_CONTROLLER#undef CONFIG_NET_POLL_CONTROLLER#endif#ifndef PMSG_SUSPEND#define PMSG_SUSPEND 3#endif/* generic boolean compatibility */#undef TRUE#undef FALSE#define TRUE true#define FALSE false#ifdef GCC_VERSION#if ( GCC_VERSION < 3000 )#define _Bool char#endif#endif#ifndef bool#define bool _Bool#define true 1#define false 0#endif#ifndef module_param#define module_param(v,t,p) MODULE_PARM(v, "i");#endif#ifndef DMA_64BIT_MASK#define DMA_64BIT_MASK  0xffffffffffffffffULL#endif#ifndef DMA_32BIT_MASK#define DMA_32BIT_MASK  0x00000000ffffffffULL#endif#ifndef PCI_CAP_ID_EXP#define PCI_CAP_ID_EXP 0x10#endif#ifndef mmiowb#ifdef CONFIG_IA64#define mmiowb() asm volatile ("mf.a" ::: "memory")#else#define mmiowb()#endif#endif#ifndef IRQ_HANDLED#define irqreturn_t void#define IRQ_HANDLED#define IRQ_NONE#endif#ifndef SET_NETDEV_DEV#define SET_NETDEV_DEV(net, pdev)#endif#ifndef HAVE_FREE_NETDEV#define free_netdev(x)	kfree(x)#endif#ifdef HAVE_POLL_CONTROLLER#define CONFIG_NET_POLL_CONTROLLER#endif#ifndef NETDEV_TX_OK#define NETDEV_TX_OK 0#endif#ifndef NETDEV_TX_BUSY#define NETDEV_TX_BUSY 1#endif#ifndef NETDEV_TX_LOCKED#define NETDEV_TX_LOCKED -1#endif#ifndef SKB_DATAREF_SHIFT/* if we do not have the infrastructure to detect if skb_header is cloned   just return false in all cases */#define skb_header_cloned(x) 0#endif#ifndef NETIF_F_GSO#define gso_size tso_size#define gso_segs tso_segs#endif#ifndef CHECKSUM_PARTIAL#define CHECKSUM_PARTIAL CHECKSUM_HW#define CHECKSUM_COMPLETE CHECKSUM_HW#endif#ifndef __read_mostly#define __read_mostly#endif#ifndef HAVE_NETIF_MSG#define HAVE_NETIF_MSG 1enum {	NETIF_MSG_DRV		= 0x0001,	NETIF_MSG_PROBE		= 0x0002,	NETIF_MSG_LINK		= 0x0004,	NETIF_MSG_TIMER		= 0x0008,	NETIF_MSG_IFDOWN	= 0x0010,	NETIF_MSG_IFUP		= 0x0020,	NETIF_MSG_RX_ERR	= 0x0040,	NETIF_MSG_TX_ERR	= 0x0080,	NETIF_MSG_TX_QUEUED	= 0x0100,	NETIF_MSG_INTR		= 0x0200,	NETIF_MSG_TX_DONE	= 0x0400,	NETIF_MSG_RX_STATUS	= 0x0800,	NETIF_MSG_PKTDATA	= 0x1000,	NETIF_MSG_HW		= 0x2000,	NETIF_MSG_WOL		= 0x4000,};#else#define NETIF_MSG_HW	0x2000#define NETIF_MSG_WOL	0x4000#endif /* HAVE_NETIF_MSG */#ifndef MII_RESV1#define MII_RESV1		0x17		/* Reserved...		*/#endif#ifndef unlikely#define unlikely(_x) _x#define likely(_x) _x#endif#ifndef WARN_ON#define WARN_ON(x)#endif#ifndef PCI_DEVICE#define PCI_DEVICE(vend,dev) \	.vendor = (vend), .device = (dev), \	.subvendor = PCI_ANY_ID, .subdevice = PCI_ANY_ID#endif#ifndef num_online_cpus#define num_online_cpus() smp_num_cpus#endif#ifndef _LINUX_RANDOM_H#include <linux/random.h>#endif#ifndef DECLARE_BITMAP#ifndef BITS_TO_LONGS#define BITS_TO_LONGS(bits) (((bits)+BITS_PER_LONG-1)/BITS_PER_LONG)#endif#define DECLARE_BITMAP(name,bits) long name[BITS_TO_LONGS(bits)]#endif#ifndef VLAN_HLEN#define VLAN_HLEN 4#endif#ifndef VLAN_ETH_HLEN#define VLAN_ETH_HLEN 18#endif#ifndef VLAN_ETH_FRAME_LEN#define VLAN_ETH_FRAME_LEN 1518#endif/*****************************************************************************//* Installations with ethtool version without eeprom, adapter id, or statistics * support */#ifndef ETH_GSTRING_LEN#define ETH_GSTRING_LEN 32#endif#ifndef ETHTOOL_GSTATS#define ETHTOOL_GSTATS 0x1d#undef ethtool_drvinfo#define ethtool_drvinfo k_ethtool_drvinfostruct k_ethtool_drvinfo {	u32 cmd;	char driver[32];	char version[32];	char fw_version[32];	char bus_info[32];	char reserved1[32];	char reserved2[16];	u32 n_stats;	u32 testinfo_len;	u32 eedump_len;	u32 regdump_len;};struct ethtool_stats {	u32 cmd;	u32 n_stats;	u64 data[0];};#endif /* ETHTOOL_GSTATS */#ifndef ETHTOOL_PHYS_ID#define ETHTOOL_PHYS_ID 0x1c#endif /* ETHTOOL_PHYS_ID */#ifndef ETHTOOL_GSTRINGS#define ETHTOOL_GSTRINGS 0x1benum ethtool_stringset {	ETH_SS_TEST             = 0,	ETH_SS_STATS,};struct ethtool_gstrings {	u32 cmd;            /* ETHTOOL_GSTRINGS */	u32 string_set;     /* string set id e.c. ETH_SS_TEST, etc*/	u32 len;            /* number of strings in the string set */	u8 data[0];};#endif /* ETHTOOL_GSTRINGS */#ifndef ETHTOOL_TEST#define ETHTOOL_TEST 0x1aenum ethtool_test_flags {	ETH_TEST_FL_OFFLINE	= (1 << 0),	ETH_TEST_FL_FAILED	= (1 << 1),};struct ethtool_test {	u32 cmd;	u32 flags;	u32 reserved;	u32 len;	u64 data[0];};#endif /* ETHTOOL_TEST */#ifndef ETHTOOL_GEEPROM#define ETHTOOL_GEEPROM 0xb#undef ETHTOOL_GREGSstruct ethtool_eeprom {	u32 cmd;	u32 magic;	u32 offset;	u32 len;	u8 data[0];};struct ethtool_value {	u32 cmd;	u32 data;};#endif /* ETHTOOL_GEEPROM */#ifndef ETHTOOL_GLINK#define ETHTOOL_GLINK 0xa#endif /* ETHTOOL_GLINK */#ifndef ETHTOOL_GREGS#define ETHTOOL_GREGS		0x00000004 /* Get NIC registers */#define ethtool_regs _kc_ethtool_regs/* for passing big chunks of data */struct _kc_ethtool_regs {	u32 cmd;	u32 version; /* driver-specific, indicates different chips/revs */	u32 len; /* bytes */	u8 data[0];};#endif /* ETHTOOL_GREGS */#ifndef ETHTOOL_GMSGLVL#define ETHTOOL_GMSGLVL		0x00000007 /* Get driver message level */#endif#ifndef ETHTOOL_SMSGLVL#define ETHTOOL_SMSGLVL		0x00000008 /* Set driver msg level, priv. */#endif#ifndef ETHTOOL_NWAY_RST#define ETHTOOL_NWAY_RST	0x00000009 /* Restart autonegotiation, priv */#endif#ifndef ETHTOOL_GLINK#define ETHTOOL_GLINK		0x0000000a /* Get link status */#endif#ifndef ETHTOOL_GEEPROM#define ETHTOOL_GEEPROM		0x0000000b /* Get EEPROM data */#endif#ifndef ETHTOOL_SEEPROM#define ETHTOOL_SEEPROM		0x0000000c /* Set EEPROM data */#endif#ifndef ETHTOOL_GCOALESCE#define ETHTOOL_GCOALESCE	0x0000000e /* Get coalesce config *//* for configuring coalescing parameters of chip */#define ethtool_coalesce _kc_ethtool_coalescestruct _kc_ethtool_coalesce {	u32	cmd;	/* ETHTOOL_{G,S}COALESCE */	/* How many usecs to delay an RX interrupt after	 * a packet arrives.  If 0, only rx_max_coalesced_frames	 * is used.	 */	u32	rx_coalesce_usecs;	/* How many packets to delay an RX interrupt after	 * a packet arrives.  If 0, only rx_coalesce_usecs is	 * used.  It is illegal to set both usecs and max frames	 * to zero as this would cause RX interrupts to never be	 * generated.	 */	u32	rx_max_coalesced_frames;	/* Same as above two parameters, except that these values	 * apply while an IRQ is being serviced by the host.  Not	 * all cards support this feature and the values are ignored	 * in that case.	 */	u32	rx_coalesce_usecs_irq;	u32	rx_max_coalesced_frames_irq;	/* How many usecs to delay a TX interrupt after	 * a packet is sent.  If 0, only tx_max_coalesced_frames	 * is used.	 */	u32	tx_coalesce_usecs;	/* How many packets to delay a TX interrupt after	 * a packet is sent.  If 0, only tx_coalesce_usecs is	 * used.  It is illegal to set both usecs and max frames	 * to zero as this would cause TX interrupts to never be	 * generated.	 */	u32	tx_max_coalesced_frames;	/* Same as above two parameters, except that these values	 * apply while an IRQ is being serviced by the host.  Not	 * all cards support this feature and the values are ignored	 * in that case.	 */	u32	tx_coalesce_usecs_irq;	u32	tx_max_coalesced_frames_irq;	/* How many usecs to delay in-memory statistics	 * block updates.  Some drivers do not have an in-memory	 * statistic block, and in such cases this value is ignored.	 * This value must not be zero.	 */	u32	stats_block_coalesce_usecs;	/* Adaptive RX/TX coalescing is an algorithm implemented by	 * some drivers to improve latency under low packet rates and	 * improve throughput under high packet rates.  Some drivers	 * only implement one of RX or TX adaptive coalescing.  Anything	 * not implemented by the driver causes these values to be	 * silently ignored.	 */	u32	use_adaptive_rx_coalesce;	u32	use_adaptive_tx_coalesce;	/* When the packet rate (measured in packets per second)	 * is below pkt_rate_low, the {rx,tx}_*_low parameters are	 * used.	 */	u32	pkt_rate_low;	u32	rx_coalesce_usecs_low;	u32	rx_max_coalesced_frames_low;	u32	tx_coalesce_usecs_low;	u32	tx_max_coalesced_frames_low;	/* When the packet rate is below pkt_rate_high but above	 * pkt_rate_low (both measured in packets per second) the	 * normal {rx,tx}_* coalescing parameters are used.	 */	/* When the packet rate is (measured in packets per second)	 * is above pkt_rate_high, the {rx,tx}_*_high parameters are	 * used.	 */	u32	pkt_rate_high;	u32	rx_coalesce_usecs_high;	u32	rx_max_coalesced_frames_high;	u32	tx_coalesce_usecs_high;

⌨️ 快捷键说明

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