History log of /haiku/src/add-ons/kernel/bus_managers/ata/ATAPrivate.h
Revision Date Author Comments
# 1029af17 01-Sep-2021 Augustin Cavalier <waddlesplash@gmail.com>

Add missing includes following previous commit.

All these files were making use of headers included indirectly
through AutoLock.h that are now no longer following the previous commit.


# 51d76425 13-Jan-2011 Axel Dörfler <axeld@pinc-software.de>

* Added a new B_GET_DEVICE_NAME ioctl - this should be implemented by all
drivers in the future, such that NetworkStatus and similar software can show
nice names for the devices. The device manager should implement this and
return the B_DEVICE_PRETTY_NAME of the device (and in turn, new style drivers
should actually set this).
* Implemented handling of this ioctl in the scsi_periph to return the vendor/
product strings.
* Implemented this in the ATA bus manager to return the model from the info
block.
* KDiskDevice now fills in the partition_data::name if the B_GET_DEVICE_NAME
succeeds.
* As a side effect, at least BootManager now shows the drive name; maybe
DriveSetup does as well for the raw device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40231 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f10a55a6 01-Nov-2010 Jérôme Duval <korli@users.berlios.de>

* ata: added ATADevice::ReadCapacity16()
* ata: don't fail if lba_sector_count is null and lba48_sector_count is not
* scsi_periph: if ReadCapacity() returns 0xffffffff, use ReadCapacity16() instead
* scsi_disk: use a different computation in the struct geometry computation for bigger disks
Tested successfully with a virtual 10TB hard drive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39252 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31794499 26-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed ATAInfoblock.h to ATAInfoBlock.h.
* Fixed copyright as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11a40e6d 23-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed wrong indentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6c7bc7cd 23-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Added missing const in ATAPIDevice::IsATAPI() that prevented CD-ROMs from
working since r36416.
* Added more const, and removed all superfluous semicolons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36429 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63400da8 22-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the ATA_BLOCK_SIZE define.
* The logical and physical block sizes are now retrieved from the info block,
though only the logical one is actually used (where ATA_BLOCK_SIZE was used
before).
* Also added retrieving the offset of the first logical block inside the first
physical one.
* All this stupidity just for Windows XP, it's really sad.
* Added "const" to some methods, removed some superfluous ';'.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a4794591 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Write device identification into syslog.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33042 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c13be10 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Clear pending interrupts after reset and timeouts


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33039 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5987738c 06-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Faster bus scan by reusing device presence information that is available before
resetting the bus. This allows to skip devices that are not present. Works for
most but not all devices. Sometimes device 0 pretends that a device 1 exists,
but it's usefull anyway.
Allow working device 1 only configurations by not selecting device 0 anymore
for identification. Moved indentification from Reset into BusScan to do everything
in a single step. A SATA emulation in combined mode might have a slave (device 1)
only configuration when only one device is connected, depending on the port.
Also tested with PATA.
Recovery for lost interrupts. Works but is dead slow because of the timeout.
Bus reset isn't possible anymore, this needs to be implemented in a save way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32978 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22a6e4bb 21-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Only use 2 bytes of the signature instead of all four. Even though the specs
clearly state that the other two bytes need to be 0x01 (and they always did,
even back to the very first ATA/ATAPI specs), I have one device here that
doesn't set the sector count register to 1. Since those two bytes are the unique
ones of the signatures anyway, it shouldn't harm to just ignore the others.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30311 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c5cccce 20-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Explicitly check device selection success. If device selection failed, assume
there is no device. Should fix long reset timeouts when only device 1 is
present and therefore device 0 can't be selected.
* In case a device reset error is reported, don't try to identify/use the device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30286 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca68245e 19-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Wrote a new infoblock header according to ATA/ATAPI-6 that is cleaner and more
verbose than the old one. Removed the latter.
* Put some of the hardcoded values into defines for more clearity.
* Report more detailed device type for ATAPI devices and report removable
media based on the bit in the infoblock as well.
* Rename the channel ID attributes back to ide to let the hack in scsi_periph
work that then publishes the devices under the disk/ata[pi] tree.
* Also disable command queueing for ATAPI devices.
* Remove remnants of CHS support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6b82488 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Apply block count maximum according to device capability. If the device supports
LBA48 we can allow a maximum block count of 65535 as we have a 16bit sector
count field available.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30254 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6a2bc102 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

