drivers/scsi/isci/remote_node_table.h

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

File Facts

System
Linux kernel
Corpus path
drivers/scsi/isci/remote_node_table.h
Extension
.h
Size
6439 bytes
Lines
189
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 sci_remote_node_table {
	/**
	 * This field contains the array size in dwords
	 */
	u16 available_nodes_array_size;

	/**
	 * This field contains the array size of the
	 */
	u16 group_array_size;

	/**
	 * This field is the array of available remote node entries in bits.
	 * Because of the way STP remote node data is allocated on the SCU hardware
	 * the remote nodes must occupy three consecutive remote node context
	 * entries.  For ease of allocation and de-allocation we have broken the
	 * sets of three into a single nibble.  When the STP RNi is allocated all
	 * of the bits in the nibble are cleared.  This math results in a table size
	 * of MAX_REMOTE_NODES / CONSECUTIVE RNi ENTRIES for STP / 2 entries per byte.
	 */
	u32 available_remote_nodes[
		(SCI_MAX_REMOTE_DEVICES / SCIC_SDS_REMOTE_NODES_PER_DWORD)
		+ ((SCI_MAX_REMOTE_DEVICES % SCIC_SDS_REMOTE_NODES_PER_DWORD) != 0)];

	/**
	 * This field is the nibble selector for the above table.  There are three
	 * possible selectors each for fast lookup when trying to find one, two or
	 * three remote node entries.
	 */
	u32 remote_node_groups[
		SCU_STP_REMOTE_NODE_COUNT][
		(SCI_MAX_REMOTE_DEVICES / (32 * SCU_STP_REMOTE_NODE_COUNT))
		+ ((SCI_MAX_REMOTE_DEVICES % (32 * SCU_STP_REMOTE_NODE_COUNT)) != 0)];

};

/* --------------------------------------------------------------------------- */

void sci_remote_node_table_initialize(
	struct sci_remote_node_table *remote_node_table,
	u32 remote_node_entries);

u16 sci_remote_node_table_allocate_remote_node(
	struct sci_remote_node_table *remote_node_table,
	u32 remote_node_count);

void sci_remote_node_table_release_remote_node_index(
	struct sci_remote_node_table *remote_node_table,
	u32 remote_node_count,
	u16 remote_node_index);

#endif /* _SCIC_SDS_REMOTE_NODE_TABLE_H_ */

Annotation

Implementation Notes