History log of /freebsd-10-stable/sys/dev/ida/
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
281826 21-Apr-2015 mav

MFC r280347: Remove MAXBSIZE use from drivers where it has nothing to do.

In some cases limits are just not needed, in others -- DFLTPHYS is the
right constant to use instead.

276268 26-Dec-2014 ian

MFC r274188, r274189:
DMA tag alignment should be 1 (not 0) when a device can dma at any address.

256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


239740 27-Aug-2012 jhb

Rework the DMA handling in ida(4) and add locking to make this driver
MPSAFE.
- Preallocate a full set of QCBs during attach rather than allocating new
ones on demand to avoid allocations in the I/O path.
- Remove the explicit bus space tag/handle and use bus_*() on the
relevant 'struct resource' instead.
- Defer logical drive probing to an intrhook.
- Fix ida_detach() to detach and delete child devices (logical drives).
- Update the DMA handling to support EINPROGRESS by moving the work to
submit a mapped request into the bus_dma callback routine as well as
add support for freezing the queue when EINPROGRESS is encountered.

Tested by: Marco Steinbach coco executive-computing de


232854 12-Mar-2012 scottl

Convert a number of drivers to obtaining their parent DMA tag from their
PCI device attachment.


227843 22-Nov-2011 marius

- There's no need to overwrite the default device method with the default
one. Interestingly, these are actually the default for quite some time
(bus_generic_driver_added(9) since r52045 and bus_generic_print_child(9)
since r52045) but even recently added device drivers do this unnecessarily.
Discussed with: jhb, marcel
- While at it, use DEVMETHOD_END.
Discussed with: jhb
- Also while at it, use __FBSDID.


166901 23-Feb-2007 piso

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@


146734 29-May-2005 nyan

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)


145024 13-Apr-2005 mdodd

Test for NULL before use.

Submitted by: sam (Coverity)


145023 13-Apr-2005 mdodd

Add KASSERT() to warn against NULL deref.

Submitted by: sam (Coverity)


144992 13-Apr-2005 mdodd

Define additional commands.

Obtained from: Linux


144991 13-Apr-2005 mdodd

Whitespace cleanup.


143160 05-Mar-2005 imp

Use BUS_PROBE_DEFAULT for pci probe return value


139749 06-Jan-2005 imp

Start each of the license/copyright comments with /*-, minor shuffle of lines


138853 14-Dec-2004 mdodd

Add a callout to dump card status on command queue timeouts.


138852 14-Dec-2004 mdodd

Modify ida_v3_done() to treat FIFO status of -1 as FIFO empty (0).
This is what ida_v4_done() does and seems to be necessary with some
firmware versions on v3 devices.


138851 14-Dec-2004 mdodd

Reformat arguments bus_dma_tag_create().


130585 16-Jun-2004 phk

Do the dreaded s/dev_t/struct cdev */
Bump __FreeBSD_version accordingly.


129879 30-May-2004 phk

Add missing <sys/module.h> includes


127135 17-Mar-2004 njl

Convert callers to the new bus_alloc_resource_any(9) API.

Submitted by: Mark Santcroos <marks@ripe.net>
Reviewed by: imp, dfr, bde


126080 21-Feb-2004 phk

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.


125975 18-Feb-2004 phk

Change the disk(9) API in order to make device removal more robust.

Previously the "struct disk" were owned by the device driver and this
gave us problems when the device disappared and the users of that device
were not immediately disappearing.

Now the struct disk is allocate with a new call, disk_alloc() and owned
by geom_disk and just abandonned by the device driver when disk_create()
is called.

Unfortunately, this results in a ton of "s/\./->/" changes to device
drivers.

Since I'm doing the sweep anyway, a couple of other API improvements
have been carried out at the same time:

The Giant awareness flag has been flipped from DISKFLAG_NOGIANT to
DISKFLAG_NEEDSGIANT

A version number have been added to disk_create() so that we can detect,
report and ignore binary drivers with old ABI in the future.

Manual page update to follow shortly.


124540 15-Jan-2004 mdodd

