#
9c6a0920 |
| 01-May-2001 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix up unit attention and selection timeout handling in various peripheral drivers.
- change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls cam_periph_runccb(). - change the pt(4
Fix up unit attention and selection timeout handling in various peripheral drivers.
- change daprevent() to set CAM_RETRY_SELTO and SF_RETRY_UA when it calls cam_periph_runccb(). - change the pt(4) driver to ignore unit attentions - change the targ(4) driver to retry selection timeouts - clean up a few formatting glitches in the targ(4) driver
Reviewed by: gibbs
show more ...
|
Revision tags: release/4.3.0_cvs, release/4.3.0 |
|
#
3393f8da |
| 27-Mar-2001 |
Kenneth D. Merry <ken@FreeBSD.org> |
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
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
show more ...
|
#
f8388051 |
| 26-Mar-2001 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Send the remains (such as I have located) of "block major numbers" to the bit-bucket.
|
#
0b7c27b9 |
| 07-Feb-2001 |
Peter Wemm <peter@FreeBSD.org> |
Change the peripheral driver list from a linker set to module driven driver registration. This should allow things like da, sa, cd etc to be in seperate KLD's to the cam core and make them preloadab
Change the peripheral driver list from a linker set to module driven driver registration. This should allow things like da, sa, cd etc to be in seperate KLD's to the cam core and make them preloadable.
show more ...
|
#
fc2ffbe6 |
| 04-Feb-2001 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Mechanical change to use <sys/queue.h> macro API instead of fondling implementation details.
Created with: sed(1) Reviewed by: md5(1)
|
Revision tags: release/4.2.0, release/4.1.1_cvs, release/4.1.0, release/3.5.0_cvs |
|
#
e3975643 |
| 26-May-2000 |
Jake Burkholder <jake@FreeBSD.org> |
Back out the previous change to the queue(3) interface. It was not discussed and should probably not happen.
Requested by: msmith and others
|
#
740a1973 |
| 23-May-2000 |
Jake Burkholder <jake@FreeBSD.org> |
Change the way that the queue(3) structures are declared; don't assume that the type argument to *_HEAD and *_ENTRY is a struct.
Suggested by: phk Reviewed by: phk Approved by: mdodd
|
#
9626b608 |
| 05-May-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Separate the struct bio related stuff out of <sys/buf.h> into <sys/bio.h>.
<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on
Separate the struct bio related stuff out of <sys/buf.h> into <sys/bio.h>.
<sys/bio.h> is now a prerequisite for <sys/buf.h> but it shall not be made a nested include according to bdes teachings on the subject of nested includes.
Diskdrivers and similar stuff below specfs::strategy() should no longer need to include <sys/buf.> unless they need caching of data.
Still a few bogus uses of struct buf to track down.
Repocopy by: peter
show more ...
|
#
8177437d |
| 15-Apr-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Complete the bio/buf divorce for all code below devfs::strategy
Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case.
CCD not conve
Complete the bio/buf divorce for all code below devfs::strategy
Exceptions: Vinum untouched. This means that it cannot be compiled. Greg Lehey is on the case.
CCD not converted yet, casts to struct buf (still safe)
atapi-cd casts to struct buf to examine B_PHYS
show more ...
|
#
c244d2de |
| 02-Apr-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(Much of this done by script)
Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.
Move b_pblkno and b_iodone_chain to struct bio while w
Move B_ERROR flag to b_ioflags and call it BIO_ERROR.
(Much of this done by script)
Move B_ORDERED flag to b_ioflags and call it BIO_ORDERED.
Move b_pblkno and b_iodone_chain to struct bio while we transition, they will be obsoleted once bio structs chain/stack.
Add bio_queue field for struct bio aware disksort.
Address a lot of stylistic issues brought up by bde.
show more ...
|
#
21144e3b |
| 20-Mar-2000 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set.
B_WRITE was bogusly defined as zero giving rise t
Remove B_READ, B_WRITE and B_FREEBUF and replace them with a new field in struct buf: b_iocmd. The b_iocmd is enforced to have exactly one bit set.
B_WRITE was bogusly defined as zero giving rise to obvious coding mistakes.
Also eliminate the redundant struct buf flag B_CALL, it can just as efficiently be done by comparing b_iodone to NULL.
Should you get a panic or drop into the debugger, complaining about "b_iocmd", don't continue. It is likely to write on your disk where it should have been reading.
This change is a step in the direction towards a stackable BIO capability.
A lot of this patch were machine generated (Thanks to style(9) compliance!)
Vinum users: Greg has not had time to test this yet, be careful.
show more ...
|
Revision tags: release/4.0.0_cvs |
|
#
10b6172a |
| 17-Jan-2000 |
Matt Jacob <mjacob@FreeBSD.org> |
Do the minor changes needed because of change to ccb_getdev structure. JKH Trading Stamps applied.
Reviewed by: gibbs@freebsd.org, ken@freebsd.org
|
Revision tags: release/3.4.0_cvs |
|
#
73d26919 |
| 17-Nov-1999 |
Kenneth D. Merry <ken@FreeBSD.org> |
Convert the xpt, pass, pt and target drivers to use the new make_dev()/destroy_dev() interface.
|
#
779b1b3d |
| 01-Oct-1999 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Introduce the disk mini-layer and devstat_end_transaction_buf() in cam/scsi.
Somewhat reviewed by: ken
|
#
d6a0e38a |
| 25-Sep-1999 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Remove five now unused fields from struct cdevsw. They should never have been there in the first place. A GENERIC kernel shrinks almost 1k.
Add a slightly different safetybelt under nostop for tty
Remove five now unused fields from struct cdevsw. They should never have been there in the first place. A GENERIC kernel shrinks almost 1k.
Add a slightly different safetybelt under nostop for tty drivers.
Add some missing FreeBSD tags
show more ...
|
Revision tags: release/3.3.0_cvs |
|
#
c3aac50f |
| 28-Aug-1999 |
Peter Wemm <peter@FreeBSD.org> |
$Id$ -> $FreeBSD$
|
#
3ece1bd2 |
| 20-Aug-1999 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix short timeout problems with the pt(4) driver:
- increase the default timeout from 10 seconds to 60 seconds - add a new kernel option, SCSI_PT_DEFAULT_TIMEOUT, that lets users specify the defau
Fix short timeout problems with the pt(4) driver:
- increase the default timeout from 10 seconds to 60 seconds - add a new kernel option, SCSI_PT_DEFAULT_TIMEOUT, that lets users specify the default timeout for the pt driver to use - add two new ioctls, one to get the timeout for a given pt device, the other to set the timeout for a given pt device. The idea is that userland applications using the device can set the timeout to suit their purposes. The ioctls are defined in a new header file, sys/ptio.h
PR: 10266 Reviewed by: gibbs, joerg
show more ...
|
#
b8e49f68 |
| 17-Aug-1999 |
Bill Fumerola <billf@FreeBSD.org> |
Welcome devtoname(), to most likely be used when printing information about a dev_t.
printf("%x", dev) now becomes printf("%s", devtoname(dev)) because printing actual information about the device i
Welcome devtoname(), to most likely be used when printing information about a dev_t.
printf("%x", dev) now becomes printf("%s", devtoname(dev)) because printing actual information about the device is much more useful then printing a pointer to an address that would never help the developer debug.
Submitted by: phk, bde
show more ...
|
#
2447bec8 |
| 31-May-1999 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing.
Simplify cdevsw registration.
The cdevsw_add() function now finds the major number(s) in the struct cdevsw passed to it. cdevsw_add_generic() is no longer needed, cdevsw_add() does the same thing.
cdevsw_add() will print an message if the d_maj field looks bogus.
Remove nblkdev and nchrdev variables. Most places they were used bogusly. Instead check a dev_t for validity by seeing if devsw() or bdevsw() returns NULL.
Move bdevsw() and devsw() functions to kern/kern_conf.c
Bump __FreeBSD_version to 400006
This commit removes: 72 bogus makedev() calls 26 bogus SYSINIT functions
if_xe.c bogusly accessed cdevsw[], author/maintainer please fix.
I4b and vinum not changed. Patches emailed to authors. LINT probably broken until they catch up.
show more ...
|
#
4e2f199e |
| 30-May-1999 |
Poul-Henning Kamp <phk@FreeBSD.org> |
This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".
Initialize the d_maj and d_bmaj fields.
The d_reset field was not removed, a
This commit should be a extensive NO-OP:
Reformat and initialize correctly all "struct cdevsw".
Initialize the d_maj and d_bmaj fields.
The d_reset field was not removed, although it is never used.
I used a program to do most of this, so all the files now use the same consistent format. Please keep it that way.
Vinum and i4b not modified, patches emailed to respective authors.
show more ...
|
Revision tags: release/3.2.0 |
|
#
516871c6 |
| 23-May-1999 |
Justin T. Gibbs <gibbs@FreeBSD.org> |
Add a default async handler funstion to cam_periph.c to remove duplicated code in all initiator type peripheral drivers.
scsi_target.c: Release ATIO structures that wind up in the 'unkown command q
Add a default async handler funstion to cam_periph.c to remove duplicated code in all initiator type peripheral drivers.
scsi_target.c: Release ATIO structures that wind up in the 'unkown command queue' for consumption by our userland counterpart, back to the controller when the exception for that command is cleared.
show more ...
|
#
50711c71 |
| 09-May-1999 |
Kenneth D. Merry <ken@FreeBSD.org> |
Add a facility in the CAM error handling code to retry selection timeouts. If the client requests that the error recovery code retry a selection timeout, it will be retried after half a second. The
Add a facility in the CAM error handling code to retry selection timeouts. If the client requests that the error recovery code retry a selection timeout, it will be retried after half a second. The delay is to give the device time to recover.
For most of these drivers, I only added selection timeout retries where they were also retrying unit attention type errors. The sa(4) driver calls saerror() in a number of places, but most of them don't request retrying unit attentions.
Also, bump the default minimum CD changer timeout from 2 to 5 seconds and the maximum timeout from 10 to 15 seconds. Some Pioneer changers seem to have trouble with the shorter timeout.
Reviewed by: gibbs
show more ...
|
#
c48d1775 |
| 07-May-1999 |
Poul-Henning Kamp <phk@FreeBSD.org> |
Introduce two functions: physread() and physwrite() and use these directly in *devsw[] rather than the 46 local copies of the same functions.
(grog will do the same for vinum when he has time)
|
Revision tags: release/3.1.0 |
|
#
2a888f93 |
| 10-Feb-1999 |
Kenneth D. Merry <ken@FreeBSD.org> |
Add a prioritization field to the devstat_add_entry() call so that peripheral drivers can determine where in the devstat(9) list they are inserted.
This requires recompilation of libdevstat, systat,
Add a prioritization field to the devstat_add_entry() call so that peripheral drivers can determine where in the devstat(9) list they are inserted.
This requires recompilation of libdevstat, systat, vmstat, rpc.rstatd, and any ports that depend on the devstat code, since the size of the devstat structure has changed. The devstat version number has been incremented as well to reflect the change.
This sorts devices in the devstat list in "more interesting" to "less interesting" order. So, for instance, da devices are now more important than floppy drives, and so will appear before floppy drives in the default output from systat, iostat, vmstat, etc.
The order of devices is, for now, kept in a central table in devicestat.h. If individual drivers were able to make a meaningful decision on what priority they should be at attach time, we could consider splitting the priority information out into the various drivers. For now, though, they have no way of knowing that, so it's easier to put them in an easy to find table.
Also, move the checkversion() call in vmstat(8) to a more logical place.
Thanks to Bruce and David O'Brien for suggestions, for reviewing this, and for putting up with the long time it has taken me to commit it. Bruce did object somewhat to the central priority table (he would rather the priorities be distributed in each driver), so his objection is duly noted here.
Reviewed by: bde, obrien
show more ...
|
Revision tags: release/3.0.0, release/2.2.8 |
|
#
22b9c86c |
| 23-Nov-1998 |
Kenneth D. Merry <ken@FreeBSD.org> |
Fix a few problems that Bruce noticed about a month ago, and fix oup one other problem.
- Hold onto splsoftcam() in the peripheral driver open routines until we have locked the periph. This elimi
Fix a few problems that Bruce noticed about a month ago, and fix oup one other problem.
- Hold onto splsoftcam() in the peripheral driver open routines until we have locked the periph. This eliminates a race condition.
- Disallow opening the pass driver when securelevel > 1.
- If a user tries to open the pass driver with O_NONBLOCK set, return EINVAL instead of ENODEV. (noticed by gibbs)
show more ...
|