ipath_common.h

来自「LINUX 2.6.17.4的源码」· C头文件 代码 · 共 617 行 · 第 1/2 页

H
617
字号
	__u32 spi_rcv_egrchunksize;	/* total size of mmap to cover full rcvegrbuffers */	__u32 spi_rcv_egrbuftotlen;} __attribute__ ((aligned(8)));/* * This version number is given to the driver by the user code during * initialization in the spu_userversion field of ipath_user_info, so * the driver can check for compatibility with user code. * * The major version changes when data structures * change in an incompatible way.  The driver must be the same or higher * for initialization to succeed.  In some cases, a higher version * driver will not interoperate with older software, and initialization * will return an error. */#define IPATH_USER_SWMAJOR 1/* * Minor version differences are always compatible * a within a major version, however if if user software is larger * than driver software, some new features and/or structure fields * may not be implemented; the user code must deal with this if it * cares, or it must abort after initialization reports the difference */#define IPATH_USER_SWMINOR 2#define IPATH_USER_SWVERSION ((IPATH_USER_SWMAJOR<<16) | IPATH_USER_SWMINOR)#define IPATH_KERN_TYPE 0/* * Similarly, this is the kernel version going back to the user.  It's * slightly different, in that we want to tell if the driver was built as * part of a PathScale release, or from the driver from OpenIB, kernel.org, * or a standard distribution, for support reasons.  The high bit is 0 for * non-PathScale, and 1 for PathScale-built/supplied. * * It's returned by the driver to the user code during initialization in the * spi_sw_version field of ipath_base_info, so the user code can in turn * check for compatibility with the kernel.*/#define IPATH_KERN_SWVERSION ((IPATH_KERN_TYPE<<31) | IPATH_USER_SWVERSION)/* * This structure is passed to ipath_userinit() to tell the driver where * user code buffers are, sizes, etc.   The offsets and sizes of the * fields must remain unchanged, for binary compatibility.  It can * be extended, if userversion is changed so user code can tell, if needed */struct ipath_user_info {	/*	 * version of user software, to detect compatibility issues.	 * Should be set to IPATH_USER_SWVERSION.	 */	__u32 spu_userversion;	/* desired number of receive header queue entries */	__u32 spu_rcvhdrcnt;	/* size of struct base_info to write to */	__u32 spu_base_info_size;	/*	 * number of words in KD protocol header	 * This tells InfiniPath how many words to copy to rcvhdrq.  If 0,	 * kernel uses a default.  Once set, attempts to set any other value	 * are an error (EAGAIN) until driver is reloaded.	 */	__u32 spu_rcvhdrsize;	/*	 * cache line aligned (64 byte) user address to	 * which the rcvhdrtail register will be written by infinipath	 * whenever it changes, so that no chip registers are read in	 * the performance path.	 */	__u64 spu_rcvhdraddr;	/*	 * address of struct base_info to write to	 */	__u64 spu_base_info;} __attribute__ ((aligned(8)));/* User commands. */#define IPATH_CMD_MIN		16#define IPATH_CMD_USER_INIT	16	/* set up userspace */#define IPATH_CMD_PORT_INFO	17	/* find out what resources we got */#define IPATH_CMD_RECV_CTRL	18	/* control receipt of packets */#define IPATH_CMD_TID_UPDATE	19	/* update expected TID entries */#define IPATH_CMD_TID_FREE	20	/* free expected TID entries */#define IPATH_CMD_SET_PART_KEY	21	/* add partition key */#define IPATH_CMD_MAX		21struct ipath_port_info {	__u32 num_active;	/* number of active units */	__u32 unit;		/* unit (chip) assigned to caller */	__u32 port;		/* port on unit assigned to caller */};struct ipath_tid_info {	__u32 tidcnt;	/* make structure same size in 32 and 64 bit */	__u32 tid__unused;	/* virtual address of first page in transfer */	__u64 tidvaddr;	/* pointer (same size 32/64 bit) to __u16 tid array */	__u64 tidlist;	/*	 * pointer (same size 32/64 bit) to bitmap of TIDs used	 * for this call; checked for being large enough at open	 */	__u64 tidmap;};struct ipath_cmd {	__u32 type;			/* command type */	union {		struct ipath_tid_info tid_info;		struct ipath_user_info user_info;		/* address in userspace of struct ipath_port_info to		   write result to */		__u64 port_info;		/* enable/disable receipt of packets */		__u32 recv_ctrl;		/* partition key to set */		__u16 part_key;	} cmd;};struct ipath_iovec {	/* Pointer to data, but same size 32 and 64 bit */	__u64 iov_base;	/*	 * Length of data; don't need 64 bits, but want	 * ipath_sendpkt to remain same size as before 32 bit changes, so...	 */	__u64 iov_len;};/* * Describes a single packet for send.  Each packet can have one or more * buffers, but the total length (exclusive of IB headers) must be less * than the MTU, and if using the PIO method, entire packet length, * including IB headers, must be less than the ipath_piosize value (words). * Use of this necessitates including sys/uio.h */struct __ipath_sendpkt {	__u32 sps_flags;	/* flags for packet (TBD) */	__u32 sps_cnt;		/* number of entries to use in sps_iov */	/* array of iov's describing packet. TEMPORARY */	struct ipath_iovec sps_iov[4];};/* Passed into SMA special file's ->read and ->write methods. */struct ipath_sma_pkt{	__u32 unit;	/* unit on which to send packet */	__u64 data;	/* address of payload in userspace */	__u32 len;	/* length of payload */};/* * Data layout in I2C flash (for GUID, etc.) * All fields are little-endian binary unless otherwise stated */#define IPATH_FLASH_VERSION 1struct ipath_flash {	/* flash layout version (IPATH_FLASH_VERSION) */	__u8 if_fversion;	/* checksum protecting if_length bytes */	__u8 if_csum;	/*	 * valid length (in use, protected by if_csum), including	 * if_fversion and if_sum themselves)	 */	__u8 if_length;	/* the GUID, in network order */	__u8 if_guid[8];	/* number of GUIDs to use, starting from if_guid */	__u8 if_numguid;	/* the board serial number, in ASCII */	char if_serial[12];	/* board mfg date (YYYYMMDD ASCII) */	char if_mfgdate[8];	/* last board rework/test date (YYYYMMDD ASCII) */	char if_testdate[8];	/* logging of error counts, TBD */	__u8 if_errcntp[4];	/* powered on hours, updated at driver unload */	__u8 if_powerhour[2];	/* ASCII free-form comment field */	char if_comment[32];	/* 78 bytes used, min flash size is 128 bytes */	__u8 if_future[50];};/* * These are the counters implemented in the chip, and are listed in order. * The InterCaps naming is taken straight from the chip spec. */struct infinipath_counters {	__u64 LBIntCnt;	__u64 LBFlowStallCnt;	__u64 Reserved1;	__u64 TxUnsupVLErrCnt;	__u64 TxDataPktCnt;	__u64 TxFlowPktCnt;	__u64 TxDwordCnt;	__u64 TxLenErrCnt;	__u64 TxMaxMinLenErrCnt;	__u64 TxUnderrunCnt;	__u64 TxFlowStallCnt;	__u64 TxDroppedPktCnt;	__u64 RxDroppedPktCnt;	__u64 RxDataPktCnt;	__u64 RxFlowPktCnt;	__u64 RxDwordCnt;	__u64 RxLenErrCnt;	__u64 RxMaxMinLenErrCnt;	__u64 RxICRCErrCnt;	__u64 RxVCRCErrCnt;	__u64 RxFlowCtrlErrCnt;	__u64 RxBadFormatCnt;	__u64 RxLinkProblemCnt;	__u64 RxEBPCnt;	__u64 RxLPCRCErrCnt;	__u64 RxBufOvflCnt;	__u64 RxTIDFullErrCnt;	__u64 RxTIDValidErrCnt;	__u64 RxPKeyMismatchCnt;	__u64 RxP0HdrEgrOvflCnt;	__u64 RxP1HdrEgrOvflCnt;	__u64 RxP2HdrEgrOvflCnt;	__u64 RxP3HdrEgrOvflCnt;	__u64 RxP4HdrEgrOvflCnt;	__u64 RxP5HdrEgrOvflCnt;	__u64 RxP6HdrEgrOvflCnt;	__u64 RxP7HdrEgrOvflCnt;	__u64 RxP8HdrEgrOvflCnt;	__u64 Reserved6;	__u64 Reserved7;	__u64 IBStatusChangeCnt;	__u64 IBLinkErrRecoveryCnt;	__u64 IBLinkDownedCnt;	__u64 IBSymbolErrCnt;};/* * The next set of defines are for packet headers, and chip register * and memory bits that are visible to and/or used by user-mode software * The other bits that are used only by the driver or diags are in * ipath_registers.h *//* RcvHdrFlags bits */#define INFINIPATH_RHF_LENGTH_MASK 0x7FF#define INFINIPATH_RHF_LENGTH_SHIFT 0#define INFINIPATH_RHF_RCVTYPE_MASK 0x7#define INFINIPATH_RHF_RCVTYPE_SHIFT 11#define INFINIPATH_RHF_EGRINDEX_MASK 0x7FF#define INFINIPATH_RHF_EGRINDEX_SHIFT 16#define INFINIPATH_RHF_H_ICRCERR   0x80000000#define INFINIPATH_RHF_H_VCRCERR   0x40000000#define INFINIPATH_RHF_H_PARITYERR 0x20000000#define INFINIPATH_RHF_H_LENERR    0x10000000#define INFINIPATH_RHF_H_MTUERR    0x08000000#define INFINIPATH_RHF_H_IHDRERR   0x04000000#define INFINIPATH_RHF_H_TIDERR    0x02000000#define INFINIPATH_RHF_H_MKERR     0x01000000#define INFINIPATH_RHF_H_IBERR     0x00800000#define INFINIPATH_RHF_L_SWA       0x00008000#define INFINIPATH_RHF_L_SWB       0x00004000/* infinipath header fields */#define INFINIPATH_I_VERS_MASK 0xF#define INFINIPATH_I_VERS_SHIFT 28#define INFINIPATH_I_PORT_MASK 0xF#define INFINIPATH_I_PORT_SHIFT 24#define INFINIPATH_I_TID_MASK 0x7FF#define INFINIPATH_I_TID_SHIFT 13#define INFINIPATH_I_OFFSET_MASK 0x1FFF#define INFINIPATH_I_OFFSET_SHIFT 0/* K_PktFlags bits */#define INFINIPATH_KPF_INTR 0x1/* SendPIO per-buffer control */#define INFINIPATH_SP_LENGTHP1_MASK 0x3FF#define INFINIPATH_SP_LENGTHP1_SHIFT 0#define INFINIPATH_SP_INTR    0x80000000#define INFINIPATH_SP_TEST    0x40000000#define INFINIPATH_SP_TESTEBP 0x20000000/* SendPIOAvail bits */#define INFINIPATH_SENDPIOAVAIL_BUSY_SHIFT 1#define INFINIPATH_SENDPIOAVAIL_CHECK_SHIFT 0#endif				/* _IPATH_COMMON_H */

⌨️ 快捷键说明

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