Add a per controller IOCTL interface.


124539 15-Jan-2004 mdodd

- Add comments.
- Add more command defines and data structures.
- Re-organize struct ida_drive_info to factor out struct ida_drive_info
which will be used elsewhere.


124538 15-Jan-2004 mdodd

Insure values of adapter structure members are in correct byte order.


124500 13-Jan-2004 mdodd

Initialize drive device_t in softc.


124471 13-Jan-2004 mdodd

style(9): single tab after #define.


124449 12-Jan-2004 mdodd

Handle "Bad Command List" errors.

No error status is returned by the adapter so set CMD_REJECTED so that
ida_done() will DTRT.


124447 12-Jan-2004 mdodd

Remove comments that no longer apply.


124423 12-Jan-2004 mdodd

- Initialize qcb flags in ida_construct_qcb() with respect to DMA direction.
- Print operation type, if known in hard/soft error message in ida_done().
- NULL qcb struct bio pointer in ida_done().


119690 02-Sep-2003 jhb

Use PCIR_BAR(x) instead of PCIR_MAPS.

Glanced over by: imp, gibbs
Tested by: i386 LINT


119418 24-Aug-2003 obrien

Use __FBSDID().
Also some minor style cleanups.


119280 22-Aug-2003 imp

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.


118678 08-Aug-2003 mdodd

Initialize bp->bio_driver1 in idad_strategy().
Removed by accident in 1.38.

This fixes the trap 12 everyone was seeing in ida_construct_qcb().

PR: kern/53245


117126 01-Jul-2003 scottl

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


115343 27-May-2003 scottl

Bring back bus_dmasync_op_t. It is now a typedef to an int, though the
BUS_DMASYNC_ definitions remain as before. The does not change the ABI,
and reverts the API to be a bit more compatible and flexible. This has
survived a full 'make universe'.

Approved by: re (bmah)


113350 10-Apr-2003 mux

I deserve a big pointy hat for having missed all those references
to bus_dmasync_op_t in my last commit.


112946 01-Apr-2003 phk

Use bioq_flush() to drain a bio queue with a specific error code.
Retain the mistake of not updating the devstat API for now.

Spell bioq_disksort() consistently with the remaining bioq_*().

#include <geom/geom_disk.h> where this is more appropriate.


112367 18-Mar-2003 phk

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.


111979 08-Mar-2003 phk

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.


111748 02-Mar-2003 des

More low-hanging fruit: kill caddr_t in calls to wakeup(9) / [mt]sleep(9).


111337 23-Feb-2003 phk

NO_GEOM cleanup:

Move ida driver to "struct disk *" centric api.

Retire major number 109.


111336 23-Feb-2003 phk

Fix the detach code to actually detach the disk instance created
during attach.


111335 23-Feb-2003 phk

Remove a goto the very next statement.


111220 21-Feb-2003 phk

NO_GEOM cleanup:

Retire the "d_dump_t" and use the "dumper_t" type instead.

Dumper_t takes a void * as first arg which is more general than the
dev_t taken by d_dump_t. (Remember: we could have net-dumpers if
somebody wrote us one!)

Define the convention for GEOM controlled disk devices to be that the
first argument to the dumper function is the struct disk pointer.

Change device drivers accordingly.


110483 07-Feb-2003 ps

Update to new crashdump API


106591 07-Nov-2002 jhb

Use [u]intmax_t and %j instead of long long and %ll to better fix warnings
I fixed earlier.

Requested by: mux, jake


106536 06-Nov-2002 jhb

Cast a bus_addr_t to a long long to make printf happy.


103870 23-Sep-2002 alfred

use __packed.


103714 20-Sep-2002 phk

(This commit touches about 15 disk device drivers in a very consistent
and predictable way, and I apologize if I have gotten it wrong anywhere,
getting prior review on a patch like this is not feasible, considering
the number of people involved and hardware availability etc.)

If struct disklabel is the messenger: kill the messenger.

Inside struct disk we had a struct disklabel which disk drivers used to
communicate certain metrics to the disklayer above (GEOM or the disk
mini-layer). This commit changes this communication to use four
explicit fields instead.

