fet_proto: capture FET error code.

This commit is contained in:
Daniel Beer 2012-10-03 13:36:09 +13:00
parent 1de9e43187
commit c5e93345a0
2 changed files with 4 additions and 4 deletions

View File

@ -128,7 +128,6 @@ static int parse_packet(struct fet_proto *dev, int plen)
uint16_t r = LE_WORD(dev->fet_buf, plen);
int i = 2;
int type;
int error;
if (c != r) {
printc_err("fet: checksum error (calc %04x,"
@ -142,11 +141,11 @@ static int parse_packet(struct fet_proto *dev, int plen)
dev->command_code = dev->fet_buf[i++];
type = dev->fet_buf[i++];
dev->state = dev->fet_buf[i++];
error = dev->fet_buf[i++];
dev->error = dev->fet_buf[i++];
if (error) {
if (dev->error) {
printc_err("fet: FET returned error code %d (%s)\n",
error, fet_error(error));
dev->error, fet_error(dev->error));
return -1;
}

View File

@ -48,6 +48,7 @@ struct fet_proto {
/* Received packet is parsed into these fields */
int command_code;
int state;
int error;
int argc;
uint32_t argv[FET_PROTO_MAX_PARAMS];