drivers/scsi/hpsa.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/hpsa.h
Extension
.h
Size
20431 bytes
Lines
674
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 access_method {
	void (*submit_command)(struct ctlr_info *h,
		struct CommandList *c);
	void (*set_intr_mask)(struct ctlr_info *h, unsigned long val);
	bool (*intr_pending)(struct ctlr_info *h);
	unsigned long (*command_completed)(struct ctlr_info *h, u8 q);
};

/* for SAS hosts and SAS expanders */
struct hpsa_sas_node {
	struct device *parent_dev;
	struct list_head port_list_head;
};

struct hpsa_sas_port {
	struct list_head port_list_entry;
	u64 sas_address;
	struct sas_port *port;
	int next_phy_index;
	struct list_head phy_list_head;
	struct hpsa_sas_node *parent_node;
	struct sas_rphy *rphy;
};

struct hpsa_sas_phy {
	struct list_head phy_list_entry;
	struct sas_phy *phy;
	struct hpsa_sas_port *parent_port;
	bool added_to_port;
};

#define EXTERNAL_QD 128
struct hpsa_scsi_dev_t {
	unsigned int devtype;
	int bus, target, lun;		/* as presented to the OS */
	unsigned char scsi3addr[8];	/* as presented to the HW */
	u8 physical_device : 1;
	u8 expose_device;
	u8 removed : 1;			/* device is marked for death */
	u8 was_removed : 1;		/* device actually removed */
#define RAID_CTLR_LUNID "\0\0\0\0\0\0\0\0"
	unsigned char device_id[16];    /* from inquiry pg. 0x83 */
	u64 sas_address;
	u64 eli;			/* from report diags. */
	unsigned char vendor[8];        /* bytes 8-15 of inquiry data */
	unsigned char model[16];        /* bytes 16-31 of inquiry data */
	unsigned char rev;		/* byte 2 of inquiry data */
	unsigned char raid_level;	/* from inquiry page 0xC1 */
	unsigned char volume_offline;	/* discovered via TUR or VPD */
	u16 queue_depth;		/* max queue_depth for this device */
	atomic_t commands_outstanding;	/* track commands sent to device */
	atomic_t ioaccel_cmds_out;	/* Only used for physical devices
					 * counts commands sent to physical
					 * device via "ioaccel" path.
					 */
	bool in_reset;
	u32 ioaccel_handle;
	u8 active_path_index;
	u8 path_map;
	u8 bay;
	u8 box[8];
	u16 phys_connector[8];
	int offload_config;		/* I/O accel RAID offload configured */
	int offload_enabled;		/* I/O accel RAID offload enabled */
	int offload_to_be_enabled;
	int hba_ioaccel_enabled;
	int offload_to_mirror;		/* Send next I/O accelerator RAID
					 * offload request to mirror drive
					 */
	struct raid_map_data raid_map;	/* I/O accelerator RAID map */

	/*
	 * Pointers from logical drive map indices to the phys drives that
	 * make those logical drives.  Note, multiple logical drives may
	 * share physical drives.  You can have for instance 5 physical
	 * drives with 3 logical drives each using those same 5 physical
	 * disks. We need these pointers for counting i/o's out to physical
	 * devices in order to honor physical device queue depth limits.
	 */
	struct hpsa_scsi_dev_t *phys_disk[RAID_MAP_MAX_ENTRIES];
	int nphysical_disks;
	int supports_aborts;
	struct hpsa_sas_port *sas_port;
	int external;   /* 1-from external array 0-not <0-unknown */
};

struct reply_queue_buffer {
	u64 *head;
	size_t size;
	u8 wraparound;

Annotation

Implementation Notes