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

📄 sktr.h

📁 powerpc内核mpc8241linux系统下net驱动程序
💻 H
📖 第 1 页 / 共 3 页
字号:
/* OPEN Options (high-low) */#define WRAP_INTERFACE		0x0080	/* Inserting omitted for test					 * purposes; transmit data appears					 * as receive data. (usefull for					 * testing; change: CLOSE necessary)					 */#define DISABLE_HARD_ERROR	0x0040  /* On HARD_ERROR & TRANSMIT_BEACON					 * no RING.STATUS interrupt.					 */#define DISABLE_SOFT_ERROR	0x0020  /* On SOFT_ERROR, no RING.STATUS					 * interrupt.					 */#define PASS_ADAPTER_MAC_FRAMES 0x0010  /* Passing unsupported MAC frames					 * to system.					 */#define PASS_ATTENTION_FRAMES   0x0008  /* All changed attention MAC frames are					 * passed to the system.					 */#define PAD_ROUTING_FIELD	0x0004  /* Routing field is padded to 18					 * bytes.					 */#define FRAME_HOLD		0x0002  /* Adapter waits for entire frame before					 * initiating DMA transfer; otherwise:					 * DMA transfer initiation if internal					 * buffer filled.					 */#define CONTENDER		0x0001  /* Adapter participates in the monitor					 * contention process.					 */#define PASS_BEACON_MAC_FRAMES  0x8000  /* Adapter passes beacon MAC frames					 * to the system.					 */#define EARLY_TOKEN_RELEASE 	0x1000  /* Only valid in 16 Mbps operation;					 * 0 = ETR. (no effect in 4 Mbps					 * operation)					 */#define COPY_ALL_MAC_FRAMES	0x0400  /* All MAC frames are copied to					 * the system. (after OPEN: duplicate					 * address test (DAT) MAC frame is 					 * first received frame copied to the					 * system)					 */#define COPY_ALL_NON_MAC_FRAMES	0x0200  /* All non MAC frames are copied to					 * the system.					 */#define PASS_FIRST_BUF_ONLY	0x0100  /* Passes only first internal buffer					 * of each received frame; FrameSize					 * of RPLs must contain internal					 * BUFFER_SIZE bits for promiscous mode.					 */#define ENABLE_FULL_DUPLEX_SELECTION 0x2000 /* Enable the use of full-duplex					 * settings with bits in byte 22 in					 * ocpl. (new feature in firmware					 * version 3.09)					 *//* Full-duplex settings */#define OPEN_FULL_DUPLEX_OFF	0x0000#define OPEN_FULL_DUPLEX_ON	0x00c0#define OPEN_FULL_DUPLEX_AUTO	0x0080#define PROD_ID_SIZE	18	/* Length of product ID. */#define TX_FRAG_NUM	3	 /* Number of fragments used in one TPL. */#define TX_MORE_FRAGMENTS 0x8000 /* Bit set in DataCount to indicate more				  * fragments following.				  */#define ISA_MAX_ADDRESS 0x00ffffff#pragma pack(1)typedef struct {	unsigned short OPENOptions;	unsigned char NodeAddr[6];	/* Adapter node address; use ROM 					 * address					 */	unsigned long GroupAddr;	/* Multicast: high order					 * bytes = 0xC000					 */	unsigned long FunctAddr;	/* High order bytes = 0xC000 */	unsigned short RxListSize;	/* RPL size: 0 (=26), 14, 20 or					 * 26 bytes read by the adapter.					 * (Depending on the number of 					 * fragments/list)					 */	unsigned short TxListSize;	/* TPL size */	unsigned short BufSize;		/* Is automatically rounded up to the					 * nearest nK boundary.					 */	unsigned short FullDuplex;	unsigned short Reserved;	unsigned char TXBufMin;		/* Number of adapter buffers reserved					 * for transmission a minimum of 2					 * buffers must be allocated.					 */	unsigned char TXBufMax;		/* Maximum number of adapter buffers					 * for transmit; a minimum of 2 buffers					 * must be available for receive.					 * Default: 6					 */	unsigned short ProdIDAddr[2];	/* Pointer to product ID. */} OPB, *OPB_Ptr;#pragma pack()/* * SCB: adapter commands enabled by the host system started by writing * CMD_INTERRUPT_ADAPTER | CMD_EXECUTE (|SCB_REQUEST) to the SIFCMD IO * register. (special case: | CMD_SYSTEM_IRQ for initialization) */#pragma pack(1)typedef struct {	unsigned short CMD;	/* Command code */	unsigned short Parm[2];	/* Pointer to Command Parameter Block */} SCB;	/* System Command Block (32 bit physical address; big endian)*/#pragma pack()/* * SSB: adapter command return status can be evaluated after COMMAND_STATUS * adapter to system interrupt after reading SSB, the availability of the SSB * has to be told the adapter by writing CMD_INTERRUPT_ADAPTER | CMD_SSB_CLEAR * in the SIFCMD IO register. */#pragma pack(1)typedef struct {	unsigned short STS;	/* Status code */	unsigned short Parm[3];	/* Parameter or pointer to Status Parameter				 * Block.				 */} SSB;	/* System Status Block (big endian - physical address)  */#pragma pack()typedef struct {	unsigned short BurnedInAddrPtr;	/* Pointer to adapter burned in					 * address. (BIA)					 */	unsigned short SoftwareLevelPtr;/* Pointer to software level data. */	unsigned short AdapterAddrPtr;	/* Pointer to adapter addresses. */	unsigned short AdapterParmsPtr;	/* Pointer to adapter parameters. */	unsigned short MACBufferPtr;	/* Pointer to MAC buffer. (internal) */	unsigned short LLCCountersPtr;	/* Pointer to LLC counters.  */	unsigned short SpeedFlagPtr;	/* Pointer to data rate flag.					 * (4/16 Mbps)					 */	unsigned short AdapterRAMPtr;	/* Pointer to adapter RAM found. (KB) */} INTPTRS;	/* Adapter internal pointers */#pragma pack(1)typedef struct {	unsigned char Line_Error;	/* Line error: code violation in					 * frame or in a token, or FCS error.					 */	unsigned char Internal_Error;	/* IBM specific. (Reserved_1) */	unsigned char Burst_Error;	unsigned char ARI_FCI_Error;	/* ARI/FCI bit zero in AMP or					 * SMP MAC frame.					 */	unsigned char AbortDelimeters;	/* IBM specific. (Reserved_2) */	unsigned char Reserved_3;	unsigned char Lost_Frame_Error;	/* Receive of end of transmitted					 * frame failed.					 */	unsigned char Rx_Congest_Error;	/* Adapter in repeat mode has not					 * enough buffer space to copy incoming					 * frame.					 */	unsigned char Frame_Copied_Error;/* ARI bit not zero in frame					 * addressed to adapter.					 */	unsigned char Frequency_Error;	/* IBM specific. (Reserved_4) */	unsigned char Token_Error;	/* (active only in monitor station) */	unsigned char Reserved_5;	unsigned char DMA_Bus_Error;	/* DMA bus errors not exceeding the					 * abort thresholds.					 */	unsigned char DMA_Parity_Error;	/* DMA parity errors not exceeding					 * the abort thresholds.					 */} ERRORTAB;	/* Adapter error counters */#pragma pack()/*--------------------- Send and Receive definitions -------------------*/#pragma pack(1)typedef struct {	unsigned short DataCount;	/* Value 0, even and odd values are					 * permitted; value is unaltered most					 * significant bit set: following					 * fragments last fragment: most					 * significant bit is not evaluated.					 * (???)					 */	unsigned long DataAddr;		/* Pointer to frame data fragment;					 * even or odd.					 */} Fragment;#pragma pack()#define MAX_FRAG_NUMBERS    9	/* Maximal number of fragments possible to use				 * in one RPL/TPL. (depending on TI firmware 				 * version)				 */#define MAX_TX_QUEUE	    10	/* Maximal number of skb's queued in driver. *//* * AC (1), FC (1), Dst (6), Src (6), RIF (18), Data (4472) = 4504 * The packet size can be one of the follows: 548, 1502, 2084, 4504, 8176, * 11439, 17832. Refer to TMS380 Second Generation Token Ring User's Guide * Page 2-27. */#define HEADER_SIZE		(1 + 1 + 6 + 6)#define SRC_SIZE		18#define MIN_DATA_SIZE		516#define DEFAULT_DATA_SIZE	4472#define MAX_DATA_SIZE		17800#define DEFAULT_PACKET_SIZE (HEADER_SIZE + SRC_SIZE + DEFAULT_DATA_SIZE)#define MIN_PACKET_SIZE     (HEADER_SIZE + SRC_SIZE + MIN_DATA_SIZE)#define MAX_PACKET_SIZE     (HEADER_SIZE + SRC_SIZE + MAX_DATA_SIZE)/* * Macros to deal with the frame status field. */#define AC_NOT_RECOGNIZED	0x00#define GROUP_BIT		0x80#define GET_TRANSMIT_STATUS_HIGH_BYTE(Ts) ((unsigned char)((Ts) >> 8))#define GET_FRAME_STATUS_HIGH_AC(Fs)	  ((unsigned char)(((Fs) & 0xC0) >> 6))#define GET_FRAME_STATUS_LOW_AC(Fs)       ((unsigned char)(((Fs) & 0x0C) >> 2))#define DIRECTED_FRAME(Context)           (!((Context)->MData[2] & GROUP_BIT))/*--------------------- Send Functions ---------------------------------*//* define TX_CSTAT _REQUEST (R) and _COMPLETE (C) values (high-low) */#define TX_VALID		0x0080	/* R: set via TRANSMIT.VALID interrupt.					 * C: always reset to zero!					 */#define TX_FRAME_COMPLETE	0x0040	/* R: must be reset to zero.					 * C: set to one.					 */#define TX_START_FRAME		0x0020  /* R: start of a frame: 1 					 * C: unchanged.					 */#define TX_END_FRAME		0x0010  /* R: end of a frame: 1					 * C: unchanged.					 */#define TX_FRAME_IRQ		0x0008  /* R: request interrupt generation					 * after transmission.					 * C: unchanged.					 */#define TX_ERROR		0x0004  /* R: reserved.					 * C: set to one if Error occurred.					 */#define TX_INTERFRAME_WAIT	0x0004#define TX_PASS_CRC		0x0002  /* R: set if CRC value is already					 * calculated. (valid only in					 * FRAME_START TPL)					 * C: unchanged.					 */#define TX_PASS_SRC_ADDR	0x0001  /* R: adapter uses explicit frame					 * source address and does not overwrite					 * with the adapter node address.					 * (valid only in FRAME_START TPL)					 *					 * C: unchanged.					 */#define TX_STRIP_FS		0xFF00  /* R: reserved.					 * C: if no Transmission Error,					 * field contains copy of FS byte after					 * stripping of frame.					 *//* * Structure of Transmit Parameter Lists (TPLs) (only one frame every TPL, * but possibly multiple TPLs for one frame) the length of the TPLs has to be * initialized in the OPL. (OPEN parameter list) */#define TPL_NUM		3	/* Number of Transmit Parameter Lists.				 * !! MUST BE >= 3 !!				 */#pragma pack(1)typedef struct s_TPL TPL;struct s_TPL {	/* Transmit Parameter List (align on even word boundaries) */	unsigned long NextTPLAddr;	/* Pointer to next TPL in chain; if					 * pointer is odd: this is the last					 * TPL. Pointing to itself can cause					 * problems!					 */	volatile unsigned short Status;	/* Initialized by the adapter:					 * CSTAT_REQUEST important: update least					 * significant bit first! Set by the					 * adapter: CSTAT_COMPLETE status.					 */	unsigned short FrameSize;	/* Number of bytes to be transmitted					 * as a frame including AC/FC,					 * Destination, Source, Routing field					 * not including CRC, FS, End Delimiter					 * (valid only if START_FRAME bit in 					 * CSTAT nonzero) must not be zero in					 * any list; maximum value: (BUFFER_SIZE					 * - 8) * TX_BUF_MAX sum of DataCount					 * values in FragmentList must equal					 * Frame_Size value in START_FRAME TPL!					 * frame data fragment list.					 */	/* TPL/RPL size in OPEN parameter list depending on maximal	 * numbers of fragments used in one parameter list.	 */	Fragment FragList[TX_FRAG_NUM];	/* Maximum: nine frame fragments in one					 * TPL actual version of firmware: 9					 * fragments possible.					 */#pragma pack()	/* Special proprietary data and precalculations */	TPL *NextTPLPtr;		/* Pointer to next TPL in chain. */	unsigned char *MData;	struct sk_buff *Skb;	unsigned char TPLIndex;	volatile unsigned char BusyFlag;/* Flag: TPL busy? */};/* ---------------------Receive Functions-------------------------------* * define RECEIVE_CSTAT_REQUEST (R) and RECEIVE_CSTAT_COMPLETE (C) values. * (high-low) */#define RX_VALID		0x0080	/* R: set; tell adapter with					 * RECEIVE.VALID interrupt.					 * C: reset to zero.					 */#define RX_FRAME_COMPLETE	0x0040  /* R: must be reset to zero,					 * C: set to one.					 */#define RX_START_FRAME		0x0020  /* R: must be reset to zero.					 * C: set to one on the list.					 */#define RX_END_FRAME		0x0010  /* R: must be reset to zero.					 * C: set to one on the list					 * that ends the frame.					 */#define RX_FRAME_IRQ		0x0008  /* R: request interrupt generation					 * after receive.					 * C: unchanged.					 */#define RX_INTERFRAME_WAIT	0x0004  /* R: after receiving a frame:					 * interrupt and wait for a					 * RECEIVE.CONTINUE.					 * C: unchanged.					 */#define RX_PASS_CRC		0x0002  /* R: if set, the adapter includes					 * the CRC in data passed. (last four 					 * bytes; valid only if FRAME_START is					 * set)					 * C: set, if CRC is included in					 * received data.					 */#define RX_PASS_SRC_ADDR	0x0001  /* R: adapter uses explicit frame					 * source address and does not					 * overwrite with the adapter node					 * address. (valid only if FRAME_START					 * is set)					 * C: unchanged.					 */

⌨️ 快捷键说明

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