dln2_transfer(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 sending
  • cmd β€” the command to be sent to the device πŸ“¨
  • obuf β€” the buffer to be sent to the device; it can be NULL if the user doesn't need to transmit data with this command 🫢 so like, no data to send? totally fine, just pass NULL
  • obuf_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 be NULL if the user doesn't need the response data πŸ™…β€β™€οΈ don't care about the answer? NULL it, queen
  • ibuf_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:


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