From 112d2c8a79f4e523b160e683f7b020d9712a3572 Mon Sep 17 00:00:00 2001 From: graf_chokolo Date: Tue, 5 Apr 2011 08:16:38 +0000 Subject: [PATCH] ps3encdec_ioctl: new command kgenflash --- ps3encdec_ioctl.c | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/ps3encdec_ioctl.c b/ps3encdec_ioctl.c index 312566c..d972dd8 100644 --- a/ps3encdec_ioctl.c +++ b/ps3encdec_ioctl.c @@ -48,11 +48,12 @@ static void usage(void) { "Usage: ps3encdec_ioctl [OPTIONS] DEVICE [ARGS]\n" "\n" "Options:\n" - " -h, --help Show this message and exit\n" - " -v, --verbose Increase verbosity\n" - " -V, --version Show version information and exit\n" + " -h, --help Show this message and exit\n" + " -v, --verbose Increase verbosity\n" + " -V, --version Show version information and exit\n" "Commands:\n" - " kgen1 ARG1 EdecKgen1\n" + " kgen1 ARG1 EdecKgen1\n" + " kgenflash EdecKgenFlash\n" "\n\n" "Simple example: EdecKgen1:\n" " ps3encdec_ioctl /dev/ps3encdec kgen1 0x00 0x01 0x00 0x30 0x72 0xA7 0x88 0xEC \\\n" @@ -176,6 +177,22 @@ static int cmd_kgen1(int fd, struct opts *opts, int argc, char **argv) return error; } + +/* + * cmd_kgenflash + */ +static int cmd_kgenflash(int fd, struct opts *opts, int argc, char **argv) +{ + int error; + + error = ps3encdec_dev_do_request(fd, 0x84, NULL, 0, NULL, 0); + + if (error) + fprintf(stderr, "%s: %s\n", opts->device_name, strerror(errno)); + + return error; +} + /* * main */ @@ -209,6 +226,8 @@ int main(int argc, char **argv) if (!strcmp(opts.cmd, "kgen1")) { error = cmd_kgen1(fd, &opts, argc, argv); + } else if (!strcmp(opts.cmd, "kgenflash")) { + error = cmd_kgenflash(fd, &opts, argc, argv); } else { usage(); error = 1; -- 2.11.4.GIT