drivers/net/can/kvaser_pciefd/kvaser_pciefd.h
Source file repositories/reference/linux-study-clean/drivers/net/can/kvaser_pciefd/kvaser_pciefd.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/net/can/kvaser_pciefd/kvaser_pciefd.h- Extension
.h- Size
- 2332 bytes
- Lines
- 97
- 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/can/dev.hlinux/completion.hlinux/pci.hlinux/spinlock.hlinux/timer.hlinux/types.hnet/devlink.h
Detected Declarations
struct kvaser_pciefdstruct kvaser_pciefd_address_offsetstruct kvaser_pciefd_irq_maskstruct kvaser_pciefd_dev_opsstruct kvaser_pciefd_driver_datastruct kvaser_pciefd_fw_versionstruct kvaser_pciefd_canstruct kvaser_pciefd
Annotated Snippet
struct kvaser_pciefd_address_offset {
u32 serdes;
u32 pci_ien;
u32 pci_irq;
u32 sysid;
u32 loopback;
u32 kcan_srb_fifo;
u32 kcan_srb;
u32 kcan_ch0;
u32 kcan_ch1;
};
struct kvaser_pciefd_irq_mask {
u32 kcan_rx0;
u32 kcan_tx[KVASER_PCIEFD_MAX_CAN_CHANNELS];
u32 all;
};
struct kvaser_pciefd_dev_ops {
void (*kvaser_pciefd_write_dma_map)(struct kvaser_pciefd *pcie,
dma_addr_t addr, int index);
};
struct kvaser_pciefd_driver_data {
const struct kvaser_pciefd_address_offset *address_offset;
const struct kvaser_pciefd_irq_mask *irq_mask;
const struct kvaser_pciefd_dev_ops *ops;
};
struct kvaser_pciefd_fw_version {
u8 major;
u8 minor;
u16 build;
};
struct kvaser_pciefd_can {
struct can_priv can;
struct devlink_port devlink_port;
struct kvaser_pciefd *kv_pcie;
void __iomem *reg_base;
struct can_berr_counter bec;
u32 ioc;
u8 cmd_seq;
u8 tx_max_count;
u8 tx_idx;
u8 ack_idx;
int err_rep_cnt;
unsigned int completed_tx_pkts;
unsigned int completed_tx_bytes;
spinlock_t lock; /* Locks sensitive registers (e.g. MODE) */
struct timer_list bec_poll_timer;
struct completion start_comp, flush_comp;
};
struct kvaser_pciefd {
struct pci_dev *pci;
void __iomem *reg_base;
struct kvaser_pciefd_can *can[KVASER_PCIEFD_MAX_CAN_CHANNELS];
const struct kvaser_pciefd_driver_data *driver_data;
void *dma_data[KVASER_PCIEFD_DMA_COUNT];
u8 nr_channels;
u32 bus_freq;
u32 freq;
u32 freq_to_ticks_div;
struct kvaser_pciefd_fw_version fw_version;
};
extern const struct devlink_ops kvaser_pciefd_devlink_ops;
int kvaser_pciefd_devlink_port_register(struct kvaser_pciefd_can *can);
void kvaser_pciefd_devlink_port_unregister(struct kvaser_pciefd_can *can);
#endif /* _KVASER_PCIEFD_H */
Annotation
- Immediate include surface: `linux/can/dev.h`, `linux/completion.h`, `linux/pci.h`, `linux/spinlock.h`, `linux/timer.h`, `linux/types.h`, `net/devlink.h`.
- Detected declarations: `struct kvaser_pciefd`, `struct kvaser_pciefd_address_offset`, `struct kvaser_pciefd_irq_mask`, `struct kvaser_pciefd_dev_ops`, `struct kvaser_pciefd_driver_data`, `struct kvaser_pciefd_fw_version`, `struct kvaser_pciefd_can`, `struct kvaser_pciefd`.
- 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.