cc_copy_sg_portion(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… cc_copy_sg_portion β€” the Kernel API Manual page, bestie edition ✨

okay so picture this: it's a (9) kernel API page, part of the Kernel API Manual, and honestly? it's giving "small function, big responsibilities." we're in the crypto driver neighborhood (./drivers/crypto/ccree, ily) and this lil guy's whole job is shuffling scatter list data around. let's get into it 🫢


🌸 NAME 🌸

cc_copy_sg_portion β€” copy scatter list data, from to_skip to end, to dest and vice versa πŸ’«

like, it literally copies SG data but only the slice you asked for, and it can go both directions. main character energy fr fr.


✨ SYNOPSIS ✨

void cc_copy_sg_portion (struct device *dev , u8 *dest , struct scatterlist *sg , u32 to_skip , u32 end , enum cc_sg_cpy_direct direct );

that's the whole vibe check right there πŸ‘‘ returns void, so no exit-status drama, no "did it work" crumbs β€” it just does the thing.


πŸŽ€ ARGUMENTS πŸŽ€

  • dev β€” the device object πŸ–₯️ like, whose device are we doing this for? this one.
  • dest β€” the buffer to copy to/from 🧺 it's the other end of the transaction, depending on which way you're going.
  • sg β€” the SG list πŸ“‹ the scatter list in question. the source of truth (or the destination, again, depends).
  • to_skip β€” number of bytes to skip before copying πŸ™ˆ we are not starting at zero, bestie. we're starting after this many bytes.
  • end β€” offset of the last byte to copy 🏁 that's your finish line, an offset not a length, iykyk.
  • direct β€” transfer direction πŸ’… true == from SG list to buffer, false == from buffer to SG list. pick a lane, babe.
ngl the whole function hinges on direct β€” get it backwards and you're copying the wrong way. no cap, double-check it. 😭

πŸ¦‹ SEE ALSO πŸ¦‹


and that's the page!! 🌈 source is ./drivers/crypto/ccree, dated October 2026, and the section is cc_copy_sg_portion(9) β€” mwah, slay, go copy some scatter list portions responsibly πŸ’–πŸŽ€πŸ§š

πŸ“¦ where this page comes from