[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    attach(9E) manual page Table of Contents

Name

attach - attach a device to the system

Synopsis


#include <sys/conf.h>

#include <sys/ddi.h>

#include <sys/sunddi.h>
int prefixattach(dev_info_t *dip, ddi_attach_cmd_t cmd);

Interface Level

Solaris DDI specific (Solaris DDI). This entry point is required and must be written.

Arguments

dip
A pointer to the device’s dev_info structure.
cmd
Attach type. Should be set to DDI_ATTACH . Other values are reserved. The driver should return DDI_FAILURE if reserved values are passed to it.

Description

attach() is the device-specific initialization entry point. When attach() is called with cmd set to DDI_ATTACH , all normal kernel services (such as kmem_alloc(9F) ) are available for use by the driver. Device interrupts are not blocked when attaching a device to the system.

attach() will be called once for each instance of the device on the system. Until attach() succeeds, the only driver entry points which may be called are open(9E) and getinfo(9E) . See the "Autoconfiguration" chapter in The instance number may be obtained using ddi_get_instance(9F) .

A successful return from probe(9E) is required before a call to the driver’s attach() entry point will be made.

Return Values

attach() must return:
DDI_SUCCESS
on success.
DDI_FAILURE
on failure.

See Also

getinfo(9E) , open(9E) , probe(9E) , ddi_add_intr(9F) , ddi_create_minor_node(9F) , ddi_get_instance(9F) , ddi_map_regs(9F) , kmem_alloc(9F)


Table of Contents