SVR5
drv_open(D3)
drv_open --
obtain a channel handle for subsequent access by layered driver
Synopsis
#include <sys/types.h>
#include <sys/ddi.h>
int drv_open(rm_key_t key, channel_t channelp,
int oflags, struct cred_t *crp,
chan_handle_t* *chan_handle_p);
Description
drv_open( )
obtains a channel handle that a layered driver can use
to access this driver's entry points.
The layered driver can use this handle as an argument to the
do_biostart(D3),
do_devinfo(D3),
do_ioctl(D3),
and
drv_close(D3)
functions.
Arguments
key-
Resource manager key for the driver
channelp-
Channel number used to select subcomponents
and/or operating modes of this device instance.
This value is passed to the
open(D2)
entry point routine.
oflags-
Flags to pass to the
open( )
entry point routine.
See the
open(D2)
manual page for a list of valid values.
crp-
Pointer to the user credential structure.
This value is passed to the
open(D2)
entry point routine.
chan_handle_p-
Will be updated to the actual channel number
that will be used by other functions
if the underlying device uses device indirection.
Return values
The
drv_open( )
function returns 0 for success, or the
appropriate non-zero error number from
errnos(D5).
Usage
Each
drv_open( )
call must be matched by a corresponding
drv_close(D3)
call, although the target driver only receives
one
close(D2)
call per channel,
called when the last outstanding
drv_open( )
call has been ended with a call to
drv_close( ).
Context and synchronization
User or blockable
context.
Hardware applicability
All
Version applicability
ddi:
8, 8mp
References
do_biostart(D3),
do_devinfo(D3),
do_ioctl(D3),
drv_attach(D3),
drv_close(D3)
``Layered device drivers'' in HDK Technical Reference
19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005