drivers/net/netdevsim/psp.c
Source file repositories/reference/linux-study-clean/drivers/net/netdevsim/psp.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/netdevsim/psp.c- Extension
.c- Size
- 7060 bytes
- Lines
- 288
- Domain
- Driver Families
- Bucket
- drivers/net
- Inferred role
- Driver Families: operation-table or driver-model contract
- Status
- pattern 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 an operation table; this is where Linux turns generic core objects into subsystem-specific behavior.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/ip.hlinux/skbuff.hnet/ip6_checksum.hnet/psp.hnet/sock.hnetdevsim.h
Detected Declarations
function nsim_psp_handle_extfunction nsim_do_pspfunction nsim_psp_set_configfunction nsim_rx_spi_allocfunction nsim_assoc_addfunction nsim_key_rotatefunction nsim_assoc_delfunction nsim_get_statsfunction __nsim_psp_uninitfunction nsim_psp_uninitfunction nsim_psp_rereg_writefunction nsim_psp_init
Annotated Snippet
static const struct file_operations nsim_psp_rereg_fops = {
.open = simple_open,
.write = nsim_psp_rereg_write,
.llseek = generic_file_llseek,
.owner = THIS_MODULE,
};
int nsim_psp_init(struct netdevsim *ns)
{
struct dentry *ddir = ns->nsim_dev_port->ddir;
struct psp_dev *psd;
psd = psp_dev_create(ns->netdev, &nsim_psp_ops, &nsim_psp_caps, ns);
if (IS_ERR(psd))
return PTR_ERR(psd);
rcu_assign_pointer(ns->psp.dev, psd);
mutex_init(&ns->psp.rereg_lock);
ns->psp.rereg = debugfs_create_file("psp_rereg", 0200, ddir, ns,
&nsim_psp_rereg_fops);
return 0;
}
Annotation
- Immediate include surface: `linux/ip.h`, `linux/skbuff.h`, `net/ip6_checksum.h`, `net/psp.h`, `net/sock.h`, `netdevsim.h`.
- Detected declarations: `function nsim_psp_handle_ext`, `function nsim_do_psp`, `function nsim_psp_set_config`, `function nsim_rx_spi_alloc`, `function nsim_assoc_add`, `function nsim_key_rotate`, `function nsim_assoc_del`, `function nsim_get_stats`, `function __nsim_psp_uninit`, `function nsim_psp_uninit`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern 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.