Rewrite of the CAM error recovery code.
commitb05e84c9a475726405321ab008aa9bf128308d44
authorPeter Avalos <pavalos@dragonflybsd.org>
Sun, 18 Nov 2007 17:53:02 +0000 (18 17:53 +0000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sun, 18 Nov 2007 17:53:02 +0000 (18 17:53 +0000)
tree07608ab4e1ebc28d06f24d2afe678a5bf23117d7
parentdf279962c8b6f7d297a002639532eda744e9e3fc
Rewrite of the CAM error recovery code.

Some of the major changes include:

- The SCSI error handling portion of cam_periph_error() has
  been broken out into a number of subfunctions to better
  modularize the code that handles the hierarchy of SCSI errors.
  As a result, the code is now much easier to read.

- String handling and error printing has been significantly
  revamped.  We now use sbufs to do string formatting instead
  of using printfs (for the kernel) and snprintf/strncat (for
  userland) as before.

  There is a new catchall error printing routine,
  cam_error_print() and its string-based counterpart,
  cam_error_string() that allow the kernel and userland
  applications to pass in a CCB and have errors printed out
  properly, whether or not they're SCSI errors.  Among other
  things, this helped eliminate a fair amount of duplicate code
  in camcontrol.

  We now print out more information than before, including
  the CAM status and SCSI status and the error recovery action
  taken to remedy the problem.

Obtained-from: FreeBSD
26 files changed:
Makefile.inc1
lib/libcam/Makefile
sbin/camcontrol/Makefile
sbin/camcontrol/camcontrol.c
share/mk/bsd.libnames.mk
sys/bus/cam/cam.c
sys/bus/cam/cam.h
sys/bus/cam/cam_ccb.h
sys/bus/cam/cam_debug.h
sys/bus/cam/cam_periph.c
sys/bus/cam/cam_xpt.c
sys/bus/cam/cam_xpt.h
sys/bus/cam/scsi/scsi_all.c
sys/bus/cam/scsi/scsi_all.h
sys/bus/cam/scsi/scsi_cd.c
sys/bus/cam/scsi/scsi_ch.c
sys/bus/cam/scsi/scsi_da.c
sys/bus/cam/scsi/scsi_pass.c
sys/bus/cam/scsi/scsi_pass.h
sys/bus/cam/scsi/scsi_pt.c
sys/bus/cam/scsi/scsi_sa.c
sys/bus/cam/scsi/scsi_ses.c
sys/conf/files
sys/libkern/bsearch.c [new file with mode: 0644]
sys/sys/libkern.h
usr.bin/kdump/mkioctls