For packet devices we want to actually return a check condition when the device
indicates an error. Also we then need to pass through the request sense command
to the device. This should fix media status reporting for ATAPI.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30253 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 827f849a 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Reworked device detection, we'll see how well this works...
* Reworked some of the transfer handling after reading the specs.
* Ensure that the device selection bit is set correctly for all commands.
* Generally disable interrupts and enable them only when expecting a DMA one.
* Renamed disk failure to device fault according to specs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30248 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33d80ba2 10-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Rework ATAPI handling, removing all PIO interrupts. As Marcus pointed out the
complication is not really worth it and it would in any case be unreliable
in the shared interrupt case (even though you could always check the poll
condition in the interrupt handler).
* Probably broke ATAPI with those changes though.
* Change blocksLeft to bytesLeft to allow using it for arbitrary ATAPI requests.
* Check some more error conditions and actually let those states get through
to the SCSI layer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30109 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da4c9900 10-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Move the lock into the request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30100 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 118bb4e7 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Fix race condition between finishing a request and returning a busy status
when the channel is in use, which would cause the SCSI scheduler to stop
sending requests.
* Indeed we need to return a status from the interrupt handler, as for PIO
transfers there is no way of knowning whether or not the interrupt at hand
was ours.
* Add some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30091 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22805aae 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Adding ATAPI support to the new ATA bus_manager. Only tested in QEMU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30080 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 79973897 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Implement DMA transfers in the new ATA bus_manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30069 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9611bddd 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Adding DMA detection and generally allow DMA. Not used yet though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30054 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bb01f71 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding/updating license headers.
* Add the standalone ata module to the Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30053 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44039cc6 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Additional to the normal detection of device presence, use the trick previously
present in the IDE bus_manager when detecting devices to avoid long timeouts
when waiting for possible ATAPI devices.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30052 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf9a3835 08-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Work in progress commit of a reworked ATA bus_manager. It's now object based,
but doesn't really do anything more than before.
* It also replaces everything IDE with ATA counterparts and cleans up a lot
of the definitions.
* Cleaning up the old ATA bus_manager as well as some license headers missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30049 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 51d76425033b27609fb4e206c7c9610cd4c4a653 13-Jan-2011 Axel Dörfler <axeld@pinc-software.de>

* Added a new B_GET_DEVICE_NAME ioctl - this should be implemented by all
drivers in the future, such that NetworkStatus and similar software can show
nice names for the devices. The device manager should implement this and
return the B_DEVICE_PRETTY_NAME of the device (and in turn, new style drivers
should actually set this).
* Implemented handling of this ioctl in the scsi_periph to return the vendor/
product strings.
* Implemented this in the ATA bus manager to return the model from the info
block.
* KDiskDevice now fills in the partition_data::name if the B_GET_DEVICE_NAME
succeeds.
* As a side effect, at least BootManager now shows the drive name; maybe
DriveSetup does as well for the raw device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40231 a95241bf-73f2-0310-859d-f6bbb57e9c96


# f10a55a632599ee0c06dd3235df51cb2410e3633 01-Nov-2010 Jérôme Duval <korli@users.berlios.de>

* ata: added ATADevice::ReadCapacity16()
* ata: don't fail if lba_sector_count is null and lba48_sector_count is not
* scsi_periph: if ReadCapacity() returns 0xffffffff, use ReadCapacity16() instead
* scsi_disk: use a different computation in the struct geometry computation for bigger disks
Tested successfully with a virtual 10TB hard drive.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39252 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 31794499331ff7359c7757b4a972030bb644eb13 26-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Renamed ATAInfoblock.h to ATAInfoBlock.h.
* Fixed copyright as pointed out by Ingo.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36480 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 11a40e6d4663604a0448efa92899e41d32f7bbb4 23-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Fixed wrong indentation.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36430 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6c7bc7cd2230c59efbf58f993dd1925b72e2c25d 23-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Added missing const in ATAPIDevice::IsATAPI() that prevented CD-ROMs from
working since r36416.
* Added more const, and removed all superfluous semicolons.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36429 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 63400da873b3eecf384aec6bc227fe76c3e282f1 22-Apr-2010 Axel Dörfler <axeld@pinc-software.de>

* Got rid of the ATA_BLOCK_SIZE define.
* The logical and physical block sizes are now retrieved from the info block,
though only the logical one is actually used (where ATA_BLOCK_SIZE was used
before).
* Also added retrieving the offset of the first logical block inside the first
physical one.
* All this stupidity just for Windows XP, it's really sad.
* Added "const" to some methods, removed some superfluous ';'.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36416 a95241bf-73f2-0310-859d-f6bbb57e9c96


# a479459113a5536cae45de8392993d8f04ebad53 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Write device identification into syslog.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33042 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 3c13be106e70f3e3c4586ef3c68dcb480cc19ce2 10-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Clear pending interrupts after reset and timeouts


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@33039 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 5987738cbe03d66514022c2309921302325805a4 06-Sep-2009 Marcus Overhagen <marcusoverhagen@gmail.com>

Faster bus scan by reusing device presence information that is available before
resetting the bus. This allows to skip devices that are not present. Works for
most but not all devices. Sometimes device 0 pretends that a device 1 exists,
but it's usefull anyway.
Allow working device 1 only configurations by not selecting device 0 anymore
for identification. Moved indentification from Reset into BusScan to do everything
in a single step. A SATA emulation in combined mode might have a slave (device 1)
only configuration when only one device is connected, depending on the port.
Also tested with PATA.
Recovery for lost interrupts. Works but is dead slow because of the timeout.
Bus reset isn't possible anymore, this needs to be implemented in a save way.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@32978 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22a6e4bb80ac3242749093f607dd4b9d0bd6f34e 21-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Only use 2 bytes of the signature instead of all four. Even though the specs
clearly state that the other two bytes need to be 0x01 (and they always did,
even back to the very first ATA/ATAPI specs), I have one device here that
doesn't set the sector count register to 1. Since those two bytes are the unique
ones of the signatures anyway, it shouldn't harm to just ignore the others.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30311 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 8c5cccce46dcef2f3505205372d8121ac6aba17c 20-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Explicitly check device selection success. If device selection failed, assume
there is no device. Should fix long reset timeouts when only device 1 is
present and therefore device 0 can't be selected.
* In case a device reset error is reported, don't try to identify/use the device.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30286 a95241bf-73f2-0310-859d-f6bbb57e9c96


# ca68245eb72cd2490a1e35ab97d0bf4837051d89 19-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Wrote a new infoblock header according to ATA/ATAPI-6 that is cleaner and more
verbose than the old one. Removed the latter.
* Put some of the hardcoded values into defines for more clearity.
* Report more detailed device type for ATAPI devices and report removable
media based on the bit in the infoblock as well.
* Rename the channel ID attributes back to ide to let the hack in scsi_periph
work that then publishes the devices under the disk/ata[pi] tree.
* Also disable command queueing for ATAPI devices.
* Remove remnants of CHS support.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30270 a95241bf-73f2-0310-859d-f6bbb57e9c96


# b6b82488dfda5ae59f0a48b5371c8a24fb4a24aa 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Apply block count maximum according to device capability. If the device supports
LBA48 we can allow a maximum block count of 65535 as we have a 16bit sector
count field available.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30254 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6a2bc1027bc2e679655e319f5eb5d45702efee58 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

For packet devices we want to actually return a check condition when the device
indicates an error. Also we then need to pass through the request sense command
to the device. This should fix media status reporting for ATAPI.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30253 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 827f849a3434806b7ab0bcea89bc8791e4aa77ce 18-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Reworked device detection, we'll see how well this works...
* Reworked some of the transfer handling after reading the specs.
* Ensure that the device selection bit is set correctly for all commands.
* Generally disable interrupts and enable them only when expecting a DMA one.
* Renamed disk failure to device fault according to specs.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30248 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 33d80ba202e1cda4c2b97b9888b1cee94bcb74e1 10-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Rework ATAPI handling, removing all PIO interrupts. As Marcus pointed out the
complication is not really worth it and it would in any case be unreliable
in the shared interrupt case (even though you could always check the poll
condition in the interrupt handler).
* Probably broke ATAPI with those changes though.
* Change blocksLeft to bytesLeft to allow using it for arbitrary ATAPI requests.
* Check some more error conditions and actually let those states get through
to the SCSI layer.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30109 a95241bf-73f2-0310-859d-f6bbb57e9c96


# da4c99002d66f9936d8b815ea4824b9f5559cce2 10-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Move the lock into the request.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30100 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 118bb4e7505b6ca54926b39ab24d100efbdff121 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Fix race condition between finishing a request and returning a busy status
when the channel is in use, which would cause the SCSI scheduler to stop
sending requests.
* Indeed we need to return a status from the interrupt handler, as for PIO
transfers there is no way of knowning whether or not the interrupt at hand
was ours.
* Add some debug output.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30091 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 22805aae7f88e4a16627e5a8f97edf7501f44b64 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Adding ATAPI support to the new ATA bus_manager. Only tested in QEMU.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30080 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7997389772efc7249ab5ae3d010514301652cdb8 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Implement DMA transfers in the new ATA bus_manager.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30069 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9611bddd7abfd4579e8cedcade99164d06401a38 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Adding DMA detection and generally allow DMA. Not used yet though.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30054 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 6bb01f71bc05b8280fa28bf0bc3d367a11bd57b0 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Adding/updating license headers.
* Add the standalone ata module to the Jamfile.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30053 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 44039cc60555062526278bb7c4fbaea70ec1a71a 09-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

Additional to the normal detection of device presence, use the trick previously
present in the IDE bus_manager when detecting devices to avoid long timeouts
when waiting for possible ATAPI devices.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30052 a95241bf-73f2-0310-859d-f6bbb57e9c96


# bf9a38352439cea6594757b3c0c47e5151548d0d 08-Apr-2009 Michael Lotz <mmlr@mlotz.ch>

* Work in progress commit of a reworked ATA bus_manager. It's now object based,
but doesn't really do anything more than before.
* It also replaces everything IDE with ATA counterparts and cleans up a lot
of the definitions.
* Cleaning up the old ATA bus_manager as well as some license headers missing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@30049 a95241bf-73f2-0310-859d-f6bbb57e9c96