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

📄 ambassador.h

📁 Linux内核源代码 为压缩文件 是<<Linux内核>>一书中的源代码
💻 H
📖 第 1 页 / 共 2 页
字号:
#define MAX_COMMAND_DATA 13#define MAX_TRANSFER_DATA 11typedef struct {  u32 address;  u32 count;  u32 data[MAX_TRANSFER_DATA];} transfer_block;typedef struct {  u32 result;  u32 command;  union {    transfer_block transfer;    u32 version;    u32 start;    u32 data[MAX_COMMAND_DATA];  } payload;  u32 valid;} loader_block;/* command queue *//* Again all data are BIG ENDIAN */typedef	struct {  union {    struct {      u32 vc;      u32 flags;      u32 rate;    } open;    struct {      u32 vc;      u32 rate;    } modify_rate;    struct {      u32 vc;      u32 flags;    } modify_flags;    struct {      u32 vc;    } close;    struct {      u32 lower4;      u32 upper2;    } bia;    struct {      u32 address;    } suni;    struct {      u32 major;      u32 minor;    } version;    struct {      u32 read;      u32 write;    } speed;    struct {      u32 flags;    } flush;    struct {      u32 address;      u32 data;    } memory;    u32 par[3];  } args;  u32 request;} command;/* transmit queues and associated structures *//* The hosts transmit structure. All BIG ENDIAN; host address   restricted to first 1GByte, but address passed to the card must   have the top MS bit or'ed in. -- check this *//* TX is described by 1+ tx_frags followed by a tx_frag_end */typedef struct {  u32 bytes;  u32 address;} tx_frag;/* apart from handle the fields here are for the adapter to play with   and should be set to zero */typedef struct {  u32	handle;  u16	vc;  u16	next_descriptor_length;  u32	next_descriptor;#ifdef AMB_NEW_MICROCODE  u8    cpcs_uu;  u8    cpi;  u16   pad;#endif} tx_frag_end;typedef struct {  tx_frag tx_frag;  tx_frag_end tx_frag_end;  struct sk_buff * skb;} tx_simple;#if 0typedef union {  tx_frag	fragment;  tx_frag_end	end_of_list;} tx_descr;#endif/* this "points" to the sequence of fragments and trailer */typedef	struct {  u16	vc;  u16	tx_descr_length;  u32	tx_descr_addr;} tx_in;/* handle is the handle from tx_in */typedef	struct {  u32 handle;} tx_out;/* receive frame structure *//* All BIG ENDIAN; handle is as passed from host; length is zero for   aborted frames, and frames with errors. Header is actually VC   number, lec-id is NOT yet supported. */typedef struct {  u32  handle;  u16  vc;  u16  lec_id; // unused  u16  status;  u16  length;} rx_out;/* buffer supply structure */typedef	struct {  u32 handle;  u32 host_address;} rx_in;/* This first structure is the area in host memory where the adapter   writes its pointer values. These pointer values are BIG ENDIAN and   reside in the same 4MB 'page' as this structure. The host gives the   adapter the address of this block by sending a doorbell interrupt   to the adapter after downloading the code and setting it going. The   addresses have the top 10 bits set to 1010000010b -- really?      The host must initialise these before handing the block to the   adapter. */typedef struct {  u32 command_start;		/* SRB commands completions */  u32 command_end;		/* SRB commands completions */  u32 tx_start;  u32 tx_end;  u32 txcom_start;		/* tx completions */  u32 txcom_end;		/* tx completions */  struct {    u32 buffer_start;    u32 buffer_end;    u32 buffer_q_get;    u32 buffer_q_end;    u32 buffer_aptr;    u32 rx_start;		/* rx completions */    u32 rx_end;    u32 rx_ptr;    u32 buffer_size;		/* size of host buffer */  } rec_struct[NUM_RX_POOLS];#ifdef AMB_NEW_MICROCODE  u16 init_flags;  u16 talk_block_spare;#endif} adap_talk_block;/* This structure must be kept in line with the vcr image in sarmain.h      This is the structure in the host filled in by the adapter by   GET_SUNI_STATS */typedef struct {  u8	racp_chcs;  u8	racp_uhcs;  u16	spare;  u32	racp_rcell;  u32	tacp_tcell;  u32	flags;  u32	dropped_cells;  u32	dropped_frames;} suni_stats;typedef enum {  dead} amb_flags;#define NEXTQ(current,start,limit) \  ( (current)+1 < (limit) ? (current)+1 : (start) ) typedef struct {  command * start;  command * in;  command * out;  command * limit;} amb_cq_ptrs;typedef struct {  spinlock_t lock;  unsigned int pending;  unsigned int high;  unsigned int filled;  unsigned int maximum; // size - 1 (q implementation)  amb_cq_ptrs ptrs;} amb_cq;typedef struct {  spinlock_t lock;  unsigned int pending;  unsigned int high;  unsigned int filled;  unsigned int maximum; // size - 1 (q implementation)  struct {    tx_in * start;    tx_in * ptr;    tx_in * limit;  } in;  struct {    tx_out * start;    tx_out * ptr;    tx_out * limit;  } out;} amb_txq;typedef struct {  spinlock_t lock;  unsigned int pending;  unsigned int low;  unsigned int emptied;  unsigned int maximum; // size - 1 (q implementation)  struct {    rx_in * start;    rx_in * ptr;    rx_in * limit;  } in;  struct {    rx_out * start;    rx_out * ptr;    rx_out * limit;  } out;  unsigned int buffers_wanted;  unsigned int buffer_size;} amb_rxq;typedef struct {  unsigned long tx_ok;  struct {    unsigned long ok;    unsigned long error;    unsigned long badcrc;    unsigned long toolong;    unsigned long aborted;    unsigned long unused;  } rx;} amb_stats;// a single struct pointed to by atm_vcc->dev_datatypedef struct {  u8               tx_vc_bits:7;  u8               tx_present:1;} amb_tx_info;typedef struct {  unsigned char    pool;} amb_rx_info;typedef struct {  amb_rx_info      rx_info;  u16              tx_frame_bits;  unsigned int     tx_rate;  unsigned int     rx_rate;} amb_vcc;struct amb_dev {  u8               irq;  u8               flags;  u32              iobase;  u32 *            membase;#ifdef FILL_RX_POOLS_IN_BH  struct tq_struct bh;#endif    amb_cq           cq;  amb_txq          txq;  amb_rxq          rxq[NUM_RX_POOLS];    struct semaphore vcc_sf;  amb_tx_info      txer[NUM_VCS];  struct atm_vcc * rxer[NUM_VCS];  unsigned int     tx_avail;  unsigned int     rx_avail;    amb_stats        stats;    struct atm_dev * atm_dev;  struct pci_dev * pci_dev;  struct amb_dev * prev;};typedef struct amb_dev amb_dev;#define AMB_DEV(atm_dev) ((amb_dev *) (atm_dev)->dev_data)#define AMB_VCC(atm_vcc) ((amb_vcc *) (atm_vcc)->dev_data)/* the microcode */typedef struct {  u32 start;  unsigned int count;} region;extern const region ucode_regions[];extern const u32 ucode_data[];extern const u32 ucode_start;/* rate rounding */typedef enum {  round_up,  round_down,  round_nearest} rounding;#endif

⌨️ 快捷键说明

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