DEVICE_ATTACH(9)
π 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 π¦
devfs(4)bus_attach_children(9)device(9)DEVICE_DETACH(9)DEVICE_IDENTIFY(9)DEVICE_PROBE(9)DEVICE_SHUTDOWN(9)
π 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
- freebsd 15.1: base 15.1
- nixpkgs unstable: source
- Copyright (c) 1998 Doug Rabson
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms