sdio_readw(9)
π sdio_readw β bestie edition π
okay so real talk, this one lives in the Kernel API Manual and it's literally just "read a 16 bit integer from a SDIO function" and honestly? iconic. tiny little function, does exactly one thing, slays. π
β¨ SYNOPSIS β¨
u16 sdio_readw (struct sdio_func *func , unsigned int addr , int
*err_ret );
like, that's the whole vibe. three args, one u16 coming back at you. π
πΈ ARGUMENTS πΈ
funcβ the SDIO function you wanna access. your main character. the one you're talking to. π«Άaddrβ the address you're reading from. yes bestie, this exact one, no cap. πerr_retβ optional status value from the transfer. it's optional so like, you can passNULL, but then you're reading on hard mode ngl. π
π¦ DESCRIPTION π¦
So the way this works: sdio_readw reads a 16 bit integer out of the address space of a given SDIO function. that's it, that's the whole job, and it eats every time. β¨
BUT β and this is the important part, listen to me β if there's a problem reading the address, it returns 0xffff and err_ret will contain the error code. so like, if you get 0xffff back, don't just assume the hardware said 0xffff?? check err_ret first, fr fr. that's your vibe check. ππ
ngl this is the kind of thing that bites you at 3am.0xffffis both a valid-looking number AND the error sentinel, so please please please actually readerr_ret. π§
π SEE ALSO π
Kernel file ./drivers/mmc/core/sdio_io.c β go read the source, it's giving open book exam. π
sdio_claim_host(9)sdio_release_host(9)sdio_enable_func(9)sdio_disable_func(9)sdio_set_block_size(9)sdio_align_size(9)sdio_readb(9)sdio_writeb(9)sdio_writeb_readb(9)sdio_memcpy_fromio(9)sdio_memcpy_toio(9)sdio_readsb(9)sdio_writesb(9)sdio_writew(9)sdio_readl(9)sdio_writel(9)sdio_f0_readb(9)sdio_f0_writeb(9)sdio_get_host_pm_caps(9)sdio_set_host_pm_flags(9)sdio_retune_crc_disable(9)sdio_retune_crc_enable(9)sdio_retune_hold_now(9)sdio_retune_release(9)
like yes that's a lot of besties but they're all in the same friend group, iykyk. π
mwah π this page lives in ./drivers/mmc/core and it's dated October 2026 β that's the source, the version, and the whole entire footer, periodt. go read your 16 bits 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