Commit Graph

166 Commits

Author SHA1 Message Date
Alexander Motin
57ae362c8f When hacking INQUIRY result, make sure that it is right INQUIRY and there
is enough of result to hack.
2010-02-05 12:40:18 +00:00
Alexander Motin
0a65b79f42 Return CAM_RELEASE_SIMQ flag only when it is needed, when SIM really
was frozen before and should be released.
2010-02-04 14:40:08 +00:00
Alexander Motin
83c5d981ac MFp4: Large set of CAM inprovements.
- Unify bus reset/probe sequence. Whenever bus attached at boot or later,
CAM will automatically reset and scan it. It allows to remove duplicate
code from many drivers.
- Any bus, attached before CAM completed it's boot-time initialization,
will equally join to the process, delaying boot if needed.
- New kern.cam.boot_delay loader tunable should help controllers that
are still unable to register their buses in time (such as slow USB/
PCCard/ CardBus devices), by adding one more event to wait on boot.
- To allow synchronization between different CAM levels, concept of
requests priorities was extended. Priorities now split between several
"run levels". Device can be freezed at specified level, allowing higher
priority requests to pass. For example, no payload requests allowed,
until PMP driver enable port. ATA XPT negotiate transfer parameters,
periph driver configure caching and so on.
- Frozen requests are no more counted by request allocation scheduler.
It fixes deadlocks, when frozen low priority payload requests occupying
slots, required by higher levels to manage theit execution.
- Two last changes were holding proper ATA reinitialization and error
recovery implementation. Now it is done: SATA controllers and Port
Multipliers now implement automatic hot-plug and should correctly
recover from timeouts and bus resets.
- Improve SCSI error recovery for devices on buses without automatic sense
reporting, such as ATAPI or USB. For example, it allows CAM to wait, while
CD drive loads disk, instead of immediately return error status.
- Decapitalize diagnostic messages and make them more readable and sensible.
- Teach PMP driver to limit maximum speed on fan-out ports.
- Make boot wait for PMP scan completes, and make rescan more reliable.
- Fix pass driver, to return CCB to user level in case of error.
- Increase number of retries in cd driver, as device may return several UAs.
2010-01-28 08:41:30 +00:00
Gavin Atkinson
64a026bdcc Don't panic due to unlocking an unowned mutex if we fail during attach.
PR:		kern/139053
Reviewed by:	scottl
Approved by:	ed (mentor)
MFC after:	2 weeks
2009-12-17 17:46:08 +00:00
Scott Long
2fdaa90df8 Sync driver with Yahoo:
- Implement MSI support (MSIX support was already there)
- Use a table to drive MSI/MSIX exceptions
- Pre-calculate the command address instead of wasting cycles doing the
  calculation on every i/o.
2009-09-16 23:27:14 +00:00
Scott Long
744c0d23ea Fix locking around copyout() operations. 2009-09-16 23:17:22 +00:00
Scott Long
b23be3e0a6 Make MSI and PERFORMANT interrupts work correctly. Only require the minimum
number of MSIX interrupts that are needed, and don't strictly check for 4.
Enable enough interrupt mask bits so that the controller will generate
interrupts in PERFORMANT mode.  This fixes the hang-on-boot issues that
people were seeing with newer controllers.
2009-09-16 23:10:10 +00:00
Scott Long
c7241f65ad Increase CISS_MAX_PHYSTGT to 256 so that it matches what the controller might
give us.  Without this, certain data structures get sized incorrectly, leading
to a panic on certain cards that want to use high-value target numbers.
2009-09-16 22:52:20 +00:00
Scott Long
62fdee1dda Fix an apparently harmless typo.
Approved by:	re
2009-07-20 03:59:00 +00:00
Scott Long
de985f6174 Revert the CISS driver to 64K i/o, the previous change was in error and
missing a lot of needed infrastructure.

Approved by:	re
2009-07-13 20:19:29 +00:00
Scott Long
52c9ce25d8 Separate the parallel scsi knowledge out of the core of the XPT, and
modularize it so that new transports can be created.

Add a transport for SATA

Add a periph+protocol layer for ATA

