Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ attach(9E) — SunOS 5.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

identify(9E)

probe(9E)

ddi_add_intr(9F)

ddi_create_minor_node(9F)

ddi_get_instance(9F)

ddi_map_regs(9F)

kmem_alloc(9F)

timeout(9F)

attach(9E)

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)

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. 

INTERFACE LEVEL

SPARC architecture specific (SPARC DDI).  This entry point is Required.  You must write it. 

DESCRIPTION

attach() is the device-specific initialization entry point.  After attach() is called with cmd set to DDI_ATTACH, normal kernel services (such as kmem_alloc(9F) will be available for use to the driver. Typically, though, all device interrupts are blocked at this time, so the driver must complete its initialization without assuming that device interrupts can occur. This would include the system clock, and, therefore, system timer services as described in timeout(9F) cannot be assume to be functioning correctly when this entry point is called. 

attach() should be called once for each instance of the device on the system.  The instance number may be obtained using ddi_get_instance(9F).  Until attach() succeeds no other driver entry points may be called. 

Successful returns from identify(9E) and probe(9E) are required before a call to driver’s attach() entry point can be made.

RETURN VALUES

attach() should return:

DDI_SUCCESS on success. 

DDI_FAILURE on failure. 

SEE ALSO

identify(9E), probe(9E), ddi_add_intr(9F), ddi_create_minor_node(9F), ddi_get_instance(9F), ddi_map_regs(9F), kmem_alloc(9F), timeout(9F)

SunOS 5.1  —  Last change: 11 Apr 1991

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026