drivers/net/can/spi/mcp251xfd/mcp251xfd.h
Source file repositories/reference/linux-study-clean/drivers/net/can/spi/mcp251xfd/mcp251xfd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/spi/mcp251xfd/mcp251xfd.h- Extension
.h- Size
- 30603 bytes
- Lines
- 985
- 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.
- 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/bitfield.hlinux/can/core.hlinux/can/dev.hlinux/can/rx-offload.hlinux/gpio/consumer.hlinux/gpio/driver.hlinux/kernel.hlinux/netdevice.hlinux/regmap.hlinux/regulator/consumer.hlinux/spi/spi.hlinux/timecounter.hlinux/workqueue.h
Detected Declarations
struct mcp251xfd_hw_tef_objstruct mcp251xfd_hw_tx_obj_canstruct mcp251xfd_hw_tx_obj_canfdstruct mcp251xfd_hw_rx_obj_canstruct mcp251xfd_hw_rx_obj_canfdstruct __packedstruct __packedstruct __packedstruct __packedstruct __packedstruct mcp251xfd_tx_objstruct mcp251xfd_tef_ringstruct mcp251xfd_tx_ringstruct mcp251xfd_rx_ringstruct mcp251xfd_eccstruct mcp251xfd_regs_statusstruct mcp251xfd_devtype_datastruct mcp251xfd_privenum mcp251xfd_modelenum mcp251xfd_flagsfunction mcp251xfd_is_fd_modefunction mcp251xfd_first_byte_setfunction mcp251xfd_last_byte_setfunction mcp251xfd_cmd_resetfunction mcp251xfd_spi_cmd_read_nocrcfunction mcp251xfd_spi_cmd_write_nocrcfunction mcp251xfd_reg_in_ramfunction __mcp251xfd_spi_cmd_crc_set_lenfunction mcp251xfd_spi_cmd_crc_set_len_in_ramfunction mcp251xfd_spi_cmd_crc_set_len_in_regfunction mcp251xfd_spi_cmd_read_crc_set_addrfunction mcp251xfd_spi_cmd_read_crcfunction mcp251xfd_spi_cmd_write_crc_set_addrfunction mcp251xfd_spi_cmd_write_safe_set_addrfunction mcp251xfd_spi_cmd_write_crcfunction mcp251xfd_spi_cmd_writefunction mcp251xfd_get_timestamp_rawfunction mcp251xfd_skb_set_timestampfunction mcp251xfd_skb_set_timestamp_rawfunction mcp251xfd_get_tef_obj_addrfunction mcp251xfd_get_tx_obj_addrfunction mcp251xfd_get_rx_obj_addrfunction mcp251xfd_tx_tail_get_from_chipfunction mcp251xfd_get_tef_headfunction mcp251xfd_get_tef_tailfunction mcp251xfd_get_tef_linear_lenfunction mcp251xfd_get_tx_headfunction mcp251xfd_get_tx_tail
Annotated Snippet
struct mcp251xfd_hw_tef_obj {
u32 id;
u32 flags;
u32 ts;
};
/* The tx_obj_raw version is used in spi async, i.e. without
* regmap. We have to take care of endianness ourselves.
*/
struct __packed mcp251xfd_hw_tx_obj_raw {
__le32 id;
__le32 flags;
u8 data[sizeof_field(struct canfd_frame, data)];
};
struct mcp251xfd_hw_tx_obj_can {
u32 id;
u32 flags;
u8 data[sizeof_field(struct can_frame, data)];
};
struct mcp251xfd_hw_tx_obj_canfd {
u32 id;
u32 flags;
u8 data[sizeof_field(struct canfd_frame, data)];
};
struct mcp251xfd_hw_rx_obj_can {
u32 id;
u32 flags;
u32 ts;
u8 data[sizeof_field(struct can_frame, data)];
};
struct mcp251xfd_hw_rx_obj_canfd {
u32 id;
u32 flags;
u32 ts;
u8 data[sizeof_field(struct canfd_frame, data)];
};
struct __packed mcp251xfd_buf_cmd {
__be16 cmd;
};
struct __packed mcp251xfd_buf_cmd_crc {
__be16 cmd;
u8 len;
};
union mcp251xfd_tx_obj_load_buf {
struct __packed {
struct mcp251xfd_buf_cmd cmd;
struct mcp251xfd_hw_tx_obj_raw hw_tx_obj;
} nocrc;
struct __packed {
struct mcp251xfd_buf_cmd_crc cmd;
struct mcp251xfd_hw_tx_obj_raw hw_tx_obj;
__be16 crc;
} crc;
} ____cacheline_aligned;
union mcp251xfd_write_reg_buf {
struct __packed {
struct mcp251xfd_buf_cmd cmd;
u8 data[4];
} nocrc;
struct __packed {
struct mcp251xfd_buf_cmd_crc cmd;
u8 data[4];
__be16 crc;
} crc;
struct __packed {
struct mcp251xfd_buf_cmd cmd;
u8 data[1];
__be16 crc;
} safe;
} ____cacheline_aligned;
struct mcp251xfd_tx_obj {
struct spi_message msg;
struct spi_transfer xfer[2];
union mcp251xfd_tx_obj_load_buf buf;
};
struct mcp251xfd_tef_ring {
unsigned int head;
unsigned int tail;
/* u8 obj_num equals tx_ring->obj_num */
Annotation
- Immediate include surface: `linux/bitfield.h`, `linux/can/core.h`, `linux/can/dev.h`, `linux/can/rx-offload.h`, `linux/gpio/consumer.h`, `linux/gpio/driver.h`, `linux/kernel.h`, `linux/netdevice.h`.
- Detected declarations: `struct mcp251xfd_hw_tef_obj`, `struct mcp251xfd_hw_tx_obj_can`, `struct mcp251xfd_hw_tx_obj_canfd`, `struct mcp251xfd_hw_rx_obj_can`, `struct mcp251xfd_hw_rx_obj_canfd`, `struct __packed`, `struct __packed`, `struct __packed`, `struct __packed`, `struct __packed`.
- Atlas domain: Driver Families / drivers/net.
- Implementation status: source 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.