drivers/net/can/sja1000/sja1000.c
Source file repositories/reference/linux-study-clean/drivers/net/can/sja1000/sja1000.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/sja1000/sja1000.c- Extension
.c- Size
- 18162 bytes
- Lines
- 708
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/module.hlinux/init.hlinux/kernel.hlinux/sched.hlinux/types.hlinux/fcntl.hlinux/interrupt.hlinux/ptrace.hlinux/string.hlinux/errno.hlinux/ethtool.hlinux/netdevice.hlinux/if_arp.hlinux/if_ether.hlinux/skbuff.hlinux/delay.hlinux/can/dev.hlinux/can/error.hsja1000.h
Detected Declarations
function sja1000_write_cmdregfunction sja1000_is_absentfunction sja1000_probe_chipfunction set_reset_modefunction set_normal_modefunction chipset_initfunction sja1000_startfunction sja1000_set_modefunction sja1000_set_bittimingfunction sja1000_get_berr_counterfunction sja1000_start_xmitfunction sja1000_rxfunction sja1000_reset_interruptfunction sja1000_errfunction sja1000_interruptfunction sja1000_openfunction sja1000_closefunction free_sja1000devfunction register_sja1000devfunction unregister_sja1000devexport sja1000_interruptexport alloc_sja1000devexport free_sja1000devexport register_sja1000devexport unregister_sja1000dev
Annotated Snippet
static const struct net_device_ops sja1000_netdev_ops = {
.ndo_open = sja1000_open,
.ndo_stop = sja1000_close,
.ndo_start_xmit = sja1000_start_xmit,
};
static const struct ethtool_ops sja1000_ethtool_ops = {
.get_ts_info = ethtool_op_get_ts_info,
};
int register_sja1000dev(struct net_device *dev)
{
if (!sja1000_probe_chip(dev))
return -ENODEV;
dev->flags |= IFF_ECHO; /* we support local echo */
dev->netdev_ops = &sja1000_netdev_ops;
dev->ethtool_ops = &sja1000_ethtool_ops;
set_reset_mode(dev);
chipset_init(dev);
return register_candev(dev);
}
EXPORT_SYMBOL_GPL(register_sja1000dev);
void unregister_sja1000dev(struct net_device *dev)
{
set_reset_mode(dev);
unregister_candev(dev);
}
EXPORT_SYMBOL_GPL(unregister_sja1000dev);
Annotation
- Immediate include surface: `linux/module.h`, `linux/init.h`, `linux/kernel.h`, `linux/sched.h`, `linux/types.h`, `linux/fcntl.h`, `linux/interrupt.h`, `linux/ptrace.h`.
- Detected declarations: `function sja1000_write_cmdreg`, `function sja1000_is_absent`, `function sja1000_probe_chip`, `function set_reset_mode`, `function set_normal_mode`, `function chipset_init`, `function sja1000_start`, `function sja1000_set_mode`, `function sja1000_set_bittiming`, `function sja1000_get_berr_counter`.
- 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.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.