Amongst the benefits is that the fields do not get overwritten by
wrong or bogus on-disk disklabels.

Once that is clear, <sys/disk.h> which is included in the drivers
no longer need to pull <sys/disklabel.h> and <sys/diskslice.h> in,
the few places that needs them, have gotten explicit #includes for
them.

The disklabel inside struct disk is now only for internal use in
the disk mini-layer, so instead of embedding it, we malloc it as
we need it.

This concludes (modulus any mistakes) the series of disklabel related
commits.

I belive it all amounts to a NOP for all the rest of you :-)

Sponsored by: DARPA & NAI Labs.


93496 31-Mar-2002 phk

Here follows the new kernel dumping infrastructure.

Caveats:

The new savecore program is not complete in the sense that it emulates
enough of the old savecores features to do the job, but implements none
of the options yet.

I would appreciate if a userland hacker could help me out getting savecore
to do what we want it to do from a users point of view, compression,
email-notification, space reservation etc etc. (send me email if
you are interested).

Currently, savecore will scan all devices marked as "swap" or "dump" in
/etc/fstab _or_ any devices specified on the command-line.

All architectures but i386 lack an implementation of dumpsys(), but
looking at the i386 version it should be trivial for anybody familiar
with the platform(s) to provide this function.

Documentation is quite sparse at this time, more to come.

Details:

ATA and SCSI drivers should work as the dump formatting code has been
removed. The IDA, TWE and AAC have not yet been converted.

Dumpon now opens the device and uses ioctl(DIOCGKERNELDUMP) to set
the device as dumpdev. To implement the "off" argument, /dev/null
is used as the device.

Savecore will fail if handed any options since they are not (yet)
implemented. All devices marked "dump" or "swap" in /etc/fstab
will be scanned and dumps found will be saved to diskfiles
named from the MD5 hash of the header record. The header record
is dumped in readable format in the .info file. The kernel
is not saved. Only complete dumps will be saved.

All maintainer rights for this code are disclaimed: feel free to
improve and extend.

Sponsored by: DARPA, NAI Labs


92820 20-Mar-2002 imp

No need to conditionalize on pci being in the kernel for this


86313 13-Nov-2001 ps

Fix a signed bug in the crashdump code for systems with > 2GB of ram.

Reviewed by: peter


83366 12-Sep-2001 julian

KSE Milestone 2
Note ALL MODULES MUST BE RECOMPILED
make the kernel aware that there are smaller units of scheduling than the
process. (but only allow one thread per process at this time).
This is functionally equivalent to teh previousl -current except
that there is a thread associated with each process.

Sorry john! (your next MFC will be a doosie!)

Reviewed by: peter@freebsd.org, dillon@freebsd.org

X-MFC after: ha ha ha ha


78246 15-Jun-2001 peter

