diff options
author | mav <mav@FreeBSD.org> | 2011-07-22 16:37:04 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2011-07-22 16:37:04 +0000 |
commit | 910d1f1924e5aee0338fe4b68d377839ddbe538a (patch) | |
tree | 436d90436cc83fbe9aaba180811a88cff92268d7 /sys/dev/ata/ata-pci.h | |
parent | 83fc4e3c9214d3e7d1d8809bd71840e5df2c8895 (diff) | |
download | FreeBSD-src-910d1f1924e5aee0338fe4b68d377839ddbe538a.zip FreeBSD-src-910d1f1924e5aee0338fe4b68d377839ddbe538a.tar.gz |
- Use mutex to serialize index/data register pair usage, when
accessing SATA registers. Unserialized access under heavy load caused
wrong speed reporting and potentially could cause device loss.
- To free memory and other resources (including above), allocated
during chipinit() method call on attach, add new chipdeinit() method,
called during driver detach.
Submitted by: Andrew Boyer <aboyer@averesystems.com> (initial version)
Approved by: re (kib)
MFC after: 1 week
Diffstat (limited to 'sys/dev/ata/ata-pci.h')
-rw-r--r-- | sys/dev/ata/ata-pci.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sys/dev/ata/ata-pci.h b/sys/dev/ata/ata-pci.h index 51064f6..3b90498 100644 --- a/sys/dev/ata/ata-pci.h +++ b/sys/dev/ata/ata-pci.h @@ -55,6 +55,7 @@ struct ata_pci_controller { int channels; int ichannels; int (*chipinit)(device_t); + int (*chipdeinit)(device_t); int (*suspend)(device_t); int (*resume)(device_t); int (*ch_attach)(device_t); @@ -579,6 +580,8 @@ int ata_sii_chipinit(device_t); /* externs */ extern devclass_t ata_pci_devclass; +MALLOC_DECLARE(M_ATAPCI); + /* macro for easy definition of all driver module stuff */ #define ATA_DECLARE_DRIVER(dname) \ static device_method_t __CONCAT(dname,_methods)[] = { \ |