Add a driver for AHCI-compliant hardware.

Add a maxio field to CAM so that drivers can advertise their max
I/O capability.  Modify various drivers so that they are insulated
from the value of MAXPHYS.

The new ATA/SATA code supports AHCI-compliant hardware, and will override
the classic ATA driver if it is loaded as a module at boot time or compiled
into the kernel.  The stack now support NCQ (tagged queueing) for increased
performance on modern SATA drives.  It also supports port multipliers.

ATA drives are accessed via 'ada' device nodes.  ATAPI drives are
accessed via 'cd' device nodes.  They can all be enumerated and manipulated
via camcontrol, just like SCSI drives.  SCSI commands are not translated to
their ATA equivalents; ATA native commands are used throughout the entire
stack, including camcontrol.  See the camcontrol manpage for further
details.  Testing this code may require that you update your fstab, and
possibly modify your BIOS to enable AHCI functionality, if available.

This code is very experimental at the moment.  The userland ABI/API has
changed, so applications will need to be recompiled.  It may change
further in the near future.  The 'ada' device name may also change as
more infrastructure is completed in this project.  The goal is to
eventually put all CAM busses and devices until newbus, allowing for
interesting topology and management options.

Few functional changes will be seen with existing SCSI/SAS/FC drivers,
though the userland ABI has still changed.  In the future, transports
specific modules for SAS and FC may appear in order to better support
the topologies and capabilities of these technologies.

The modularization of CAM and the addition of the ATA/SATA modules is
meant to break CAM out of the mold of being specific to SCSI, letting it
grow to be a framework for arbitrary transports and protocols.  It also
allows drivers to be written to support discrete hardware without
jeopardizing the stability of non-related hardware.  While only an AHCI
driver is provided now, a Silicon Image driver is also in the works.
Drivers for ICH1-4, ICH5-6, PIIX, classic IDE, and any other hardware
is possible and encouraged.  Help with new transports is also encouraged.

Submitted by:	scottl, mav
Approved by:	re
2009-07-10 08:18:08 +00:00
Warner Losh
00b4e54ae7 We no longer need to use d_thread_t, migrate to struct thread *. 2009-05-20 17:29:21 +00:00
Scott Long
7b6d3d4c7b Updated PCI ID's from the vendor 2009-05-19 01:41:11 +00:00
Scott Long
63b9228b0b Tell CAM that CISS logical devices support tagged queueing. This fixes
the low "max device openings" count that has led to poor performance in
FreeBSD 7.0 and 7.1
2009-02-20 07:43:43 +00:00
Scott Long
d69c9c7867 Work again to fix the interrupt masking problems. We now recognize
that there are 3 different interrupt enable bits, 2 for different
families of cards, and 1 for when MSI is used.  Also apply a big
hammer backstop for cards that aren't recognized.  This should fix
all of the interrupt issues at boot.
2008-08-29 01:23:16 +00:00
Scott Long
8792c6abd8 Correctly set the interrupt enable and disable bits. The previous
code interfered with Performant mode and legacy interrupts.  Also
remove a register read operation on the Simplq code that was
effectively a time-wasting no-op.
2008-08-02 13:04:26 +00:00
Scott Long
22657ce129 A number of significant enhancements to the ciss driver:
1.  The FreeBSD driver was setting an interrupt coalesce delay of 1000us
for reasons that I can only speculate on.  This was hurting everything
from lame sequential I/O "benchmarks" to legitimate filesystem metadata
operations that relied on serialized barrier writes.  One of my
filesystem tests went from 35s to complete down to 6s.

2.  Implemented the Performant transport method.  Without the fix in
(1), I saw almost no difference.  With it, my filesystem tests showed
another 5-10% improvement in speed.  It was hard to measure CPU
utilization in any meaningful way, so it's not clear if there was a
benefit there, though there should have been since the interrupt handler
was reduced from 2 or more PCI reads down to 1.

