mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-11-09 13:12:37 -05:00
ata: SSDs: Only check for _legal_ "rotational rate" values
I'm 98% sure that the "byteswapped" value I saw was due to another bug (bad PIO timings on ipods leading to data corruption) and none of the growing pile of identify device data files that I have include the backwards one. Change-Id: Iea47b7419b120a3c8a282b2e3a8f65b8965356ce
This commit is contained in:
parent
1ece63d054
commit
8daf1f1bfe
1 changed files with 6 additions and 8 deletions
|
|
@ -176,7 +176,6 @@ static inline int ata_disk_isssd(void)
|
|||
0x0401 -> 0xffe == RPM
|
||||
All others reserved
|
||||
|
||||
Some CF cards return 0x0100 (ie byteswapped 0x0001) so accept either.
|
||||
However, this is a relatively recent change, and we can't rely on it,
|
||||
especially for the FC1307A CF->SD adapters!
|
||||
|
||||
|
|
@ -199,14 +198,13 @@ static inline int ata_disk_isssd(void)
|
|||
then device is standard flash CF. However this is not foolproof
|
||||
as newer CF cards (and those CF->SD adapters) may report this.
|
||||
|
||||
|
||||
*/
|
||||
return ( (identify_info[217] == 0x0001 || identify_info[217] == 0x0100) /* "Solid state" rotational rate */
|
||||
|| ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */
|
||||
|| (identify_info[169] & (1<<0)) /* TRIM supported */
|
||||
|| (identify_info[163] > 0) /* CF Advanced timing modes */
|
||||
|| ((identify_info[83] & (1<<2)) && /* CFA compliant */
|
||||
((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */
|
||||
return ( (identify_info[217] == 0x0001) /* "Solid state" rotational rate */
|
||||
|| ((identify_info[168] & 0x0f) >= 0x06) /* Explicit SSD form factors */
|
||||
|| (identify_info[169] & (1<<0)) /* TRIM supported */
|
||||
|| (identify_info[163] > 0) /* CF Advanced timing modes */
|
||||
|| ((identify_info[83] & (1<<2)) && /* CFA compliant */
|
||||
((identify_info[160] & (1<<15)) == 0)) /* CF power level 0 */
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue