drivers/net/can/rockchip/rockchip_canfd.h
Source file repositories/reference/linux-study-clean/drivers/net/can/rockchip/rockchip_canfd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/rockchip/rockchip_canfd.h- Extension
.h- Size
- 18183 bytes
- Lines
- 554
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/bitfield.hlinux/can/dev.hlinux/can/rx-offload.hlinux/clk.hlinux/io.hlinux/netdevice.hlinux/reset.hlinux/skbuff.hlinux/timecounter.hlinux/types.hlinux/u64_stats_sync.hlinux/units.h
Detected Declarations
struct rkcanfd_devtype_datastruct rkcanfd_fifo_headerstruct rkcanfd_statsstruct rkcanfd_privenum rkcanfd_modelfunction rkcanfd_readfunction rkcanfd_read_repfunction rkcanfd_writefunction rkcanfd_get_timestampfunction rkcanfd_get_tx_headfunction rkcanfd_get_tx_tailfunction rkcanfd_get_tx_pendingfunction rkcanfd_get_tx_free
Annotated Snippet
struct rkcanfd_devtype_data {
enum rkcanfd_model model;
u32 quirks;
};
struct rkcanfd_fifo_header {
u32 frameinfo;
u32 id;
u32 ts;
};
struct rkcanfd_stats {
struct u64_stats_sync syncp;
/* Erratum 5 */
u64_stats_t rx_fifo_empty_errors;
/* Erratum 6 */
u64_stats_t tx_extended_as_standard_errors;
};
struct rkcanfd_priv {
struct can_priv can;
struct can_rx_offload offload;
struct net_device *ndev;
void __iomem *regs;
unsigned int tx_head;
unsigned int tx_tail;
u32 reg_mode_default;
u32 reg_int_mask_default;
struct rkcanfd_devtype_data devtype_data;
struct cyclecounter cc;
struct timecounter tc;
struct delayed_work timestamp;
unsigned long work_delay_jiffies;
struct can_berr_counter bec;
struct rkcanfd_stats stats;
struct reset_control *reset;
struct clk_bulk_data *clks;
int clks_num;
};
static inline u32
rkcanfd_read(const struct rkcanfd_priv *priv, u32 reg)
{
return readl(priv->regs + reg);
}
static inline void
rkcanfd_read_rep(const struct rkcanfd_priv *priv, u32 reg,
void *buf, unsigned int len)
{
readsl(priv->regs + reg, buf, len / sizeof(u32));
}
static inline void
rkcanfd_write(const struct rkcanfd_priv *priv, u32 reg, u32 val)
{
writel(val, priv->regs + reg);
}
static inline u32
rkcanfd_get_timestamp(const struct rkcanfd_priv *priv)
{
return rkcanfd_read(priv, RKCANFD_REG_TIMESTAMP);
}
static inline unsigned int
rkcanfd_get_tx_head(const struct rkcanfd_priv *priv)
{
return READ_ONCE(priv->tx_head) & (RKCANFD_TXFIFO_DEPTH - 1);
}
static inline unsigned int
rkcanfd_get_tx_tail(const struct rkcanfd_priv *priv)
{
return READ_ONCE(priv->tx_tail) & (RKCANFD_TXFIFO_DEPTH - 1);
}
static inline unsigned int
rkcanfd_get_tx_pending(const struct rkcanfd_priv *priv)
{
return READ_ONCE(priv->tx_head) - READ_ONCE(priv->tx_tail);
}
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/can/dev.h`, `linux/can/rx-offload.h`, `linux/clk.h`, `linux/io.h`, `linux/netdevice.h`, `linux/reset.h`, `linux/skbuff.h`.
- Detected declarations: `struct rkcanfd_devtype_data`, `struct rkcanfd_fifo_header`, `struct rkcanfd_stats`, `struct rkcanfd_priv`, `enum rkcanfd_model`, `function rkcanfd_read`, `function rkcanfd_read_rep`, `function rkcanfd_write`, `function rkcanfd_get_timestamp`, `function rkcanfd_get_tx_head`.
- Atlas domain: Driver Families / drivers/net.
- 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.