3.  Implemented MSI-X.  Without any docs on this, I was just taking a
guess, and it appears to only work with the Performant method.  This
could be a programming or understanding mistake on my part.  While this
by itself made almost no difference to performance since the Performant
method already eliminated most of the synchronous reads over the PCI
bus, it did allow the CISS hardware to stop sharing its interrupt with
the USB hardware, which in turn allowed the driver to become decoupled
from the Giant-locked USB driver stack.  This increased performance by
almost 20%.  The MSI-X setup was done with 4 vectors allocated, but only
1 vector used since the performant method was told to only use 1 of 4
queues.  Fiddling with this might make it work with the simpleq method,
not sure.  I did not implement MSI since I have no MSI-specific hardware
in my test lab.

4.  Improved the locking in the driver, trimmed some data structures.
This didn't improve test times in any measurable way, but it does look
like it gave a minor improvement to CPU usage when many
processes/threads were doing I/O in parallel.  Again, this was hard to
accurately test.
2008-07-11 21:20:51 +00:00
Paul Saab
160b4e6bfc Add support for the P212, P410, P410i, P411, and P812 HP Smart Array
controllers.

Submitted by:  Scott Benesh at HP
2008-06-10 17:51:51 +00:00
Paul Saab
17e8474976 Remove a check that didn't allow > 12 byte CDB's to be issued to
ciss.  This should allow volumes > 2TB to work.

Reported by:	Emil Mikulic
2008-05-16 08:27:02 +00:00
Mitsuru IWASAKI
5a3c4d694e Add `hw.ciss.nop_message_heartbeat' tunable (default disabled) for
NOP-message polling in ciss_periodic().
Note that setting the tunable to non-zero can be workaround only for
`ADAPTER HEARTBEAT FAILED' problem, and may freeze the system w/o
the problem.

Reviewed by:	scottl
Reported by:	Attila Nagy
MFC after:	3 days
2008-02-10 06:21:52 +00:00
Mitsuru IWASAKI
0aeee4bd8a Don't repeat error logging about NOP message sending if
ciss_report_request() return an error (which is most likely data
underrun).

Noticed by:	Mark Atkinson
MFC after:	1 week
2008-01-28 16:21:34 +00:00
Mitsuru IWASAKI
54d02e0aa7 Fix NOP message sending in ciss_periodic() which causes panic with
option INVARIANTS.

Reviewed by:	simokawa
Tested by:	noriyosi_kawano
MFC after:	1 week
2007-11-05 13:54:23 +00:00
Julian Elischer
3745c395ec Rename the kthread_xxx (e.g. kthread_create()) calls
to kproc_xxx as they actually make whole processes.
Thos makes way for us to add REAL kthread_create() and friends
that actually make theads. it turns out that most of these
calls actually end up being moved back to the thread version
when it's added. but we need to make this cosmetic change first.

I'd LOVE to do this rename in 7.0  so that we can eventually MFC the
new kthread_xxx() calls.
2007-10-20 23:23:23 +00:00
Mitsuru IWASAKI
e08d902a7a Add NOP-message polling to ciss_periodic().
Disable adapter by detecting adapter is dead.

Tested by:	Masaki YATSU(on RELENG_6)
Reviewed by:	scottl
MFC after:	1 week
2007-10-13 05:45:45 +00:00
Scott Long
45650f529d Fix a mistake made in the MPSAFE commit that caused CAM to serialize requests
to the controller.
2007-10-12 17:03:41 +00:00
Scott Long
b50569b71d Prepare for future integration between CAM and newbus. xpt_bus_register
now takes a device_t to be the parent of the bus that is being created.
Most SIMs have been updated with a reasonable argument, but a few exceptions
just pass NULL for now.  This argument isn't used yet and the newbus
integration likely won't be ready until after 7.0-RELEASE.
2007-06-17 05:55:54 +00:00
Scott Long
d4a4ddc6ba Satisfy witness during shutdown 2007-06-05 05:03:13 +00:00
Scott Long
e62c19b256 Eliminate M_TEMP. 2007-05-14 22:01:03 +00:00
Scott Long
2472e51e46 Streamline locking in ciss_free() 2007-05-02 04:44:31 +00:00
Scott Long
975b731815 MPSAFE ciss driver 2007-05-01 05:13:15 +00:00
Scott Long
2b83592fdc Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that
SIM.  Drivers that are not yet MPSAFE register Giant and operate as
usual.  RIght now, no drivers are MPSAFE, though a few will be changed
in the coming week as this work settles down.

