From efc757f9c921cb5656692e41a55a1ff194b70d0e Mon Sep 17 00:00:00 2001 From: Adrien Destugues - PulkoMandy Date: Sun, 11 Mar 2012 12:08:26 +0100 Subject: [PATCH] Some ground work for TRIM command support for SSDs. However, this was enough to show that mine doesn't support it, so I'm not investigating further. --- src/add-ons/kernel/bus_managers/ata/ATACommands.h | 3 +++ src/add-ons/kernel/bus_managers/ata/ATAInfoBlock.h | 12 +++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/add-ons/kernel/bus_managers/ata/ATACommands.h b/src/add-ons/kernel/bus_managers/ata/ATACommands.h index 0cfe44a435..78079e0264 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATACommands.h +++ b/src/add-ons/kernel/bus_managers/ata/ATACommands.h @@ -1,4 +1,5 @@ /* + * Copyright 2012, Adrien Destugues, pulkomandy@pulkomandy.tk. * Copyright 2009, Michael Lotz, mmlr@mlotz.ch. * Copyright 2002-2003, Thomas Kurschel. * @@ -42,6 +43,8 @@ #define ATA_COMMAND_FLUSH_CACHE 0xe7 #define ATA_COMMAND_FLUSH_CACHE_EXT 0xea +#define ATA_COMMAND_DATA_SET_MANAGEMENT 0x06 + #define ATA_COMMAND_MEDIA_EJECT 0xed #define ATA_COMMAND_IDENTIFY_PACKET_DEVICE 0xa1 diff --git a/src/add-ons/kernel/bus_managers/ata/ATAInfoBlock.h b/src/add-ons/kernel/bus_managers/ata/ATAInfoBlock.h index 619599c2e4..197696f913 100644 --- a/src/add-ons/kernel/bus_managers/ata/ATAInfoBlock.h +++ b/src/add-ons/kernel/bus_managers/ata/ATAInfoBlock.h @@ -338,7 +338,17 @@ typedef struct ata_device_infoblock { word_160_supported : 1 ); - uint16 word_161_175_reserved_compact_flash_assoc[15]; + uint16 word_161_167_reserved_compact_flash_assoc[7]; + LBITFIELD2( + device_nominal_form_factor : 4, + word_168_bits_4_15_reserved : 12 + ); + LBITFIELD2( + data_set_management_support : 1, + word_169_bits_1_15_reserved : 15 + ); + uint16 additional_product_identifier[4]; + uint16 word_174_175_reserved[2]; uint16 current_media_serial_number[30]; uint16 word_206_208_reserved[3];