e1000.h

来自「linux 内核源代码」· C头文件 代码 · 共 514 行 · 第 1/2 页

H
514
字号
/*******************************************************************************  Intel PRO/1000 Linux driver  Copyright(c) 1999 - 2007 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*******************************************************************************//* Linux PRO/1000 Ethernet Driver main header file */#ifndef _E1000_H_#define _E1000_H_#include <linux/types.h>#include <linux/timer.h>#include <linux/workqueue.h>#include <linux/io.h>#include <linux/netdevice.h>#include "hw.h"struct e1000_info;#define ndev_printk(level, netdev, format, arg...) \	printk(level "%s: %s: " format, (netdev)->dev.parent->bus_id, \	       (netdev)->name, ## arg)#ifdef DEBUG#define ndev_dbg(netdev, format, arg...) \	ndev_printk(KERN_DEBUG , netdev, format, ## arg)#else#define ndev_dbg(netdev, format, arg...) do { (void)(netdev); } while (0)#endif#define ndev_err(netdev, format, arg...) \	ndev_printk(KERN_ERR , netdev, format, ## arg)#define ndev_info(netdev, format, arg...) \	ndev_printk(KERN_INFO , netdev, format, ## arg)#define ndev_warn(netdev, format, arg...) \	ndev_printk(KERN_WARNING , netdev, format, ## arg)#define ndev_notice(netdev, format, arg...) \	ndev_printk(KERN_NOTICE , netdev, format, ## arg)/* TX/RX descriptor defines */#define E1000_DEFAULT_TXD		256#define E1000_MAX_TXD			4096#define E1000_MIN_TXD			80#define E1000_DEFAULT_RXD		256#define E1000_MAX_RXD			4096#define E1000_MIN_RXD			80/* Early Receive defines */#define E1000_ERT_2048			0x100#define E1000_FC_PAUSE_TIME		0x0680 /* 858 usec *//* How many Tx Descriptors do we need to call netif_wake_queue ? *//* How many Rx Buffers do we bundle into one write to the hardware ? */#define E1000_RX_BUFFER_WRITE		16 /* Must be power of 2 */#define AUTO_ALL_MODES			0#define E1000_EEPROM_APME		0x0400#define E1000_MNG_VLAN_NONE		(-1)/* Number of packet split data buffers (not including the header buffer) */#define PS_PAGE_BUFFERS			(MAX_PS_BUFFERS - 1)enum e1000_boards {	board_82571,	board_82572,	board_82573,	board_80003es2lan,	board_ich8lan,	board_ich9lan,};struct e1000_queue_stats {	u64 packets;	u64 bytes;};struct e1000_ps_page {	struct page *page;	u64 dma; /* must be u64 - written to hw */};/* * wrappers around a pointer to a socket buffer, * so a DMA handle can be stored along with the buffer */struct e1000_buffer {	dma_addr_t dma;	struct sk_buff *skb;	union {		/* TX */		struct {			unsigned long time_stamp;			u16 length;			u16 next_to_watch;		};		/* RX */		/* arrays of page information for packet split */		struct e1000_ps_page *ps_pages;	};};struct e1000_ring {	void *desc;			/* pointer to ring memory  */	dma_addr_t dma;			/* phys address of ring    */	unsigned int size;		/* length of ring in bytes */	unsigned int count;		/* number of desc. in ring */	u16 next_to_use;	u16 next_to_clean;	u16 head;	u16 tail;	/* array of buffer information structs */	struct e1000_buffer *buffer_info;	struct sk_buff *rx_skb_top;	struct e1000_queue_stats stats;};/* board specific private data structure */struct e1000_adapter {	struct timer_list watchdog_timer;	struct timer_list phy_info_timer;	struct timer_list blink_timer;	struct work_struct reset_task;	struct work_struct watchdog_task;	const struct e1000_info *ei;	struct vlan_group *vlgrp;	u32 bd_number;	u32 rx_buffer_len;	u16 mng_vlan_id;	u16 link_speed;	u16 link_duplex;	spinlock_t tx_queue_lock; /* prevent concurrent tail updates */	/* this is still needed for 82571 and above */	atomic_t irq_sem;	/* track device up/down/testing state */	unsigned long state;	/* Interrupt Throttle Rate */	u32 itr;	u32 itr_setting;	u16 tx_itr;	u16 rx_itr;	/*	 * TX	 */	struct e1000_ring *tx_ring /* One per active queue */						____cacheline_aligned_in_smp;	struct napi_struct napi;	unsigned long tx_queue_len;	unsigned int restart_queue;	u32 txd_cmd;	bool detect_tx_hung;	u8 tx_timeout_factor;	u32 tx_int_delay;	u32 tx_abs_int_delay;	unsigned int total_tx_bytes;	unsigned int total_tx_packets;	unsigned int total_rx_bytes;	unsigned int total_rx_packets;	/* TX stats */	u64 tpt_old;	u64 colc_old;	u64 gotcl_old;	u32 gotcl;	u32 tx_timeout_count;	u32 tx_fifo_head;	u32 tx_head_addr;	u32 tx_fifo_size;	u32 tx_dma_failed;	/*	 * RX	 */	bool (*clean_rx) (struct e1000_adapter *adapter,			  int *work_done, int work_to_do)						____cacheline_aligned_in_smp;	void (*alloc_rx_buf) (struct e1000_adapter *adapter,			      int cleaned_count);	struct e1000_ring *rx_ring;	u32 rx_int_delay;	u32 rx_abs_int_delay;	/* RX stats */	u64 hw_csum_err;	u64 hw_csum_good;	u64 rx_hdr_split;	u64 gorcl_old;	u32 gorcl;	u32 alloc_rx_buff_failed;	u32 rx_dma_failed;	unsigned int rx_ps_pages;	u16 rx_ps_bsize0;	/* OS defined structs */	struct net_device *netdev;	struct pci_dev *pdev;	struct net_device_stats net_stats;	spinlock_t stats_lock;      /* prevent concurrent stats updates */	/* structs defined in e1000_hw.h */	struct e1000_hw hw;	struct e1000_hw_stats stats;	struct e1000_phy_info phy_info;	struct e1000_phy_stats phy_stats;	struct e1000_ring test_tx_ring;	struct e1000_ring test_rx_ring;	u32 test_icr;

⌨️ 快捷键说明

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