add "support" for enable/disable reverting to power-on defaults
PATCH 1/1 add "support" for enable/disable reverting to power-on defaults
Greetings,
the following patch adds subcommands 0xCC and 0x66 for enabling/disabling reverting to power-on defaults after a soft reset as invoked by the following command (running under Linux) :
# hdparm -K1 /dev/hda
/dev/hda:
setting drive keep features to 1 (on)
this is specially visible in OpenSolaris that locks the drive configuration at boot as shown by (line 1366):
and therefore will complain with the following error when booted in qemu :
ata_set_feature: (0x66,0x0) failed
the proposed implementation just ignores the flag but is consistent with the current behavior for the other IDE feature flags (read look-ahead and write cache) a complete implementation for all SET_FEATURES subcommands as spelled in section 8.37 of the ATA/ATAPI 5 (T13/1321D revision 3) standard will be provided later if the increase in complexity size is worth the added functionality (to be debated)
Carlo
Index: hw/ide.c
===================================================================
RCS file: /sources/qemu/qemu/hw/ide.c,v
retrieving revision 1.53
ide.c +2 -0
@@ -1729,6 +1728,8 @@ goto abort_cmd;/* XXX: valid for CDROM ? */ switch (s->feature) { +case 0xcc :/* reverting to power-on defaults enable */ +case 0x66 :/* reverting to power-on defaults disable*/ case 0x02 :/* write cache enable */ case 0x82 :/* write cache disable */ case 0xaa :/* read look-ahead enable */