Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 26 Mar 2001 21:45:53 -0800 (PST)
From:      "Kenneth D. Merry" <ken@FreeBSD.org>
To:        cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org
Subject:   cvs commit: src Makefile.inc1 src/lib Makefile src/lib/libcam Makefile src/lib/libsbuf Makefile src/sbin/camcontrol Makefile camcontrol.c src/share/man/man9 sbuf.9 src/share/mk bsd.libnames.mk src/sys/cam cam.c cam.h cam_ccb.h cam_debug.h ...
Message-ID:  <200103270545.f2R5jrI22896@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help
ken         2001/03/26 21:45:52 PST

  Modified files:
    .                    Makefile.inc1 
    lib                  Makefile 
    lib/libcam           Makefile 
    sbin/camcontrol      Makefile camcontrol.c 
    share/man/man9       sbuf.9 
    share/mk             bsd.libnames.mk 
    sys/cam              cam.c cam.h cam_ccb.h cam_debug.h 
                         cam_periph.c cam_xpt.c cam_xpt.h 
    sys/cam/scsi         scsi_all.c scsi_all.h scsi_cd.c scsi_ch.c 
                         scsi_da.c scsi_pass.c scsi_pass.h 
                         scsi_pt.c scsi_sa.c scsi_ses.c 
    sys/conf             files 
    sys/dev/aic7xxx      aic7xxx_freebsd.h 
    sys/kern             subr_sbuf.c 
    sys/sys              libkern.h sbuf.h 
    usr.bin/kdump        mkioctls 
  Added files:
    lib/libsbuf          Makefile 
    sys/libkern          bsearch.c 
  Log:
  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.
  
  	- sbufs are now available in userland, via libsbuf.  This
  	  change was necessary since most of the error printing code
  	  is shared between libcam and the kernel.
  
  	- A new transfer settings interface is included in this checkin.
  	  This code is #ifdef'ed out, and is primarily intended to aid
  	  discussion with HBA driver authors on the final form the
  	  interface should take.  There is example code in the ahc(4)
  	  driver that implements the HBA driver side of the new
  	  interface.  The new transfer settings code won't be enabled
  	  until we're ready to switch all HBA drivers over to the new
  	  interface.
  
  src/Makefile.inc1,
  lib/Makefile:		Add libsbuf.  It must be built before libcam,
  			since libcam uses sbuf routines.
  
  libcam/Makefile:	libcam now depends on libsbuf.
  
  libsbuf/Makefile:	Add a makefile for libsbuf.  This pulls in the
  			sbuf sources from sys/kern.
  
  bsd.libnames.mk:	Add LIBSBUF.
  
  camcontrol/Makefile:	Add -lsbuf.  Since camcontrol is statically
  			linked, we can't depend on the dynamic linker
  			to pull in libsbuf.
  
  camcontrol.c:		Use cam_error_print() instead of checking for
  			CAM_SCSI_STATUS_ERROR on every failed CCB.
  
  sbuf.9:			Change the prototypes for sbuf_cat() and
  			sbuf_cpy() so that the source string is now a
  			const char *.  This is more in line wth the
  			standard system string functions, and helps
  			eliminate warnings when dealing with a const
  			source buffer.
  
  			Fix a typo.
  
  cam.c:			Add description strings for the various CAM
  			error status values, as well as routines to
  			look up those strings.
  
  			Add new cam_error_string() and
  			cam_error_print() routines for userland and
  			the kernel.
  
  cam.h:			Add a new CAM flag, CAM_RETRY_SELTO.
  
  			Add enumerated types for the various options
  			available with cam_error_print() and
  			cam_error_string().
  
  cam_ccb.h:		Add new transfer negotiation structures/types.
  
  			Change inq_len in the ccb_getdev structure to
  			be "reserved".  This field has never been
  			filled in, and will be removed when we next
  			bump the CAM version.
  
  cam_debug.h:		Fix typo.
  
  cam_periph.c:		Modularize cam_periph_error().  The SCSI error
  			handling part of cam_periph_error() is now
  			in camperiphscsistatuserror() and
  			camperiphscsisenseerror().
  
  			In cam_periph_lock(), increase the reference
  			count on the periph while we wait for our lock
  			attempt to succeed so that the periph won't go
  			away while we're sleeping.
  
  cam_xpt.c:		Add new transfer negotiation code.  (ifdefed
  			out)
  
  			Add a new function, xpt_path_string().  This
  			is a string/sbuf analog to xpt_print_path().
  
  scsi_all.c:		Revamp string handing and error printing code.
  			We now use sbufs for much of the string
  			formatting code.  More of that code is shared
  			between userland the kernel.
  
  scsi_all.h:		Get rid of SS_TURSTART, it wasn't terribly
  			useful in the first place.
  
  			Add a new error action, SS_REQSENSE.  (Send a
  			request sense and then retry the command.)
  			This is useful when the controller hasn't
  			performed autosense for some reason.
  
  			Change the default actions around a bit.
  
  scsi_cd.c,
  scsi_da.c,
  scsi_pt.c,
  scsi_ses.c:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.  Selection
  			timeouts shouldn't be covered by a sense flag.
  
  scsi_pass.[ch]:		SF_RETRY_SELTO -> CAM_RETRY_SELTO.
  
  			Get rid of the last vestiges of a read/write
  			interface.
  
  libkern/bsearch.c,
  sys/libkern.h,
  conf/files:		Add bsearch.c, which is needed for some of the
  			new table lookup routines.
  
  aic7xxx_freebsd.c:	Define AHC_NEW_TRAN_SETTINGS if
  			CAM_NEW_TRAN_CODE is defined.
  
  sbuf.h,
  subr_sbuf.c:		Add the appropriate #ifdefs so sbufs can
  			compile and run in userland.
  
  			Change sbuf_printf() to use vsnprintf()
  			instead of kvprintf(), which is only available
  			in the kernel.
  
  			Change the source string for sbuf_cpy() and
  			sbuf_cat() to be a const char *.
  
  			Add __BEGIN_DECLS and __END_DECLS around
  			function prototypes since they're now exported
  			to userland.
  
  kdump/mkioctls:		Include stdio.h before cam.h since cam.h now
  			includes a function with a FILE * argument.
  
  Submitted by:	gibbs (mostly)
  Reviewed by:	jdp, marcel (libsbuf makefile changes)
  Reviewed by:	des (sbuf changes)
  Reviewed by:	ken
  
  Revision  Changes    Path
  1.196     +5 -3      src/Makefile.inc1
  1.118     +3 -2      src/lib/Makefile
  1.8       +36 -33    src/lib/libcam/Makefile
  1.7       +3 -3      src/sbin/camcontrol/Makefile
  1.34      +86 -112   src/sbin/camcontrol/camcontrol.c
  1.5       +4 -4      src/share/man/man9/sbuf.9
  1.37      +2 -1      src/share/mk/bsd.libnames.mk
  1.4       +245 -1    src/sys/cam/cam.c
  1.8       +56 -4     src/sys/cam/cam.h
  1.20      +109 -12   src/sys/cam/cam_ccb.h
  1.7       +2 -2      src/sys/cam/cam_debug.h
  1.32      +445 -473  src/sys/cam/cam_periph.c
  1.110     +609 -29   src/sys/cam/cam_xpt.c
  1.4       +3 -1      src/sys/cam/cam_xpt.h
  1.21      +835 -999  src/sys/cam/scsi/scsi_all.c
  1.17      +56 -40    src/sys/cam/scsi/scsi_all.h
  1.49      +46 -42    src/sys/cam/scsi/scsi_cd.c
  1.27      +28 -29    src/sys/cam/scsi/scsi_ch.c
  1.67      +62 -57    src/sys/cam/scsi/scsi_da.c
  1.28      +36 -195   src/sys/cam/scsi/scsi_pass.c
  1.4       +5 -1      src/sys/cam/scsi/scsi_pass.h
  1.27      +3 -4      src/sys/cam/scsi/scsi_pt.c
  1.67      +7 -7      src/sys/cam/scsi/scsi_sa.c
  1.18      +4 -3      src/sys/cam/scsi/scsi_ses.c
  1.503     +2 -1      src/sys/conf/files
  1.9       +4 -1      src/sys/dev/aic7xxx/aic7xxx_freebsd.h
  1.5       +37 -20    src/sys/kern/subr_sbuf.c
  1.26      +3 -1      src/sys/sys/libkern.h
  1.3       +5 -3      src/sys/sys/sbuf.h
  1.19      +2 -2      src/usr.bin/kdump/mkioctls


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe cvs-all" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200103270545.f2R5jrI22896>