Fix warning: 186: warning: label `done' defined but not used


76324 06-May-2001 phk

Make the disk mini-layer check for and handle zero-length transfers
instead of the underlying drivers.


76322 06-May-2001 phk

Actually biofinish(struct bio *, struct devstat *, int error) is more general
than the bioerror().

Most of this patch is generated by scripts.


74890 28-Mar-2001 ps

Last commit was broken.. It always prints '[CTRL-C to abort]'.
Move duplicate code for printing the status of the dump and checking
for abort into a separate function.

Pointy hat to: me


74841 27-Mar-2001 ps

Change the dump routines to only abort if control-c is pressed.
If any other key is pressed, print a message stating that control-c
is how to abort.

Reviewed by: peter


74810 26-Mar-2001 phk

Send the remains (such as I have located) of "block major numbers" to
the bit-bucket.


73280 01-Mar-2001 markm

Turn on interrupt-entropy harvesting for all/any mass storage devices
I could find. I have no doubt missed a couple.

Interrupt entropy harvesting is still conditional on the
kern.random.sys.harvest_interrupt sysctl.


73113 26-Feb-2001 jlemon

Add crashdump support.

Tested by: ps


70845 09-Jan-2001 jlemon

Add a flag value to the board identifiers, and use this to enable the
firmware for selected revisions of the controller.

Spotted by: Alexander Hausner <alex@hugo.bmg.gv.at>


69781 08-Dec-2000 dwmalone

Convert more malloc+bzero to malloc+M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>


69479 01-Dec-2000 jlemon

Add PCI id for the RAID LC2 controller.

Pick up correct location for the DEC version of the chip, this
got broken in a previous commit.


67164 15-Oct-2000 phk

Remove unneeded #include <machine/clock.h>


67101 13-Oct-2000 jlemon

Look at both the vendor and subvendor information when determining
whether this is a Smart Array. This fixes a problem where the driver
would incorrectly match a Dell RAID device.

Reviewed by: msmith


63934 27-Jul-2000 jlemon

The DEC version of the Smart controller has its configuration information
stored at a different location in the PCI space, so adjust accordingly.

Also, when using more than two smart controllers in one machine, the
disks were assigned the wrong drive number; fix this as well.


60938 26-May-2000 jake

Back out the previous change to the queue(3) interface.
It was not discussed and should probably not happen.

Requested by: msmith and others


60833 23-May-2000 jake

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


60830 23-May-2000 jlemon

Add code which actually checks for the NCR PCI id so it can be used.


60796 22-May-2000 jlemon

Add PCI ID for NEC/Compaq controller.


60795 22-May-2000 jlemon

Add PCI id for Compaq Smart Array 431 card.


60041 05-May-2000 phk

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


59999 04-May-2000 jlemon

Add PCI identification for another SmartArray 4200, which identifies
itself as a DEC card instead of Compaq.


59760 29-Apr-2000 phk

Remove unneeded #include <sys/kernel.h>


59485 22-Apr-2000 mdodd

- Fix a problem with the cdevsw struct that prevented the kernel from
booting on a RAID volume.
- Change 'id_foo' and 'idfoo' to 'idad_foo' and 'idadfoo'. This makes
names more consistent with the devices that the code belongs to (more
in line with the style used in the amr/mlx driver.)

Reviewed by: jlemon


59391 19-Apr-2000 phk

Remove ~25 unneeded #include <sys/conf.h>
Remove ~60 unneeded #include <sys/malloc.h>


59273 16-Apr-2000 mdodd

- Define registers as offsets from register base rather than offsets from
EISA slot base.
- Remove unused IOPORT resource.

Reviewed by: jlemon


59249 15-Apr-2000 phk

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


59213 13-Apr-2000 jlemon

Change the maximum I/O transfer size to DFLTPHYS. This should fix
write corruption that some users were experiencing.


59209 13-Apr-2000 mdodd

- Add an additional call to eisa_add_iospace() so we get the right IOPORT
in attach.
- Change a EISA_CHANNEL_CLEAR to EISA_CHANNEL_BUSY in ida_v1_submit().

This may fix the problem with EISA IDA adapters though we have not heard
back from testers yet.

Reviewed by: jlemon


58934 02-Apr-2000 phk

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.


58345 20-Mar-2000 phk

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.


57833 08-Mar-2000 jlemon

Cosmetic fix: "id" -> "idad" for devstat.

Missed in prior (approved) commit by: jlemon


57828 08-Mar-2000 jlemon

Add support for older EISA compaq cards and newer Smart 4200 cards.
Change disk names to `idad' to avoid naming conflicts with the controller,
and enable the new disk code to pick up the drives.

Tested by: david.w.james@bt.com (existing compaq support)
Reviewed by: msmith
Approved by: jordan


54279 08-Dec-1999 ken

Revamp the devstat priority system. All disks now have the same priority.
The same goes for CD drivers and tape drivers. In systems with mixed IDE
and SCSI, devices in the same priority class will be sorted in attach
order.

Also, the 'CCD' priority is now the 'ARRAY' priority, and a number of
drivers have been modified to use that priority.

This includes the necessary changes to all drivers, except the ATA drivers.
Soren will modify those separately.

This does not include and does not require any change in the devstat
version number, since no known userland applications use the priority
enumerations.

