# HG changeset patch # User Michael Spacefalcon # Date 1391649013 0 # Node ID cb833ff54d8885912e6bbf26b4b7f09e384e4594 # Parent 4c416868524a6b272ce0ad430fff8d72e28e9b33 rvinterf: CLI2RVI_RESET_PACKET_RX command implemented diff -r 4c416868524a -r cb833ff54d88 rvinterf/include/localsock.h --- a/rvinterf/include/localsock.h Thu Feb 06 00:34:45 2014 +0000 +++ b/rvinterf/include/localsock.h Thu Feb 06 01:10:13 2014 +0000 @@ -21,6 +21,7 @@ #define CLI2RVI_WANT_MUXPROTO 0x01 #define CLI2RVI_PKT_TO_TARGET 0x02 #define CLI2RVI_RAWBYTES_TO_TARGET 0x03 +#define CLI2RVI_RESET_PACKET_RX 0x04 /* * The first two commands (CLI2RVI_WANT_RVTRACE and CLI2RVI_WANT_MUXPROTO) @@ -39,6 +40,10 @@ * packets exchanged between the host and the target, e.g., 0x12 for L1 traces * as defined in pktmux.h, for a total message length of 2 bytes. * + * The CLI2RVI_RESET_PACKET_RX opcode resets the "interests" previously set + * with CLI2RVI_WANT_RVTRACE and/or CLI2RVI_WANT_MUXPROTO. It is a "blanket" + * reset; the command message consists of just the opcode. + * * The last two commands (CLI2RVI_PKT_TO_TARGET and CLI2RVI_RAWBYTES_TO_TARGET) * cause data payload to be sent to the target serial port. Payload following * CLI2RVI_PKT_TO_TARGET (must not exceed MAX_PKT_TO_TARGET) is sent with the diff -r 4c416868524a -r cb833ff54d88 rvinterf/lowlevel/clientcmd.c --- a/rvinterf/lowlevel/clientcmd.c Thu Feb 06 00:34:45 2014 +0000 +++ b/rvinterf/lowlevel/clientcmd.c Thu Feb 06 01:10:13 2014 +0000 @@ -38,10 +38,12 @@ cli->int_rvt_match[c] = cli->rx_buf[5] << 24 | cli->rx_buf[6] << 16 | cli->rx_buf[7] << 8 | cli->rx_buf[8]; +#if 0 sprintf(logmsg, "*** Client program interested in RVT mask %08X match %08X", cli->int_rvt_mask[c], cli->int_rvt_match[c]); output_line(logmsg); +#endif cli->int_rvt_count++; send_local_msg_to_client(cli, "+OK"); return; @@ -55,13 +57,20 @@ "-Unsupported protocol MUX value"); return; } +#if 0 sprintf(logmsg, "*** Client program interested in MUX proto %02X", cli->rx_buf[1]); output_line(logmsg); +#endif cli->int_proto[cli->rx_buf[1] - 0x12] = 1; send_local_msg_to_client(cli, "+OK"); return; + case CLI2RVI_RESET_PACKET_RX: + cli->int_rvt_count = 0; + bzero(cli->int_proto, sizeof(cli->int_proto)); + send_local_msg_to_client(cli, "+OK"); + return; case CLI2RVI_PKT_TO_TARGET: c = cli->rx_msglen - 1; if (c < 1 || c > MAX_PKT_TO_TARGET) {