drivers/scsi/esp_scsi.h

Source file repositories/reference/linux-study-clean/drivers/scsi/esp_scsi.h

File Facts

System
Linux kernel
Corpus path
drivers/scsi/esp_scsi.h
Extension
.h
Size
22553 bytes
Lines
586
Domain
Driver Families
Bucket
drivers/scsi
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

struct esp_cmd_priv {
	int			num_sg;
	int			cur_residue;
	struct scatterlist	*prv_sg;
	struct scatterlist	*cur_sg;
	int			tot_residue;
};

#define ESP_CMD_PRIV(cmd)	((struct esp_cmd_priv *)scsi_cmd_priv(cmd))

/* NOTE: this enum is ordered based on chip features! */
enum esp_rev {
	ESP100,  /* NCR53C90 - very broken */
	ESP100A, /* NCR53C90A */
	ESP236,
	FAS236,
	PCSCSI,  /* AM53c974 */
	FSC,     /* NCR/Symbios Logic 53CF9x-2 */
	FAS100A,
	FAST,
	FASHME,
};

struct esp_cmd_entry {
	struct list_head	list;

	struct scsi_cmnd	*cmd;

	unsigned int		saved_cur_residue;
	struct scatterlist	*saved_prv_sg;
	struct scatterlist	*saved_cur_sg;
	unsigned int		saved_tot_residue;

	u8			flags;
#define ESP_CMD_FLAG_WRITE	0x01 /* DMA is a write */
#define ESP_CMD_FLAG_AUTOSENSE	0x04 /* Doing automatic REQUEST_SENSE */
#define ESP_CMD_FLAG_RESIDUAL	0x08 /* AM53c974 BLAST residual */

	u8			tag[2];
	u8			orig_tag[2];

	u8			status;
	u8			message;

	unsigned char		*sense_ptr;
	unsigned char		*saved_sense_ptr;
	dma_addr_t		sense_dma;

	struct completion	*eh_done;
};

#define ESP_DEFAULT_TAGS	16

#define ESP_MAX_TARGET		16
#define ESP_MAX_LUN		8
#define ESP_MAX_TAG		256

struct esp_lun_data {
	struct esp_cmd_entry	*non_tagged_cmd;
	int			num_tagged;
	int			hold;
	struct esp_cmd_entry	*tagged_cmds[ESP_MAX_TAG];
};

struct esp_target_data {
	/* These are the ESP_STP, ESP_SOFF, and ESP_CFG3 register values which
	 * match the currently negotiated settings for this target.  The SCSI
	 * protocol values are maintained in spi_{offset,period,wide}(starget).
	 */
	u8			esp_period;
	u8			esp_offset;
	u8			esp_config3;

	u8			flags;
#define ESP_TGT_WIDE		0x01
#define ESP_TGT_DISCONNECT	0x02
#define ESP_TGT_NEGO_WIDE	0x04
#define ESP_TGT_NEGO_SYNC	0x08
#define ESP_TGT_CHECK_NEGO	0x40
#define ESP_TGT_BROKEN		0x80

	/* When ESP_TGT_CHECK_NEGO is set, on the next scsi command to this
	 * device we will try to negotiate the following parameters.
	 */
	u8			nego_goal_period;
	u8			nego_goal_offset;
	u8			nego_goal_width;
	u8			nego_goal_tags;

	struct scsi_target	*starget;

Annotation

Implementation Notes