The driver API has changed, so all CAM drivers will need to be recompiled.
The userland API has not changed, so tools like camcontrol do not need to
be recompiled.
2007-04-15 08:49:19 +00:00
Paolo Pisati
ef544f6312 o break newbus api: add a new argument of type driver_filter_t to
bus_setup_intr()

o add an int return code to all fast handlers

o retire INTR_FAST/IH_FAST

For more info: http://docs.freebsd.org/cgi/getmsg.cgi?fetch=465712+0+current/freebsd-current

Reviewed by: many
Approved by: re@
2007-02-23 12:19:07 +00:00
Maxim Konovalov
91d7721c0b o ciss.ko depends on cam and pci.
PR:		kern/105989
Submitted by:	nork
MFC after:	1 month
2006-11-30 15:14:17 +00:00
Matt Jacob
bd3fd815a7 2nd and final commit that moves us to CAM_NEW_TRAN_CODE
as the default.

Reviewed by multitudes.
2006-11-02 00:54:38 +00:00
Matt Jacob
fa9ed86506 The first of 3 major steps to move the CAM layer forward to using
the CAM_NEW_TRAN_CODE that has been in the tree for some years now.

This first step consists solely of adding to or correcting
CAM_NEW_TRAN_CODE pieces in the kernel source tree such
that a both a GENERIC (at least on i386) and a LINT build
with CAM_NEW_TRAN_CODE as an option will compile correctly
and run (at least with some the h/w I have).

After a short settle time, the other pieces (making
CAM_NEW_TRAN_CODE the default and updating libcam
and camcontrol) will be brought in.

This will be an incompatible change in that the size of structures
related to XPT_PATH_INQ and XPT_{GET,SET}_TRAN_SETTINGS change
in both size and content. However, basic system operation and
basic system utilities work well enough with this change.

Reviewed by:	freebsd-scsi and specific stakeholders
2006-10-31 05:53:29 +00:00
Paul Saab
f83695f5e9 Spin until a request structure is available in the ioctl path. 2006-05-30 06:42:02 +00:00
Poul-Henning Kamp
c40da00ca3 Since DELAY() was moved, most <machine/clock.h> #includes have been
unnecessary.
2006-05-16 14:37:58 +00:00
Paul Saab
c1885ab8c5 Free another memory leak when dealing with disk notification. 2006-04-20 03:05:02 +00:00
Paul Saab
ee626b40c0 Free some previously leaked memory on module unload. 2006-04-19 19:56:10 +00:00
Paul Saab
2514c5bfdd It seems ciss should ignore overrun and underrun on a SCSI INQUIRY
command.  This fixes some weird booting issues on newer versions
of the firmware on the MSA20.

Reported by:	Philippe Pegon <Philippe dot Pegon at crc dot u-strasbg dot fr>
2005-12-16 06:50:55 +00:00
Paul Saab
cad572c41b Update PCI ids to add the E200, E200i, P400, and P400i storage
controllers.  Remove the E400 since it is not a real product.

Submitted by:	HP
2005-11-11 16:45:33 +00:00
Paul Saab
7a0c10de8d There's no reason to check the valence. This allows ciss to work
on the P600.
2005-08-09 20:53:51 +00:00
Yoshihiro Takahashi
d4fcf3cba5 Remove bus_{mem,p}io.h and related code for a micro-optimization on i386
and amd64.  The optimization is a trivial on recent machines.

Reviewed by:	-arch (imp, marcel, dfr)
2005-05-29 04:42:30 +00:00
Paul Saab
7caeec6a13 Support passthru ioctl commands from 32bit binaries. 2005-05-18 05:31:34 +00:00
Paul Saab
4bb10cf193 Add support for the P600 and name the E400. 2005-04-28 14:40:23 +00:00
Paul Saab
17c0792df6 Provide a way to soft reset a proxy controller such as an MSA20 or
MSA500.  This is useful if you need to reset one of the storage
arrays on reboot.
2005-04-19 06:11:16 +00:00
Sam Leffler
14d15addab handle ciss_lookup failure
Noticed by:	Coverity Prevent analysis tool
2005-03-29 01:44:17 +00:00
Warner Losh
538565c4a5 Use BUS_PROBE_DEFAULT for pci probe return value 2005-03-05 18:30:12 +00:00
Scott Long
5f2657119e - Remove dead code.
- Protect against negative values as array indexes.

