DEVCLASS_GET_SOFTC(9)
β¨ DEVCLASS_GET_SOFTC β¨
okay bestie, welcome to section 9 of the kernel dev manual β yes it's the Kernel Developer's Manual, and yes we're about to make unit numbers make sense π
πΈ NAME πΈ
devclass_get_softc β turning a unit number into a driver's private lil structure, no cap
π SYNOPSIS π
#include <sys/param.h>
#include <sys/bus.h>
void *
devclass_get_softc(devclass_t dc, int unit);
π¦ DESCRIPTION π¦
So here's the vibe: this function goes and fetches the driver private instance variables for the device that has the unit number you hand it, and then it gives them right back to you. That's it. That's the whole thing. iconic, honestly.
You pass in the devclass (dc) and the unit number (unit), and out comes the softc. iykyk π«Ά
π RETURN VALUES π
- If the device exists β you get its driver-private variables back. slay.
- If the device doesn't exist β you get
NULL. that's the whole deal. π«
π₯ SEE ALSO π₯
π AUTHORS π
This manual page was written by Doug Rabson. we love a legend π
and that's a wrap, bestie β this page came straight outta the Debian edition of the Kernel Developer's Manual, dated June 16, 1998, filed under DEVCLASS_GET_SOFTC(9). go forth and softc responsibly β¨π
π¦ where this page comes from
- debian bookworm: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- debian trixie: freebsd-manpages 12.2-2 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu jammy: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu noble: freebsd-manpages 12.2-1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu questing: freebsd-manpages 12.2-2
- ubuntu resolute: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- ubuntu stonking: freebsd-manpages 12.2-2build1 Β· BSD-2-Clause-FreeBSD AND BSD-4-Clause
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms