fet_proto: capture FET error code.
This commit is contained in:
parent
1de9e43187
commit
c5e93345a0
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
Loading…
Reference in New Issue