drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c
Source file repositories/reference/linux-study-clean/drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/ethernet/ti/icssm/icssm_prueth_switch.c- Extension
.c- Size
- 27507 bytes
- Lines
- 1066
- Domain
- Driver Families
- Bucket
- drivers/net
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/etherdevice.hlinux/kernel.hlinux/remoteproc.hnet/switchdev.hicssm_prueth.hicssm_prueth_switch.hicssm_prueth_fdb_tbl.h
Detected Declarations
struct icssm_prueth_sw_fdb_workfunction icssm_prueth_sw_free_fdb_tablefunction icssm_prueth_sw_fdb_tbl_initfunction icssm_pru_lock_donefunction icssm_prueth_sw_fdb_spin_lockfunction icssm_prueth_sw_fdb_spin_unlockfunction icssm_prueth_sw_fdb_hashfunction icssm_prueth_sw_fdb_searchfunction icssm_prueth_sw_fdb_find_open_slotfunction icssm_prueth_sw_find_fdb_insertfunction icssm_prueth_sw_fdb_empty_slot_leftfunction icssm_prueth_sw_fdb_empty_slot_rightfunction icssm_prueth_sw_fdb_move_range_leftfunction icssm_prueth_sw_fdb_move_range_rightfunction icssm_prueth_sw_fdb_update_index_tblfunction icssm_prueth_sw_find_free_macfunction icssm_prueth_sw_insert_fdb_entryfunction icssm_prueth_sw_delete_fdb_entryfunction icssm_prueth_sw_do_purge_fdbfunction icssm_prueth_sw_init_fdb_tablefunction icssm_prueth_sw_fdb_addfunction icssm_prueth_sw_fdb_delfunction icssm_prueth_sw_fdb_workfunction icssm_prueth_sw_learn_fdbfunction icssm_prueth_sw_purge_fdbfunction icssm_prueth_sw_hostconfigfunction icssm_prueth_sw_port_configfunction icssm_prueth_sw_emac_configfunction icssm_prueth_sw_boot_prusfunction icssm_prueth_sw_shutdown_prus
Annotated Snippet
struct icssm_prueth_sw_fdb_work {
netdevice_tracker ndev_tracker;
struct work_struct work;
struct prueth_emac *emac;
u8 addr[ETH_ALEN];
int event;
};
const struct prueth_queue_info sw_queue_infos[][NUM_QUEUES] = {
[PRUETH_PORT_QUEUE_HOST] = {
[PRUETH_QUEUE1] = {
P0_Q1_BUFFER_OFFSET,
P0_QUEUE_DESC_OFFSET,
P0_Q1_BD_OFFSET,
P0_Q1_BD_OFFSET + ((HOST_QUEUE_1_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE2] = {
P0_Q2_BUFFER_OFFSET,
P0_QUEUE_DESC_OFFSET + 8,
P0_Q2_BD_OFFSET,
P0_Q2_BD_OFFSET + ((HOST_QUEUE_2_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE3] = {
P0_Q3_BUFFER_OFFSET,
P0_QUEUE_DESC_OFFSET + 16,
P0_Q3_BD_OFFSET,
P0_Q3_BD_OFFSET + ((HOST_QUEUE_3_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE4] = {
P0_Q4_BUFFER_OFFSET,
P0_QUEUE_DESC_OFFSET + 24,
P0_Q4_BD_OFFSET,
P0_Q4_BD_OFFSET + ((HOST_QUEUE_4_SIZE - 1) * BD_SIZE),
},
},
[PRUETH_PORT_QUEUE_MII0] = {
[PRUETH_QUEUE1] = {
P1_Q1_BUFFER_OFFSET,
P1_Q1_BUFFER_OFFSET +
((QUEUE_1_SIZE - 1) * ICSS_BLOCK_SIZE),
P1_Q1_BD_OFFSET,
P1_Q1_BD_OFFSET + ((QUEUE_1_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE2] = {
P1_Q2_BUFFER_OFFSET,
P1_Q2_BUFFER_OFFSET +
((QUEUE_2_SIZE - 1) * ICSS_BLOCK_SIZE),
P1_Q2_BD_OFFSET,
P1_Q2_BD_OFFSET + ((QUEUE_2_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE3] = {
P1_Q3_BUFFER_OFFSET,
P1_Q3_BUFFER_OFFSET +
((QUEUE_3_SIZE - 1) * ICSS_BLOCK_SIZE),
P1_Q3_BD_OFFSET,
P1_Q3_BD_OFFSET + ((QUEUE_3_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE4] = {
P1_Q4_BUFFER_OFFSET,
P1_Q4_BUFFER_OFFSET +
((QUEUE_4_SIZE - 1) * ICSS_BLOCK_SIZE),
P1_Q4_BD_OFFSET,
P1_Q4_BD_OFFSET + ((QUEUE_4_SIZE - 1) * BD_SIZE),
},
},
[PRUETH_PORT_QUEUE_MII1] = {
[PRUETH_QUEUE1] = {
P2_Q1_BUFFER_OFFSET,
P2_Q1_BUFFER_OFFSET +
((QUEUE_1_SIZE - 1) * ICSS_BLOCK_SIZE),
P2_Q1_BD_OFFSET,
P2_Q1_BD_OFFSET + ((QUEUE_1_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE2] = {
P2_Q2_BUFFER_OFFSET,
P2_Q2_BUFFER_OFFSET +
((QUEUE_2_SIZE - 1) * ICSS_BLOCK_SIZE),
P2_Q2_BD_OFFSET,
P2_Q2_BD_OFFSET + ((QUEUE_2_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE3] = {
P2_Q3_BUFFER_OFFSET,
P2_Q3_BUFFER_OFFSET +
((QUEUE_3_SIZE - 1) * ICSS_BLOCK_SIZE),
P2_Q3_BD_OFFSET,
P2_Q3_BD_OFFSET + ((QUEUE_3_SIZE - 1) * BD_SIZE),
},
[PRUETH_QUEUE4] = {
P2_Q4_BUFFER_OFFSET,
P2_Q4_BUFFER_OFFSET +
Annotation
- Immediate include surface: `linux/etherdevice.h`, `linux/kernel.h`, `linux/remoteproc.h`, `net/switchdev.h`, `icssm_prueth.h`, `icssm_prueth_switch.h`, `icssm_prueth_fdb_tbl.h`.
- Detected declarations: `struct icssm_prueth_sw_fdb_work`, `function icssm_prueth_sw_free_fdb_table`, `function icssm_prueth_sw_fdb_tbl_init`, `function icssm_pru_lock_done`, `function icssm_prueth_sw_fdb_spin_lock`, `function icssm_prueth_sw_fdb_spin_unlock`, `function icssm_prueth_sw_fdb_hash`, `function icssm_prueth_sw_fdb_search`, `function icssm_prueth_sw_fdb_find_open_slot`, `function icssm_prueth_sw_find_fdb_insert`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
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.