Print this page
12061 Convert cb_ops(9S) to mandoc
*** 1,64 ****
CB_OPS(9S) Data Structures for Drivers CB_OPS(9S)
-
-
NAME
cb_ops - character/block entry points structure
SYNOPSIS
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
-
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)
DESCRIPTION
The cb_ops structure contains all entry points for drivers that support
both character and block entry points. All leaf device drivers that
support direct user process access to a device should declare a cb_ops
structure.
- All drivers that safely allow multiple threads of execution in the
- driver at the same time must set the D_MP flag in the cb_flag field.
- See open(9E).
-
-
If the driver properly handles 64-bit offsets, it should also set the
D_64BIT flag in the cb_flag field. This specifies that the driver will
use the uio_loffset field of the uio(9S) structure.
-
If the driver returns EINTR from open(9E), it should also set the
D_OPEN_RETURNS_EINTR flag in the cb_flag field. This lets the framework
know that it is safe for the driver to return EINTR when waiting, to
! provide exclusion for a last-reference close(9E) call to complete
! before calling open(9E).
- The mt-streams(9F) function describes other flags that can be set in
- the cb_flag field.
-
-
The cb_rev is the cb_ops structure revision number. This field must be
set to CB_REV.
-
Non-STREAMS drivers should set cb_str to NULL.
-
The following DDI/DKI or DKI-only or DDI-only functions are provided in
the character/block driver operations structure.
-
-
-
block/char Function Description
- ----------------------------------------
b/c XXopen DDI/DKI
b/c XXclose DDI/DKI
b XXstrategy DDI/DKI
b XXprint DDI/DKI
b XXdump DDI(Sun)
--- 1,50 ----
CB_OPS(9S) Data Structures for Drivers CB_OPS(9S)
NAME
cb_ops - character/block entry points structure
SYNOPSIS
#include <sys/conf.h>
#include <sys/ddi.h>
#include <sys/sunddi.h>
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)
DESCRIPTION
The cb_ops structure contains all entry points for drivers that support
both character and block entry points. All leaf device drivers that
support direct user process access to a device should declare a cb_ops
structure.
+ All drivers that safely allow multiple threads of execution in the driver
+ at the same time must set the D_MP flag in the cb_flag field. See
+ open(9E).
If the driver properly handles 64-bit offsets, it should also set the
D_64BIT flag in the cb_flag field. This specifies that the driver will
use the uio_loffset field of the uio(9S) structure.
If the driver returns EINTR from open(9E), it should also set the
D_OPEN_RETURNS_EINTR flag in the cb_flag field. This lets the framework
know that it is safe for the driver to return EINTR when waiting, to
! provide exclusion for a last-reference close(9E) call to complete before
! calling open(9E).
+ The mt-streams(9F) function describes other flags that can be set in the
+ cb_flag field.
The cb_rev is the cb_ops structure revision number. This field must be
set to CB_REV.
Non-STREAMS drivers should set cb_str to NULL.
The following DDI/DKI or DKI-only or DDI-only functions are provided in
the character/block driver operations structure.
block/char Function Description
b/c XXopen DDI/DKI
b/c XXclose DDI/DKI
b XXstrategy DDI/DKI
b XXprint DDI/DKI
b XXdump DDI(Sun)
*** 71,81 ****
c XXchpoll DDI/DKI
c XXprop_op DDI(Sun)
c XXaread DDI(Sun)
c XXawrite DDI(Sun)
-
STRUCTURE MEMBERS
int (*cb_open)(dev_t *devp, int flag, int otyp, cred_t *credp);
int (*cb_close)(dev_t dev, int flag, int otyp, cred_t *credp);
int (*cb_strategy)(struct buf *bp);
int (*cb_print)(dev_t dev, char *str);
--- 57,66 ----
*** 99,119 ****
int cb_flag;
int cb_rev;
int (*cb_aread)(dev_t dev, struct aio_req *aio, cred_t *credp);
int (*cb_awrite)(dev_t dev, struct aio_req *aio, cred_t *credp);
-
SEE ALSO
aread(9E), awrite(9E), chpoll(9E), close(9E), dump(9E), ioctl(9E),
mmap(9E), open(9E), print(9E), prop_op(9E), read(9E), segmap(9E),
strategy(9E), write(9E), nochpoll(9F), nodev(9F), nulldev(9F),
dev_ops(9S), qinit(9S)
! Writing Device Drivers
!
! STREAMS Programming Guide
!
!
!
! April 24, 2008 CB_OPS(9S)
--- 84,99 ----
int cb_flag;
int cb_rev;
int (*cb_aread)(dev_t dev, struct aio_req *aio, cred_t *credp);
int (*cb_awrite)(dev_t dev, struct aio_req *aio, cred_t *credp);
SEE ALSO
aread(9E), awrite(9E), chpoll(9E), close(9E), dump(9E), ioctl(9E),
mmap(9E), open(9E), print(9E), prop_op(9E), read(9E), segmap(9E),
strategy(9E), write(9E), nochpoll(9F), nodev(9F), nulldev(9F),
dev_ops(9S), qinit(9S)
+ Writing Device Drivers.
! STREAMS Programming Guide.
! illumos July 9, 2018 illumos