genwqe_crc16(9)
β¨ genwqe_crc16(9) β like, the Kernel API Manual page, bestie β¨
Okay so before we even start β this little cutie lives in the Kernel API Manual, section 9, and its whole name is genwqe_crc16. Say it with me: gen-w-q-e c-r-c-sixteen. Iconic. Now let's get into it π
π NAME π
genwqe_crc16 β generates a 16-bit crc, exactly the way the DDCBs need it. That's the whole job. She's a specialist. She's booked and busy. β¨
π¦ SYNOPSIS π¦
u16 genwqe_crc16 (const u8 *buff , size_t len , u16 init );
Look at that signature. Three little arguments, one u16 coming back out. Chef's kiss. π«Ά
πΈ ARGUMENTS πΈ
buffβ pointer to the data buffer, aka where your actual bytes are chilling. She needs the pointer, not a vibe. Give her the pointer. π₯Ίlenβ length of data for calculation. Like, how many bytes are we doing the math on, bestie. Don't make her guess.initβ the initial crc, and heads up:0xffffat start. That's the starting energy. π
π DESCRIPTION π
Okay so the whole personality of this function comes down to one polynomial, and here it is, no cap:
Polynomial = x^16 + x^12 + x^5 + 1 (0x1021)
That's it. That's the tea. π₯
π EXAMPLE π
Picture this: 4 bytes, 0x01 0x02 0x03 0x04, with init = 0xffff. Run her through genwqe_crc16 and the expected result is a crc16 of 0x89c3. Slay. β
π RETURN π
It returns the crc16 checksum in big endian format β and yes that exclamation point is doing a lot of work in the original, so I'm keeping the energy: big endian format! π₯π
π SEE ALSO π
Go look at the kernel file ./drivers/misc/genwqe/card_ddcb.c β it's giving main character energy, fr fr β and then meet the whole friend group:
ddcb_requ_finished(9)enqueue_ddcb(9)copy_ddcb_results(9)genwqe_check_ddcb_queue(9)__genwqe_wait_ddcb(9)get_next_ddcb(9)__genwqe_purge_ddcb(9)__genwqe_enqueue_ddcb(9)__genwqe_execute_raw_ddcb(9)genwqe_next_ddcb_ready(9)genwqe_ddcbs_in_flight(9)genwqe_card_thread(9)genwqe_setup_service_layer(9)queue_wake_up_all(9)genwqe_finish_queue(9)genwqe_release_service_layer(9)
All sixteen of them. Not me counting twice to make sure. π You're welcome, iykyk.
π Real talk though: keep the arguments exactly as written β pointer, length, init crc β and remember the return is big endian. No creative liberties with the actual crc math, bestie. That's how you get cursed builds.
And that's a wrap on genwqe_crc16(9) from the Kernel API Manual β sourced from ./drivers/misc/genwqe, dated October 2026, and filed right back under genwqe_crc16(9). Byeee, go slay those checksums π§π
π¦ 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