unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-5.7)
Page:
Section:
Apropos / Subsearch:
optional field

CONFIG_ATTACH(9)         BSD Kernel Developer's Manual        CONFIG_ATTACH(9)

NAME
     config_attach, config_detach, config_detach_children -- attach and detach
     devices

SYNOPSIS
     #include <&lt;sys/param.h>&gt;
     #include <&lt;sys/device.h>&gt;

     struct device *
     config_attach(struct device *parent, void *cf, void *aux,
         cfprint_t print);

     int
     config_detach(struct device *dev, int flags);

     int
     config_detach_children(struct device *parent, int flags);

DESCRIPTION
     The config_attach() function attaches a found device.  Memory is allo-
     cated for the softc structure and the driver's attach function is called
     according to the configuration table.  If successful, config_attach()
     returns the softc.  If unsuccessful, it returns NULL.

     The config_detach() function is called by the parent to detach the child
     device.  The second argument flags contains detachment flags:

     #define DETACH_FORCE    0x01    /* Force detachment; hardware gone */
     #define DETACH_QUIET    0x02    /* Don't print a notice */

CONTEXT
     config_detach() is always called from process context, allowing tsleep(9)
     to be called while the device detaches itself (to deal with processes
     which have a device open).

RETURN VALUES
     config_detach() returns zero if successful and an error code otherwise.

SEE ALSO
     config_found(9)

BSD                            December 5, 2014                            BSD