DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

bcb(D4)


bcb -- breakup control block structure

Syntax

   #include <sys/types.h>
   #include <sys/buf.h>
   #include <sys/ddi.h>
   

typedef bcb_t;

Description

The bcb structure is passed to buf_breakup(D3) to indicate desired breakup properties.

Usage

The bcb structure is prepared with the bcb_prep(D3) function, allocated by the bcb_alloc(D3) routine, and freed with the bcb_free(D3) routine.

Structure definitions

The bcb structure is defined as type bcb_t and contains the following members:
   uchar_t   bcb_addrtypes;     /* type(s) of addresses accepted */
   uchar_t   bcb_flags;         /* misc flags */
   size_t    bcb_max_xfer;      /* maximum transfer length; total */
                                /* xfer if not BA_SCGTH, else per */
                                /* ba_scgth_t entry */
   size_t    bcb_granularity;   /* minimum acceptable offset/size */
                                /* unit (sector size, for disks) */
   physreq_t *bcb_physreqp;     /* physical alignment requirements */


bcb_addrtypes
specifies the types of addresses accepted. It should be the sum of one or more address types, as listed for b_addrtype in buf(D4). The valid values for DDI 8 drivers are:

BA_KVIRT
contiguous kernel virtual

BA_SCGTH
physical scatter/gather list

BA_UIO
use uio(D4) structure

BA_SCGTH may not be used with BA_KVIRT.

Drivers that support only character access (in other words, no buffer cache use) set the BA_UIO flag only for a bcb that is used for data transfers within the operating system. Drivers that support I/O operations that use the buffer cache must set both BA_UIO and BA_KVIRT in addrtypes for such data transfers. Drivers that set multiple addrtypes must be able to distinguish one from the other and be coded to use the buffers appropriately.


bcb_flags
include the following:

BCB_ONE_PIECE
Whole job must be done in one piece; fail if not possible.

BCB_EXACT_SIZE
Fail jobs with unaligned offsets or sizes.

BCB_SYNCHRONOUS
Do not send multiple simultaneous jobs; also fail any B_ASYNC jobs.

bcb_max_xfer
maximum transfer length; for BA_SCGTH and BA_SCGTH64, this is the maximum length of all scatter/gather elements combined. bcb_max_xfer may be zero, meaning unlimited; otherwise, it must be a multiple of the bcb_granularity value.

bcb_granularity
defines the minimum acceptable offset or size of a transfer. In disks, for example, this corresponds to sector size. bcb_granularity does not need to be a power of 2, but it must not be zero.

bcb_physreqp
pointer to a physreq(D4) structure that defines the physical alignment requirements. The driver must call the physreq_alloc(D3) function to allocate the physreq structure before populating it. The bcb_prep(D3) call that ``preps'' the bcb structure will also prep the physreq structure, although a separate call to the physreq_prep(D3) function is legal.

Applicable hardware

All

Version applicability

ddi: 5, 5mp, 6, 6mp, 7, 7mp, 7.1, 7.1mp, 8, 8mp

Differences between versions

The following bcb_flag is supported only in DDI versions before version 8.


BCB_PHYSCONTIG
Requires physically contiguous buffers (if not BA_SCGTH). Drivers should use the PREQ_PHYSCONTIG flag in the bcb_physreq member in preference to BCB_PHYSCONTIG.

The following values are accepted for the b_addrtypes member in pre-DDI 8 drivers:


BA_PAGELIST
list of physical pages

BA_UVIRT
contiguous user virtual

BA_KVIRT
contiguous kernel virtual

BA_KVIRT is the only b_addrtypes specification that can be used for both DDI 8 and pre-DDI 8 drivers.

Earlier releases erroneously stated that thebcb_max_xfer member determined the maximum transfer length of each piece for scatter/gather operations.

Earlier releases documented a BA_PHYS value for the bcb_addrtypes member. This was never correctly implemented and should not be used.

References

bcb_alloc(D3), bcb_free(D3), bcb_prep(D3), buf_breakup(D3), physreq(D4)

``Buffered I/O buffers, allocating'' in HDK Technical Reference
``DMA up to 64 bits (DDI only)'' in HDK Technical Reference
``Extended SCSI addressing scheme'' in HDK Technical Reference
``Memory allocation'' in HDK Technical Reference
``Scatter/gather operations'' in HDK Technical Reference


19 June 2005
© 2005 The SCO Group, Inc. All rights reserved.
OpenServer 6 and UnixWare (SVR5) HDK - June 2005