Reviewed by: msmith, sos, phk, jlemon, mjacob, bde


54073 03-Dec-1999 mdodd

Remove the 'ivars' arguement to device_add_child() and
device_add_child_ordered(). 'ivars' may now be set using the
device_set_ivars() function.

This makes it easier for us to change how arbitrary data structures are
associated with a device_t. Eventually we won't be modifying device_t
to add additional pointers for ivars, softc data etc.

Despite my best efforts I've probably forgotten something so let me know
if this breaks anything. I've been running with this change for months
and its been quite involved actually isolating all the changes from
the rest of the local changes in my tree.

Reviewed by: peter, dfr


53004 08-Nov-1999 peter

Call id_drvinit() from attach, not probe as the OS hasn't necessarily
decided which driver to use until attach. Use DRIVER_MODULE().


51957 05-Oct-1999 n_hibma

Removal of sys/device.h

- Move intrhook stuff into kernel.h
- Remove all occurrences of #device <device.h>
- Add kernel.h were necessary (nowhere)
- delete device.h

This file contained the structures for cfdata (old style config) and is no
longer used. It was included by most drivers.

It confuses the remote debugger as the definition of 'struct device' in
device.h is found before the one in bus_private.h.


51658 25-Sep-1999 phk

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


51376 18-Sep-1999 phk

Use devstat_end_transaction_buf() rather than Use devstat_end_transaction()


50523 28-Aug-1999 phk

Fix various trivial warnings from LINT


50511 28-Aug-1999 phk

We don't need to pass the diskname argument all over the diskslice/label
code, we can find the name from any convenient dev_t


50477 28-Aug-1999 peter

$Id$ -> $FreeBSD$


49860 16-Aug-1999 gibbs

Properly set the alignment argument to bus_dma_tag_create(). If we
don't care about the alignment, set it to 1, meaning single byte alignment.


49771 14-Aug-1999 phk

Spring cleaning around strategy and disklabels/slices:

Introduce BUF_STRATEGY(struct buf *, int flag) macro, and use it throughout.
please see comment in sys/conf.h about the flag argument.

Remove strategy argument from all the diskslice/label/bad144
implementations, it should be found from the dev_t.

Remove bogus and unused strategy1 routines.

Remove open/close arguments from dssize(). Pick them up from dev_t.

Remove unused and unfinished setgeom support from diskslice/label/bad144 code.


49195 29-Jul-1999 mdodd

Alter the behavior of sys/kern/subr_bus.c:device_print_child()

- device_print_child() either lets the BUS_PRINT_CHILD
method produce the entire device announcement message or
it prints "foo0: not found\n"

Alter sys/kern/subr_bus.c:bus_generic_print_child() to take on
the previous behavior of device_print_child() (printing the
"foo0: <FooDevice 1.1>" bit of the announce message.)

Provide bus_print_child_header() and bus_print_child_footer()
to actually print the output for bus_generic_print_child().
These functions should be used whenever possible (unless you can
just use bus_generic_print_child())

The BUS_PRINT_CHILD method now returns int instead of void.

Modify everything else that defines or uses a BUS_PRINT_CHILD
method to comply with the above changes.

- Devices are 'on' a bus, not 'at' it.
- If a custom BUS_PRINT_CHILD method does the same thing
as bus_generic_print_child(), use bus_generic_print_child()
- Use device_get_nameunit() instead of both
device_get_name() and device_get_unit()
- All BUS_PRINT_CHILD methods return the number of
characters output.

Reviewed by: dfr, peter


48557 04-Jul-1999 phk

Remove cmaj and bmaj args from DEV_DRIVER_MODULE.


48528 03-Jul-1999 peter

Eliminate a bunch of #include "pci.h" and #if NPCI > 0 around entire
files. config will leave the whole file out if configured to do so.


48156 24-Jun-1999 jlemon

Compaq Smart RAID driver for -current. Based on the original ida.c
driver by Mark Dawson. This probably needs some work, but is stable
enough to boot a RAID-only configuration, and survive `make world'.