DEVICE_ATTACH(9)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1, nixpkgs unstable

πŸ’… DEVICE_ATTACH(9) β€” attach a device

okay so this icon is straight out of the Kernel Developer's Manual β€” yes, the kernel-dev manual, we love a technical queen ✨

πŸŽ€ NAME πŸŽ€

DEVICE_ATTACH β€” attach a device

🧚 SYNOPSIS 🧚

#include <sys/param.h>
#include <sys/bus.h>

int
DEVICE_ATTACH(device_t dev);

🌸 DESCRIPTION 🌸

So DEVICE_ATTACH() is the method that attaches a device to the system after DEVICE_PROBE() has been called and has indicated that the device exists. Basically probe says β€œshe’s real” and then attach says β€œsay less, I’ll set her up” πŸ’–

The DEVICE_ATTACH() method should initialize the hardware and allocate other system resources (such as devfs(4) entries). It’s giving hardware setup era, no cap.

Devices which implement buses should use this method to probe for the existence of devices attached to the bus and add them as children. That’s the bus doing a little headcount of its child devices πŸ‘‘

If this is combined with the use of bus_attach_children(9), the child devices will be automatically probed and attached. automatic? we love to see it πŸ”₯

πŸ”₯ RETURN VALUES πŸ”₯

Zero is returned on success, otherwise an appropriate error is returned. So zero = slay, error = read the vibe check and handle it πŸ’…

πŸ¦‹ SEE ALSO πŸ¦‹

πŸ‘‘ AUTHORS πŸ‘‘

This manual page was written by Doug Rabson <dfr@FreeBSD.org>. iconic, honestly 🫢


This page is from the Debian source/version sitch, dated February 5, 2025 β€” mwah πŸ’‹

πŸ“¦ where this page comes from