cc_copy_sg_portion(9)
π 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 π¦
- Kernel file
./drivers/crypto/ccree/cc_buffer_mgr.cπ (that's where the lore lives) cc_copy_mac(9)π₯cc_get_sgl_nents(9)β
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
- 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