changeset 266:cb833ff54d88

rvinterf: CLI2RVI_RESET_PACKET_RX command implemented
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 06 Feb 2014 01:10:13 +0000
parents 4c416868524a
children 4c6bee98e002
files rvinterf/include/localsock.h rvinterf/lowlevel/clientcmd.c
diffstat 2 files changed, 14 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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) {