Submitted by: Coverity Prevent analysis tool
2005-02-21 05:17:29 +00:00
Paul Saab
f3f8276732 Remove 6422, V100 and add the P600.
Submitted by:	John Cagle
2005-01-20 22:51:38 +00:00
Peter Wemm
cc85036382 ciss's interrupt handler was missing the INTR_ENTROPY flag. 2004-08-16 23:13:16 +00:00
Paul Saab
4788ab3312 Clean up structure packing. 2004-07-29 08:06:22 +00:00
Alexander Kabaev
3bdee39ecb Make __packed attribute apply to structs themselves, not their typedefs.
GCC 3.4.2 issues warning about that.
2004-07-28 06:19:25 +00:00
Paul Saab
d49f1379e4 Name non-physical devices. 2004-07-28 06:18:05 +00:00
Paul Saab
5cf5a43040 Reset the update flag when scanning for new devices. 2004-06-22 23:05:06 +00:00
Paul Saab
6768864478 Use the maximum physical bus when rescanning those targets. This
fixes a panic on cards which do not have any drives attached.
2004-06-22 17:39:57 +00:00
Paul Saab
139233cbd6 on media exchange, update/rescan the drives. This allows a volume
in a failed stated to come back on-line without a reboot.
2004-06-21 22:57:10 +00:00
Paul Saab
88c78a3815 There is no need to call ciss_media_accept async anymore since all
notify events are handled in a kthread.
2004-06-21 21:56:57 +00:00
Scott Long
1fe6c4ee54 Add SCSI passthrough support to CISS. This allows devices like tape drives
that are on a CISS bus to be exported up to CAM and made available as normal
devices.  This will typically add one or two buses to CAM, which will be
numbered starting at 32 to allow room for CISS proxy buses.  Also, the CISS
firmware usually hides disk devices, but these can also be exposed as 'pass'
devices if you set the hw.ciss.expose_hidden_physical tunable.

Sponsored by:	Tape Laboratories, Inc.
MFC After: 3 days
2004-06-21 20:18:40 +00:00
Poul-Henning Kamp
89c9c53da0 Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.
2004-06-16 09:47:26 +00:00
Paul Saab
6f71a9531a If a device is not ONLINE, do not attempt to submit any commands
or I/O to the volume.  This solves a panic when removing a disk in
a RAID 0 volume.

Reported by:	le
2004-06-15 19:40:47 +00:00
Paul Saab
a54e98d365 Document the 64bit version of blocks_to_recover for logical drive status.
Pad the struct to 1024 bytes as defined in the firmware spec.
2004-06-05 18:31:04 +00:00
Paul Saab
b612d5e1ea Add pci id's for the SmartArray 6422 and V100 controllers. Also
add a whole bunch of pci id's for future controllers.

Submitted by:	John Cagle <first.last@hp.com>
2004-06-05 18:12:56 +00:00
Paul Saab
bbfb452827 Update logical drive structure 2004-06-04 17:22:13 +00:00
Paul Saab
10672bdf56 Define another HOTPLUG event. 2004-05-28 00:49:57 +00:00
Paul Saab
a891a3bf7c Turn SCSI pre-fetch ON. This is mainly for 64XX and 64X based
controllers and allows the controller to prefetch 1-2k on certain
PCI memory reads to the host.  The spec says this should only be
used for IA32 based systems.

