 |
Index for Section 9 |
|
 |
Alphabetical listing for D |
|
 |
Bottom of page |
|
dsent(9s)
NAME
dsent - General: Defines a device driver's entry points and other
information
SYNOPSIS
struct dsent
{
int (*d_open)();
int (*d_close)();
int (*d_strategy)();
int (*d_read)();
int (*d_write)();
int (*d_ioctl)();
int (*d_dump)();
int (*d_psize)();
int (*d_stop)();
int (*d_reset)();
int (*d_select)();
int (*d_mmap)();
int (*d_segmap)();
struct tty *d_ttys;
int d_funnel;
int d_bflags;
int d_cflags;
};
MEMBERS
d_open
Specifies a pointer to an entry point for the block and character
driver's open interface, which opens a device.
d_close
Specifies a pointer to an entry point for the block and character
driver's close interface, which closes a device.
d_strategy
Specifies a pointer to an entry point for the block driver's strategy
interface, which reads and writes block data.
d_read
Specifies a pointer to an entry point for the character driver's read
interface, which reads characters or raw data.
d_write
Specifies a pointer to an entry point for the character driver's write
interface, which writes characters or raw data.
d_ioctl
Specifies a pointer to an entry point for the block and character
driver's ioctl interface, which performs special functions or I/O
control.
d_dump
Specifies a pointer to an entry point for a block driver's dump
interface, which is used for panic dumps of the system image.
d_psize
Specifies a pointer to an entry point for the block driver's psize
interface, which returns the size in physical blocks of a device (disk
partition).
d_stop
Specifies a pointer to an entry point for the driver's stop interface,
which suspends other processing on behalf of the current process. You
typically use the d_stop member only for terminal (character) drivers.
d_reset
Specifies a pointer to an entry point for the character driver's reset
interface, which stops all current work and places the device connected
to the controller in a known, quiescent state.
d_select
Specifies a pointer to an entry point for the character driver's select
interface, which determines if a call to a read or write interface will
block.
d_mmap
Specifies a pointer to an entry point for the character driver's mmap
interface, which maps kernel memory to user address space.
d_segmap
Specifies the character driver's segmap entry point.
d_ttys
Specifies a pointer to the character driver's private data.
d_funnel
Schedules block and character device drivers onto a CPU in a
multiprocessor configuration. You can pass the constants DEV_FUNNEL
(funnel the device) or DEV_FUNNEL_NULL (do not funnel the device). See
the DESCRIPTION section for more information on these constants.
d_bflags
Specifies a block driver's device-related and other flags. You set
this member to the bitwise inclusive OR of the device-related and other
flags. One example of a device-related flag is B_TAPE. This flag is
set in the b_flags member of the buf structure. The B_TAPE flag
determines whether to use delayed writes, which are not allowed for
tape devices. For all other drivers, this member is set to the value 0
(zero). Another flag specifies whether this character driver is an SVR4
DDI/DKI-compliant device driver. You set this member to the B_DDIDKI
flag to indicate that this is an SVR4 DDI/DKI-compliant device driver.
d_cflags
Specifies whether this character driver is an SVR4 DDI/DKI-compliant
device driver. Set this member to the C_DDIDKI constant to indicate
that this is an SVR4 DDI/DKI-compliant device driver.
DESCRIPTION
The dsent data structure contains pointers to entry points for a specific
driver's I/O services interfaces and other information. The system
maintains a table (array) of these dsent data structures (referred to as
the device switch table) that contains pointers to entry points for the
associated driver's I/O services interfaces for each block and character
mode device that the system supports. In addition, the table can contain
stubs for device driver entry points for block and character mode devices
that do not exist or entry points not used by a device driver.
Both block and character device special files can access the same device
driver entry. If the device driver does not support access by both block
and character device special files, then the driver must perform the
appropriate check in its open interface and return an error for the devices
it does not support.
The d_funnel member takes one of the following constants:
DEV_FUNNEL
Specifies that you want to funnel the device driver because you
have not made it SMP safe. This means that the driver is forced to
execute on a single (the master) CPU.
Even if you funnel your device driver, you must follow the SMP
locking conventions when accessing kernel data structures external
to the driver. Typically, you use kernel interfaces that
Compaqsupplies to indirectly access kernel data structures outside
the driver.
DEV_FUNNEL_NULL
Specifies that you do not want to funnel the device driver because
you have made it SMP safe. This means that the driver can execute
on multiple CPUs. You make a device driver SMP safe by using the
simple or complex lock mechanism.
FILES
<sys/conf.h>
SEE ALSO
Kernel Interfaces: devsw_add(9r), devsw_del(9r), devsw_get(9r)
 |
Index for Section 9 |
|
 |
Alphabetical listing for D |
|
 |
Top of page |
|