summaryrefslogtreecommitdiffstats
path: root/utils/nwztools/scsitools
diff options
context:
space:
mode:
authorAmaury Pouly <amaury.pouly@gmail.com>2020-05-17 20:17:14 +0200
committerAmaury Pouly <amaury.pouly@gmail.com>2020-05-17 20:21:12 +0200
commitf86723716c18608c344e24bf740980ed76a00637 (patch)
treee89391e46e6f6715de473a06cfdc870a288dd5d9 /utils/nwztools/scsitools
parent1686093e7897d902405bb818eadcf6d52e00e0d0 (diff)
downloadrockbox-f86723716c18608c344e24bf740980ed76a00637.tar.gz
rockbox-f86723716c18608c344e24bf740980ed76a00637.tar.bz2
rockbox-f86723716c18608c344e24bf740980ed76a00637.zip
nwztools/scsitool: add alternative firmware upgrade command
Newer devices seem to require flags 0x00 where older devices wanted 0x80, now try both variants Change-Id: Ifeee641052857c66c1b64860d7309a235021a168
Diffstat (limited to 'utils/nwztools/scsitools')
-rw-r--r--utils/nwztools/scsitools/scsitool.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/utils/nwztools/scsitools/scsitool.c b/utils/nwztools/scsitools/scsitool.c
index 024a845596..3d4b0c0a13 100644
--- a/utils/nwztools/scsitools/scsitool.c
+++ b/utils/nwztools/scsitools/scsitool.c
@@ -757,13 +757,13 @@ int get_dhp(int argc, char **argv)
return 0;
}
-int do_fw_upgrade(int argc, char **argv)
+int try_fw_upgrade(unsigned flags, int argc, char **argv)
{
(void) argc;
- (void )argv;
+ (void) argv;
/* older devices may have used subcommand 3 instead of 4, but this is not
* supported by any device I have seen */
- uint8_t cdb[12] = {0xfc, 0, 0x04, 'd', 'b', 'm', 'n', 0, 0x80, 0, 0, 0};
+ uint8_t cdb[12] = {0xfc, 0, 0x04, 'd', 'b', 'm', 'n', 0, flags, 0, 0, 0};
char *buffer = malloc(0x81);
int buffer_size = 0x80;
@@ -789,6 +789,14 @@ int do_fw_upgrade(int argc, char **argv)
return 0;
}
+int do_fw_upgrade(int argc, char **argv)
+{
+ if(!try_fw_upgrade(0x80, argc, argv))
+ return 0;
+ cprintf(GREY, "Trying alternative firmware upgrade command...\n");
+ return try_fw_upgrade(0, argc, argv);
+}
+
static struct
{
unsigned long dest;