Informed of feature by:	John Cagle <first.last@hp.com>
2004-05-17 17:27:38 +00:00
Paul Saab
609caf8db9 make this compile/work with CISS_DEBUG defined. 2004-04-26 19:28:08 +00:00
Paul Saab
256588d2c4 define some new fields in the physical drive structure and pad the
structure to 512 bytes.
2004-04-22 06:23:47 +00:00
Paul Saab
3c6b835326 There's no need to call ciss_report_request in the passthru ioctl
routine since the error will be reported back to the user buffer.
This will quiet down the bootverbose case when using an ACU which
does brute force discovery of the physical and logical devices.
2004-04-19 17:16:06 +00:00
Paul Saab
2e80ca8a68 Report only new new events when initially attaching to the controller. 2004-04-19 00:57:29 +00:00
Paul Saab
78d033619f move the cleanup of the control device into ciss_free and add some
ifdefs for the diffrent kthread_create API between -current and
-stable
2004-04-18 02:39:01 +00:00
Paul Saab
c61314601b Add support for the HP Modular Smart Array 20 & 500 storage arrays.
Logical volumes on these devices show up as LUNs behind another
controller (also known as proxy controller).  In order to issue
firmware commands for a volume on a proxy controller, they must be
targeted at the address of the proxy controller it is attached to,
not the Host/PCI controller.

A proxy controller is defined as a device listed in the INQUIRY
PHYSICAL LUNS command who's L2 and L3 SCSI addresses are zero.  The
corresponding address returned defines which "bus" the controller
lives on and we use this to create a virtual CAM bus.

A logical volume's addresses first byte defines the logical drive
number.  The second byte defines the bus that it is attached to
which corresponds to the BUS of the proxy controller's found or the
Host/PCI controller.

Change event notification to be handled in its own kernel thread.
This is needed since some events may require the driver to sleep
on some operations and this cannot be done during interrupt context.
With this change, it is now possible to create and destroy logical
volumes from FreeBSD, but it requires a native application to
construct the proper firmware commands which is not publicly
available.

Special thanks to John Cagle @ HP for providing remote access to
all the hardware and beating on the storage engineers at HP to
answer my questions.
2004-04-16 23:00:01 +00:00
Paul Saab
a32168b78e Whitespace cleanup. 2004-04-16 21:03:38 +00:00
Paul Saab
ffdf82e1a7 Don't allow the driver to be unloaded if the device node is open. 2004-04-14 19:45:07 +00:00
Paul Saab
40f05b02ec Do not catch signals when waiting for a request. This fixes a nasty
race when issuing commands from userland.
2004-04-14 18:55:28 +00:00
Nate Lawson
5f96beb9e0 Convert callers to the new bus_alloc_resource_any(9) API.
Submitted by:	Mark Santcroos <marks@ripe.net>
Reviewed by:	imp, dfr, bde
2004-03-17 17:50:55 +00:00
Poul-Henning Kamp
dc08ffec87 Device megapatch 4/6:
Introduce d_version field in struct cdevsw, this must always be
initialized to D_VERSION.

Flip sense of D_NOGIANT flag to D_NEEDGIANT, this involves removing
four D_NOGIANT flags and adding 145 D_NEEDGIANT flags.
2004-02-21 21:10:55 +00:00
Poul-Henning Kamp
c9c7976f7f Device megapatch 1/6:
Free approx 86 major numbers with a mostly automatically generated patch.

