Up to [DragonFly] / src / sys / bus / cam / scsi
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Sync CAM with FreeBSD using lockmgr locks instead of mutexes. Note: This is mostly a code sync with FreeBSD which improves stability in addition to the items listed below. This provides a framework for releasing the mplock, but for now it's still there. Add an xpt_print function to reduce most of the xpt_print_path/printf pairs. Convert the core code to use it. Initial cut at Basic Domain Validation. Make cam_xpt's pronouncements match camcontrol (Tagged -> Command) Queueing. Pay attention to return value from xpt_bus_register in xpt_init. Add an xpt_rescan function and a thread that will field rescan requests. The purpose of this is to allow a SIM (or other entities) to request a bus rescan and have it then fielded in a different (process) context from the caller. Check the return value from cam_periph_acquire. Drop the periph/sim lock when calling disk_destroy(). Drop the topology lock before calling the periph oninvalidate and dtor vectors. For the XPT_SASYNC_CB operation, only decouple the broadcast to the bus and device lists instead of decoupling the whole operation. This avoids problems with SIMs going away. Split the camisr into per-SIM done queues. This optimizes the locking a little bit and allows for direct dispatch of the doneq from certain contexts that would otherwise face recursive locking problems. Zero the CCBs when mallocing them. Only schedule the xpt_finishconfig_task once. Eliminate the use of M_TEMP. Add a helper function for registering async callbacks. Release the bus reference that is acquired when doing a CAMIOCOMMAND ioctl. Zero scsi_readcapacity allocations so we can really tell if there has been data returned. Remove duplicate includes and fix typos. Add a bunch of definitions and structures to support newer drivers. When probing a newly found device, don't automatically assume that the device supports retrieving a serial number. Instead, first query the list of VPD pages it does support, and only query the serial number if it's supported, else silently move on. This eliminates a lot of noise during verbose booting, and will likely eliminate the need for most NOSERIAL quirks. Reduce diffs from FreeBSD. Obtained-from: FreeBSD
Fine-grained malloc statistics - replace some M_DEVBUF with module-specific types. Obtained-from: FreeBSD
Remove unused variable. Obtained-from: FreeBSD
Propagate CAM_DIS_DISCONNECT on through: 1. If we get frozen, unfreeze for disable disconnects. 2. Put CAM_DIS_DISCONNECT commands at the head of the work queue (we have a target still connected and we can't run anything else until this command completes). If we had an error sending the last CTIO, unfreeze the queue anyway. Obtained-from: FreeBSD
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. Obtained-from: FreeBSD
Rename printf -> kprintf in sys/ and add some defines where necessary (files which are used in userland, too).
Rename malloc->kmalloc, free->kfree, and realloc->krealloc. Pass 1
Remove all occurences of double semicolons at the end of a line by single ones. Submitted-by: Bill Marquette <firstname.lastname@example.org>
* Move function types to a separate line. * Ansify function definitions. * Remove (void) casts for discarded return values. In collaboration with: Alexey Slynko <email@example.com>
Remove spl*() calls from the bus/ infrastructure, replacing them with critical sections. Remove splusb() from everywhere, replacing it with critical sections.
Do some M_WAITOK<->M_INTWAIT cleanups. Code entered from userland, such as device open and device ioctl, generally use M_WAITOK, while low level structures such as the capacity structure are allocated using M_INTWAIT.
Change M_NOWAIT to M_INTWAIT or M_WAITOK. CAM does a mediocre job checking for NULL returns from malloc() and even when it does it generally causes the device operation to fail instead of retrying, resulting in unacceptable behavior. M_NOWAIT semantics allow NULL to be returned during normal system operation. This is especially true in DragonFly. Also remove much of the code that previously checked for NULL. By using M_INTWAIT or M_WAITOK, malloc() will panic rather then return NULL. Only the addition of M_NULLOK allows a blocking malloc() to return NULL, and we do not use that flag in CAM. Add M_ZERO to a number of malloc()'s and remove subsequent bzero()'s, and add M_ZERO to a few mallocs (primarily for the read capacity data structure) that did not bother zeroing out the structure before. While the data is supposed to be overwritten read-capacity is often quite fragile due to the SCSI simulation layer, so we do not take any chances.
* Remove instances of PRIBIO because DragonFly no longer uses sleep priorities.
Synchronize the USB, CAM, and TASKQUEUE subsystems with FreeBSD RELENG_4. Also update the $FreeBSD$ ids in the files to the synchronized rev numbers. This has the side effect of bringing in some additional SCSI robustness checks, bug fixes, quirk inheritance between subsystems (e.g. USB now sets PIM_NO_6_BYTE by default and CAM now understands it). This also brings in a huge amount of SCSI CD code that had been MFCd to FreeBSD-4 from FreeBSD-5.
kernel tree reorganization stage 1: Major cvs repository work (not logged as commits) plus a major reworking of the #include's to accomodate the relocations. * CVS repository files manually moved. Old directories left intact and empty (temporary). * Reorganize all filesystems into vfs/, most devices into dev/, sub-divide devices by function. * Begin to move device-specific architecture files to the device subdirs rather then throwing them all into, e.g. i386/include * Reorganize files related to system busses, placing the related code in a new bus/ directory. Also move cam to bus/cam though this may not have been the best idea in retrospect. * Reorganize emulation code and place it in a new emulation/ directory. * Remove the -I- compiler option in order to allow #include file localization, rename all config generated X.h files to use_X.h to clean up the conflicts. * Remove /usr/src/include (or /usr/include) dependancies during the kernel build, beyond what is normally needed to compile helper programs. * Make config create 'machine' softlinks for architecture specific directories outside of the standard <arch>/include. * Bump the config rev. WARNING! after this commit /usr/include and /usr/src/sys/compile/* should be regenerated from scratch.
Consolidate usage of MIN/MAX(). Instead, just remove the conditional processing in sys/param.h so it's available to all files.
Add the DragonFly cvs id and perform general cleanups on cvs/rcs/sccs ids. Most ids have been removed from !lint sections and moved into comment sections.
import from FreeBSD RELENG_4 18.104.22.168