STRUCT XCAN_PRIV(9)
โจ struct xcan_priv(9) โจ
okay bestie, so this is a Kernel API Manual page for struct xcan_priv โ and like, the whole point of it is that this definition define CAN driver instance ๐
that's the vibe, that's the assignment. It's the little private clubhouse where one Xilinx CAN driver keeps all its stuff. Let's get into it ๐
๐ธ SYNOPSIS ๐ธ
Here's the whole struct, character for character, no cap โ don't touch a single field:
struct xcan_priv {
struct can_priv can;
spinlock_t tx_lock;
unsigned int tx_head;
unsigned int tx_tail;
unsigned int tx_max;
struct napi_struct napi;
u32 (*read_reg)(const struct xcan_priv *priv, enum xcan_reg reg);
void (*write_reg)(const struct xcan_priv *priv, enum xcan_reg reg,
u32 val);
struct device *dev;
void __iomem *reg_base;
unsigned long irq_flags;
struct clk *bus_clk;
struct clk *can_clk;
struct xcan_devtype_data devtype;
struct phy *transceiver;
struct reset_control *rstc;
bool ecc_enable;
struct u64_stats_sync syncp;
u64_stats_t ecc_rx_2_bit_errors;
u64_stats_t ecc_rx_1_bit_errors;
u64_stats_t ecc_txol_2_bit_errors;
u64_stats_t ecc_txol_1_bit_errors;
u64_stats_t ecc_txtl_2_bit_errors;
u64_stats_t ecc_txtl_1_bit_errors;
};
(yeah that u32 val); line is doing its own little thing, we love a quirky wrap ๐)
๐ฆ Members ๐ฆ
okay so member by member, and I'm gonna give you the actual tea for each one:
canโ CAN private data structure. the whole CAN situation lives in here bestie โจtx_lockโ Lock for synchronizing TX interrupt handling ๐tx_headโ Tx CAN packets ready to send on the queue ๐คtx_tailโ Tx CAN packets successfully sended on the queue ๐ฅtx_maxโ Maximum number packets the driver can send ๐ฆnapiโ NAPI structure, iconic as always ๐read_regโ For reading data from CAN registers ๐write_regโ For writing data to CAN registers โ๏ธdevโ Network device data structure ๐ปreg_baseโ Ioremapped address to registers ๐บ๏ธirq_flagsโ Forrequest_irqโกbus_clkโ Pointer tostruct clk๐ฐ๏ธcan_clkโ Pointer tostruct clk๐ฐ๏ธ (yes, another one, she's got two clocks, main character energy)devtypeโ Device type specific constants ๐งฌtransceiverโ Optional pointer to associated CAN transceiver ๐กrstcโ Pointer to reset control ๐ecc_enableโ ECC enable flag ๐ฉsyncpโ synchronization for ECC error stats ๐งฎecc_rx_2_bit_errorsโ RXFIFO 2bit ECC count ๐ecc_rx_1_bit_errorsโ RXFIFO 1bit ECC count ๐ญecc_txol_2_bit_errorsโ TXOLFIFO 2bit ECC count ๐ecc_txol_1_bit_errorsโ TXOLFIFO 1bit ECC count ๐ญecc_txtl_2_bit_errorsโ TXTLFIFO 2bit ECC count ๐ecc_txtl_1_bit_errorsโ TXTLFIFO 1bit ECC count ๐ญ
bestie note: those ECC counters are error counts, so if they're going up... vibe check failed, go look at your hardware ๐ซถ
๐ SEE ALSO ๐
Kernel file ./drivers/net/can/xilinx_can.c โ and like, literally the entire friend group:
xcan_write_reg_le(9)xcan_read_reg_le(9)xcan_write_reg_be(9)xcan_read_reg_be(9)xcan_rx_int_mask(9)set_reset_mode(9)xcan_set_bittiming(9)xcan_chip_start(9)xcan_do_set_mode(9)xcan_write_frame(9)xcan_start_xmit_fifo(9)xcan_start_xmit_mailbox(9)xcan_start_xmit(9)xcan_rx(9)xcanfd_rx(9)xcan_current_error_state(9)xcan_set_error_state(9)xcan_update_error_state_after_rxtx(9)xcan_err_interrupt(9)xcan_state_interrupt(9)xcan_rx_fifo_get_next_frame(9)xcan_rx_poll(9)xcan_tx_interrupt(9)xcan_interrupt(9)xcan_chip_stop(9)xcan_open(9)xcan_close(9)xcan_get_berr_counter(9)xcan_get_auto_tdcv(9)xcan_suspend(9)xcan_resume(9)xcan_runtime_suspend(9)xcan_runtime_resume(9)xcan_probe(9)xcan_remove(9)
anyway that's the whole page, go read the source, ily, bye ๐โจ
signed, sealed, delivered: this came out of./drivers/net/can, dated October 2026, and it's still calledstruct xcan_priv(9). periodt ๐๐ฆ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms