dln2_transfer(9)
π dln2_transfer β the Kernel API Manual, bestie edition
okay so we're in the Kernel API Manual today and the function we're stanning is dln2_transfer(9). put your phone down for two seconds, this one's actually cute once you get it. π¦
β¨ NAME β¨
dln2_transfer β issue a DLN2 command and wait for a response π΄β³ and the associated data that comes with it
like, you send the thing, you wait, and then the data shows up. main character behaviour fr fr.
πΈ SYNOPSIS πΈ
int dln2_transfer (struct platform_device *pdev , u16 cmd , const void
*obuf , unsigned obuf_len , void *ibuf , unsigned *ibuf_len );
that's the whole signature, no cap. six arguments. she's a little extra but we love her π
π ARGUMENTS π
ngl the original page literally just says -- undescribed -- for every single one of these π which is so unhelpful of it. but don't panic, bestie β the DESCRIPTION section below actually explains each one, so scroll down like two inches and you're golden:
pdevβ-- undescribed --(spoiler: it's the sub-device, keep reading π)cmdβ-- undescribed --obufβ-- undescribed --obuf_lenβ-- undescribed --ibufβ-- undescribed --ibuf_lenβ-- undescribed --
π DESCRIPTION π
okay here's where it gets good. buckle up π’
pdevβ the sub-device which is issuing this transfer π she's the one doing the sendingcmdβ the command to be sent to the device π¨obufβ the buffer to be sent to the device; it can beNULLif the user doesn't need to transmit data with this command π«Ά so like, no data to send? totally fine, just passNULLobuf_lenβ the size of the buffer to be sent to the device πibufβ any data associated with the response will be copied here; it can beNULLif the user doesn't need the response data π ββοΈ don't care about the answer?NULLit, queenibuf_lenβ must be initialized to the input buffer size; it will be modified to indicate the actual data transferred; β οΈ this is the important one, do not skip it
π¨ listen to me: ibuf_len has to be initialized to the input buffer size before you call this. it doesn't magically know. and after the call it gets modified to tell you the actual data transferred. so it's an in-out situation, iykyk π
and the return vibe check: return 0 for success, negative value for errors β
/ π
β SEE ALSO β
go read these next, they're all part of the same friend group:
- Kernel file
./include/linux/mfd/dln2.hπ dln2_unregister_event_cb(9)dln2_transfer_rx(9)dln2_transfer_tx(9)
and that's the whole page, bestie! β¨ this icon lived at ./include/linux/mfd, dated October 2026 β so if anyone asks, that's the source of truth, mwah ππ
π¦ 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