drivers/scsi/isci/port.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/isci/port.h
Extension
.h
Size
9355 bytes
Lines
284
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 isci_port {
	struct isci_host *isci_host;
	struct list_head remote_dev_list;
	#define IPORT_RESET_PENDING 0
	unsigned long state;
	enum sci_status hard_reset_status;
	struct sci_base_state_machine sm;
	bool ready_exit;
	u8 logical_port_index;
	u8 physical_port_index;
	u8 active_phy_mask;
	u8 enabled_phy_mask;
	u8 last_active_phy;
	u16 reserved_rni;
	u16 reserved_tag;
	u32 started_request_count;
	u32 assigned_device_count;
	u32 hang_detect_users;
	u32 not_ready_reason;
	struct isci_phy *phy_table[SCI_MAX_PHYS];
	struct isci_host *owning_controller;
	struct sci_timer timer;
	struct scu_port_task_scheduler_registers __iomem *port_task_scheduler_registers;
	/* XXX rework: only one register, no need to replicate per-port */
	u32 __iomem *port_pe_configuration_register;
	struct scu_viit_entry __iomem *viit_registers;
};

enum sci_port_not_ready_reason_code {
	SCIC_PORT_NOT_READY_NO_ACTIVE_PHYS,
	SCIC_PORT_NOT_READY_HARD_RESET_REQUESTED,
	SCIC_PORT_NOT_READY_INVALID_PORT_CONFIGURATION,
	SCIC_PORT_NOT_READY_RECONFIGURING,

	SCIC_PORT_NOT_READY_REASON_CODE_MAX
};

struct sci_port_end_point_properties {
	struct sci_sas_address sas_address;
	struct sci_phy_proto protocols;
};

struct sci_port_properties {
	u32 index;
	struct sci_port_end_point_properties local;
	struct sci_port_end_point_properties remote;
	u32 phy_mask;
};

/**
 * enum sci_port_states - port state machine states
 * @SCI_PORT_STOPPED: port has successfully been stopped.  In this state
 *		      no new IO operations are permitted.  This state is
 *		      entered from the STOPPING state.
 * @SCI_PORT_STOPPING: port is in the process of stopping.  In this
 *		       state no new IO operations are permitted, but
 *		       existing IO operations are allowed to complete.
 *		       This state is entered from the READY state.
 * @SCI_PORT_READY: port is now ready.  Thus, the user is able to
 *		    perform IO operations on this port. This state is
 *		    entered from the STARTING state.
 * @SCI_PORT_SUB_WAITING: port is started and ready but has no active
 *			  phys.
 * @SCI_PORT_SUB_OPERATIONAL: port is started and ready and there is at
 *			      least one phy operational.
 * @SCI_PORT_SUB_CONFIGURING: port is started and there was an
 *			      add/remove phy event.  This state is only
 *			      used in Automatic Port Configuration Mode
 *			      (APC)
 * @SCI_PORT_RESETTING: port is in the process of performing a hard
 *			reset.  Thus, the user is unable to perform IO
 *			operations on this port.  This state is entered
 *			from the READY state.
 * @SCI_PORT_FAILED: port has failed a reset request.  This state is
 *		     entered when a port reset request times out. This
 *		     state is entered from the RESETTING state.
 */
#define PORT_STATES {\
	C(PORT_STOPPED),\
	C(PORT_STOPPING),\
	C(PORT_READY),\
	C(PORT_SUB_WAITING),\
	C(PORT_SUB_OPERATIONAL),\
	C(PORT_SUB_CONFIGURING),\
	C(PORT_RESETTING),\
	C(PORT_FAILED),\
	}
#undef C
#define C(a) SCI_##a
enum sci_port_states PORT_STATES;

Annotation

Implementation Notes