drivers/net/can/cc770/cc770.c
Source file repositories/reference/linux-study-clean/drivers/net/can/cc770/cc770.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/cc770/cc770.c- Extension
.c- Size
- 23166 bytes
- Lines
- 899
- 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.
- 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.hlinux/can/dev.hlinux/can/error.hlinux/can/platform/cc770.hcc770.h
Detected Declarations
function intid2objfunction enable_all_objsfunction disable_all_objsfunction set_reset_modefunction set_normal_modefunction chipset_initfunction cc770_probe_chipfunction cc770_startfunction cc770_set_modefunction cc770_set_bittimingfunction cc770_get_berr_counterfunction cc770_txfunction cc770_start_xmitfunction cc770_rxfunction cc770_errfunction cc770_status_interruptfunction cc770_rx_interruptfunction cc770_rtr_interruptfunction cc770_tx_interruptfunction cc770_interruptfunction cc770_openfunction cc770_closefunction free_cc770devfunction register_cc770devfunction unregister_cc770devfunction cc770_initfunction cc770_exitmodule init cc770_initexport alloc_cc770devexport free_cc770devexport register_cc770devexport unregister_cc770dev
Annotated Snippet
static const struct net_device_ops cc770_netdev_ops = {
.ndo_open = cc770_open,
.ndo_stop = cc770_close,
.ndo_start_xmit = cc770_start_xmit,
};
static const struct ethtool_ops cc770_ethtool_ops = {
.get_ts_info = ethtool_op_get_ts_info,
};
int register_cc770dev(struct net_device *dev)
{
struct cc770_priv *priv = netdev_priv(dev);
int err;
err = cc770_probe_chip(dev);
if (err)
return err;
dev->netdev_ops = &cc770_netdev_ops;
dev->ethtool_ops = &cc770_ethtool_ops;
dev->flags |= IFF_ECHO; /* we support local echo */
/* Should we use additional functions? */
if (!i82527_compat && priv->control_normal_mode & CTRL_EAF) {
priv->can.do_get_berr_counter = cc770_get_berr_counter;
priv->control_normal_mode = CTRL_IE | CTRL_EAF | CTRL_EIE;
netdev_dbg(dev, "i82527 mode with additional functions\n");
} else {
priv->control_normal_mode = CTRL_IE | CTRL_EIE;
netdev_dbg(dev, "strict i82527 compatibility mode\n");
}
chipset_init(priv);
set_reset_mode(dev);
return register_candev(dev);
}
EXPORT_SYMBOL_GPL(register_cc770dev);
void unregister_cc770dev(struct net_device *dev)
{
set_reset_mode(dev);
unregister_candev(dev);
}
EXPORT_SYMBOL_GPL(unregister_cc770dev);
static __init int cc770_init(void)
{
if (msgobj15_eff) {
cc770_obj_flags[CC770_OBJ_RX0] |= CC770_OBJ_FLAG_EFF;
cc770_obj_flags[CC770_OBJ_RX1] &= ~CC770_OBJ_FLAG_EFF;
}
pr_info("CAN netdevice driver\n");
return 0;
}
module_init(cc770_init);
static __exit void cc770_exit(void)
{
pr_info("driver removed\n");
}
module_exit(cc770_exit);
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 intid2obj`, `function enable_all_objs`, `function disable_all_objs`, `function set_reset_mode`, `function set_normal_mode`, `function chipset_init`, `function cc770_probe_chip`, `function cc770_start`, `function cc770_set_mode`, `function cc770_set_bittiming`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: pattern implementation candidate.
- 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.