Am 29.07.2011 21:56 schrieb Uwe Hermann:
On Sun, Nov 14, 2010 at 12:39:17AM +0100, Carl-Daniel Hailfinger wrote:
Secret knowledge is cool, but public knowledge is better. Implement all Dediprog commands found in USB traces, even if their purpose is not yet known. Annotate unknown commands with info about the call sequence they are embedded in and the firmware version of the log.
Add a new shutdown command for firmware 5.x.
Signed-off-by: Carl-Daniel Hailfinger c-d.hailfinger.devel.2006@gmx.net
Acked-by: Uwe Hermann uwe@hermann-uwe.de
Thanks, committed in r1477 with some changes (bulk write added). My apologies for forgetting to paste your Ack into the changelog, I had overlooked your mail completely.
+#if 0 +/* Something.
- Present in eng_detect_blink.log with firmware 3.1.8
- Always preceded by Command Receive Device String
- */
+static int dediprog_command_b(void) +{
- int ret;
- char buf[0x3];
Minor nitpick: I like 0x3 -> 3 better here. Feel free to ignore, though.
- memset(buf, 0, sizeof(buf));
- ret = usb_control_msg(dediprog_handle, 0xc3, 0x7, 0x0, 0xef00, buf, 0x3, DEFAULT_TIMEOUT);
Please wrap, longer than 80 chars/line. Same goes for a few other usb_control_msg() lines.
- if ((ret != 0x3) || (buf[0] != 0xff) || (buf[1] != 0xff) ||
^^^
And here I like 0x03 better for consistency with the rest of the line :)
- /* Shutdown on firmware 5.x */
- if (dediprog_firmwareversion == 5)
if (dediprog_command_i())
return 1;
Maybe add a msg_* here to notify the user.
Yes, dediprog.c definitely needs some housekeeping.
Regards, Carl-Daniel