[flashrom] [PATCH] Implement unknown Dediprog commands

Uwe Hermann uwe at hermann-uwe.de
Fri Jul 29 21:56:41 CEST 2011


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 at gmx.net>

Acked-by: Uwe Hermann <uwe at hermann-uwe.de>

Probably needs to be updated as the patch is pretty old by now.

 
> +#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.


Uwe.
-- 
http://hermann-uwe.de     | http://sigrok.org
http://randomprojects.org | http://unmaintained-free-software.org




More information about the flashrom mailing list