ctucan_rx(9)
π ctucan_rx β the Kernel API Manual page you didn't know you needed
okay so bestie, welcome to ctucan_rx(9), a real Kernel API Manual situation, and honestly? she's niche but she's iconic. let's get into it β¨
πΈ NAME πΈ
ctucan_rx β okay so this is the function that gets called from the CAN ISR (interrupt service routine) to finish the received-frame processing. she's the closer, the finisher, the one who ties the bow on the rx frame π
β¨ SYNOPSIS β¨
int ctucan_rx (struct net_device *ndev );
that's it. that's the whole vibe. one function, one pointer, no cap π
π¦ ARGUMENTS π¦
ndevβ a pointer to thenet_devicestructure. that's her whole personality, honestly. she takes the net device and she does the thing. π«Ά
π DESCRIPTION π
so here's the tea β: this function gets invoked from the CAN isr (that's the poll, iykyk) to process the Rx frames.
and the way that she's so lowkey about it? she does minimal processing β like, literally the bare minimum, she's not here to overwork herself β and then she invokes netif_receive_skb to handle the rest of the processing. so she hands it off to the network layer and lets them take it from there. delegation queen π
π₯ RETURN π₯
the returns, bestie, let's break them down:
1β the frame got passed along to the network layer. slay! a total win, main character energy π0β the first frame word was read BUT the system is temporally out of free SKBs π so the code is left to resolve the SKB allocation later. not a fail, just a "we'll deal with this in a sec" moment.-EAGAINβ this is the case where the Rx FIFO is just... empty. nothing there. ghost town π
ngl, remember that 0 is not an error β it's a later problem, not a never problem. the code left to resolve the SKB allocation later handles it π
π§ SEE ALSO π§
the whole friend group, the whole squad, the whole kernel file:
- Kernel file
./drivers/net/can/ctucanfd/ctucanfd_base.c ctucan_state_to_str(9)ctucan_reset(9)ctucan_set_btr(9)ctucan_set_bittiming(9)ctucan_set_data_bittiming(9)ctucan_set_secondary_sample_point(9)ctucan_set_mode(9)ctucan_chip_start(9)ctucan_do_set_mode(9)ctucan_get_tx_status(9)ctucan_is_txt_buf_writable(9)ctucan_insert_frame(9)ctucan_give_txtb_cmd(9)ctucan_start_xmit(9)ctucan_read_rx_frame(9)ctucan_read_fault_state(9)ctucan_get_rec_tec(9)ctucan_err_interrupt(9)ctucan_rx_poll(9)ctucan_rotate_txb_prio(9)ctucan_tx_interrupt(9)ctucan_interrupt(9)ctucan_chip_stop(9)ctucan_open(9)ctucan_close(9)ctucan_get_berr_counter(9)
like, that's literally the entire group chat. go read them too, they're all worth it π
and that's the page, bestie!! mwah π this whole thing lives in ./drivers/net/can/ctucanfd, it's dated October 2026, and it's officially known as ctucan_rx(9). catch you in the next manpage β ily, stay hydrated, and may your Rx FIFO never be empty πβ¨
π¦ 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