summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Paluch <peter.paluch@fri.uniza.sk>2014-01-20 12:16:44 -0800
committerDavid Zeuthen <zeuthen@gmail.com>2014-01-20 12:16:44 -0800
commit81a350fca9431048175fcf639909d988aceb2a17 (patch)
treef5fa24e4ac6d7ca20de1a5bb8df28ebd9857ba13
parentf71262abfcdf4792112e273c554ab500bb1faed9 (diff)
Use SECTOR_COUNT=1 when issuing ATA IDENTIFY COMMAND
... otherwise this fails with some devices / translqation layers. For more information see https://bugs.freedesktop.org/show_bug.cgi?id=73780 Signed-off-by: David Zeuthen <zeuthen@gmail.com>
-rw-r--r--src/udiskslinuxdevice.c2
-rw-r--r--src/udiskslinuxdriveata.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/udiskslinuxdevice.c b/src/udiskslinuxdevice.c
index 0b65a69..8c4a3ed 100644
--- a/src/udiskslinuxdevice.c
+++ b/src/udiskslinuxdevice.c
@@ -199,6 +199,7 @@ probe_ata (UDisksLinuxDevice *device,
{
/* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
input.command = 0xec;
+ input.count = 1;
output.buffer = g_new0 (guchar, 512);
output.buffer_size = 512;
if (!udisks_ata_send_command_sync (fd,
@@ -221,6 +222,7 @@ probe_ata (UDisksLinuxDevice *device,
{
/* ATA8: 7.17 IDENTIFY PACKET DEVICE - A1h, PIO Data-In */
input.command = 0xa1;
+ input.count = 1;
output.buffer = g_new0 (guchar, 512);
output.buffer_size = 512;
if (!udisks_ata_send_command_sync (fd,
diff --git a/src/udiskslinuxdriveata.c b/src/udiskslinuxdriveata.c
index 48cc6e6..534ef4d 100644
--- a/src/udiskslinuxdriveata.c
+++ b/src/udiskslinuxdriveata.c
@@ -1943,7 +1943,7 @@ udisks_linux_drive_ata_secure_erase_sync (UDisksLinuxDriveAta *drive,
/* First get the IDENTIFY data directly from the drive, for sanity checks */
{
/* ATA8: 7.16 IDENTIFY DEVICE - ECh, PIO Data-In */
- UDisksAtaCommandInput input = {.command = 0xec};
+ UDisksAtaCommandInput input = {.command = 0xec, .count = 1};
UDisksAtaCommandOutput output = {.buffer = identify.buf, .buffer_size = sizeof (identify.buf)};
if (!udisks_ata_send_command_sync (fd,
-1,