The following represents an update to the case for blkdev.  The blkdev
framework has not delivered anything yet, and so I'm sending this as an 
update
to the existing and previously approved case.  If anyone feels this warrants
promotion to a fast track of its own, please let me know asap.    I won't
integrate anything until after Wednesday, to give any one who wants to 
engage
in further discussion (or request such a promotion) a chance to do so.

The justification for these changes comes about as a result of feedback
from external consumers who are looking at this driver and framework for
future use, and need it extended to support some additional functionality
for write cache management and device ids.

1) The d_wwn field is removed from struct bd_drive.  Instead, the client
    drivers will supply an optional entry point, xx_devid_init(), which
    has the following prototype:

     int xx_devid_init(dev_info_t *dip, void *arg, ddi_devid_t *devid);

    The blkdev target will call this entry point (if defined) to establish
    a device id (see ddi_devid_init(9f)) for the target.     This is more
    flexible than a simple WWN, since it will allow other types of device
    ids besides WWNs to be used.     (For example, an ATA workalike 
driver could
    use DEVID_ATA_SERIAL.)   The dip is the target device's dev_info_t
    which was created by the framework, and the "arg" field is client
    driver's private state structure, and the devid is a pointer to receive
    the created ddi_devid_t.  Generally, both the dip and the devid pointer
    will be passed directly to ddi_devid_init(9f) and not used for anything
    else.

    This function returns the return code from ddi_devid_init(9F).

    This function is always called in kernel context as part of attach(9E)
    processing.
2) A new entry point for write cache management is provided, which has the
    following form:

         int xx_wcache_ctl(void *a, int op);

     op is one of:

     BD_WCACHE_SYNC    - flush any write cache out to disk
     BD_WCACHE_EN    - enable the write cache
     BD_WCACHE_DIS    - disable the write cache

     returned value is either 0 for success, or an errno.  This function is
     always called in kernel or user context.

     At this time we are not distinguishing between volatile and 
non-volatile
     write caches.

3) The bd_ops structure changes to accommodate the new entry points:


struct bd_ops {
     int    o_version;
     void    (*o_drive_info)(void *, bd_drive_t *);
     int    (*o_media_info)(void *, bd_media_t *);
     int    (*o_devid_init)(void *, dev_info_t *, ddi_devid_t *);
     int    (*o_wcache_ctl)(void *, int);
     int    (*o_read)(void *, bd_xfer_t *);
     int    (*o_write)(void *, bd_xfer_t *);
     int    (*o_dump)(void *, bd_xfer_t *);
};


Note that these interfaces will remain Consolidation Private.

Reply via email to