Interface to Physical Disk Device Drivers

Physical disk device drivers adhere to the criteria that are listed in this section if they are to be accessed by the LVDD.

  • Disk block size must be 512 bytes.
  • The physical disk device driver needs to accept a list of requests defined by buf structures, which are linked together by the av_forw field in each buf structure.
  • For unrecoverable media errors, physical disk device drivers need to set the following:
    • The B_ERROR flag must be set to on (defined in the /usr/include/sys/buf.h file) in the b_flags field.
    • The b_error field must be set to E_MEDIA (defined in the /usr/include/sys/errno.h file).
    • The b_resid field must be set to the number of bytes in the request that were not read or written successfully. The b_resid field is used to determine the block in error.
      Note: For write requests, the LVDD attempts to hardware-relocate the bad block. If this is unsuccessful, then the block is software-relocated. For read requests, the information is recorded and the block is relocated on the next write request to that block.
  • For a successful request that generated an excessive number of retries, the device driver can return good data. To indicate this situation it must set the following:
    • The b_error field is set to ESOFT; this is defined in the /usr/include/sys/errno.h file.
    • The b_flags field has the B_ERROR flag set to on.
    • The b_resid field is set to a count indicating the first block in the request that had excessive retries. This block is then relocated.
  • The physical disk device driver needs to accept a request of one block with HWRELOC (defined in the /usr/include/sys/lvdd.h file) set to on in the b_options field. This indicates that the device driver is to perform a hardware relocation on this request. If the device driver does not support hardware relocation the following should be set:
    • The b_error field is set to EIO; this is defined in the /usr/include/sys/errno.h file.
    • The b_flags field has the B_ERROR flag set on.
    • The b_resid field is set to a count indicating the first block in the request that has excessive retries.
  • The physical disk device driver should support the system dump interface as defined.
  • The physical disk device driver must support write verification on an I/O request. Requests for write verification are made by setting the b_options field to WRITEV. This value is defined in the /usr/include/sys/lvdd.h file.