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