drivers/scsi/isci/remote_node_table.c
Source file repositories/reference/linux-study-clean/drivers/scsi/isci/remote_node_table.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/scsi/isci/remote_node_table.c- Extension
.c- Size
- 21018 bytes
- Lines
- 599
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
remote_node_table.hremote_node_context.h
Detected Declarations
function sci_remote_node_table_get_group_indexfunction sci_remote_node_table_clear_group_indexfunction sci_remote_node_table_set_group_indexfunction sci_remote_node_table_set_node_indexfunction sci_remote_node_table_clear_node_indexfunction sci_remote_node_table_clear_groupfunction sci_remote_node_table_set_groupfunction sci_remote_node_table_get_group_valuefunction sci_remote_node_table_initializefunction sci_remote_node_table_allocate_single_remote_nodefunction sci_remote_node_table_allocate_triple_remote_nodefunction sci_remote_node_table_allocate_remote_nodefunction sci_remote_node_table_release_single_remote_nodefunction sci_remote_node_table_release_triple_remote_nodefunction sci_remote_node_table_release_remote_node_index
Annotated Snippet
if (group_table[dword_index] != 0) {
for (bit_index = 0; bit_index < 32; bit_index++) {
if ((group_table[dword_index] & (1 << bit_index)) != 0) {
return (dword_index * 32) + bit_index;
}
}
}
}
return SCIC_SDS_REMOTE_NODE_TABLE_INVALID_INDEX;
}
/**
* sci_remote_node_table_clear_group_index()
* @remote_node_table: This the remote node table in which to clear the
* selector.
* @group_table_index: This is the remote node selector in which the change will be
* made.
* @group_index: This is the bit index in the table to be modified.
*
* This method will clear the group index entry in the specified group index
* table. none
*/
static void sci_remote_node_table_clear_group_index(
struct sci_remote_node_table *remote_node_table,
u32 group_table_index,
u32 group_index)
{
u32 dword_index;
u32 bit_index;
u32 *group_table;
BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
dword_index = group_index / 32;
bit_index = group_index % 32;
group_table = remote_node_table->remote_node_groups[group_table_index];
group_table[dword_index] = group_table[dword_index] & ~(1 << bit_index);
}
/**
* sci_remote_node_table_set_group_index()
* @remote_node_table: This the remote node table in which to set the
* selector.
* @group_table_index: This is the remote node selector in which the change
* will be made.
* @group_index: This is the bit position in the table to be modified.
*
* This method will set the group index bit entry in the specified gropu index
* table. none
*/
static void sci_remote_node_table_set_group_index(
struct sci_remote_node_table *remote_node_table,
u32 group_table_index,
u32 group_index)
{
u32 dword_index;
u32 bit_index;
u32 *group_table;
BUG_ON(group_table_index >= SCU_STP_REMOTE_NODE_COUNT);
BUG_ON(group_index >= (u32)(remote_node_table->group_array_size * 32));
dword_index = group_index / 32;
bit_index = group_index % 32;
group_table = remote_node_table->remote_node_groups[group_table_index];
group_table[dword_index] = group_table[dword_index] | (1 << bit_index);
}
/**
* sci_remote_node_table_set_node_index()
* @remote_node_table: This is the remote node table in which to modify
* the remote node availability.
* @remote_node_index: This is the remote node index that is being returned to
* the table.
*
* This method will set the remote to available in the remote node allocation
* table. none
*/
static void sci_remote_node_table_set_node_index(
struct sci_remote_node_table *remote_node_table,
u32 remote_node_index)
{
u32 dword_location;
u32 dword_remainder;
u32 slot_normalized;
u32 slot_position;
Annotation
- Immediate include surface: `remote_node_table.h`, `remote_node_context.h`.
- Detected declarations: `function sci_remote_node_table_get_group_index`, `function sci_remote_node_table_clear_group_index`, `function sci_remote_node_table_set_group_index`, `function sci_remote_node_table_set_node_index`, `function sci_remote_node_table_clear_node_index`, `function sci_remote_node_table_clear_group`, `function sci_remote_node_table_set_group`, `function sci_remote_node_table_get_group_value`, `function sci_remote_node_table_initialize`, `function sci_remote_node_table_allocate_single_remote_node`.
- Atlas domain: Driver Families / drivers/scsi.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.