A number of strategic drivers have been left behind by caution, and a few
because they still (ab)use their major number.
2004-02-21 19:42:58 +00:00
Ruslan Ermilov
4c7ca6e54c Fixed a memory leak.
Reported by:	Stanford Metacompilation research group
2004-01-18 16:55:01 +00:00
Paul Saab
591d10119e White space cleanup 2003-12-13 07:54:07 +00:00
Paul Saab
307e04602c Correct the READ/WRITE CDB direction definition.
Submitted by:	John Cagle <john.cagle@hp.com>
2003-12-08 23:12:57 +00:00
Paul Saab
aaf8327b2d Define RAID 5+1 and RAID ADG fault tolerances 2003-12-08 16:07:35 +00:00
Paul Saab
b26392c7f6 Add PCID for 6i controller
Submitted by:	John Cagle <john.cagle@hp.com>
2003-11-07 03:01:48 +00:00
Paul Saab
79adbf76d0 Print the correct logical drive lun number returned by the controller. 2003-10-15 18:52:44 +00:00
Paul Saab
88ff7f004e Quiet down boot verbose and allow commands to be submitted to a target
which does not have a volume attached.  This will stop cam from retrying
a bunch of time at boot for devices which do not exsist.
2003-09-08 16:45:33 +00:00
Warner Losh
4fbd232c86 Prefer new location of pci include files (which have only been in the
tree for two or more years now), except in a few places where there's
code to be compatible with older versions of FreeBSD.
2003-08-22 05:54:52 +00:00
Paul Saab
639717c8bb Support EINPROGRESS and properly deal with 64bit physical addressing. 2003-08-12 17:55:53 +00:00
Paul Saab
3c63a8b4fc Check the status of the user command and return the proper error
to the user.
2003-07-12 22:37:03 +00:00
Paul Saab
4bca277bd3 Quiet down ciss unless bootverbose is set. 2003-07-12 22:32:27 +00:00
Scott Long
f6b1c44d1f Mega busdma API commit.
Add two new arguments to bus_dma_tag_create(): lockfunc and lockfuncarg.
Lockfunc allows a driver to provide a function for managing its locking
semantics while using busdma.  At the moment, this is used for the
asynchronous busdma_swi and callback mechanism.  Two lockfunc implementations
are provided: busdma_lock_mutex() performs standard mutex operations on the
mutex that is specified from lockfuncarg.  dftl_lock() is a panic
implementation and is defaulted to when NULL, NULL are passed to
bus_dma_tag_create().  The only time that NULL, NULL should ever be used is
when the driver ensures that bus_dmamap_load() will not be deferred.
Drivers that do not provide their own locking can pass
busdma_lock_mutex,&Giant args in order to preserve the former behaviour.

sparc64 and powerpc do not provide real busdma_swi functions, so this is
largely a noop on those platforms.  The busdma_swi on is64 is not properly
locked yet, so warnings will be emitted on this platform when busdma
callback deferrals happen.

If anyone gets panics or warnings from dflt_lock() being called, please
let me know right away.

Reviewed by:	tmm, gibbs
2003-07-01 15:52:06 +00:00
Paul Saab
be241f79bb Give the correct size for the command map to busdma. 2003-06-26 04:01:34 +00:00
Poul-Henning Kamp
777d1b3990 Fix off-by-one error in drive number check.
Don't return(foo(...)) in function returning void.

Found by:       FlexeLint
2003-05-31 18:41:09 +00:00
Paul Saab
3284b9ee87 Make ciss usable under PAE
Approved by:	re (scottl)
2003-05-21 07:17:06 +00:00
Paul Saab
9e7313bba7 Add support for the HP Smart Array 6400 EM
Change the interrupt mask for the Smart Array 6xxx controllers after
discussions w/ HP.
2003-04-03 20:09:27 +00:00
Poul-Henning Kamp
b4b138c27f Including <sys/stdint.h> is (almost?) universally only to be able to use
%j in printfs, so put a newsted include in <sys/systm.h> where the printf
prototype lives and save everybody else the trouble.
2003-03-18 08:45:25 +00:00
Poul-Henning Kamp
60794e0478 Centralize the devstat handling for all GEOM disk device drivers
in geom_disk.c.

As a side effect this makes a lot of #include <sys/devicestat.h>
lines not needed and some biofinish() calls can be reduced to
biodone() again.
2003-03-08 08:01:31 +00:00
Poul-Henning Kamp
7ac40f5f59 Gigacommit to improve device-driver source compatibility between
branches:

Initialize struct cdevsw using C99 sparse initializtion and remove
all initializations to default values.

This patch is automatically generated and has been tested by compiling
LINT with all the fields in struct cdevsw in reverse order on alpha,
sparc64 and i386.

Approved by:    re(scottl)
2003-03-03 12:15:54 +00:00
Poul-Henning Kamp
715b1e0ab0 Put cdevsw initialization on canonical format. 2003-03-02 16:50:09 +00:00
Warner Losh
a163d034fa Back out M_* changes, per decision of the TRB.
Approved by: trb
2003-02-19 05:47:46 +00:00
Paul Saab
2648ded594 Add some PCI device ID's from HP 2003-02-18 21:53:44 +00:00