Commit Graph

13 Commits

Author SHA1 Message Date
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
Doug Ambrisko
fa1e6ef4ef - Fix from jhb for failing I/O request when bus_dmamap_load fails.
- Fix to ioctl path in which the length could be 0 which means
  no data in/out from LSI.
- Fix to ioctl path in which the data in the sense data space
  of the ioctl packet is a really a pointer to some location in
  user-space.  From LSI re-worked a bit by me.
- Add HW support for next gen cards from LSI.

Thanks to LSI for their support!

Submitted by:	jhb, LSI
MFC after:	3 days
2008-11-12 22:44:50 +00:00
Scott Long
610f2ef365 Update the MFI driver to support new "1078" series of hardware. This
includes the upcoming Dell PERC6 series.  Many thanks to LSI for
contributing this code.

Submitted by: LSI
Approved by: re
2007-08-25 23:58:45 +00:00
John Baldwin
8ec5c98ba4 Teach the mfi(4) driver to handle requests from userland management
applications to add and remove volumes.

MFC after:	1 week
Approved by:	re (bmah)
Reviewed by:	ambrisko, scottl
2007-08-13 19:29:17 +00:00
Doug Ambrisko
5be25877a1 Add in a couple of things:
-	In the ioctl path let command get queued up and return
	when complete _without_ blocking the driving waiting for
	the response.  This way the driver doesn't "lock up" for
	~30s during a flash command.  Submitted by scottl.
      -	Add a guard so that if a DCMD of 0 is sent down the ioctl
	path don't send it to the controller.  Return with a
	status of OK.  This is a little strange since MegaCli
	doesn't seem to like something and will issue some DCMD
	of 0.  This doesn't happen under Linux.  So the emulation
	needs to be improved but I'm not sure what.  Another strange
	thing is that when a DCMD of 0 gets issued under i386 the
	controller returns OK but in amd64 the context is messed
	up.
      -	Add a guard so the context has to be with-in the legal
	limit so we get a reasonable error assertion versus random
	panic.

It's going to be a challenge to figure out why MegaCli is not totally
happy and then sends some bogus commands.  This means that flashing
firmware via the Linux tool won't work since it generates a DCMD of
0 when it should be opening the firmware for a flash update.  Without
this problem flashing works fine.  This means there is no publicly
available tool to upgrade the RAID firmware under FreeBSD right now.

I plan to MFC all of the mfi changes to 6.X shortly.  This might not
include the SCSI pass-through changes.

Submitted by:	scottl
Reviewed by:	scottl
MFC after:	3 days
2007-06-04 16:39:22 +00:00
Scott Long
35ef86f285 Catch up to driver changes required for the mfip sub-driver. 2007-05-16 17:23:36 +00:00
Scott Long
ddfae47b9d Collapse the mfi_ld object. Add an ioctl to help management apps map
array Id's to FreeBSD device names.
2007-05-10 15:33:41 +00:00
Scott Long
441f6d5dca - Add a command validator for use in debugging.
- Fix the locking protocol to eliminate races between normal I/O and AENs.
- Various small improvements and usability tweaks.

Sponsored by: IronPort
Portions Submitted by: Doug Ambrisko
2006-10-16 04:18:38 +00:00
Scott Long
5ba21ff136 Add a command debugging module and a periodic watchdog timer.
Sponsored by: IronPort
2006-09-25 11:35:34 +00:00
Scott Long
78e36c279b Change some variable names and update some comments to help clarify some
confusing issues.
2006-09-20 06:58:02 +00:00
Paul Saab
c0b332d17a Instead of using scsi probes to do device discovery, use the firmware
commands to grab the device listing.  This resolves issues using
multiple volumes, where each volume was actually internally pointing
to target 0.
2006-06-20 22:41:44 +00:00
Doug Ambrisko
741367d5a5 Add in a bunch of things to the mfi driver:
- Linux ioctl support, with the other Linux changes MegaCli
	will run if you mount linprocfs & linsysfs then set
	sysctl compat.linux.osrelease=2.6.12 or similar.  This works
	on i386.  It should work on amd64 but not well tested yet.
	StoreLib may or may not work.  Remember to kldload mfi_linux.
      - Add in AEN (Async Event Notification) support so we can
	get messages from the firmware when something happens.
	Not all messages are in defined in event detail.  Use
	event_log to try to figure out what happened.
      - Try to implement something like SIGIO for StoreLib.  Since
	mrmonitor doesn't work right I can't fully test it.  StoreLib
	works best with the rh9 base.  In theory mrmonitor isn't
	needed due to native driver support of AEN :-)
Now we can configure and monitor the RAID better.

Submitted by:	IronPort Systems.
2006-05-18 23:30:48 +00:00
Scott Long
2e21a3ef7e Add a driver for the new LSI MegaRAID SAS controller family. The 'MFI' name
is derived from the phrase 'MegaRAID Firmware Interface' used by LSI.  This
driver provides a block interface to logical disks on the card and a minimal
management device.  It is MPSAFE, INTR_FAST, and 64-bit capable.

Thanks to Dell for providing hardware to test with and IronPort for
sponsoring the work.

Sponsored by: Dell, Ironport
MFC After: 3 days
2006-03-25 06:14:32 +00:00