summaryrefslogtreecommitdiffstats
path: root/lib/libcam
Commit message (Collapse)AuthorAgeFilesLines
* Better memory handling:delphij2005-07-131-4/+7
| | | | | | | | | | | | - It is acceptable to call free(3) when the given pointer itself is NULL, so we do not need to determine NULL before passing a pointer to free(3) - Handle failure of malloc(3) MT6/5 Candidate Submitted by: Dan Lukes <dan at obluda cz> PR: bin/83352
* Expand *n't contractions.ru2005-02-132-9/+9
|
* Change a couple of comments so that GCC doesn't think that they containscottl2004-07-291-3/+3
| | | | tri-graphs.
* Eliminate double whitespace.ru2004-07-031-1/+1
|
* Mechanically kill hard sentence breaks.ru2004-07-022-39/+79
|
* Fixed style of DPADD and LDADD assignments as per style.Makefile(5).ru2004-02-051-2/+2
|
* mdoc(7): Use the new feature of the .In macro.ru2003-09-081-1/+1
|
* Stage 3 of dynamic root support. Make all the libraries needed to rungordon2003-08-171-0/+1
| | | | | | binaries in /bin and /sbin installed in /lib. Only the versioned files reside in /lib, the .so symlink continues to live /usr/lib so the toolchain doesn't need to be modified.
* Remove MAINTAINER= lines in the makefiles for camcontrol, iostat, libcamken2003-06-141-2/+0
| | | | | | | | and libdevstat, since the new way of doing things is to just list maintainership in src/MAINTAINERS. Also, remove duplicate entries in src/MAINTAINERS for those utilities. I already had entries for them.
* english(4) police.schweikh2002-12-271-9/+9
|
* Don't depend on <sys/types.h> pollution in <fcntl.h>.mike2002-09-161-0/+2
|
* string cleanup:ken2002-05-141-14/+12
| | | | | | | | | | | - fix a potential overrun made worse by rev 1.5 of camlib.h - change strncpy() and strcpy() calls to strlcpy() - use sizeof(string[]) instead of STRING_LEN to avoid future problems - get rid of an unused variable Thanks to BDE for pointing out some of the problems. MFC after: 2 weeks
* Do not +1 with MAXPATHLEN.obrien2002-04-231-1/+1
| | | | Reviewed by: imp
* Const'ify the CDB format string passed to the CDB parsing routineskbyanc2001-12-183-43/+62
| | | | | | (csio_decode_visit() and family). Reviewed by: ken
* mdoc(7) police: Use the new .In macro for #include statements.ru2001-10-012-4/+4
|
* Add __FBSDID()s to libcamdillon2001-09-302-3/+7
|
* Mark some functions as __printflike() and/or taking const char * argumentskris2001-08-201-3/+3
| | | | | | instead of char *. MFC after: 2 weeks
* mdoc(7) police: s/BSD/.Bx/ where appropriate.ru2001-08-141-1/+4
|
* mdoc(7) police: join split punctuation to macro calls.ru2001-08-101-4/+4
|
* mdoc(7) police: protect trailing full stops of abbreviationsru2001-08-101-1/+1
| | | | with a trailing zero-width space: `e.g.\&'.
* Remove whitespace at EOL.dd2001-07-152-10/+10
|
* mdoc(7) police: removed HISTORY info from the .Os call.ru2001-07-102-2/+2
|
* mdoc(7) police: remove extraneous .Pp before and/or after .Sh.dd2001-07-091-1/+0
|
* Make sure you don't have a file descriptor leak for the 'real'mjacob2001-07-041-1/+5
| | | | | | | | | | underlying CAM device. This needs to be checked not only in the open routine, but the device->fd has to be initialized as well. PR: 28688 Submitted (partially) by: T. William Wells <bill@twwells.com> MFC after: 2 weeks
* MAN[1-9] -> MAN.ru2001-03-271-1/+1
|
* Rewrite of the CAM error recovery code.ken2001-03-271-34/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Remove the `r' devices.obrien2001-02-271-5/+2
|
* mdoc(7) police: removed history info from the .Os FreeBSD call.ru2000-12-142-2/+2
|
* Use Fx macro wherever possible.ru2000-11-141-3/+6
|
* Fixed typo: .FR -> .Faru2000-11-061-1/+1
|
* This is an overhaul of the mode page handling in camcontrol as well askbyanc2000-08-082-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | related patches. These include: * Mode page editting can be scripted. This involves two things: first, if stdin is not a tty, changes are read from stdin rather than invoking $EDITOR. Second, and more importantly, not all modepage entries must be included in the change set. This means that camcontrol can now gracefully handle more intrusive editting from the $EDITOR, including removal or rearrangement of lines. It also means that you can do stuff like: # echo "WCE: 1" | camcontrol modepage da3 -m 8 -e # newfs /dev/da3 # echo "WCE: 0" | camcontrol modepage da3 -m 8 -e * Range-checking on user-supplied input values. modeedit.c now uses the field width specifiers to determine the maximum allowable value for a field. If the user enters a value larger than the maximum, it clips the value to the max and warns the user. This also involved patching cam_cmdparse.c to be more consistent with regards to the "count" parameter to arg_put (previously is was the length of strings and 1 for all integral types). The cam_cdbparse(3) man page was also updated to reflect the revised semantics. * In the process, I removed the 64 entry limit on mode pages (not that we were even close to hitting that limit). This was a nice side-effect of the other changes. * Technically, the new mode editting functionality allows editting of character array entries in mode pages (type 'c' or 'z'), however since buff_encode doesn't grok them it is currently useless. * Camcontrol gained two new options related to mode pages: -l and -b. The former lists all available mode pages for a given device. The latter forces mode page display in binary format (the default when no mode page definition was found in scsi_modes). * Added support for mode page names to scsi_modes. Allows names to be displayed alongside mode numbers in the mode page listing. Updated scsi_modes to use the new functionality. This also adds the semicolon into the scsi_modes syntax as an optional mode page definition terminator. This is needed to name pages without providing a page format definition. * Updated scsi_all.h to include a structure describing mode page headers. * Added $FreeBSD$ line to scsi_modes. Inspired by: dwhite Reviewed by: ken
* Fix groff confusion for PS output.alex2000-06-201-3/+1
| | | | | PR: 14532 Submitted by: Peter Jeremy <peter.jeremy@alcatel.com.au>
* Implement a new camcontrol function, 'camcontrol format'.ken2000-05-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | libcam/Makefile: Add scsi_da.c to libcam for the new scsi_format_unit() function. camcontrol.8: Update the man page for the new format functionality, and take out the examples section describing how to do it with 'camcontrol cmd'. camcontrol.c: New format functionality. Note that unlike the rest of the camcontrol subcommands, this one is interactive by default. Because of the potential destructiveness of the format command, I thought it necessary to get confirmation from the user before spamming a disk. You can disable the interactive behavior, and the status meter with command line arguments. scsi_da.c: Add the new scsi_format_unit() cdb building function and use #ifdef _KERNEL to make this file compile in both the kernel and userland. The format unit function is currently only defined in the non-kernel case, because nothing in the kernel is using it. If that changes, it should be un-ifdefed and compiled in both cases. scsi_da.h: New function declaration, CDB structure and format data structures. Thanks to Nick Hibma for providing some valuable input on these changes.
* Introduce .Lb macro to libcam manpages.phantom2000-04-222-0/+4
|
* Specify the system directory for which we put in our include pathmjacob2000-01-211-1/+2
| | | | | as a separate line so we can override it on the command line if we need to.
* get pd_type from inquiry data itselfmjacob2000-01-161-1/+1
|
* Replace beforeinstall target with new variables used by .mk system.rgrimes2000-01-141-4/+3
| | | | Reviewed by: marcel, and make world
* Fix a file descriptor leak in cam_open_btl(). The xpt device was opened,ken1999-09-121-1/+5
| | | | | | but never closed. Submitted by: amobbs@allstor-sw.co.uk
* $Id$ -> $FreeBSD$peter1999-08-285-5/+5
|
* Take out a reference to ccb(4). I never got around to writing it.ken1999-08-171-3/+2
| | | | Reported by: "Alexey M. Zelkin" <phantom@cris.net>
* Various man page cleanup:mpp1999-08-151-3/+3
| | | | | | | | | | - Sort xrefs - FreeBSD.ORG -> FreeBSD.org - Be consistent with section names as outlines in mdoc(7) - Other misc mdoc cleanup. PR: doc/13144 Submitted by: Alexy M. Zelkin <phantom@cris.net>
* Add a MAINTAINER line to modules that I maintain.ken1999-06-181-0/+1
| | | | Suggested by: brian, markm
* cam_get_device() was returning 0 on failure, and 1 on success, whilempp1999-06-151-10/+10
| | | | | | | | camcontrol(8) and the documentation in camlib.c and cam(3) all expect -1 on failure and 0 on success. Updated camlib.c to return the values specified by the documentation. PR: 12023
* Fixed missing header in synopsis (<camlib.h> includes half the universebde1999-03-052-2/+4
| | | | but not <stdio.h>).
* Use snprintf to make sure we don't overflow a buffer.ken1998-11-151-4/+5
|
* Fix an error message. (it was using an uninitialized variable)ken1998-11-151-2/+2
| | | | Reported by: dan@math.berkeley.edu (Dan Strick)
* Add man pages for many of the functions in the CAM library. This coversken1998-10-143-33/+983
| | | | | | | | | | | most of the open/close routines, and the buffer/cdb parsing routines derived from the old scsi(3) library. The cam_cdbparse(3) man page borrows from the old scsi(3) man page, so the copyright and history section reflect that. The many scsi_* functions and other functions that are pulled in from the kernel aren't documented yet, but will be eventually.
* Add a "dummy light" (actually two dummy lights) to catch people who don'tken1998-10-121-4/+27
| | | | | | | | | have the passthrough device configured in their kernel. This will hopefully reduce the number of people complaining that they can't get {camcontrol, xmcd, tosha, cdrecord, etc.} to work. Reviewed by: gibbs
* Remove scsi_da.c from the list of things compiled into the CAM library.ken1998-09-181-1/+1
| | | | | | | | | | | | | | The functions that were being compiled into the library have been moved to scsi_all.c. One warning: Any programs using scsi_start_stop() or scsi_read_write() that included scsi_da.h but not scsi_all.h will need to be changed to include scsi_all.h. This doesn't affect camcontrol, and I don't think it affects any ports, but you never know. PR: kern/7969 Reviewed by: gibbs
* Fix some Alpha portability problems, and add some belt-and-suspendersken1998-09-161-9/+44
| | | | | | | checking in some functions. Submitted by: dfr Modified by: ken
OpenPOWER on IntegriCloud