Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
/*-
|
2012-01-15 13:23:18 +00:00
|
|
|
* Copyright (c) 1998 - 2008 Søren Schmidt <sos@FreeBSD.org>
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer,
|
|
|
|
* without modification, immediately at the beginning of the file.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
|
|
|
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
|
|
|
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
|
|
|
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
|
|
|
|
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
|
|
|
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
|
|
|
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
|
|
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
|
|
|
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
*/
|
|
|
|
|
2003-08-24 17:55:58 +00:00
|
|
|
#include <sys/cdefs.h>
|
|
|
|
__FBSDID("$FreeBSD$");
|
|
|
|
|
1999-10-09 19:57:13 +00:00
|
|
|
#include "opt_ata.h"
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
#include <sys/param.h>
|
|
|
|
#include <sys/systm.h>
|
2001-03-15 15:36:25 +00:00
|
|
|
#include <sys/ata.h>
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
#include <sys/kernel.h>
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
#include <sys/module.h>
|
2003-08-24 09:22:26 +00:00
|
|
|
#include <sys/endian.h>
|
2003-10-10 11:00:06 +00:00
|
|
|
#include <sys/ctype.h>
|
2001-03-15 15:36:25 +00:00
|
|
|
#include <sys/conf.h>
|
1999-04-18 20:48:15 +00:00
|
|
|
#include <sys/bus.h>
|
2000-05-05 09:59:14 +00:00
|
|
|
#include <sys/bio.h>
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
#include <sys/malloc.h>
|
2000-01-27 19:00:51 +00:00
|
|
|
#include <sys/sysctl.h>
|
2004-01-14 21:26:35 +00:00
|
|
|
#include <sys/sema.h>
|
2003-08-24 09:22:26 +00:00
|
|
|
#include <sys/taskqueue.h>
|
2004-01-14 21:26:35 +00:00
|
|
|
#include <vm/uma.h>
|
2000-01-24 20:45:24 +00:00
|
|
|
#include <machine/stdarg.h>
|
1999-04-18 20:48:15 +00:00
|
|
|
#include <machine/resource.h>
|
|
|
|
#include <machine/bus.h>
|
|
|
|
#include <sys/rman.h>
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
#include <dev/ata/ata-all.h>
|
2010-07-25 15:43:52 +00:00
|
|
|
#include <dev/pci/pcivar.h>
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
#include <ata_if.h>
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
#include <cam/cam.h>
|
|
|
|
#include <cam/cam_ccb.h>
|
|
|
|
#include <cam/cam_sim.h>
|
|
|
|
#include <cam/cam_xpt_sim.h>
|
|
|
|
#include <cam/cam_debug.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* device structure */
|
|
|
|
static d_ioctl_t ata_ioctl;
|
2004-05-20 14:49:12 +00:00
|
|
|
static struct cdevsw ata_cdevsw = {
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
.d_version = D_VERSION,
|
2009-08-20 19:17:53 +00:00
|
|
|
.d_flags = D_NEEDGIANT, /* we need this as newbus isn't mpsafe */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
.d_ioctl = ata_ioctl,
|
|
|
|
.d_name = "ata",
|
2001-03-15 15:36:25 +00:00
|
|
|
};
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2001-03-15 15:36:25 +00:00
|
|
|
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
/* prototypes */
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2000-02-18 20:57:33 +00:00
|
|
|
static void ata_boot_attach(void);
|
2009-02-28 22:07:15 +00:00
|
|
|
static device_t ata_add_child(device_t, struct ata_device *, int);
|
2009-12-06 00:10:13 +00:00
|
|
|
#else
|
|
|
|
static void ataaction(struct cam_sim *sim, union ccb *ccb);
|
|
|
|
static void atapoll(struct cam_sim *sim);
|
|
|
|
#endif
|
2009-02-21 22:57:26 +00:00
|
|
|
static void ata_conn_event(void *, int);
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-29 11:30:03 +00:00
|
|
|
static void bswap(int8_t *, int);
|
|
|
|
static void btrim(int8_t *, int);
|
|
|
|
static void bpack(int8_t *, int8_t *, int);
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2009-12-06 00:10:13 +00:00
|
|
|
static void ata_interrupt_locked(void *data);
|
2011-04-21 09:02:19 +00:00
|
|
|
#ifdef ATA_CAM
|
2010-10-18 11:30:13 +00:00
|
|
|
static void ata_periodic_poll(void *data);
|
2011-04-21 09:02:19 +00:00
|
|
|
#endif
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
|
2003-11-11 14:55:36 +00:00
|
|
|
/* global vars */
|
2005-10-31 15:41:29 +00:00
|
|
|
MALLOC_DEFINE(M_ATA, "ata_generic", "ATA driver generic layer");
|
2005-05-16 13:07:27 +00:00
|
|
|
int (*ata_raid_ioctl_func)(u_long cmd, caddr_t data) = NULL;
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2006-03-08 16:39:01 +00:00
|
|
|
struct intr_config_hook *ata_delayed_attach = NULL;
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2003-11-11 14:55:36 +00:00
|
|
|
devclass_t ata_devclass;
|
2008-04-17 12:29:35 +00:00
|
|
|
uma_zone_t ata_request_zone;
|
2005-04-18 16:01:56 +00:00
|
|
|
uma_zone_t ata_composite_zone;
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2004-05-20 14:49:12 +00:00
|
|
|
int ata_wc = 1;
|
2008-04-10 13:05:05 +00:00
|
|
|
int ata_setmax = 0;
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2008-08-15 10:55:11 +00:00
|
|
|
int ata_dma_check_80pin = 1;
|
2003-11-11 14:55:36 +00:00
|
|
|
|
|
|
|
/* local vars */
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2003-11-11 14:55:36 +00:00
|
|
|
static int ata_dma = 1;
|
2004-08-01 12:31:38 +00:00
|
|
|
static int atapi_dma = 1;
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2003-11-11 14:55:36 +00:00
|
|
|
|
2001-03-19 08:04:54 +00:00
|
|
|
/* sysctl vars */
|
2011-11-07 15:43:11 +00:00
|
|
|
static SYSCTL_NODE(_hw, OID_AUTO, ata, CTLFLAG_RD, 0, "ATA driver parameters");
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2003-08-24 09:22:26 +00:00
|
|
|
TUNABLE_INT("hw.ata.ata_dma", &ata_dma);
|
2003-11-03 09:25:02 +00:00
|
|
|
SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma, CTLFLAG_RDTUN, &ata_dma, 0,
|
|
|
|
"ATA disk DMA mode control");
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2008-08-15 10:55:11 +00:00
|
|
|
TUNABLE_INT("hw.ata.ata_dma_check_80pin", &ata_dma_check_80pin);
|
|
|
|
SYSCTL_INT(_hw_ata, OID_AUTO, ata_dma_check_80pin,
|
2010-07-10 13:46:14 +00:00
|
|
|
CTLFLAG_RW, &ata_dma_check_80pin, 1,
|
2008-08-15 10:55:11 +00:00
|
|
|
"Check for 80pin cable before setting ATA DMA mode");
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2003-08-24 09:22:26 +00:00
|
|
|
TUNABLE_INT("hw.ata.atapi_dma", &atapi_dma);
|
2003-11-03 09:25:02 +00:00
|
|
|
SYSCTL_INT(_hw_ata, OID_AUTO, atapi_dma, CTLFLAG_RDTUN, &atapi_dma, 0,
|
|
|
|
"ATAPI device DMA mode control");
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
TUNABLE_INT("hw.ata.wc", &ata_wc);
|
|
|
|
SYSCTL_INT(_hw_ata, OID_AUTO, wc, CTLFLAG_RDTUN, &ata_wc, 0,
|
|
|
|
"ATA disk write caching");
|
2008-04-10 13:05:05 +00:00
|
|
|
TUNABLE_INT("hw.ata.setmax", &ata_setmax);
|
|
|
|
SYSCTL_INT(_hw_ata, OID_AUTO, setmax, CTLFLAG_RDTUN, &ata_setmax, 0,
|
|
|
|
"ATA disk set max native address");
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
Add a "kern.features.ata_cam" sysctl in the kernel when the ATA_CAM kernel
option is defined. This sysctl can be queried by feature_present(3).
Query for this feature in /sbin/atacontrol and /usr/sbin/burncd.
If these utilities detect that ATA_CAM is enabled, then these utilities
will error out. These utilities are compatible with the old ATA
driver, but are incomptible with the new ATA_CAM driver. By erroring out,
we give end-users an idea as to what remedies to use, and reduce the need for them
to file PR's. For atacontrol, camcontrol must be used instead,
and for burncd, alternative utilties from the ports collection must be used
such as sysutils/cdrtools.
In future, maybe someone can re-write burncd to work with ATA_CAM,
but at least for now, we give a somewhat useful error message to end users.
PR: 160979
Reviewed by: jh, Arnaud Lacombe <lacombar at gmail dot com>
Reported by: Joe Barbish <fbsd8 at a1poweruser dot com>
MFC after: 3 days
2011-10-09 21:42:02 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
FEATURE(ata_cam, "ATA devices are accessed through the cam(4) driver");
|
|
|
|
#endif
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
|
2003-08-24 09:22:26 +00:00
|
|
|
/*
|
|
|
|
* newbus device interface related functions
|
|
|
|
*/
|
2000-09-19 11:08:39 +00:00
|
|
|
int
|
2000-02-18 20:57:33 +00:00
|
|
|
ata_probe(device_t dev)
|
|
|
|
{
|
2004-08-12 08:20:36 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int
|
|
|
|
ata_attach(device_t dev)
|
|
|
|
{
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
2004-08-12 08:20:36 +00:00
|
|
|
int error, rid;
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
struct cam_devq *devq;
|
2010-07-03 14:14:42 +00:00
|
|
|
const char *res;
|
|
|
|
char buf[64];
|
|
|
|
int i, mode;
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2004-08-12 08:20:36 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* check that we have a virgin channel to attach */
|
|
|
|
if (ch->r_irq)
|
|
|
|
return EEXIST;
|
2004-08-12 08:20:36 +00:00
|
|
|
|
2000-02-18 20:57:33 +00:00
|
|
|
/* initialize the softc basics */
|
2003-08-24 09:22:26 +00:00
|
|
|
ch->dev = dev;
|
2004-09-26 11:48:43 +00:00
|
|
|
ch->state = ATA_IDLE;
|
|
|
|
bzero(&ch->state_mtx, sizeof(struct mtx));
|
|
|
|
mtx_init(&ch->state_mtx, "ATA state lock", NULL, MTX_DEF);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
bzero(&ch->queue_mtx, sizeof(struct mtx));
|
|
|
|
mtx_init(&ch->queue_mtx, "ATA queue lock", NULL, MTX_DEF);
|
|
|
|
TAILQ_INIT(&ch->ata_queue);
|
2009-02-21 22:57:26 +00:00
|
|
|
TASK_INIT(&ch->conntask, 0, ata_conn_event, dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
for (i = 0; i < 16; i++) {
|
2012-10-02 22:03:21 +00:00
|
|
|
ch->user[i].revision = 0;
|
|
|
|
snprintf(buf, sizeof(buf), "dev%d.sata_rev", i);
|
|
|
|
if (resource_int_value(device_get_name(dev),
|
|
|
|
device_get_unit(dev), buf, &mode) != 0 &&
|
|
|
|
resource_int_value(device_get_name(dev),
|
|
|
|
device_get_unit(dev), "sata_rev", &mode) != 0)
|
|
|
|
mode = -1;
|
|
|
|
if (mode >= 0)
|
|
|
|
ch->user[i].revision = mode;
|
2009-12-06 00:10:13 +00:00
|
|
|
ch->user[i].mode = 0;
|
2010-07-03 14:14:42 +00:00
|
|
|
snprintf(buf, sizeof(buf), "dev%d.mode", i);
|
|
|
|
if (resource_string_value(device_get_name(dev),
|
|
|
|
device_get_unit(dev), buf, &res) == 0)
|
|
|
|
mode = ata_str2mode(res);
|
|
|
|
else if (resource_string_value(device_get_name(dev),
|
|
|
|
device_get_unit(dev), "mode", &res) == 0)
|
|
|
|
mode = ata_str2mode(res);
|
|
|
|
else
|
|
|
|
mode = -1;
|
|
|
|
if (mode >= 0)
|
|
|
|
ch->user[i].mode = mode;
|
2009-12-06 00:10:13 +00:00
|
|
|
if (ch->flags & ATA_SATA)
|
|
|
|
ch->user[i].bytecount = 8192;
|
|
|
|
else
|
|
|
|
ch->user[i].bytecount = MAXPHYS;
|
2010-11-18 19:28:45 +00:00
|
|
|
ch->user[i].caps = 0;
|
2009-12-06 00:10:13 +00:00
|
|
|
ch->curr[i] = ch->user[i];
|
2010-11-18 19:28:45 +00:00
|
|
|
if (ch->pm_level > 0)
|
|
|
|
ch->user[i].caps |= CTS_SATA_CAPS_H_PMREQ;
|
|
|
|
if (ch->pm_level > 1)
|
|
|
|
ch->user[i].caps |= CTS_SATA_CAPS_D_PMREQ;
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
2010-10-18 11:30:13 +00:00
|
|
|
callout_init(&ch->poll_callout, 1);
|
2011-04-21 09:02:19 +00:00
|
|
|
#endif
|
2003-03-29 13:37:09 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-08 09:37:47 +00:00
|
|
|
/* reset the controller HW, the channel and device(s) */
|
2005-03-31 15:05:40 +00:00
|
|
|
while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
|
2007-02-23 16:25:08 +00:00
|
|
|
pause("ataatch", 1);
|
2005-04-28 22:08:08 +00:00
|
|
|
ATA_RESET(dev);
|
2005-03-31 15:05:40 +00:00
|
|
|
ATA_LOCKING(dev, ATA_LF_UNLOCK);
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2000-02-18 20:57:33 +00:00
|
|
|
|
2008-06-11 06:44:58 +00:00
|
|
|
/* allocate DMA resources if DMA HW present*/
|
|
|
|
if (ch->dma.alloc)
|
|
|
|
ch->dma.alloc(dev);
|
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* setup interrupt delivery */
|
2001-02-06 16:44:25 +00:00
|
|
|
rid = ATA_IRQ_RID;
|
2004-03-17 17:50:55 +00:00
|
|
|
ch->r_irq = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid,
|
|
|
|
RF_SHAREABLE | RF_ACTIVE);
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
if (!ch->r_irq) {
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_printf(dev, "unable to allocate interrupt\n");
|
2000-02-18 20:57:33 +00:00
|
|
|
return ENXIO;
|
|
|
|
}
|
2007-02-23 12:19:07 +00:00
|
|
|
if ((error = bus_setup_intr(dev, ch->r_irq, ATA_INTR_FLAGS, NULL,
|
2009-02-17 21:17:21 +00:00
|
|
|
ata_interrupt, ch, &ch->ih))) {
|
2010-07-12 12:16:11 +00:00
|
|
|
bus_release_resource(dev, SYS_RES_IRQ, rid, ch->r_irq);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_printf(dev, "unable to setup interrupt\n");
|
2010-07-12 12:16:11 +00:00
|
|
|
return error;
|
2002-03-03 15:36:21 +00:00
|
|
|
}
|
2000-01-18 21:02:59 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-21 11:13:39 +00:00
|
|
|
/* probe and attach devices on this channel unless we are in early boot */
|
|
|
|
if (!ata_delayed_attach)
|
|
|
|
ata_identify(dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
return (0);
|
|
|
|
#else
|
2011-04-21 09:02:19 +00:00
|
|
|
if (ch->flags & ATA_PERIODIC_POLL)
|
|
|
|
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
|
2010-07-12 12:16:11 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
2009-12-06 00:10:13 +00:00
|
|
|
/* Create the device queue for our SIM. */
|
|
|
|
devq = cam_simq_alloc(1);
|
|
|
|
if (devq == NULL) {
|
|
|
|
device_printf(dev, "Unable to allocate simq\n");
|
|
|
|
error = ENOMEM;
|
|
|
|
goto err1;
|
|
|
|
}
|
|
|
|
/* Construct SIM entry */
|
|
|
|
ch->sim = cam_sim_alloc(ataaction, atapoll, "ata", ch,
|
|
|
|
device_get_unit(dev), &ch->state_mtx, 1, 0, devq);
|
|
|
|
if (ch->sim == NULL) {
|
|
|
|
device_printf(dev, "unable to allocate sim\n");
|
2010-07-12 12:16:11 +00:00
|
|
|
cam_simq_free(devq);
|
2009-12-06 00:10:13 +00:00
|
|
|
error = ENOMEM;
|
2010-07-12 12:16:11 +00:00
|
|
|
goto err1;
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
|
|
|
if (xpt_bus_register(ch->sim, dev, 0) != CAM_SUCCESS) {
|
|
|
|
device_printf(dev, "unable to register xpt bus\n");
|
|
|
|
error = ENXIO;
|
|
|
|
goto err2;
|
|
|
|
}
|
|
|
|
if (xpt_create_path(&ch->path, /*periph*/NULL, cam_sim_path(ch->sim),
|
|
|
|
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
|
|
|
|
device_printf(dev, "unable to create path\n");
|
|
|
|
error = ENXIO;
|
|
|
|
goto err3;
|
|
|
|
}
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
return (0);
|
|
|
|
|
|
|
|
err3:
|
|
|
|
xpt_bus_deregister(cam_sim_path(ch->sim));
|
|
|
|
err2:
|
|
|
|
cam_sim_free(ch->sim, /*free_devq*/TRUE);
|
2010-07-12 12:16:11 +00:00
|
|
|
ch->sim = NULL;
|
2009-12-06 00:10:13 +00:00
|
|
|
err1:
|
2010-07-12 12:16:11 +00:00
|
|
|
bus_release_resource(dev, SYS_RES_IRQ, rid, ch->r_irq);
|
2009-12-06 00:10:13 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
2010-10-18 11:30:13 +00:00
|
|
|
if (ch->flags & ATA_PERIODIC_POLL)
|
|
|
|
callout_drain(&ch->poll_callout);
|
2009-12-06 00:10:13 +00:00
|
|
|
return (error);
|
2010-07-12 12:16:11 +00:00
|
|
|
#endif
|
2000-02-18 20:57:33 +00:00
|
|
|
}
|
|
|
|
|
2001-03-06 21:43:46 +00:00
|
|
|
int
|
2000-02-18 20:57:33 +00:00
|
|
|
ata_detach(device_t dev)
|
|
|
|
{
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_t *children;
|
|
|
|
int nchildren, i;
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2005-09-14 12:45:06 +00:00
|
|
|
/* check that we have a valid channel to detach */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (!ch->r_irq)
|
2000-02-18 20:57:33 +00:00
|
|
|
return ENXIO;
|
2000-01-18 21:02:59 +00:00
|
|
|
|
2006-02-25 17:27:33 +00:00
|
|
|
/* grap the channel lock so no new requests gets launched */
|
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
ch->state |= ATA_STALL_QUEUE;
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
2011-04-21 09:02:19 +00:00
|
|
|
#ifdef ATA_CAM
|
2010-10-18 11:30:13 +00:00
|
|
|
if (ch->flags & ATA_PERIODIC_POLL)
|
|
|
|
callout_drain(&ch->poll_callout);
|
2011-04-21 09:02:19 +00:00
|
|
|
#endif
|
2006-02-25 17:27:33 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* detach & delete all children */
|
|
|
|
if (!device_get_children(dev, &children, &nchildren)) {
|
|
|
|
for (i = 0; i < nchildren; i++)
|
|
|
|
if (children[i])
|
2009-02-28 22:07:15 +00:00
|
|
|
device_delete_child(dev, children[i]);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
free(children, M_TEMP);
|
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2009-02-21 22:57:26 +00:00
|
|
|
taskqueue_drain(taskqueue_thread, &ch->conntask);
|
2004-07-12 10:50:50 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
xpt_async(AC_LOST_DEVICE, ch->path, NULL);
|
|
|
|
xpt_free_path(ch->path);
|
|
|
|
xpt_bus_deregister(cam_sim_path(ch->sim));
|
|
|
|
cam_sim_free(ch->sim, /*free_devq*/TRUE);
|
2010-07-12 12:16:11 +00:00
|
|
|
ch->sim = NULL;
|
2009-12-06 00:10:13 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
#endif
|
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* release resources */
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
bus_teardown_intr(dev, ch->r_irq, ch->ih);
|
|
|
|
bus_release_resource(dev, SYS_RES_IRQ, ATA_IRQ_RID, ch->r_irq);
|
|
|
|
ch->r_irq = NULL;
|
2009-02-18 21:12:48 +00:00
|
|
|
|
|
|
|
/* free DMA resources if DMA HW present*/
|
|
|
|
if (ch->dma.free)
|
|
|
|
ch->dma.free(dev);
|
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
mtx_destroy(&ch->state_mtx);
|
2004-03-01 13:17:07 +00:00
|
|
|
mtx_destroy(&ch->queue_mtx);
|
2003-08-24 09:22:26 +00:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-02-21 22:57:26 +00:00
|
|
|
static void
|
|
|
|
ata_conn_event(void *context, int dummy)
|
|
|
|
{
|
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
|
|
|
device_t dev = (device_t)context;
|
|
|
|
#ifdef ATA_CAM
|
2010-02-23 16:39:53 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
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
|
|
|
union ccb *ccb;
|
2009-02-21 22:57:26 +00:00
|
|
|
|
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
|
|
|
mtx_lock(&ch->state_mtx);
|
2010-07-12 12:16:11 +00:00
|
|
|
if (ch->sim == NULL) {
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
return;
|
|
|
|
}
|
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
|
|
|
ata_reinit(dev);
|
2010-07-12 12:16:11 +00:00
|
|
|
if ((ccb = xpt_alloc_ccb_nowait()) == NULL)
|
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
|
|
|
return;
|
|
|
|
if (xpt_create_path(&ccb->ccb_h.path, NULL,
|
|
|
|
cam_sim_path(ch->sim),
|
|
|
|
CAM_TARGET_WILDCARD, CAM_LUN_WILDCARD) != CAM_REQ_CMP) {
|
|
|
|
xpt_free_ccb(ccb);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
xpt_rescan(ccb);
|
2010-07-12 12:16:11 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
2010-02-23 16:39:53 +00:00
|
|
|
#else
|
|
|
|
ata_reinit(dev);
|
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
|
|
|
#endif
|
2009-02-21 22:57:26 +00:00
|
|
|
}
|
|
|
|
|
2003-08-24 09:22:26 +00:00
|
|
|
int
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
ata_reinit(device_t dev)
|
2003-08-24 09:22:26 +00:00
|
|
|
{
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
2005-09-14 12:45:06 +00:00
|
|
|
struct ata_request *request;
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_t *children;
|
|
|
|
int nchildren, i;
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2005-09-14 12:45:06 +00:00
|
|
|
/* check that we have a valid channel to reinit */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (!ch || !ch->r_irq)
|
2003-08-24 09:22:26 +00:00
|
|
|
return ENXIO;
|
|
|
|
|
2004-01-11 22:08:34 +00:00
|
|
|
if (bootverbose)
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_printf(dev, "reiniting channel ..\n");
|
2004-08-27 14:48:32 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* poll for locking the channel */
|
2005-03-31 15:05:40 +00:00
|
|
|
while (ATA_LOCKING(dev, ATA_LF_LOCK) != ch->unit)
|
2007-02-23 16:25:08 +00:00
|
|
|
pause("atarini", 1);
|
2004-10-06 19:46:08 +00:00
|
|
|
|
2006-02-25 17:27:33 +00:00
|
|
|
/* catch eventual request in ch->running */
|
2004-09-26 11:48:43 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
2009-02-21 22:57:26 +00:00
|
|
|
if (ch->state & ATA_STALL_QUEUE) {
|
|
|
|
/* Recursive reinits and reinits during detach prohobited. */
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
return (ENXIO);
|
|
|
|
}
|
2006-02-25 17:27:33 +00:00
|
|
|
if ((request = ch->running))
|
|
|
|
callout_stop(&request->callout);
|
|
|
|
ch->running = NULL;
|
|
|
|
|
|
|
|
/* unconditionally grap the channel lock */
|
|
|
|
ch->state |= ATA_STALL_QUEUE;
|
2004-09-26 11:48:43 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
|
2005-04-08 09:37:47 +00:00
|
|
|
/* reset the controller HW, the channel and device(s) */
|
2005-04-28 22:08:08 +00:00
|
|
|
ATA_RESET(dev);
|
2003-08-24 09:22:26 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* reinit the children and delete any that fails */
|
|
|
|
if (!device_get_children(dev, &children, &nchildren)) {
|
2009-08-20 19:17:53 +00:00
|
|
|
mtx_lock(&Giant); /* newbus suckage it needs Giant */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
for (i = 0; i < nchildren; i++) {
|
2006-02-25 17:27:33 +00:00
|
|
|
/* did any children go missing ? */
|
|
|
|
if (children[i] && device_is_attached(children[i]) &&
|
|
|
|
ATA_REINIT(children[i])) {
|
|
|
|
/*
|
|
|
|
* if we had a running request and its device matches
|
|
|
|
* this child we need to inform the request that the
|
|
|
|
* device is gone.
|
|
|
|
*/
|
|
|
|
if (request && request->dev == children[i]) {
|
|
|
|
request->result = ENXIO;
|
|
|
|
device_printf(request->dev, "FAILURE - device detached\n");
|
|
|
|
|
|
|
|
/* if not timeout finish request here */
|
|
|
|
if (!(request->flags & ATA_R_TIMEOUT))
|
2005-09-14 12:45:06 +00:00
|
|
|
ata_finish(request);
|
2006-02-25 17:27:33 +00:00
|
|
|
request = NULL;
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
}
|
2009-02-28 22:07:15 +00:00
|
|
|
device_delete_child(dev, children[i]);
|
2006-02-25 17:27:33 +00:00
|
|
|
}
|
2003-10-07 13:44:15 +00:00
|
|
|
}
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
free(children, M_TEMP);
|
2009-08-20 19:17:53 +00:00
|
|
|
mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */
|
2003-08-24 09:22:26 +00:00
|
|
|
}
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2006-02-25 17:27:33 +00:00
|
|
|
/* if we still have a good request put it on the queue again */
|
|
|
|
if (request && !(request->flags & ATA_R_TIMEOUT)) {
|
2005-09-14 12:45:06 +00:00
|
|
|
device_printf(request->dev,
|
|
|
|
"WARNING - %s requeued due to channel reset",
|
|
|
|
ata_cmd2str(request));
|
|
|
|
if (!(request->flags & (ATA_R_ATAPI | ATA_R_CONTROL)))
|
2006-03-09 08:34:44 +00:00
|
|
|
printf(" LBA=%ju", request->u.ata.lba);
|
2005-09-14 12:45:06 +00:00
|
|
|
printf("\n");
|
|
|
|
request->flags |= ATA_R_REQUEUE;
|
|
|
|
ata_queue_request(request);
|
|
|
|
}
|
2004-09-26 11:48:43 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* we're done release the channel for new work */
|
2004-10-19 20:13:38 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
ch->state = ATA_IDLE;
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
2005-03-31 15:05:40 +00:00
|
|
|
ATA_LOCKING(dev, ATA_LF_UNLOCK);
|
2003-08-24 09:22:26 +00:00
|
|
|
|
2009-02-21 22:57:26 +00:00
|
|
|
/* Add new children. */
|
2009-02-28 22:07:15 +00:00
|
|
|
/* ata_identify(dev); */
|
2009-02-21 22:57:26 +00:00
|
|
|
|
2004-01-11 22:08:34 +00:00
|
|
|
if (bootverbose)
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_printf(dev, "reinit done ..\n");
|
2004-09-26 11:48:43 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* kick off requests on the queue */
|
|
|
|
ata_start(dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
#else
|
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
|
|
|
xpt_freeze_simq(ch->sim, 1);
|
2009-12-06 00:10:13 +00:00
|
|
|
if ((request = ch->running)) {
|
|
|
|
ch->running = NULL;
|
|
|
|
if (ch->state == ATA_ACTIVE)
|
|
|
|
ch->state = ATA_IDLE;
|
|
|
|
callout_stop(&request->callout);
|
|
|
|
if (ch->dma.unload)
|
|
|
|
ch->dma.unload(request);
|
|
|
|
request->result = ERESTART;
|
|
|
|
ata_cam_end_transaction(dev, request);
|
|
|
|
}
|
|
|
|
/* reset the controller HW, the channel and device(s) */
|
|
|
|
ATA_RESET(dev);
|
|
|
|
/* Tell the XPT about the event */
|
|
|
|
xpt_async(AC_BUS_RESET, ch->path, NULL);
|
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
|
|
|
xpt_release_simq(ch->sim, TRUE);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
|
|
|
return(0);
|
2000-02-18 20:57:33 +00:00
|
|
|
}
|
|
|
|
|
2003-05-04 09:34:14 +00:00
|
|
|
int
|
|
|
|
ata_suspend(device_t dev)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch;
|
|
|
|
|
2005-04-21 11:13:39 +00:00
|
|
|
/* check for valid device */
|
2003-05-04 09:34:14 +00:00
|
|
|
if (!dev || !(ch = device_get_softc(dev)))
|
|
|
|
return ENXIO;
|
2004-08-12 08:20:36 +00:00
|
|
|
|
2010-05-21 13:29:28 +00:00
|
|
|
#ifdef ATA_CAM
|
2011-04-21 09:02:19 +00:00
|
|
|
if (ch->flags & ATA_PERIODIC_POLL)
|
|
|
|
callout_drain(&ch->poll_callout);
|
2010-05-21 13:29:28 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
xpt_freeze_simq(ch->sim, 1);
|
|
|
|
while (ch->state != ATA_IDLE)
|
|
|
|
msleep(ch, &ch->state_mtx, PRIBIO, "atasusp", hz/100);
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
#else
|
2006-04-14 16:25:42 +00:00
|
|
|
/* wait for the channel to be IDLE or detached before suspending */
|
|
|
|
while (ch->r_irq) {
|
2004-09-26 11:48:43 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
if (ch->state == ATA_IDLE) {
|
|
|
|
ch->state = ATA_ACTIVE;
|
2004-10-19 20:13:38 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
break;
|
2004-09-26 11:48:43 +00:00
|
|
|
}
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
2004-10-19 20:13:38 +00:00
|
|
|
tsleep(ch, PRIBIO, "atasusp", hz/10);
|
2004-09-26 11:48:43 +00:00
|
|
|
}
|
2005-03-31 15:05:40 +00:00
|
|
|
ATA_LOCKING(dev, ATA_LF_UNLOCK);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
|
|
|
return(0);
|
2003-05-04 09:34:14 +00:00
|
|
|
}
|
|
|
|
|
2001-03-06 21:43:46 +00:00
|
|
|
int
|
2000-02-18 20:57:33 +00:00
|
|
|
ata_resume(device_t dev)
|
|
|
|
{
|
2010-05-21 13:29:28 +00:00
|
|
|
struct ata_channel *ch;
|
2002-12-03 20:20:44 +00:00
|
|
|
int error;
|
|
|
|
|
2005-04-21 11:13:39 +00:00
|
|
|
/* check for valid device */
|
2010-05-21 13:29:28 +00:00
|
|
|
if (!dev || !(ch = device_get_softc(dev)))
|
2002-12-03 20:20:44 +00:00
|
|
|
return ENXIO;
|
|
|
|
|
2010-05-21 13:29:28 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
mtx_lock(&ch->state_mtx);
|
|
|
|
error = ata_reinit(dev);
|
|
|
|
xpt_release_simq(ch->sim, TRUE);
|
|
|
|
mtx_unlock(&ch->state_mtx);
|
2011-04-21 09:02:19 +00:00
|
|
|
if (ch->flags & ATA_PERIODIC_POLL)
|
|
|
|
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
|
2010-05-21 13:29:28 +00:00
|
|
|
#else
|
2005-04-21 11:13:39 +00:00
|
|
|
/* reinit the devices, we dont know what mode/state they are in */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
error = ata_reinit(dev);
|
|
|
|
/* kick off requests on the queue */
|
|
|
|
ata_start(dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
return error;
|
2003-08-24 09:22:26 +00:00
|
|
|
}
|
2003-03-22 12:18:20 +00:00
|
|
|
|
2009-02-17 21:17:21 +00:00
|
|
|
void
|
2004-09-26 11:48:43 +00:00
|
|
|
ata_interrupt(void *data)
|
2009-12-06 00:10:13 +00:00
|
|
|
{
|
|
|
|
#ifdef ATA_CAM
|
|
|
|
struct ata_channel *ch = (struct ata_channel *)data;
|
|
|
|
|
|
|
|
mtx_lock(&ch->state_mtx);
|
2012-05-12 13:55:36 +00:00
|
|
|
xpt_batch_start(ch->sim);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
|
|
|
ata_interrupt_locked(data);
|
|
|
|
#ifdef ATA_CAM
|
2012-05-12 13:55:36 +00:00
|
|
|
xpt_batch_done(ch->sim);
|
2009-12-06 00:10:13 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ata_interrupt_locked(void *data)
|
2004-09-26 11:48:43 +00:00
|
|
|
{
|
|
|
|
struct ata_channel *ch = (struct ata_channel *)data;
|
2004-10-13 15:16:35 +00:00
|
|
|
struct ata_request *request;
|
2004-09-26 11:48:43 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2004-09-26 11:48:43 +00:00
|
|
|
mtx_lock(&ch->state_mtx);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2004-10-13 15:16:35 +00:00
|
|
|
do {
|
2006-01-18 09:14:55 +00:00
|
|
|
/* ignore interrupt if its not for us */
|
|
|
|
if (ch->hw.status && !ch->hw.status(ch->dev))
|
|
|
|
break;
|
|
|
|
|
2004-10-13 15:16:35 +00:00
|
|
|
/* do we have a running request */
|
2005-09-14 12:45:06 +00:00
|
|
|
if (!(request = ch->running))
|
2004-10-13 15:16:35 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
ATA_DEBUG_RQ(request, "interrupt");
|
|
|
|
|
2006-01-18 09:14:55 +00:00
|
|
|
/* safetycheck for the right state */
|
2006-02-25 17:27:33 +00:00
|
|
|
if (ch->state == ATA_IDLE) {
|
2005-09-14 12:45:06 +00:00
|
|
|
device_printf(request->dev, "interrupt on idle channel ignored\n");
|
2004-10-13 15:16:35 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/*
|
2006-03-09 10:24:03 +00:00
|
|
|
* we have the HW locks, so end the transaction for this request
|
2005-04-21 11:13:39 +00:00
|
|
|
* if it finishes immediately otherwise wait for next interrupt
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
*/
|
2004-10-13 15:16:35 +00:00
|
|
|
if (ch->hw.end_transaction(request) == ATA_OP_FINISHED) {
|
2004-09-26 11:48:43 +00:00
|
|
|
ch->running = NULL;
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (ch->state == ATA_ACTIVE)
|
2004-09-26 11:48:43 +00:00
|
|
|
ch->state = ATA_IDLE;
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
ata_cam_end_transaction(ch->dev, request);
|
|
|
|
#else
|
2004-09-26 11:48:43 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
2005-03-31 15:05:40 +00:00
|
|
|
ATA_LOCKING(ch->dev, ATA_LF_UNLOCK);
|
2004-09-26 11:48:43 +00:00
|
|
|
ata_finish(request);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2009-02-17 21:17:21 +00:00
|
|
|
return;
|
2004-09-26 11:48:43 +00:00
|
|
|
}
|
2004-10-13 15:16:35 +00:00
|
|
|
} while (0);
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2004-10-13 15:16:35 +00:00
|
|
|
mtx_unlock(&ch->state_mtx);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
2011-04-21 09:02:19 +00:00
|
|
|
#ifdef ATA_CAM
|
2010-10-18 11:30:13 +00:00
|
|
|
static void
|
|
|
|
ata_periodic_poll(void *data)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = (struct ata_channel *)data;
|
|
|
|
|
|
|
|
callout_reset(&ch->poll_callout, hz, ata_periodic_poll, ch);
|
|
|
|
ata_interrupt(ch);
|
|
|
|
}
|
2011-04-21 09:02:19 +00:00
|
|
|
#endif
|
2010-10-18 11:30:13 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
void
|
|
|
|
ata_print_cable(device_t dev, u_int8_t *who)
|
|
|
|
{
|
|
|
|
device_printf(dev,
|
|
|
|
"DMA limited to UDMA33, %s found non-ATA66 cable\n", who);
|
|
|
|
}
|
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2009-12-06 00:10:13 +00:00
|
|
|
int
|
|
|
|
ata_check_80pin(device_t dev, int mode)
|
|
|
|
{
|
|
|
|
struct ata_device *atadev = device_get_softc(dev);
|
|
|
|
|
|
|
|
if (!ata_dma_check_80pin) {
|
|
|
|
if (bootverbose)
|
|
|
|
device_printf(dev, "Skipping 80pin cable check\n");
|
|
|
|
return mode;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mode > ATA_UDMA2 && !(atadev->param.hwres & ATA_CABLE_ID)) {
|
|
|
|
ata_print_cable(dev, "device");
|
|
|
|
mode = ATA_UDMA2;
|
|
|
|
}
|
|
|
|
return mode;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2009-12-06 00:10:13 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2009-12-06 00:10:13 +00:00
|
|
|
void
|
|
|
|
ata_setmode(device_t dev)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
|
|
|
|
struct ata_device *atadev = device_get_softc(dev);
|
|
|
|
int error, mode, pmode;
|
|
|
|
|
|
|
|
mode = atadev->mode;
|
|
|
|
do {
|
|
|
|
pmode = mode = ata_limit_mode(dev, mode, ATA_DMA_MAX);
|
|
|
|
mode = ATA_SETMODE(device_get_parent(dev), atadev->unit, mode);
|
|
|
|
if ((ch->flags & (ATA_CHECKS_CABLE | ATA_SATA)) == 0)
|
|
|
|
mode = ata_check_80pin(dev, mode);
|
|
|
|
} while (pmode != mode); /* Interate till successfull negotiation. */
|
|
|
|
error = ata_controlcmd(dev, ATA_SETFEATURES, ATA_SF_SETXFER, 0, mode);
|
|
|
|
if (bootverbose)
|
|
|
|
device_printf(dev, "%ssetting %s\n",
|
|
|
|
(error) ? "FAILURE " : "", ata_mode2str(mode));
|
|
|
|
atadev->mode = mode;
|
2004-09-26 11:48:43 +00:00
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2004-09-26 11:48:43 +00:00
|
|
|
|
2003-08-24 09:22:26 +00:00
|
|
|
/*
|
|
|
|
* device related interfaces
|
|
|
|
*/
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2003-08-24 09:22:26 +00:00
|
|
|
static int
|
2005-05-16 13:07:27 +00:00
|
|
|
ata_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
|
2004-09-26 11:48:43 +00:00
|
|
|
int32_t flag, struct thread *td)
|
2003-08-24 09:22:26 +00:00
|
|
|
{
|
2005-05-16 13:07:27 +00:00
|
|
|
device_t device, *children;
|
|
|
|
struct ata_ioc_devices *devices = (struct ata_ioc_devices *)data;
|
|
|
|
int *value = (int *)data;
|
|
|
|
int i, nchildren, error = ENOTTY;
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
case IOCATAGMAXCHANNEL:
|
2008-04-20 17:45:32 +00:00
|
|
|
/* In case we have channel 0..n this will return n+1. */
|
2005-05-16 13:07:27 +00:00
|
|
|
*value = devclass_get_maxunit(ata_devclass);
|
|
|
|
error = 0;
|
|
|
|
break;
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
case IOCATAREINIT:
|
2008-04-20 17:45:32 +00:00
|
|
|
if (*value >= devclass_get_maxunit(ata_devclass) ||
|
2009-02-19 12:47:24 +00:00
|
|
|
!(device = devclass_get_device(ata_devclass, *value)) ||
|
2009-08-20 19:17:53 +00:00
|
|
|
!device_is_attached(device))
|
2005-05-16 13:07:27 +00:00
|
|
|
return ENXIO;
|
|
|
|
error = ata_reinit(device);
|
2003-08-24 09:22:26 +00:00
|
|
|
break;
|
2002-03-30 16:36:41 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
case IOCATAATTACH:
|
2008-04-20 17:45:32 +00:00
|
|
|
if (*value >= devclass_get_maxunit(ata_devclass) ||
|
2009-02-19 12:47:24 +00:00
|
|
|
!(device = devclass_get_device(ata_devclass, *value)) ||
|
2009-08-20 19:17:53 +00:00
|
|
|
!device_is_attached(device))
|
2005-05-16 13:07:27 +00:00
|
|
|
return ENXIO;
|
2009-02-19 12:47:24 +00:00
|
|
|
error = DEVICE_ATTACH(device);
|
2005-05-16 13:07:27 +00:00
|
|
|
break;
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
case IOCATADETACH:
|
2008-04-20 17:45:32 +00:00
|
|
|
if (*value >= devclass_get_maxunit(ata_devclass) ||
|
2009-02-19 12:47:24 +00:00
|
|
|
!(device = devclass_get_device(ata_devclass, *value)) ||
|
2009-08-20 19:17:53 +00:00
|
|
|
!device_is_attached(device))
|
2005-05-16 13:07:27 +00:00
|
|
|
return ENXIO;
|
2009-02-19 12:47:24 +00:00
|
|
|
error = DEVICE_DETACH(device);
|
2003-08-24 09:22:26 +00:00
|
|
|
break;
|
2002-04-02 13:48:17 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
case IOCATADEVICES:
|
2008-04-20 17:45:32 +00:00
|
|
|
if (devices->channel >= devclass_get_maxunit(ata_devclass) ||
|
2009-02-19 12:47:24 +00:00
|
|
|
!(device = devclass_get_device(ata_devclass, devices->channel)) ||
|
2009-08-20 19:17:53 +00:00
|
|
|
!device_is_attached(device))
|
2005-05-16 13:07:27 +00:00
|
|
|
return ENXIO;
|
|
|
|
bzero(devices->name[0], 32);
|
|
|
|
bzero(&devices->params[0], sizeof(struct ata_params));
|
|
|
|
bzero(devices->name[1], 32);
|
|
|
|
bzero(&devices->params[1], sizeof(struct ata_params));
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (!device_get_children(device, &children, &nchildren)) {
|
|
|
|
for (i = 0; i < nchildren; i++) {
|
2005-05-16 13:07:27 +00:00
|
|
|
if (children[i] && device_is_attached(children[i])) {
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
struct ata_device *atadev = device_get_softc(children[i]);
|
|
|
|
|
2008-04-10 13:05:05 +00:00
|
|
|
if (atadev->unit == ATA_MASTER) { /* XXX SOS PM */
|
2005-05-16 13:07:27 +00:00
|
|
|
strncpy(devices->name[0],
|
|
|
|
device_get_nameunit(children[i]), 32);
|
|
|
|
bcopy(&atadev->param, &devices->params[0],
|
|
|
|
sizeof(struct ata_params));
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
}
|
2008-04-10 13:05:05 +00:00
|
|
|
if (atadev->unit == ATA_SLAVE) { /* XXX SOS PM */
|
2005-05-16 13:07:27 +00:00
|
|
|
strncpy(devices->name[1],
|
|
|
|
device_get_nameunit(children[i]), 32);
|
|
|
|
bcopy(&atadev->param, &devices->params[1],
|
|
|
|
sizeof(struct ata_params));
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
free(children, M_TEMP);
|
|
|
|
error = 0;
|
2003-08-24 09:22:26 +00:00
|
|
|
}
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
else
|
2005-05-16 13:07:27 +00:00
|
|
|
error = ENODEV;
|
2003-08-24 09:22:26 +00:00
|
|
|
break;
|
2003-05-02 12:41:44 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
default:
|
|
|
|
if (ata_raid_ioctl_func)
|
|
|
|
error = ata_raid_ioctl_func(cmd, data);
|
|
|
|
}
|
|
|
|
return error;
|
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-05-16 13:07:27 +00:00
|
|
|
int
|
|
|
|
ata_device_ioctl(device_t dev, u_long cmd, caddr_t data)
|
|
|
|
{
|
|
|
|
struct ata_device *atadev = device_get_softc(dev);
|
2009-07-16 19:48:39 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(device_get_parent(dev));
|
2005-05-16 13:07:27 +00:00
|
|
|
struct ata_ioc_request *ioc_request = (struct ata_ioc_request *)data;
|
|
|
|
struct ata_params *params = (struct ata_params *)data;
|
|
|
|
int *mode = (int *)data;
|
|
|
|
struct ata_request *request;
|
|
|
|
caddr_t buf;
|
|
|
|
int error;
|
|
|
|
|
|
|
|
switch (cmd) {
|
|
|
|
case IOCATAREQUEST:
|
2009-07-16 19:48:39 +00:00
|
|
|
if (ioc_request->count >
|
|
|
|
(ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS)) {
|
|
|
|
return (EFBIG);
|
|
|
|
}
|
2005-05-16 13:07:27 +00:00
|
|
|
if (!(buf = malloc(ioc_request->count, M_ATA, M_NOWAIT))) {
|
|
|
|
return ENOMEM;
|
|
|
|
}
|
2008-04-17 12:29:35 +00:00
|
|
|
if (!(request = ata_alloc_request())) {
|
2005-05-16 13:07:27 +00:00
|
|
|
free(buf, M_ATA);
|
|
|
|
return ENOMEM;
|
|
|
|
}
|
2008-04-17 12:29:35 +00:00
|
|
|
request->dev = atadev->dev;
|
2005-05-16 13:07:27 +00:00
|
|
|
if (ioc_request->flags & ATA_CMD_WRITE) {
|
|
|
|
error = copyin(ioc_request->data, buf, ioc_request->count);
|
|
|
|
if (error) {
|
|
|
|
free(buf, M_ATA);
|
|
|
|
ata_free_request(request);
|
|
|
|
return error;
|
2001-08-30 09:47:17 +00:00
|
|
|
}
|
2002-03-10 21:03:04 +00:00
|
|
|
}
|
2005-05-16 13:07:27 +00:00
|
|
|
if (ioc_request->flags & ATA_CMD_ATAPI) {
|
|
|
|
request->flags = ATA_R_ATAPI;
|
|
|
|
bcopy(ioc_request->u.atapi.ccb, request->u.atapi.ccb, 16);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
request->u.ata.command = ioc_request->u.ata.command;
|
|
|
|
request->u.ata.feature = ioc_request->u.ata.feature;
|
|
|
|
request->u.ata.lba = ioc_request->u.ata.lba;
|
|
|
|
request->u.ata.count = ioc_request->u.ata.count;
|
|
|
|
}
|
|
|
|
request->timeout = ioc_request->timeout;
|
|
|
|
request->data = buf;
|
|
|
|
request->bytecount = ioc_request->count;
|
|
|
|
request->transfersize = request->bytecount;
|
|
|
|
if (ioc_request->flags & ATA_CMD_CONTROL)
|
|
|
|
request->flags |= ATA_R_CONTROL;
|
|
|
|
if (ioc_request->flags & ATA_CMD_READ)
|
|
|
|
request->flags |= ATA_R_READ;
|
|
|
|
if (ioc_request->flags & ATA_CMD_WRITE)
|
|
|
|
request->flags |= ATA_R_WRITE;
|
|
|
|
ata_queue_request(request);
|
2006-03-31 08:09:05 +00:00
|
|
|
if (request->flags & ATA_R_ATAPI) {
|
|
|
|
bcopy(&request->u.atapi.sense, &ioc_request->u.atapi.sense,
|
|
|
|
sizeof(struct atapi_sense));
|
|
|
|
}
|
|
|
|
else {
|
2005-05-16 13:07:27 +00:00
|
|
|
ioc_request->u.ata.command = request->u.ata.command;
|
|
|
|
ioc_request->u.ata.feature = request->u.ata.feature;
|
|
|
|
ioc_request->u.ata.lba = request->u.ata.lba;
|
|
|
|
ioc_request->u.ata.count = request->u.ata.count;
|
|
|
|
}
|
|
|
|
ioc_request->error = request->result;
|
|
|
|
if (ioc_request->flags & ATA_CMD_READ)
|
|
|
|
error = copyout(buf, ioc_request->data, ioc_request->count);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
else
|
2005-05-16 13:07:27 +00:00
|
|
|
error = 0;
|
|
|
|
free(buf, M_ATA);
|
|
|
|
ata_free_request(request);
|
|
|
|
return error;
|
|
|
|
|
|
|
|
case IOCATAGPARM:
|
2005-11-25 09:00:56 +00:00
|
|
|
ata_getparam(atadev, 0);
|
2005-05-16 13:07:27 +00:00
|
|
|
bcopy(&atadev->param, params, sizeof(struct ata_params));
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
case IOCATASMODE:
|
|
|
|
atadev->mode = *mode;
|
2009-12-06 00:10:13 +00:00
|
|
|
ata_setmode(dev);
|
2005-05-16 13:07:27 +00:00
|
|
|
return 0;
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
case IOCATAGMODE:
|
2009-12-06 00:10:13 +00:00
|
|
|
*mode = atadev->mode |
|
|
|
|
(ATA_GETREV(device_get_parent(dev), atadev->unit) << 8);
|
2005-05-16 13:07:27 +00:00
|
|
|
return 0;
|
2008-03-17 10:33:23 +00:00
|
|
|
case IOCATASSPINDOWN:
|
|
|
|
atadev->spindown = *mode;
|
|
|
|
return 0;
|
|
|
|
case IOCATAGSPINDOWN:
|
|
|
|
*mode = atadev->spindown;
|
|
|
|
return 0;
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
default:
|
2005-05-16 13:07:27 +00:00
|
|
|
return ENOTTY;
|
Finally!!
The much roumored replacement for our current IDE/ATA/ATAPI is
materialising in the CVS repositories around the globe.
So what does this bring us:
A new reengineered ATA/ATAPI subsystem, that tries to overcome
most of the deficiencies with the current drivers.
It supports PCI as well as ISA devices without all the hackery
in ide_pci.c to make PCI devices look like ISA counterparts.
It doesn't have the excessive wait problem on probe, in fact you
shouldn't notice any delay when your devices are getting probed.
Probing and attaching of devices are postponed until interrupts
are enabled (well almost, not finished yet for disks), making
things alot cleaner.
Improved performance, although DMA support is still WIP and not
in this pre alpha release, worldstone is faster with the new
driver compared to the old even with DMA.
So what does it take away:
There is NO support for old MFM/RLL/ESDI disks.
There is NO support for bad144, if your disk is bad, ditch it, it has
already outgrown its internal spare sectors, and is dying.
For you to try this out, you will have to modify your kernel config
file to use the "ata" controller instead of all wdc? entries.
example:
# for a PCI only system (most modern machines)
controller ata0
device atadisk0 # ATA disks
device atapicd0 # ATAPI CDROM's
device atapist0 # ATAPI tapes
#You should add the following on ISA systems:
controller ata1 at isa? port "IO_WD1" bio irq 14
controller ata2 at isa? port "IO_WD2" bio irq 15
You can leave it all in there, the system knows how to manage.
For now this driver reuses the device entries from the old system
(that will probably change later), but remember that disks are
now numbered in the sequence they are found (like the SCSI system)
not as absolute positions as the old system.
Although I have tested this on all the systems I can get my hands on,
there might very well be gremlins in there, so use AT YOU OWN RISK!!
This is still WIP, so there are lots of rough edges and unfinished
things in there, and what I have in my lab might look very different
from whats in CVS at any given time. So please have all eventual
changes go through me, or chances are they just dissapears...
I would very much like to hear from you, both good and bad news
are very welcome.
Enjoy!!
-Søren
1999-03-01 21:19:19 +00:00
|
|
|
}
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2004-05-20 14:49:12 +00:00
|
|
|
static void
|
2003-08-24 09:22:26 +00:00
|
|
|
ata_boot_attach(void)
|
2003-05-02 13:47:44 +00:00
|
|
|
{
|
|
|
|
struct ata_channel *ch;
|
|
|
|
int ctlr;
|
|
|
|
|
2009-08-20 19:17:53 +00:00
|
|
|
mtx_lock(&Giant); /* newbus suckage it needs Giant */
|
2004-09-09 13:25:46 +00:00
|
|
|
|
2011-10-06 16:13:47 +00:00
|
|
|
/* kick off probe and attach on all channels */
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
for (ctlr = 0; ctlr < devclass_get_maxunit(ata_devclass); ctlr++) {
|
|
|
|
if ((ch = devclass_get_softc(ata_devclass, ctlr))) {
|
2005-04-15 10:20:52 +00:00
|
|
|
ata_identify(ch->dev);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
}
|
1999-03-05 09:43:30 +00:00
|
|
|
}
|
2005-10-27 16:32:39 +00:00
|
|
|
|
|
|
|
/* release the hook that got us here, we are only needed once during boot */
|
|
|
|
if (ata_delayed_attach) {
|
|
|
|
config_intrhook_disestablish(ata_delayed_attach);
|
|
|
|
free(ata_delayed_attach, M_TEMP);
|
2006-02-09 20:54:42 +00:00
|
|
|
ata_delayed_attach = NULL;
|
2005-10-27 16:32:39 +00:00
|
|
|
}
|
2009-08-20 19:17:53 +00:00
|
|
|
|
|
|
|
mtx_unlock(&Giant); /* newbus suckage dealt with, release Giant */
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2005-04-21 11:13:39 +00:00
|
|
|
|
2003-08-24 09:22:26 +00:00
|
|
|
/*
|
|
|
|
* misc support functions
|
|
|
|
*/
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2009-02-28 22:07:15 +00:00
|
|
|
static device_t
|
|
|
|
ata_add_child(device_t parent, struct ata_device *atadev, int unit)
|
2002-03-30 16:36:41 +00:00
|
|
|
{
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_t child;
|
|
|
|
|
2012-05-28 14:33:15 +00:00
|
|
|
if ((child = device_add_child(parent, (unit < 0) ? NULL : "ad", unit))) {
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
device_set_softc(child, atadev);
|
|
|
|
device_quiet(child);
|
|
|
|
atadev->dev = child;
|
|
|
|
atadev->max_iosize = DEV_BSIZE;
|
|
|
|
atadev->mode = ATA_PIO_MAX;
|
2005-04-29 11:30:03 +00:00
|
|
|
}
|
2009-02-28 22:07:15 +00:00
|
|
|
return child;
|
2005-04-29 11:30:03 +00:00
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2005-04-29 11:30:03 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2008-04-10 13:05:05 +00:00
|
|
|
int
|
2005-11-25 09:00:56 +00:00
|
|
|
ata_getparam(struct ata_device *atadev, int init)
|
2005-04-29 11:30:03 +00:00
|
|
|
{
|
2005-11-25 09:00:56 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(device_get_parent(atadev->dev));
|
2005-04-29 11:30:03 +00:00
|
|
|
struct ata_request *request;
|
2010-07-03 14:14:42 +00:00
|
|
|
const char *res;
|
|
|
|
char buf[64];
|
2005-04-29 11:30:03 +00:00
|
|
|
u_int8_t command = 0;
|
2010-07-03 14:14:42 +00:00
|
|
|
int error = ENOMEM, retries = 2, mode = -1;
|
2005-04-29 11:30:03 +00:00
|
|
|
|
2009-02-28 22:07:15 +00:00
|
|
|
if (ch->devices & (ATA_ATA_MASTER << atadev->unit))
|
2005-04-29 11:30:03 +00:00
|
|
|
command = ATA_ATA_IDENTIFY;
|
2009-02-28 22:07:15 +00:00
|
|
|
if (ch->devices & (ATA_ATAPI_MASTER << atadev->unit))
|
2005-04-29 11:30:03 +00:00
|
|
|
command = ATA_ATAPI_IDENTIFY;
|
2009-02-28 22:07:15 +00:00
|
|
|
if (!command)
|
2005-04-29 11:30:03 +00:00
|
|
|
return ENXIO;
|
|
|
|
|
|
|
|
while (retries-- > 0 && error) {
|
2008-04-17 12:29:35 +00:00
|
|
|
if (!(request = ata_alloc_request()))
|
2005-04-29 11:30:03 +00:00
|
|
|
break;
|
2008-04-17 12:29:35 +00:00
|
|
|
request->dev = atadev->dev;
|
2005-04-29 11:30:03 +00:00
|
|
|
request->timeout = 1;
|
|
|
|
request->retries = 0;
|
|
|
|
request->u.ata.command = command;
|
2009-02-28 22:07:15 +00:00
|
|
|
request->flags = (ATA_R_READ|ATA_R_AT_HEAD|ATA_R_DIRECT);
|
2009-02-26 23:07:40 +00:00
|
|
|
if (!bootverbose)
|
|
|
|
request->flags |= ATA_R_QUIET;
|
2005-04-29 11:30:03 +00:00
|
|
|
request->data = (void *)&atadev->param;
|
|
|
|
request->bytecount = sizeof(struct ata_params);
|
|
|
|
request->donecount = 0;
|
|
|
|
request->transfersize = DEV_BSIZE;
|
|
|
|
ata_queue_request(request);
|
|
|
|
error = request->result;
|
|
|
|
ata_free_request(request);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!error && (isprint(atadev->param.model[0]) ||
|
|
|
|
isprint(atadev->param.model[1]))) {
|
|
|
|
struct ata_params *atacap = &atadev->param;
|
|
|
|
int16_t *ptr;
|
|
|
|
|
|
|
|
for (ptr = (int16_t *)atacap;
|
|
|
|
ptr < (int16_t *)atacap + sizeof(struct ata_params)/2; ptr++) {
|
2006-11-17 11:13:47 +00:00
|
|
|
*ptr = le16toh(*ptr);
|
2005-04-29 11:30:03 +00:00
|
|
|
}
|
|
|
|
if (!(!strncmp(atacap->model, "FX", 2) ||
|
|
|
|
!strncmp(atacap->model, "NEC", 3) ||
|
|
|
|
!strncmp(atacap->model, "Pioneer", 7) ||
|
|
|
|
!strncmp(atacap->model, "SHARP", 5))) {
|
|
|
|
bswap(atacap->model, sizeof(atacap->model));
|
|
|
|
bswap(atacap->revision, sizeof(atacap->revision));
|
|
|
|
bswap(atacap->serial, sizeof(atacap->serial));
|
|
|
|
}
|
|
|
|
btrim(atacap->model, sizeof(atacap->model));
|
|
|
|
bpack(atacap->model, atacap->model, sizeof(atacap->model));
|
|
|
|
btrim(atacap->revision, sizeof(atacap->revision));
|
|
|
|
bpack(atacap->revision, atacap->revision, sizeof(atacap->revision));
|
|
|
|
btrim(atacap->serial, sizeof(atacap->serial));
|
|
|
|
bpack(atacap->serial, atacap->serial, sizeof(atacap->serial));
|
2005-11-25 09:00:56 +00:00
|
|
|
|
2009-05-20 21:31:47 +00:00
|
|
|
if (bootverbose)
|
2009-02-28 22:07:15 +00:00
|
|
|
printf("ata%d-%s: pio=%s wdma=%s udma=%s cable=%s wire\n",
|
2006-03-10 12:20:53 +00:00
|
|
|
device_get_unit(ch->dev),
|
2008-04-10 13:05:05 +00:00
|
|
|
ata_unit2str(atadev),
|
2005-04-29 11:30:03 +00:00
|
|
|
ata_mode2str(ata_pmode(atacap)),
|
|
|
|
ata_mode2str(ata_wmode(atacap)),
|
|
|
|
ata_mode2str(ata_umode(atacap)),
|
|
|
|
(atacap->hwres & ATA_CABLE_ID) ? "80":"40");
|
2009-02-28 22:07:15 +00:00
|
|
|
|
|
|
|
if (init) {
|
|
|
|
char buffer[64];
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
|
2005-11-25 09:00:56 +00:00
|
|
|
sprintf(buffer, "%.40s/%.8s", atacap->model, atacap->revision);
|
|
|
|
device_set_desc_copy(atadev->dev, buffer);
|
2006-09-11 18:33:59 +00:00
|
|
|
if ((atadev->param.config & ATA_PROTO_ATAPI) &&
|
|
|
|
(atadev->param.config != ATA_CFA_MAGIC1) &&
|
|
|
|
(atadev->param.config != ATA_CFA_MAGIC2)) {
|
2008-04-10 13:05:05 +00:00
|
|
|
if (atapi_dma &&
|
2005-11-25 09:00:56 +00:00
|
|
|
(atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR &&
|
|
|
|
ata_umode(&atadev->param) >= ATA_UDMA2)
|
|
|
|
atadev->mode = ATA_DMA_MAX;
|
|
|
|
}
|
|
|
|
else {
|
2008-04-10 13:05:05 +00:00
|
|
|
if (ata_dma &&
|
2005-11-25 09:00:56 +00:00
|
|
|
(ata_umode(&atadev->param) > 0 ||
|
|
|
|
ata_wmode(&atadev->param) > 0))
|
|
|
|
atadev->mode = ATA_DMA_MAX;
|
|
|
|
}
|
2010-07-03 14:14:42 +00:00
|
|
|
snprintf(buf, sizeof(buf), "dev%d.mode", atadev->unit);
|
|
|
|
if (resource_string_value(device_get_name(ch->dev),
|
|
|
|
device_get_unit(ch->dev), buf, &res) == 0)
|
|
|
|
mode = ata_str2mode(res);
|
|
|
|
else if (resource_string_value(device_get_name(ch->dev),
|
|
|
|
device_get_unit(ch->dev), "mode", &res) == 0)
|
|
|
|
mode = ata_str2mode(res);
|
|
|
|
if (mode >= 0)
|
|
|
|
atadev->mode = mode;
|
2003-08-24 09:22:26 +00:00
|
|
|
}
|
2003-01-27 09:04:29 +00:00
|
|
|
}
|
2005-04-29 11:30:03 +00:00
|
|
|
else {
|
|
|
|
if (!error)
|
|
|
|
error = ENXIO;
|
|
|
|
}
|
|
|
|
return error;
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-20 12:51:54 +00:00
|
|
|
int
|
2005-04-15 10:20:52 +00:00
|
|
|
ata_identify(device_t dev)
|
Major update of the ATA RAID code, part 1:
Overhaul of the attach/detach code and structures, there were some nasty
bugs in the old implementation. This made it possible to collapse the
ATA/ATAPI device control structures into one generic structure.
A note here, the kernel is NOT ready for detach of active devices,
it fails all over in random places, but for inactive devices it works.
However for ATA RAID this works, since the RAID abstration layer
insulates the buggy^H^H^H^H^H^Hfragile device subsystem from the
physical disks.
Proberly detect the RAID's from the BIOS, and mark critical RAID1
arrays as such, but continue if there is enough of the mirror left
to do so.
Properly fail arrays on a live system. For RAID0 that means return EIO,
and for RAID1 it means continue on the still working part of the mirror
if possible, else return EIO.
If the state changes, log this to the console.
Allow for Promise & Highpoint controllers/arrays to coexist on the
same machine. It is not possible to distribute arrays over different
makes of controllers though.
If Promise SuperSwap enclosures are used, signal disk state on the
status LED on the front.
Misc fixes that I had lying around for various minor bugs.
Sponsored by: Advanis Inc.
2002-02-04 19:23:40 +00:00
|
|
|
{
|
2005-04-15 10:20:52 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
struct ata_device *atadev;
|
2009-02-21 22:57:26 +00:00
|
|
|
device_t *children;
|
2009-07-26 14:04:48 +00:00
|
|
|
device_t child, master = NULL;
|
2009-02-21 22:57:26 +00:00
|
|
|
int nchildren, i, n = ch->devices;
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2008-04-10 13:05:05 +00:00
|
|
|
if (bootverbose)
|
2009-02-21 22:57:26 +00:00
|
|
|
device_printf(dev, "Identifying devices: %08x\n", ch->devices);
|
2008-04-10 13:05:05 +00:00
|
|
|
|
2009-08-20 19:17:53 +00:00
|
|
|
mtx_lock(&Giant);
|
2009-02-21 22:57:26 +00:00
|
|
|
/* Skip existing devices. */
|
|
|
|
if (!device_get_children(dev, &children, &nchildren)) {
|
|
|
|
for (i = 0; i < nchildren; i++) {
|
|
|
|
if (children[i] && (atadev = device_get_softc(children[i])))
|
|
|
|
n &= ~((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << atadev->unit);
|
|
|
|
}
|
|
|
|
free(children, M_TEMP);
|
|
|
|
}
|
2009-02-28 22:07:15 +00:00
|
|
|
/* Create new devices. */
|
2009-02-21 22:57:26 +00:00
|
|
|
if (bootverbose)
|
|
|
|
device_printf(dev, "New devices: %08x\n", n);
|
2009-08-20 19:17:53 +00:00
|
|
|
if (n == 0) {
|
|
|
|
mtx_unlock(&Giant);
|
2009-02-23 08:58:29 +00:00
|
|
|
return (0);
|
2009-08-20 19:17:53 +00:00
|
|
|
}
|
2008-04-10 13:05:05 +00:00
|
|
|
for (i = 0; i < ATA_PM; ++i) {
|
2009-02-28 22:07:15 +00:00
|
|
|
if (n & (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << i))) {
|
|
|
|
int unit = -1;
|
2009-02-28 11:25:05 +00:00
|
|
|
|
2009-02-28 22:07:15 +00:00
|
|
|
if (!(atadev = malloc(sizeof(struct ata_device),
|
|
|
|
M_ATA, M_NOWAIT | M_ZERO))) {
|
|
|
|
device_printf(dev, "out of memory\n");
|
|
|
|
return ENOMEM;
|
|
|
|
}
|
|
|
|
atadev->unit = i;
|
|
|
|
#ifdef ATA_STATIC_ID
|
|
|
|
if (n & (ATA_ATA_MASTER << i))
|
|
|
|
unit = (device_get_unit(dev) << 1) + i;
|
|
|
|
#endif
|
|
|
|
if ((child = ata_add_child(dev, atadev, unit))) {
|
2009-07-26 14:04:48 +00:00
|
|
|
/*
|
|
|
|
* PATA slave should be identified first, to allow
|
|
|
|
* device cable detection on master to work properly.
|
|
|
|
*/
|
|
|
|
if (i == 0 && (n & ATA_PORTMULTIPLIER) == 0 &&
|
|
|
|
(n & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << 1)) != 0) {
|
|
|
|
master = child;
|
|
|
|
continue;
|
|
|
|
}
|
2009-02-28 22:07:15 +00:00
|
|
|
if (ata_getparam(atadev, 1)) {
|
|
|
|
device_delete_child(dev, child);
|
|
|
|
free(atadev, M_ATA);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
free(atadev, M_ATA);
|
|
|
|
}
|
|
|
|
}
|
2009-07-26 14:04:48 +00:00
|
|
|
if (master) {
|
|
|
|
atadev = device_get_softc(master);
|
|
|
|
if (ata_getparam(atadev, 1)) {
|
|
|
|
device_delete_child(dev, master);
|
|
|
|
free(atadev, M_ATA);
|
|
|
|
}
|
|
|
|
}
|
2005-04-15 10:20:52 +00:00
|
|
|
bus_generic_probe(dev);
|
|
|
|
bus_generic_attach(dev);
|
2009-08-20 19:17:53 +00:00
|
|
|
mtx_unlock(&Giant);
|
2005-04-15 10:20:52 +00:00
|
|
|
return 0;
|
2001-02-06 12:41:53 +00:00
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
2001-02-06 12:41:53 +00:00
|
|
|
|
2005-04-06 10:22:56 +00:00
|
|
|
void
|
2005-04-30 16:22:07 +00:00
|
|
|
ata_default_registers(device_t dev)
|
2005-04-06 10:22:56 +00:00
|
|
|
{
|
2005-04-30 16:22:07 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
|
2005-04-06 10:22:56 +00:00
|
|
|
/* fill in the defaults from whats setup already */
|
|
|
|
ch->r_io[ATA_ERROR].res = ch->r_io[ATA_FEATURE].res;
|
|
|
|
ch->r_io[ATA_ERROR].offset = ch->r_io[ATA_FEATURE].offset;
|
|
|
|
ch->r_io[ATA_IREASON].res = ch->r_io[ATA_COUNT].res;
|
|
|
|
ch->r_io[ATA_IREASON].offset = ch->r_io[ATA_COUNT].offset;
|
|
|
|
ch->r_io[ATA_STATUS].res = ch->r_io[ATA_COMMAND].res;
|
|
|
|
ch->r_io[ATA_STATUS].offset = ch->r_io[ATA_COMMAND].offset;
|
|
|
|
ch->r_io[ATA_ALTSTAT].res = ch->r_io[ATA_CONTROL].res;
|
|
|
|
ch->r_io[ATA_ALTSTAT].offset = ch->r_io[ATA_CONTROL].offset;
|
|
|
|
}
|
|
|
|
|
2005-08-17 15:00:33 +00:00
|
|
|
void
|
2005-05-03 07:55:07 +00:00
|
|
|
ata_modify_if_48bit(struct ata_request *request)
|
|
|
|
{
|
2009-10-31 13:24:14 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(request->parent);
|
2005-05-03 07:55:07 +00:00
|
|
|
struct ata_device *atadev = device_get_softc(request->dev);
|
|
|
|
|
2009-10-31 13:24:14 +00:00
|
|
|
request->flags &= ~ATA_R_48BIT;
|
2005-05-17 12:31:54 +00:00
|
|
|
|
2007-10-04 19:17:16 +00:00
|
|
|
if (((request->u.ata.lba + request->u.ata.count) >= ATA_MAX_28BIT_LBA ||
|
2005-05-03 07:55:07 +00:00
|
|
|
request->u.ata.count > 256) &&
|
|
|
|
atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) {
|
|
|
|
|
2005-05-16 13:07:27 +00:00
|
|
|
/* translate command into 48bit version */
|
2005-08-17 15:00:33 +00:00
|
|
|
switch (request->u.ata.command) {
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_READ:
|
2005-08-17 15:00:33 +00:00
|
|
|
request->u.ata.command = ATA_READ48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_READ_MUL:
|
2005-08-17 15:00:33 +00:00
|
|
|
request->u.ata.command = ATA_READ_MUL48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_READ_DMA:
|
2005-08-17 15:00:33 +00:00
|
|
|
if (ch->flags & ATA_NO_48BIT_DMA) {
|
|
|
|
if (request->transfersize > DEV_BSIZE)
|
|
|
|
request->u.ata.command = ATA_READ_MUL48;
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_READ48;
|
|
|
|
request->flags &= ~ATA_R_DMA;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_READ_DMA48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_READ_DMA_QUEUED:
|
2005-08-17 15:00:33 +00:00
|
|
|
if (ch->flags & ATA_NO_48BIT_DMA) {
|
|
|
|
if (request->transfersize > DEV_BSIZE)
|
|
|
|
request->u.ata.command = ATA_READ_MUL48;
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_READ48;
|
|
|
|
request->flags &= ~ATA_R_DMA;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_READ_DMA_QUEUED48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_WRITE:
|
2005-08-17 15:00:33 +00:00
|
|
|
request->u.ata.command = ATA_WRITE48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_WRITE_MUL:
|
2005-08-17 15:00:33 +00:00
|
|
|
request->u.ata.command = ATA_WRITE_MUL48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_WRITE_DMA:
|
2005-08-17 15:00:33 +00:00
|
|
|
if (ch->flags & ATA_NO_48BIT_DMA) {
|
|
|
|
if (request->transfersize > DEV_BSIZE)
|
|
|
|
request->u.ata.command = ATA_WRITE_MUL48;
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_WRITE48;
|
|
|
|
request->flags &= ~ATA_R_DMA;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_WRITE_DMA48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_WRITE_DMA_QUEUED:
|
2005-08-17 15:00:33 +00:00
|
|
|
if (ch->flags & ATA_NO_48BIT_DMA) {
|
|
|
|
if (request->transfersize > DEV_BSIZE)
|
|
|
|
request->u.ata.command = ATA_WRITE_MUL48;
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_WRITE48;
|
|
|
|
request->u.ata.command = ATA_WRITE48;
|
|
|
|
request->flags &= ~ATA_R_DMA;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
request->u.ata.command = ATA_WRITE_DMA_QUEUED48;
|
|
|
|
break;
|
2005-05-16 13:07:27 +00:00
|
|
|
case ATA_FLUSHCACHE:
|
2005-08-17 15:00:33 +00:00
|
|
|
request->u.ata.command = ATA_FLUSHCACHE48;
|
|
|
|
break;
|
2008-04-10 13:05:05 +00:00
|
|
|
case ATA_SET_MAX_ADDRESS:
|
|
|
|
request->u.ata.command = ATA_SET_MAX_ADDRESS48;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2009-10-31 13:24:14 +00:00
|
|
|
request->flags |= ATA_R_48BIT;
|
2008-04-10 13:05:05 +00:00
|
|
|
}
|
|
|
|
else if (atadev->param.support.command2 & ATA_SUPPORT_ADDRESS48) {
|
|
|
|
|
|
|
|
/* translate command into 48bit version */
|
|
|
|
switch (request->u.ata.command) {
|
|
|
|
case ATA_FLUSHCACHE:
|
|
|
|
request->u.ata.command = ATA_FLUSHCACHE48;
|
|
|
|
break;
|
|
|
|
case ATA_READ_NATIVE_MAX_ADDRESS:
|
|
|
|
request->u.ata.command = ATA_READ_NATIVE_MAX_ADDRESS48;
|
2005-11-25 09:00:56 +00:00
|
|
|
break;
|
|
|
|
case ATA_SET_MAX_ADDRESS:
|
|
|
|
request->u.ata.command = ATA_SET_MAX_ADDRESS48;
|
|
|
|
break;
|
2005-05-03 07:55:07 +00:00
|
|
|
default:
|
2005-08-17 15:00:33 +00:00
|
|
|
return;
|
2005-05-03 07:55:07 +00:00
|
|
|
}
|
2009-10-31 13:24:14 +00:00
|
|
|
request->flags |= ATA_R_48BIT;
|
2005-05-03 07:55:07 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2000-09-19 11:08:39 +00:00
|
|
|
void
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
ata_udelay(int interval)
|
2000-09-19 11:08:39 +00:00
|
|
|
{
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* for now just use DELAY, the timer/sleep subsytems are not there yet */
|
|
|
|
if (1 || interval < (1000000/hz) || ata_delayed_attach)
|
|
|
|
DELAY(interval);
|
|
|
|
else
|
2007-02-23 16:25:08 +00:00
|
|
|
pause("ataslp", interval/(1000000/hz));
|
2000-09-19 11:08:39 +00:00
|
|
|
}
|
2004-05-20 14:49:12 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2012-03-21 16:59:39 +00:00
|
|
|
const char *
|
2008-04-10 13:05:05 +00:00
|
|
|
ata_unit2str(struct ata_device *atadev)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(device_get_parent(atadev->dev));
|
|
|
|
static char str[8];
|
|
|
|
|
|
|
|
if (ch->devices & ATA_PORTMULTIPLIER)
|
|
|
|
sprintf(str, "port%d", atadev->unit);
|
|
|
|
else
|
|
|
|
sprintf(str, "%s", atadev->unit == ATA_MASTER ? "master" : "slave");
|
|
|
|
return str;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2008-04-10 13:05:05 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
const char *
|
2000-09-19 11:08:39 +00:00
|
|
|
ata_mode2str(int mode)
|
Ten'th update to the new ATA/ATAPI driver:
It been awhile since the last major update, as a benefit there
are some cool things in this one (and new bugs probably :) )...
The ATA driver has grown "real" timeout support for all devices.
This means that it should be possible to get in contact with
(especially) lost ATAPI devices. It also means that the ATA
driver is now usable on notebooks as it will DTRT on resume.
An experimental hack at utilizing the Promise66's at UDMA66 is
in there, but I cant test it. If someone feels like sending
me one, give me a ping.
The ATAPI DMA enableling scheme has been changed, also better DMA
support for the Aladdin chipset has been implemented for ATAPI
devices. Note that the Aladdin apparently only can do DMA reads
on ATAPI devices, and the Promise cant do ATAPI DMA at all.
I have seen problems on some ATAPI devices that should be able
to run in DMA mode, so if you encounter problems with hanging
atapi devices during the probe, or during access, disable DMA
in atapi-all.c, and let me know. It might be nessesary to do this
via a "white list" for known good devices...
The ATAPI CDROM driver can now use eject/close without hanging and
the bug that caused reading beyond the end of a CD has been fixed.
Media change is also handled proberly. DVD drives are identified
and are usable as CDROM devices at least, I dont have the HW to
test this further, see above :).
The ATAPI tape driver has gotten some support for using the DSC
method for not blocking the IDE channel during read/write when
the device has full buffers. It knows about the OnStream DI-30
device, support is not completed yet, but it can function as a
primitive backup medium, without filemarks, and without bad media
handeling. This is because the OnStream device doesn't handle this
(like everybody else) in HW. It also now supports getting/setting
the record position on devices that supports it.
Some rather major cleanups and rearrangements as well (cvs -b diff
is your freind). I'm closing in on declaring this for beta code,
most of the infrastruture is in place by now.
As usual USE AT YOUR OWN RISK!!, this is still alpha level code.
This driver can hose your disk real bad if anything goes wrong, but
now you have been warned :)
But please tell me how it works for you!
Enjoy!
-Søren
1999-09-21 19:50:40 +00:00
|
|
|
{
|
|
|
|
switch (mode) {
|
2005-08-29 18:19:06 +00:00
|
|
|
case -1: return "UNSUPPORTED";
|
2000-01-03 10:26:59 +00:00
|
|
|
case ATA_PIO0: return "PIO0";
|
|
|
|
case ATA_PIO1: return "PIO1";
|
|
|
|
case ATA_PIO2: return "PIO2";
|
|
|
|
case ATA_PIO3: return "PIO3";
|
|
|
|
case ATA_PIO4: return "PIO4";
|
2003-02-20 20:02:32 +00:00
|
|
|
case ATA_WDMA0: return "WDMA0";
|
|
|
|
case ATA_WDMA1: return "WDMA1";
|
2000-01-03 10:26:59 +00:00
|
|
|
case ATA_WDMA2: return "WDMA2";
|
2003-02-20 20:02:32 +00:00
|
|
|
case ATA_UDMA0: return "UDMA16";
|
|
|
|
case ATA_UDMA1: return "UDMA25";
|
2000-01-03 10:26:59 +00:00
|
|
|
case ATA_UDMA2: return "UDMA33";
|
2003-02-20 20:02:32 +00:00
|
|
|
case ATA_UDMA3: return "UDMA40";
|
2000-01-03 10:26:59 +00:00
|
|
|
case ATA_UDMA4: return "UDMA66";
|
2000-08-06 19:51:58 +00:00
|
|
|
case ATA_UDMA5: return "UDMA100";
|
2001-10-06 11:07:04 +00:00
|
|
|
case ATA_UDMA6: return "UDMA133";
|
2003-05-18 16:43:08 +00:00
|
|
|
case ATA_SA150: return "SATA150";
|
2005-08-12 16:54:11 +00:00
|
|
|
case ATA_SA300: return "SATA300";
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
default:
|
|
|
|
if (mode & ATA_DMA_MASK)
|
|
|
|
return "BIOSDMA";
|
|
|
|
else
|
|
|
|
return "BIOSPIO";
|
2000-01-03 10:26:59 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2010-07-03 14:14:42 +00:00
|
|
|
int
|
|
|
|
ata_str2mode(const char *str)
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!strcasecmp(str, "PIO0")) return (ATA_PIO0);
|
|
|
|
if (!strcasecmp(str, "PIO1")) return (ATA_PIO1);
|
|
|
|
if (!strcasecmp(str, "PIO2")) return (ATA_PIO2);
|
|
|
|
if (!strcasecmp(str, "PIO3")) return (ATA_PIO3);
|
|
|
|
if (!strcasecmp(str, "PIO4")) return (ATA_PIO4);
|
|
|
|
if (!strcasecmp(str, "WDMA0")) return (ATA_WDMA0);
|
|
|
|
if (!strcasecmp(str, "WDMA1")) return (ATA_WDMA1);
|
|
|
|
if (!strcasecmp(str, "WDMA2")) return (ATA_WDMA2);
|
|
|
|
if (!strcasecmp(str, "UDMA0")) return (ATA_UDMA0);
|
|
|
|
if (!strcasecmp(str, "UDMA16")) return (ATA_UDMA0);
|
|
|
|
if (!strcasecmp(str, "UDMA1")) return (ATA_UDMA1);
|
|
|
|
if (!strcasecmp(str, "UDMA25")) return (ATA_UDMA1);
|
|
|
|
if (!strcasecmp(str, "UDMA2")) return (ATA_UDMA2);
|
|
|
|
if (!strcasecmp(str, "UDMA33")) return (ATA_UDMA2);
|
|
|
|
if (!strcasecmp(str, "UDMA3")) return (ATA_UDMA3);
|
|
|
|
if (!strcasecmp(str, "UDMA44")) return (ATA_UDMA3);
|
|
|
|
if (!strcasecmp(str, "UDMA4")) return (ATA_UDMA4);
|
|
|
|
if (!strcasecmp(str, "UDMA66")) return (ATA_UDMA4);
|
|
|
|
if (!strcasecmp(str, "UDMA5")) return (ATA_UDMA5);
|
|
|
|
if (!strcasecmp(str, "UDMA100")) return (ATA_UDMA5);
|
|
|
|
if (!strcasecmp(str, "UDMA6")) return (ATA_UDMA6);
|
|
|
|
if (!strcasecmp(str, "UDMA133")) return (ATA_UDMA6);
|
|
|
|
return (-1);
|
|
|
|
}
|
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2009-12-06 00:10:13 +00:00
|
|
|
const char *
|
|
|
|
ata_satarev2str(int rev)
|
|
|
|
{
|
|
|
|
switch (rev) {
|
|
|
|
case 0: return "";
|
|
|
|
case 1: return "SATA 1.5Gb/s";
|
|
|
|
case 2: return "SATA 3Gb/s";
|
|
|
|
case 3: return "SATA 6Gb/s";
|
2010-02-22 10:45:40 +00:00
|
|
|
case 0xff: return "SATA";
|
2009-12-06 00:10:13 +00:00
|
|
|
default: return "???";
|
|
|
|
}
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2009-12-06 00:10:13 +00:00
|
|
|
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
int
|
2009-12-13 00:13:21 +00:00
|
|
|
ata_atapi(device_t dev, int target)
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
{
|
2009-12-13 00:13:21 +00:00
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
|
2009-12-13 00:13:21 +00:00
|
|
|
return (ch->devices & (ATA_ATAPI_MASTER << target));
|
This is the roumored ATA modulerisation works, and it needs a little explanation.
If you just config KERNEL as usual there should be no apparent changes, you'll get all chipset support code compiled in.
However there is now a way to only compile in code for chipsets needed on a pr vendor basis. ATA now has the following "device" entries:
atacore: ATA core functionality, always needed for any ATA setup
atacard: CARDBUS support
atacbus: PC98 cbus support
ataisa: ISA bus support
atapci: PCI bus support only generic chipset support.
ataahci: AHCI support, also pulled in by some vendor modules.
ataacard, ataacerlabs, ataadaptec, ataamd, ataati, atacenatek, atacypress, atacyrix, atahighpoint, ataintel, ataite, atajmicron, atamarvell, atamicron, atanational, atanetcell, atanvidia, atapromise, ataserverworks, atasiliconimage, atasis, atavia; Vendor support, ie atavia for VIA chipsets
atadisk: ATA disk driver
ataraid: ATA softraid driver
atapicd: ATAPI cd/dvd driver
atapifd: ATAPI floppy/flashdisk driver
atapist: ATAPI tape driver
atausb: ATA<>USB bridge
atapicam: ATA<>CAM bridge
This makes it possible to config a kernel with just VIA chipset support by having the following ATA lines in the kernel config file:
device atacore
device atapci
device atavia
And then you need the atadisk, atapicd etc lines in there just as usual.
If you use ATA as modules loaded at boot there is few changes except the rename of the "ata" module to "atacore", things looks just as usual.
However under atapci you now have a whole bunch of vendor specific drivers, that you can kldload individually depending on you needs. Drivers have the same names as used in the kernel config explained above.
2008-10-09 12:56:57 +00:00
|
|
|
}
|
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2000-02-18 20:57:33 +00:00
|
|
|
int
|
|
|
|
ata_pmode(struct ata_params *ap)
|
|
|
|
{
|
|
|
|
if (ap->atavalid & ATA_FLAG_64_70) {
|
2003-02-20 20:02:32 +00:00
|
|
|
if (ap->apiomodes & 0x02)
|
|
|
|
return ATA_PIO4;
|
2004-05-20 14:49:12 +00:00
|
|
|
if (ap->apiomodes & 0x01)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_PIO3;
|
2004-05-20 14:49:12 +00:00
|
|
|
}
|
2003-09-08 08:30:43 +00:00
|
|
|
if (ap->mwdmamodes & 0x04)
|
|
|
|
return ATA_PIO4;
|
|
|
|
if (ap->mwdmamodes & 0x02)
|
|
|
|
return ATA_PIO3;
|
|
|
|
if (ap->mwdmamodes & 0x01)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_PIO2;
|
2003-09-08 08:30:43 +00:00
|
|
|
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x200)
|
|
|
|
return ATA_PIO2;
|
|
|
|
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x100)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_PIO1;
|
2003-09-08 08:30:43 +00:00
|
|
|
if ((ap->retired_piomode & ATA_RETIRED_PIO_MASK) == 0x000)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_PIO0;
|
2004-05-20 14:49:12 +00:00
|
|
|
return ATA_PIO0;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2000-02-18 20:57:33 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2000-02-18 20:57:33 +00:00
|
|
|
int
|
|
|
|
ata_wmode(struct ata_params *ap)
|
|
|
|
{
|
2001-10-06 11:07:04 +00:00
|
|
|
if (ap->mwdmamodes & 0x04)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_WDMA2;
|
2001-10-06 11:07:04 +00:00
|
|
|
if (ap->mwdmamodes & 0x02)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_WDMA1;
|
2001-10-06 11:07:04 +00:00
|
|
|
if (ap->mwdmamodes & 0x01)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_WDMA0;
|
2000-02-18 20:57:33 +00:00
|
|
|
return -1;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2000-02-18 20:57:33 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2000-02-18 20:57:33 +00:00
|
|
|
int
|
|
|
|
ata_umode(struct ata_params *ap)
|
|
|
|
{
|
|
|
|
if (ap->atavalid & ATA_FLAG_88) {
|
2001-10-06 11:07:04 +00:00
|
|
|
if (ap->udmamodes & 0x40)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA6;
|
2000-08-06 19:51:58 +00:00
|
|
|
if (ap->udmamodes & 0x20)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA5;
|
2000-02-18 20:57:33 +00:00
|
|
|
if (ap->udmamodes & 0x10)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA4;
|
2000-02-18 20:57:33 +00:00
|
|
|
if (ap->udmamodes & 0x08)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA3;
|
2000-02-18 20:57:33 +00:00
|
|
|
if (ap->udmamodes & 0x04)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA2;
|
2000-02-18 20:57:33 +00:00
|
|
|
if (ap->udmamodes & 0x02)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA1;
|
2000-02-18 20:57:33 +00:00
|
|
|
if (ap->udmamodes & 0x01)
|
2003-02-20 20:02:32 +00:00
|
|
|
return ATA_UDMA0;
|
2000-02-18 20:57:33 +00:00
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2000-02-18 20:57:33 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2003-02-20 20:02:32 +00:00
|
|
|
int
|
2005-04-30 16:22:07 +00:00
|
|
|
ata_limit_mode(device_t dev, int mode, int maxmode)
|
2003-02-20 20:02:32 +00:00
|
|
|
{
|
2005-04-30 16:22:07 +00:00
|
|
|
struct ata_device *atadev = device_get_softc(dev);
|
|
|
|
|
2003-02-20 20:02:32 +00:00
|
|
|
if (maxmode && mode > maxmode)
|
|
|
|
mode = maxmode;
|
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (mode >= ATA_UDMA0 && ata_umode(&atadev->param) > 0)
|
|
|
|
return min(mode, ata_umode(&atadev->param));
|
2003-02-20 20:02:32 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (mode >= ATA_WDMA0 && ata_wmode(&atadev->param) > 0)
|
|
|
|
return min(mode, ata_wmode(&atadev->param));
|
2003-02-20 20:02:32 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
if (mode > ata_pmode(&atadev->param))
|
|
|
|
return min(mode, ata_pmode(&atadev->param));
|
2003-02-20 20:02:32 +00:00
|
|
|
|
|
|
|
return mode;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2003-02-20 20:02:32 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-29 11:30:03 +00:00
|
|
|
static void
|
|
|
|
bswap(int8_t *buf, int len)
|
|
|
|
{
|
|
|
|
u_int16_t *ptr = (u_int16_t*)(buf + len);
|
|
|
|
|
|
|
|
while (--ptr >= (u_int16_t*)buf)
|
|
|
|
*ptr = ntohs(*ptr);
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2005-04-29 11:30:03 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-29 11:30:03 +00:00
|
|
|
static void
|
|
|
|
btrim(int8_t *buf, int len)
|
|
|
|
{
|
|
|
|
int8_t *ptr;
|
|
|
|
|
|
|
|
for (ptr = buf; ptr < buf+len; ++ptr)
|
|
|
|
if (!*ptr || *ptr == '_')
|
|
|
|
*ptr = ' ';
|
|
|
|
for (ptr = buf + len - 1; ptr >= buf && *ptr == ' '; --ptr)
|
|
|
|
*ptr = 0;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2005-04-29 11:30:03 +00:00
|
|
|
|
2012-03-21 08:57:15 +00:00
|
|
|
#ifndef ATA_CAM
|
2005-04-29 11:30:03 +00:00
|
|
|
static void
|
|
|
|
bpack(int8_t *src, int8_t *dst, int len)
|
|
|
|
{
|
|
|
|
int i, j, blank;
|
|
|
|
|
|
|
|
for (i = j = blank = 0 ; i < len; i++) {
|
|
|
|
if (blank && src[i] == ' ') continue;
|
|
|
|
if (blank && src[i] != ' ') {
|
|
|
|
dst[j++] = src[i];
|
|
|
|
blank = 0;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
if (src[i] == ' ') {
|
|
|
|
blank = 1;
|
|
|
|
if (i == 0)
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
dst[j++] = src[i];
|
|
|
|
}
|
|
|
|
if (j < len)
|
|
|
|
dst[j] = 0x00;
|
|
|
|
}
|
2012-03-21 08:57:15 +00:00
|
|
|
#endif
|
2005-04-29 11:30:03 +00:00
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
void
|
|
|
|
ata_cam_begin_transaction(device_t dev, union ccb *ccb)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
struct ata_request *request;
|
|
|
|
|
|
|
|
if (!(request = ata_alloc_request())) {
|
|
|
|
device_printf(dev, "FAILURE - out of memory in start\n");
|
|
|
|
ccb->ccb_h.status = CAM_REQ_INVALID;
|
|
|
|
xpt_done(ccb);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
bzero(request, sizeof(*request));
|
|
|
|
|
|
|
|
/* setup request */
|
|
|
|
request->dev = NULL;
|
|
|
|
request->parent = dev;
|
|
|
|
request->unit = ccb->ccb_h.target_id;
|
|
|
|
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
|
|
|
|
request->data = ccb->ataio.data_ptr;
|
|
|
|
request->bytecount = ccb->ataio.dxfer_len;
|
|
|
|
request->u.ata.command = ccb->ataio.cmd.command;
|
|
|
|
request->u.ata.feature = ((uint16_t)ccb->ataio.cmd.features_exp << 8) |
|
|
|
|
(uint16_t)ccb->ataio.cmd.features;
|
|
|
|
request->u.ata.count = ((uint16_t)ccb->ataio.cmd.sector_count_exp << 8) |
|
|
|
|
(uint16_t)ccb->ataio.cmd.sector_count;
|
|
|
|
if (ccb->ataio.cmd.flags & CAM_ATAIO_48BIT) {
|
|
|
|
request->flags |= ATA_R_48BIT;
|
|
|
|
request->u.ata.lba =
|
|
|
|
((uint64_t)ccb->ataio.cmd.lba_high_exp << 40) |
|
|
|
|
((uint64_t)ccb->ataio.cmd.lba_mid_exp << 32) |
|
|
|
|
((uint64_t)ccb->ataio.cmd.lba_low_exp << 24);
|
|
|
|
} else {
|
|
|
|
request->u.ata.lba =
|
|
|
|
((uint64_t)(ccb->ataio.cmd.device & 0x0f) << 24);
|
|
|
|
}
|
|
|
|
request->u.ata.lba |= ((uint64_t)ccb->ataio.cmd.lba_high << 16) |
|
|
|
|
((uint64_t)ccb->ataio.cmd.lba_mid << 8) |
|
|
|
|
(uint64_t)ccb->ataio.cmd.lba_low;
|
2012-10-26 20:03:08 +00:00
|
|
|
if (ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT)
|
|
|
|
request->flags |= ATA_R_NEEDRESULT;
|
2009-12-06 00:10:13 +00:00
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE &&
|
|
|
|
ccb->ataio.cmd.flags & CAM_ATAIO_DMA)
|
|
|
|
request->flags |= ATA_R_DMA;
|
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
|
|
|
|
request->flags |= ATA_R_READ;
|
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT)
|
|
|
|
request->flags |= ATA_R_WRITE;
|
2012-11-01 00:09:01 +00:00
|
|
|
if (ccb->ataio.cmd.command == ATA_READ_MUL ||
|
|
|
|
ccb->ataio.cmd.command == ATA_READ_MUL48 ||
|
|
|
|
ccb->ataio.cmd.command == ATA_WRITE_MUL ||
|
|
|
|
ccb->ataio.cmd.command == ATA_WRITE_MUL48) {
|
|
|
|
request->transfersize = min(request->bytecount,
|
|
|
|
ch->curr[ccb->ccb_h.target_id].bytecount);
|
|
|
|
} else
|
|
|
|
request->transfersize = min(request->bytecount, 512);
|
2009-12-06 00:10:13 +00:00
|
|
|
} else {
|
|
|
|
request->data = ccb->csio.data_ptr;
|
|
|
|
request->bytecount = ccb->csio.dxfer_len;
|
|
|
|
bcopy((ccb->ccb_h.flags & CAM_CDB_POINTER) ?
|
|
|
|
ccb->csio.cdb_io.cdb_ptr : ccb->csio.cdb_io.cdb_bytes,
|
|
|
|
request->u.atapi.ccb, ccb->csio.cdb_len);
|
|
|
|
request->flags |= ATA_R_ATAPI;
|
2010-02-02 11:09:28 +00:00
|
|
|
if (ch->curr[ccb->ccb_h.target_id].atapi == 16)
|
|
|
|
request->flags |= ATA_R_ATAPI16;
|
2009-12-06 00:10:13 +00:00
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE &&
|
|
|
|
ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
|
|
|
|
request->flags |= ATA_R_DMA;
|
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_IN)
|
|
|
|
request->flags |= ATA_R_READ;
|
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) == CAM_DIR_OUT)
|
|
|
|
request->flags |= ATA_R_WRITE;
|
2012-11-01 00:09:01 +00:00
|
|
|
request->transfersize = min(request->bytecount,
|
|
|
|
ch->curr[ccb->ccb_h.target_id].bytecount);
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
|
|
|
request->retries = 0;
|
|
|
|
request->timeout = (ccb->ccb_h.timeout + 999) / 1000;
|
|
|
|
callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
|
|
|
|
request->ccb = ccb;
|
2013-02-22 21:43:21 +00:00
|
|
|
request->flags |= ATA_R_DATA_IN_CCB;
|
2009-12-06 00:10:13 +00:00
|
|
|
|
|
|
|
ch->running = request;
|
|
|
|
ch->state = ATA_ACTIVE;
|
|
|
|
if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) {
|
|
|
|
ch->running = NULL;
|
|
|
|
ch->state = ATA_IDLE;
|
|
|
|
ata_cam_end_transaction(dev, request);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2011-04-12 09:55:24 +00:00
|
|
|
static void
|
|
|
|
ata_cam_request_sense(device_t dev, struct ata_request *request)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
union ccb *ccb = request->ccb;
|
|
|
|
|
|
|
|
ch->requestsense = 1;
|
|
|
|
|
2012-07-21 08:19:43 +00:00
|
|
|
bzero(request, sizeof(*request));
|
2011-04-12 09:55:24 +00:00
|
|
|
request->dev = NULL;
|
|
|
|
request->parent = dev;
|
|
|
|
request->unit = ccb->ccb_h.target_id;
|
|
|
|
request->data = (void *)&ccb->csio.sense_data;
|
|
|
|
request->bytecount = ccb->csio.sense_len;
|
|
|
|
request->u.atapi.ccb[0] = ATAPI_REQUEST_SENSE;
|
|
|
|
request->u.atapi.ccb[4] = ccb->csio.sense_len;
|
|
|
|
request->flags |= ATA_R_ATAPI;
|
|
|
|
if (ch->curr[ccb->ccb_h.target_id].atapi == 16)
|
|
|
|
request->flags |= ATA_R_ATAPI16;
|
|
|
|
if (ch->curr[ccb->ccb_h.target_id].mode >= ATA_DMA)
|
|
|
|
request->flags |= ATA_R_DMA;
|
|
|
|
request->flags |= ATA_R_READ;
|
|
|
|
request->transfersize = min(request->bytecount,
|
|
|
|
ch->curr[ccb->ccb_h.target_id].bytecount);
|
|
|
|
request->retries = 0;
|
|
|
|
request->timeout = (ccb->ccb_h.timeout + 999) / 1000;
|
|
|
|
callout_init_mtx(&request->callout, &ch->state_mtx, CALLOUT_RETURNUNLOCKED);
|
|
|
|
request->ccb = ccb;
|
|
|
|
|
|
|
|
ch->running = request;
|
|
|
|
ch->state = ATA_ACTIVE;
|
|
|
|
if (ch->hw.begin_transaction(request) == ATA_OP_FINISHED) {
|
|
|
|
ch->running = NULL;
|
|
|
|
ch->state = ATA_IDLE;
|
|
|
|
ata_cam_end_transaction(dev, request);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
ata_cam_process_sense(device_t dev, struct ata_request *request)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
union ccb *ccb = request->ccb;
|
|
|
|
int fatalerr = 0;
|
|
|
|
|
|
|
|
ch->requestsense = 0;
|
|
|
|
|
|
|
|
if (request->flags & ATA_R_TIMEOUT)
|
|
|
|
fatalerr = 1;
|
|
|
|
if ((request->flags & ATA_R_TIMEOUT) == 0 &&
|
|
|
|
(request->status & ATA_S_ERROR) == 0 &&
|
|
|
|
request->result == 0) {
|
|
|
|
ccb->ccb_h.status |= CAM_AUTOSNS_VALID;
|
|
|
|
} else {
|
|
|
|
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
|
|
|
|
ccb->ccb_h.status |= CAM_AUTOSENSE_FAIL;
|
|
|
|
}
|
|
|
|
|
|
|
|
ata_free_request(request);
|
|
|
|
xpt_done(ccb);
|
|
|
|
/* Do error recovery if needed. */
|
|
|
|
if (fatalerr)
|
|
|
|
ata_reinit(dev);
|
|
|
|
}
|
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
void
|
|
|
|
ata_cam_end_transaction(device_t dev, struct ata_request *request)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
union ccb *ccb = request->ccb;
|
|
|
|
int fatalerr = 0;
|
|
|
|
|
2011-04-12 09:55:24 +00:00
|
|
|
if (ch->requestsense) {
|
|
|
|
ata_cam_process_sense(dev, request);
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
|
|
|
|
if (request->flags & ATA_R_TIMEOUT) {
|
|
|
|
xpt_freeze_simq(ch->sim, 1);
|
|
|
|
ccb->ccb_h.status &= ~CAM_STATUS_MASK;
|
|
|
|
ccb->ccb_h.status |= CAM_CMD_TIMEOUT | CAM_RELEASE_SIMQ;
|
|
|
|
fatalerr = 1;
|
|
|
|
} else if (request->status & ATA_S_ERROR) {
|
|
|
|
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
|
|
|
|
ccb->ccb_h.status |= CAM_ATA_STATUS_ERROR;
|
|
|
|
} else {
|
|
|
|
ccb->ccb_h.status |= CAM_SCSI_STATUS_ERROR;
|
|
|
|
ccb->csio.scsi_status = SCSI_STATUS_CHECK_COND;
|
|
|
|
}
|
|
|
|
} else if (request->result == ERESTART)
|
|
|
|
ccb->ccb_h.status |= CAM_REQUEUE_REQ;
|
|
|
|
else if (request->result != 0)
|
|
|
|
ccb->ccb_h.status |= CAM_REQ_CMP_ERR;
|
|
|
|
else
|
|
|
|
ccb->ccb_h.status |= CAM_REQ_CMP;
|
|
|
|
if ((ccb->ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP &&
|
|
|
|
!(ccb->ccb_h.status & CAM_DEV_QFRZN)) {
|
|
|
|
xpt_freeze_devq(ccb->ccb_h.path, 1);
|
|
|
|
ccb->ccb_h.status |= CAM_DEV_QFRZN;
|
|
|
|
}
|
|
|
|
if (ccb->ccb_h.func_code == XPT_ATA_IO &&
|
|
|
|
((request->status & ATA_S_ERROR) ||
|
|
|
|
(ccb->ataio.cmd.flags & CAM_ATAIO_NEEDRESULT))) {
|
|
|
|
struct ata_res *res = &ccb->ataio.res;
|
|
|
|
res->status = request->status;
|
|
|
|
res->error = request->error;
|
|
|
|
res->lba_low = request->u.ata.lba;
|
|
|
|
res->lba_mid = request->u.ata.lba >> 8;
|
|
|
|
res->lba_high = request->u.ata.lba >> 16;
|
|
|
|
res->device = request->u.ata.lba >> 24;
|
|
|
|
res->lba_low_exp = request->u.ata.lba >> 24;
|
|
|
|
res->lba_mid_exp = request->u.ata.lba >> 32;
|
|
|
|
res->lba_high_exp = request->u.ata.lba >> 40;
|
|
|
|
res->sector_count = request->u.ata.count;
|
|
|
|
res->sector_count_exp = request->u.ata.count >> 8;
|
|
|
|
}
|
2010-11-08 15:36:15 +00:00
|
|
|
if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) {
|
|
|
|
if (ccb->ccb_h.func_code == XPT_ATA_IO) {
|
|
|
|
ccb->ataio.resid =
|
|
|
|
ccb->ataio.dxfer_len - request->donecount;
|
|
|
|
} else {
|
|
|
|
ccb->csio.resid =
|
|
|
|
ccb->csio.dxfer_len - request->donecount;
|
|
|
|
}
|
|
|
|
}
|
2011-04-12 09:55:24 +00:00
|
|
|
if ((ccb->ccb_h.status & CAM_STATUS_MASK) == CAM_SCSI_STATUS_ERROR &&
|
|
|
|
(ccb->ccb_h.flags & CAM_DIS_AUTOSENSE) == 0)
|
|
|
|
ata_cam_request_sense(dev, request);
|
|
|
|
else {
|
|
|
|
ata_free_request(request);
|
|
|
|
xpt_done(ccb);
|
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
/* Do error recovery if needed. */
|
|
|
|
if (fatalerr)
|
|
|
|
ata_reinit(dev);
|
|
|
|
}
|
|
|
|
|
2010-04-30 08:37:00 +00:00
|
|
|
static int
|
|
|
|
ata_check_ids(device_t dev, union ccb *ccb)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = device_get_softc(dev);
|
|
|
|
|
|
|
|
if (ccb->ccb_h.target_id > ((ch->flags & ATA_NO_SLAVE) ? 0 : 1)) {
|
|
|
|
ccb->ccb_h.status = CAM_TID_INVALID;
|
|
|
|
xpt_done(ccb);
|
|
|
|
return (-1);
|
|
|
|
}
|
|
|
|
if (ccb->ccb_h.target_lun != 0) {
|
|
|
|
ccb->ccb_h.status = CAM_LUN_INVALID;
|
|
|
|
xpt_done(ccb);
|
|
|
|
return (-1);
|
|
|
|
}
|
|
|
|
return (0);
|
|
|
|
}
|
|
|
|
|
2009-12-06 00:10:13 +00:00
|
|
|
static void
|
|
|
|
ataaction(struct cam_sim *sim, union ccb *ccb)
|
|
|
|
{
|
2010-07-25 15:43:52 +00:00
|
|
|
device_t dev, parent;
|
2009-12-06 00:10:13 +00:00
|
|
|
struct ata_channel *ch;
|
|
|
|
|
|
|
|
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("ataaction func_code=%x\n",
|
|
|
|
ccb->ccb_h.func_code));
|
|
|
|
|
|
|
|
ch = (struct ata_channel *)cam_sim_softc(sim);
|
|
|
|
dev = ch->dev;
|
|
|
|
switch (ccb->ccb_h.func_code) {
|
|
|
|
/* Common cases first */
|
|
|
|
case XPT_ATA_IO: /* Execute the requested I/O operation */
|
|
|
|
case XPT_SCSI_IO:
|
2010-04-30 08:37:00 +00:00
|
|
|
if (ata_check_ids(dev, ccb))
|
|
|
|
return;
|
2009-12-06 00:10:13 +00:00
|
|
|
if ((ch->devices & ((ATA_ATA_MASTER | ATA_ATAPI_MASTER)
|
|
|
|
<< ccb->ccb_h.target_id)) == 0) {
|
|
|
|
ccb->ccb_h.status = CAM_SEL_TIMEOUT;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (ch->running)
|
|
|
|
device_printf(dev, "already running!\n");
|
|
|
|
if (ccb->ccb_h.func_code == XPT_ATA_IO &&
|
|
|
|
(ccb->ataio.cmd.flags & CAM_ATAIO_CONTROL) &&
|
|
|
|
(ccb->ataio.cmd.control & ATA_A_RESET)) {
|
|
|
|
struct ata_res *res = &ccb->ataio.res;
|
|
|
|
|
|
|
|
bzero(res, sizeof(*res));
|
|
|
|
if (ch->devices & (ATA_ATA_MASTER << ccb->ccb_h.target_id)) {
|
|
|
|
res->lba_high = 0;
|
|
|
|
res->lba_mid = 0;
|
|
|
|
} else {
|
|
|
|
res->lba_high = 0xeb;
|
|
|
|
res->lba_mid = 0x14;
|
|
|
|
}
|
|
|
|
ccb->ccb_h.status = CAM_REQ_CMP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
ata_cam_begin_transaction(dev, ccb);
|
2010-04-30 08:37:00 +00:00
|
|
|
return;
|
2009-12-06 00:10:13 +00:00
|
|
|
case XPT_EN_LUN: /* Enable LUN as a target */
|
|
|
|
case XPT_TARGET_IO: /* Execute target I/O request */
|
|
|
|
case XPT_ACCEPT_TARGET_IO: /* Accept Host Target Mode CDB */
|
|
|
|
case XPT_CONT_TARGET_IO: /* Continue Host Target I/O Connection*/
|
|
|
|
case XPT_ABORT: /* Abort the specified CCB */
|
|
|
|
/* XXX Implement */
|
|
|
|
ccb->ccb_h.status = CAM_REQ_INVALID;
|
|
|
|
break;
|
|
|
|
case XPT_SET_TRAN_SETTINGS:
|
|
|
|
{
|
|
|
|
struct ccb_trans_settings *cts = &ccb->cts;
|
|
|
|
struct ata_cam_device *d;
|
|
|
|
|
2010-04-30 08:37:00 +00:00
|
|
|
if (ata_check_ids(dev, ccb))
|
|
|
|
return;
|
2009-12-06 00:10:13 +00:00
|
|
|
if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
|
|
|
|
d = &ch->curr[ccb->ccb_h.target_id];
|
|
|
|
else
|
|
|
|
d = &ch->user[ccb->ccb_h.target_id];
|
2010-01-10 09:20:56 +00:00
|
|
|
if (ch->flags & ATA_SATA) {
|
2009-12-06 00:10:13 +00:00
|
|
|
if (cts->xport_specific.sata.valid & CTS_SATA_VALID_REVISION)
|
|
|
|
d->revision = cts->xport_specific.sata.revision;
|
2010-02-02 11:09:28 +00:00
|
|
|
if (cts->xport_specific.sata.valid & CTS_SATA_VALID_MODE) {
|
2009-12-06 00:10:13 +00:00
|
|
|
if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
|
|
|
|
d->mode = ATA_SETMODE(ch->dev,
|
|
|
|
ccb->ccb_h.target_id,
|
|
|
|
cts->xport_specific.sata.mode);
|
|
|
|
} else
|
|
|
|
d->mode = cts->xport_specific.sata.mode;
|
|
|
|
}
|
2010-02-02 11:09:28 +00:00
|
|
|
if (cts->xport_specific.sata.valid & CTS_SATA_VALID_BYTECOUNT)
|
2009-12-06 00:10:13 +00:00
|
|
|
d->bytecount = min(8192, cts->xport_specific.sata.bytecount);
|
2010-02-02 11:09:28 +00:00
|
|
|
if (cts->xport_specific.sata.valid & CTS_SATA_VALID_ATAPI)
|
|
|
|
d->atapi = cts->xport_specific.sata.atapi;
|
2010-11-18 19:28:45 +00:00
|
|
|
if (cts->xport_specific.sata.valid & CTS_SATA_VALID_CAPS)
|
|
|
|
d->caps = cts->xport_specific.sata.caps;
|
2009-12-06 00:10:13 +00:00
|
|
|
} else {
|
|
|
|
if (cts->xport_specific.ata.valid & CTS_ATA_VALID_MODE) {
|
|
|
|
if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
|
|
|
|
d->mode = ATA_SETMODE(ch->dev,
|
|
|
|
ccb->ccb_h.target_id,
|
|
|
|
cts->xport_specific.ata.mode);
|
|
|
|
} else
|
|
|
|
d->mode = cts->xport_specific.ata.mode;
|
|
|
|
}
|
|
|
|
if (cts->xport_specific.ata.valid & CTS_ATA_VALID_BYTECOUNT)
|
|
|
|
d->bytecount = cts->xport_specific.ata.bytecount;
|
2010-02-02 11:09:28 +00:00
|
|
|
if (cts->xport_specific.ata.valid & CTS_ATA_VALID_ATAPI)
|
|
|
|
d->atapi = cts->xport_specific.ata.atapi;
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
|
|
|
ccb->ccb_h.status = CAM_REQ_CMP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case XPT_GET_TRAN_SETTINGS:
|
|
|
|
{
|
|
|
|
struct ccb_trans_settings *cts = &ccb->cts;
|
|
|
|
struct ata_cam_device *d;
|
|
|
|
|
2010-04-30 08:37:00 +00:00
|
|
|
if (ata_check_ids(dev, ccb))
|
|
|
|
return;
|
2009-12-06 00:10:13 +00:00
|
|
|
if (cts->type == CTS_TYPE_CURRENT_SETTINGS)
|
|
|
|
d = &ch->curr[ccb->ccb_h.target_id];
|
|
|
|
else
|
|
|
|
d = &ch->user[ccb->ccb_h.target_id];
|
2012-06-06 06:52:51 +00:00
|
|
|
cts->protocol = PROTO_UNSPECIFIED;
|
2009-12-06 00:10:13 +00:00
|
|
|
cts->protocol_version = PROTO_VERSION_UNSPECIFIED;
|
2010-01-10 09:20:56 +00:00
|
|
|
if (ch->flags & ATA_SATA) {
|
2009-12-06 00:10:13 +00:00
|
|
|
cts->transport = XPORT_SATA;
|
|
|
|
cts->transport_version = XPORT_VERSION_UNSPECIFIED;
|
2010-02-22 10:45:40 +00:00
|
|
|
cts->xport_specific.sata.valid = 0;
|
2009-12-06 00:10:13 +00:00
|
|
|
cts->xport_specific.sata.mode = d->mode;
|
|
|
|
cts->xport_specific.sata.valid |= CTS_SATA_VALID_MODE;
|
|
|
|
cts->xport_specific.sata.bytecount = d->bytecount;
|
|
|
|
cts->xport_specific.sata.valid |= CTS_SATA_VALID_BYTECOUNT;
|
|
|
|
if (cts->type == CTS_TYPE_CURRENT_SETTINGS) {
|
|
|
|
cts->xport_specific.sata.revision =
|
|
|
|
ATA_GETREV(dev, ccb->ccb_h.target_id);
|
2010-02-22 10:45:40 +00:00
|
|
|
if (cts->xport_specific.sata.revision != 0xff) {
|
|
|
|
cts->xport_specific.sata.valid |=
|
|
|
|
CTS_SATA_VALID_REVISION;
|
|
|
|
}
|
2010-11-18 19:28:45 +00:00
|
|
|
cts->xport_specific.sata.caps =
|
|
|
|
d->caps & CTS_SATA_CAPS_D;
|
|
|
|
if (ch->pm_level) {
|
|
|
|
cts->xport_specific.sata.caps |=
|
|
|
|
CTS_SATA_CAPS_H_PMREQ;
|
|
|
|
}
|
|
|
|
cts->xport_specific.sata.caps &=
|
|
|
|
ch->user[ccb->ccb_h.target_id].caps;
|
|
|
|
cts->xport_specific.sata.valid |=
|
|
|
|
CTS_SATA_VALID_CAPS;
|
2010-02-22 10:45:40 +00:00
|
|
|
} else {
|
2009-12-06 00:10:13 +00:00
|
|
|
cts->xport_specific.sata.revision = d->revision;
|
2010-02-22 10:45:40 +00:00
|
|
|
cts->xport_specific.sata.valid |= CTS_SATA_VALID_REVISION;
|
2010-11-18 19:28:45 +00:00
|
|
|
cts->xport_specific.sata.caps = d->caps;
|
|
|
|
cts->xport_specific.sata.valid |= CTS_SATA_VALID_CAPS;
|
2010-02-22 10:45:40 +00:00
|
|
|
}
|
2010-02-02 11:09:28 +00:00
|
|
|
cts->xport_specific.sata.atapi = d->atapi;
|
|
|
|
cts->xport_specific.sata.valid |= CTS_SATA_VALID_ATAPI;
|
2009-12-06 00:10:13 +00:00
|
|
|
} else {
|
|
|
|
cts->transport = XPORT_ATA;
|
|
|
|
cts->transport_version = XPORT_VERSION_UNSPECIFIED;
|
2010-02-22 10:45:40 +00:00
|
|
|
cts->xport_specific.ata.valid = 0;
|
2009-12-06 00:10:13 +00:00
|
|
|
cts->xport_specific.ata.mode = d->mode;
|
|
|
|
cts->xport_specific.ata.valid |= CTS_ATA_VALID_MODE;
|
|
|
|
cts->xport_specific.ata.bytecount = d->bytecount;
|
|
|
|
cts->xport_specific.ata.valid |= CTS_ATA_VALID_BYTECOUNT;
|
2010-02-02 11:09:28 +00:00
|
|
|
cts->xport_specific.ata.atapi = d->atapi;
|
|
|
|
cts->xport_specific.ata.valid |= CTS_ATA_VALID_ATAPI;
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
|
|
|
ccb->ccb_h.status = CAM_REQ_CMP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case XPT_RESET_BUS: /* Reset the specified SCSI bus */
|
|
|
|
case XPT_RESET_DEV: /* Bus Device Reset the specified SCSI device */
|
|
|
|
ata_reinit(dev);
|
|
|
|
ccb->ccb_h.status = CAM_REQ_CMP;
|
|
|
|
break;
|
|
|
|
case XPT_TERM_IO: /* Terminate the I/O process */
|
|
|
|
/* XXX Implement */
|
|
|
|
ccb->ccb_h.status = CAM_REQ_INVALID;
|
|
|
|
break;
|
|
|
|
case XPT_PATH_INQ: /* Path routing inquiry */
|
|
|
|
{
|
|
|
|
struct ccb_pathinq *cpi = &ccb->cpi;
|
|
|
|
|
2010-07-25 15:43:52 +00:00
|
|
|
parent = device_get_parent(dev);
|
2009-12-06 00:10:13 +00:00
|
|
|
cpi->version_num = 1; /* XXX??? */
|
|
|
|
cpi->hba_inquiry = PI_SDTR_ABLE;
|
|
|
|
cpi->target_sprt = 0;
|
|
|
|
cpi->hba_misc = PIM_SEQSCAN;
|
|
|
|
cpi->hba_eng_cnt = 0;
|
|
|
|
if (ch->flags & ATA_NO_SLAVE)
|
|
|
|
cpi->max_target = 0;
|
|
|
|
else
|
|
|
|
cpi->max_target = 1;
|
|
|
|
cpi->max_lun = 0;
|
|
|
|
cpi->initiator_id = 0;
|
|
|
|
cpi->bus_id = cam_sim_bus(sim);
|
|
|
|
if (ch->flags & ATA_SATA)
|
|
|
|
cpi->base_transfer_speed = 150000;
|
|
|
|
else
|
|
|
|
cpi->base_transfer_speed = 3300;
|
|
|
|
strncpy(cpi->sim_vid, "FreeBSD", SIM_IDLEN);
|
|
|
|
strncpy(cpi->hba_vid, "ATA", HBA_IDLEN);
|
|
|
|
strncpy(cpi->dev_name, cam_sim_name(sim), DEV_IDLEN);
|
|
|
|
cpi->unit_number = cam_sim_unit(sim);
|
2010-01-10 09:20:56 +00:00
|
|
|
if (ch->flags & ATA_SATA)
|
2009-12-06 00:10:13 +00:00
|
|
|
cpi->transport = XPORT_SATA;
|
|
|
|
else
|
|
|
|
cpi->transport = XPORT_ATA;
|
|
|
|
cpi->transport_version = XPORT_VERSION_UNSPECIFIED;
|
2012-06-10 11:17:14 +00:00
|
|
|
cpi->protocol = PROTO_ATA;
|
2009-12-06 00:10:13 +00:00
|
|
|
cpi->protocol_version = PROTO_VERSION_UNSPECIFIED;
|
|
|
|
cpi->maxio = ch->dma.max_iosize ? ch->dma.max_iosize : DFLTPHYS;
|
2010-07-25 15:43:52 +00:00
|
|
|
if (device_get_devclass(device_get_parent(parent)) ==
|
|
|
|
devclass_find("pci")) {
|
|
|
|
cpi->hba_vendor = pci_get_vendor(parent);
|
|
|
|
cpi->hba_device = pci_get_device(parent);
|
|
|
|
cpi->hba_subvendor = pci_get_subvendor(parent);
|
|
|
|
cpi->hba_subdevice = pci_get_subdevice(parent);
|
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
cpi->ccb_h.status = CAM_REQ_CMP;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
ccb->ccb_h.status = CAM_REQ_INVALID;
|
|
|
|
break;
|
|
|
|
}
|
2010-04-30 08:37:00 +00:00
|
|
|
xpt_done(ccb);
|
2009-12-06 00:10:13 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
atapoll(struct cam_sim *sim)
|
|
|
|
{
|
|
|
|
struct ata_channel *ch = (struct ata_channel *)cam_sim_softc(sim);
|
|
|
|
|
|
|
|
ata_interrupt_locked(ch);
|
|
|
|
}
|
|
|
|
#endif
|
2005-04-29 11:30:03 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/*
|
|
|
|
* module handeling
|
|
|
|
*/
|
|
|
|
static int
|
|
|
|
ata_module_event_handler(module_t mod, int what, void *arg)
|
2000-02-18 20:57:33 +00:00
|
|
|
{
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
static struct cdev *atacdev;
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
|
|
|
|
switch (what) {
|
|
|
|
case MOD_LOAD:
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* register controlling device */
|
|
|
|
atacdev = make_dev(&ata_cdevsw, 0, UID_ROOT, GID_OPERATOR, 0600, "ata");
|
|
|
|
|
|
|
|
if (cold) {
|
|
|
|
/* register boot attach to be run when interrupts are enabled */
|
|
|
|
if (!(ata_delayed_attach = (struct intr_config_hook *)
|
|
|
|
malloc(sizeof(struct intr_config_hook),
|
|
|
|
M_TEMP, M_NOWAIT | M_ZERO))) {
|
|
|
|
printf("ata: malloc of delayed attach hook failed\n");
|
|
|
|
return EIO;
|
|
|
|
}
|
|
|
|
ata_delayed_attach->ich_func = (void*)ata_boot_attach;
|
|
|
|
if (config_intrhook_establish(ata_delayed_attach) != 0) {
|
|
|
|
printf("ata: config_intrhook_establish failed\n");
|
|
|
|
free(ata_delayed_attach, M_TEMP);
|
|
|
|
}
|
|
|
|
}
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
case MOD_UNLOAD:
|
2009-12-06 00:10:13 +00:00
|
|
|
#ifndef ATA_CAM
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
/* deregister controlling device */
|
|
|
|
destroy_dev(atacdev);
|
2009-12-06 00:10:13 +00:00
|
|
|
#endif
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
return 0;
|
|
|
|
|
|
|
|
default:
|
|
|
|
return EOPNOTSUPP;
|
2000-02-18 20:57:33 +00:00
|
|
|
}
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
}
|
2004-01-11 22:08:34 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
static moduledata_t ata_moduledata = { "ata", ata_module_event_handler, NULL };
|
|
|
|
DECLARE_MODULE(ata, ata_moduledata, SI_SUB_CONFIGURE, SI_ORDER_SECOND);
|
|
|
|
MODULE_VERSION(ata, 1);
|
2009-12-10 16:55:16 +00:00
|
|
|
#ifdef ATA_CAM
|
|
|
|
MODULE_DEPEND(ata, cam, 1, 1, 1);
|
|
|
|
#endif
|
2003-05-02 13:47:44 +00:00
|
|
|
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
static void
|
|
|
|
ata_init(void)
|
|
|
|
{
|
2005-04-18 16:01:56 +00:00
|
|
|
ata_request_zone = uma_zcreate("ata_request", sizeof(struct ata_request),
|
|
|
|
NULL, NULL, NULL, NULL, 0, 0);
|
|
|
|
ata_composite_zone = uma_zcreate("ata_composite",
|
2005-04-30 16:22:07 +00:00
|
|
|
sizeof(struct ata_composite),
|
|
|
|
NULL, NULL, NULL, NULL, 0, 0);
|
2000-02-18 20:57:33 +00:00
|
|
|
}
|
2005-04-18 16:01:56 +00:00
|
|
|
SYSINIT(ata_register, SI_SUB_DRIVERS, SI_ORDER_SECOND, ata_init, NULL);
|
This is the much rumoured ATA mkIII update that I've been working on.
o ATA is now fully newbus'd and split into modules.
This means that on a modern system you just load "atapci and ata"
to get the base support, and then one or more of the device
subdrivers "atadisk atapicd atapifd atapist ataraid".
All can be loaded/unloaded anytime, but for obvious reasons you
dont want to unload atadisk when you have mounted filesystems.
o The device identify part of the probe has been rewritten to fix
the problems with odd devices the old had, and to try to remove
so of the long delays some HW could provoke. Also probing is done
without the need for interrupts, making earlier probing possible.
o SATA devices can be hot inserted/removed and devices will be created/
removed in /dev accordingly.
NOTE: only supported on controllers that has this feature:
Promise and Silicon Image for now.
On other controllers the usual atacontrol detach/attach dance is
still needed.
o Support for "atomic" composite ATA requests used for RAID.
o ATA RAID support has been rewritten and and now supports these
metadata formats:
"Adaptec HostRAID"
"Highpoint V2 RocketRAID"
"Highpoint V3 RocketRAID"
"Intel MatrixRAID"
"Integrated Technology Express"
"LSILogic V2 MegaRAID"
"LSILogic V3 MegaRAID"
"Promise FastTrak"
"Silicon Image Medley"
"FreeBSD PseudoRAID"
o Update the ioctl API to match new RAID levels etc.
o Update atacontrol to know about the new RAID levels etc
NOTE: you need to recompile atacontrol with the new sys/ata.h,
make world will take care of that.
NOTE2: that rebuild is done differently from the old system as
the rebuild is now done piggybacked on read requests to the
array, so atacontrol simply starts a background "dd" to rebuild
the array.
o The reinit code has been worked over to be much more robust.
o The timeout code has been overhauled for races.
o Support of new chipsets.
o Lots of fixes for bugs found while doing the modulerization and
reviewing the old code.
Missing or changed features from current ATA:
o atapi-cd no longer has support for ATAPI changers. Todays its
much cheaper and alot faster to copy those CD images to disk
and serve them from there. Besides they dont seem to be made
anymore, maybe for that exact reason.
o ATA RAID can only read metadata from all the above metadata formats,
not write all of them (Promise and Highpoint V2 so far). This means
that arrays can be picked up from the BIOS, but they cannot be
created from FreeBSD. There is more to it than just the missing
write metadata support, those formats are not unique to a given
controller like Promise and Highpoint formats, instead they exist
for several types, and even worse, some controllers can have
different formats and its impossible to tell which one.
The outcome is that we cannot reliably create the metadata of those
formats and be sure the controller BIOS will understand it.
However write support is needed to update/fail/rebuild the arrays
properly so it sits fairly high on the TODO list.
o So far atapicam is not supported with these changes. When/if this
will change is up to the maintainer of atapi-cam so go there for
questions.
HW donated by: Webveveriet AS
HW donated by: Frode Nordahl
HW donated by: Yahoo!
HW donated by: Sentex
Patience by: Vife and my boys (and even the cats)
2005-03-30 12:03:40 +00:00
|
|
|
|
2005-04-18 16:01:56 +00:00
|
|
|
static void
|
|
|
|
ata_uninit(void)
|
|
|
|
{
|
|
|
|
uma_zdestroy(ata_composite_zone);
|
|
|
|
uma_zdestroy(ata_request_zone);
|
|
|
|
}
|
|
|
|
SYSUNINIT(ata_unregister, SI_SUB_DRIVERS, SI_ORDER_SECOND, ata_uninit, NULL);
|