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

📄 aic7xxx.h

📁 内核linux2.4.20,可跟rtlinux3.2打补丁 组成实时linux系统,编译内核
💻 H
📖 第 1 页 / 共 3 页
字号:
	uint16_t res_1[10];		/* words 20-29 */	uint16_t signature;		/* Signature == 0x250 */#define		CFSIGNATURE	0x250#define		CFSIGNATURE2	0x300	uint16_t checksum;		/* word 31 */};/****************************  Message Buffer *********************************/typedef enum {	MSG_TYPE_NONE			= 0x00,	MSG_TYPE_INITIATOR_MSGOUT	= 0x01,	MSG_TYPE_INITIATOR_MSGIN	= 0x02,	MSG_TYPE_TARGET_MSGOUT		= 0x03,	MSG_TYPE_TARGET_MSGIN		= 0x04} ahc_msg_type;typedef enum {	MSGLOOP_IN_PROG,	MSGLOOP_MSGCOMPLETE,	MSGLOOP_TERMINATED} msg_loop_stat;/*********************** Software Configuration Structure *********************/TAILQ_HEAD(scb_tailq, scb);struct ahc_suspend_channel_state {	uint8_t	scsiseq;	uint8_t	sxfrctl0;	uint8_t	sxfrctl1;	uint8_t	simode0;	uint8_t	simode1;	uint8_t	seltimer;	uint8_t	seqctl;};struct ahc_suspend_state {	struct	ahc_suspend_channel_state channel[2];	uint8_t	optionmode;	uint8_t	dscommand0;	uint8_t	dspcistatus;	/* hsmailbox */	uint8_t	crccontrol1;	uint8_t	scbbaddr;	/* Host and sequencer SCB counts */	uint8_t	dff_thrsh;	uint8_t	*scratch_ram;	uint8_t	*btt;};typedef void (*ahc_bus_intr_t)(struct ahc_softc *);struct ahc_softc {	bus_space_tag_t           tag;	bus_space_handle_t        bsh;#ifndef __linux__	bus_dma_tag_t		  buffer_dmat;   /* dmat for buffer I/O */#endif	struct scb_data		 *scb_data;	struct scb		 *next_queued_scb;	/*	 * SCBs that have been sent to the controller	 */	LIST_HEAD(, scb)	  pending_scbs;	/*	 * Counting lock for deferring the release of additional	 * untagged transactions from the untagged_queues.  When	 * the lock is decremented to 0, all queues in the	 * untagged_queues array are run.	 */	u_int			  untagged_queue_lock;	/*	 * Per-target queue of untagged-transactions.  The	 * transaction at the head of the queue is the	 * currently pending untagged transaction for the	 * target.  The driver only allows a single untagged	 * transaction per target.	 */	struct scb_tailq	  untagged_queues[AHC_NUM_TARGETS];	/*	 * Platform specific data.	 */	struct ahc_platform_data *platform_data;	/*	 * Platform specific device information.	 */	ahc_dev_softc_t		  dev_softc;	/*	 * Bus specific device information.	 */	ahc_bus_intr_t		  bus_intr;	/*	 * Target mode related state kept on a per enabled lun basis.	 * Targets that are not enabled will have null entries.	 * As an initiator, we keep one target entry for our initiator	 * ID to store our sync/wide transfer settings.	 */	struct ahc_tmode_tstate  *enabled_targets[AHC_NUM_TARGETS];	/*	 * The black hole device responsible for handling requests for	 * disabled luns on enabled targets.	 */	struct ahc_tmode_lstate  *black_hole;	/*	 * Device instance currently on the bus awaiting a continue TIO	 * for a command that was not given the disconnect priveledge.	 */	struct ahc_tmode_lstate  *pending_device;	/*	 * Card characteristics	 */	ahc_chip		  chip;	ahc_feature		  features;	ahc_bug			  bugs;	ahc_flag		  flags;	/* Values to store in the SEQCTL register for pause and unpause */	uint8_t			  unpause;	uint8_t			  pause;	/* Command Queues */	uint8_t			  qoutfifonext;	uint8_t			  qinfifonext;	uint8_t			 *qoutfifo;	uint8_t			 *qinfifo;	/* Critical Section Data */	struct cs		 *critical_sections;	u_int			  num_critical_sections;	/* Links for chaining softcs */	TAILQ_ENTRY(ahc_softc)	  links;	/* Channel Names ('A', 'B', etc.) */	char			  channel;	char			  channel_b;	/* Initiator Bus ID */	uint8_t			  our_id;	uint8_t			  our_id_b;	/*	 * PCI error detection.	 */	int			  unsolicited_ints;	/*	 * Target incoming command FIFO.	 */	struct target_cmd	 *targetcmds;	uint8_t			  tqinfifonext;	/*	 * Incoming and outgoing message handling.	 */	uint8_t			  send_msg_perror;	ahc_msg_type		  msg_type;	uint8_t			  msgout_buf[12];/* Message we are sending */	uint8_t			  msgin_buf[12];/* Message we are receiving */	u_int			  msgout_len;	/* Length of message to send */	u_int			  msgout_index;	/* Current index in msgout */	u_int			  msgin_index;	/* Current index in msgin */	/*	 * Mapping information for data structures shared	 * between the sequencer and kernel.	 */	bus_dma_tag_t		  parent_dmat;	bus_dma_tag_t		  shared_data_dmat;	bus_dmamap_t		  shared_data_dmamap;	bus_addr_t		  shared_data_busaddr;	/*	 * Bus address of the one byte buffer used to	 * work-around a DMA bug for chips <= aic7880	 * in target mode.	 */	bus_addr_t		  dma_bug_buf;	/* Information saved through suspend/resume cycles */	struct ahc_suspend_state  suspend_state;	/* Number of enabled target mode device on this card */	u_int			  enabled_luns;	/* Initialization level of this data structure */	u_int			  init_level;	/* PCI cacheline size. */	u_int			  pci_cachesize;	/* Per-Unit descriptive information */	const char		 *description;	char			 *name;	int			  unit;	/* Selection Timer settings */	int			  seltime;	int			  seltime_b;	uint16_t	 	  user_discenable;/* Disconnection allowed  */	uint16_t		  user_tagenable;/* Tagged Queuing allowed */};TAILQ_HEAD(ahc_softc_tailq, ahc_softc);extern struct ahc_softc_tailq ahc_tailq;/************************ Active Device Information ***************************/typedef enum {	ROLE_UNKNOWN,	ROLE_INITIATOR,	ROLE_TARGET} role_t;struct ahc_devinfo {	int	 our_scsiid;	int	 target_offset;	uint16_t target_mask;	u_int	 target;	u_int	 lun;	char	 channel;	role_t	 role;		/*				 * Only guaranteed to be correct if not				 * in the busfree state.				 */};/****************************** PCI Structures ********************************/typedef int (ahc_device_setup_t)(struct ahc_softc *);struct ahc_pci_identity {	uint64_t		 full_id;	uint64_t		 id_mask;	char			*name;	ahc_device_setup_t	*setup;};extern struct ahc_pci_identity ahc_pci_ident_table [];extern const u_int ahc_num_pci_devs;/***************************** VL/EISA Declarations ***************************/struct aic7770_identity {	uint32_t		 full_id;	uint32_t		 id_mask;	char			*name;	ahc_device_setup_t	*setup;};extern struct aic7770_identity aic7770_ident_table [];extern const int ahc_num_aic7770_devs;#define AHC_EISA_SLOT_OFFSET	0xc00#define AHC_EISA_IOSIZE		0x100/*************************** Function Declarations ****************************//******************************************************************************/u_int			ahc_index_busy_tcl(struct ahc_softc *ahc, u_int tcl);void			ahc_unbusy_tcl(struct ahc_softc *ahc, u_int tcl);void			ahc_busy_tcl(struct ahc_softc *ahc,				     u_int tcl, u_int busyid);/***************************** PCI Front End *********************************/struct ahc_pci_identity	*ahc_find_pci_device(ahc_dev_softc_t);int			 ahc_pci_config(struct ahc_softc *,					struct ahc_pci_identity *);/*************************** EISA/VL Front End ********************************/struct aic7770_identity *aic7770_find_device(uint32_t);int			 aic7770_config(struct ahc_softc *ahc,					struct aic7770_identity *);/************************** SCB and SCB queue management **********************/int		ahc_probe_scbs(struct ahc_softc *);void		ahc_run_untagged_queues(struct ahc_softc *ahc);void		ahc_run_untagged_queue(struct ahc_softc *ahc,				       struct scb_tailq *queue);void		ahc_qinfifo_requeue_tail(struct ahc_softc *ahc,					 struct scb *scb);int		ahc_match_scb(struct ahc_softc *ahc, struct scb *scb,			      int target, char channel, int lun,			      u_int tag, role_t role);/****************************** Initialization ********************************/struct ahc_softc	*ahc_alloc(void *platform_arg, char *name);int			 ahc_softc_init(struct ahc_softc *);void			 ahc_controller_info(struct ahc_softc *ahc, char *buf);int			 ahc_init(struct ahc_softc *ahc);void			 ahc_intr_enable(struct ahc_softc *ahc, int enable);void			 ahc_pause_and_flushwork(struct ahc_softc *ahc);int			 ahc_suspend(struct ahc_softc *ahc); int			 ahc_resume(struct ahc_softc *ahc);void			 ahc_softc_insert(struct ahc_softc *);void			 ahc_set_unit(struct ahc_softc *, int);void			 ahc_set_name(struct ahc_softc *, char *);void			 ahc_alloc_scbs(struct ahc_softc *ahc);void			 ahc_free(struct ahc_softc *ahc);int			 ahc_reset(struct ahc_softc *ahc);void			 ahc_shutdown(void *arg);/*************************** Interrupt Services *******************************/void			ahc_pci_intr(struct ahc_softc *ahc);void			ahc_clear_intstat(struct ahc_softc *ahc);void			ahc_run_qoutfifo(struct ahc_softc *ahc);#ifdef AHC_TARGET_MODEvoid			ahc_run_tqinfifo(struct ahc_softc *ahc, int paused);#endifvoid			ahc_handle_brkadrint(struct ahc_softc *ahc);void			ahc_handle_seqint(struct ahc_softc *ahc, u_int intstat);void			ahc_handle_scsiint(struct ahc_softc *ahc,					   u_int intstat);void			ahc_clear_critical_section(struct ahc_softc *ahc);/***************************** Error Recovery *********************************/typedef enum {	SEARCH_COMPLETE,	SEARCH_COUNT,	SEARCH_REMOVE} ahc_search_action;int			ahc_search_qinfifo(struct ahc_softc *ahc, int target,					   char channel, int lun, u_int tag,					   role_t role, uint32_t status,					   ahc_search_action action);int			ahc_search_disc_list(struct ahc_softc *ahc, int target,					     char channel, int lun, u_int tag,					     int stop_on_first, int remove,					     int save_state);void			ahc_freeze_devq(struct ahc_softc *ahc, struct scb *scb);int			ahc_reset_channel(struct ahc_softc *ahc, char channel,					  int initiate_reset);int			ahc_abort_scbs(struct ahc_softc *ahc, int target,				       char channel, int lun, u_int tag,				       role_t role, uint32_t status);void			ahc_restart(struct ahc_softc *ahc);void			ahc_calc_residual(struct scb *scb);/*************************** Utility Functions ********************************/struct ahc_phase_table_entry*			ahc_lookup_phase_entry(int phase);void			ahc_compile_devinfo(struct ahc_devinfo *devinfo,					    u_int our_id, u_int target,					    u_int lun, char channel,					    role_t role);/************************** Transfer Negotiation ******************************/struct ahc_syncrate*	ahc_find_syncrate(struct ahc_softc *ahc, u_int *period,					  u_int *ppr_options, u_int maxsync);u_int			ahc_find_period(struct ahc_softc *ahc,					u_int scsirate, u_int maxsync);void			ahc_validate_offset(struct ahc_softc *ahc,					    struct ahc_initiator_tinfo *tinfo,					    struct ahc_syncrate *syncrate,					    u_int *offset, int wide,					    role_t role);void			ahc_validate_width(struct ahc_softc *ahc,					   struct ahc_initiator_tinfo *tinfo,					   u_int *bus_width,					   role_t role);int			ahc_update_neg_request(struct ahc_softc*,					       struct ahc_devinfo*,					       struct ahc_tmode_tstate*,					       struct ahc_initiator_tinfo*,					       int /*force*/);void			ahc_set_width(struct ahc_softc *ahc,				      struct ahc_devinfo *devinfo,				      u_int width, u_int type, int paused);void			ahc_set_syncrate(struct ahc_softc *ahc,					 struct ahc_devinfo *devinfo,					 struct ahc_syncrate *syncrate,					 u_int period, u_int offset,					 u_int ppr_options,					 u_int type, int paused);typedef enum {	AHC_QUEUE_NONE,	AHC_QUEUE_BASIC,	AHC_QUEUE_TAGGED} ahc_queue_alg;void			ahc_set_tags(struct ahc_softc *ahc,				     struct ahc_devinfo *devinfo,				     ahc_queue_alg alg);/**************************** Target Mode *************************************/#ifdef AHC_TARGET_MODEvoid		ahc_send_lstate_events(struct ahc_softc *,				       struct ahc_tmode_lstate *);void		ahc_handle_en_lun(struct ahc_softc *ahc,				  struct cam_sim *sim, union ccb *ccb);cam_status	ahc_find_tmode_devs(struct ahc_softc *ahc,				    struct cam_sim *sim, union ccb *ccb,				    struct ahc_tmode_tstate **tstate,				    struct ahc_tmode_lstate **lstate,				    int notfound_failure);#ifndef AHC_TMODE_ENABLE#define AHC_TMODE_ENABLE 0#endif#endif/******************************* Debug ***************************************/void			ahc_print_scb(struct scb *scb);void			ahc_dump_card_state(struct ahc_softc *ahc);#endif /* _AIC7XXX_H_ */

⌨️ 快捷键说明

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