annotate rvinterf/lowlevel/rviftmode.c @ 936:f4e6f6b6548e

rvinterf TM log: decode ETM_CORE commands
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 24 May 2023 04:00:18 +0000
parents d203a9c7c4e6
children 06f96627ac9a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * This module is for rvinterf only. Whenever we send or receive Test Mode
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * packets, we should be a little more intelligent about how we display and
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 * log them. By default we only print a one-line summary, and in verbose mode
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 * we also emit a full hex dump.
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 */
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 #include <sys/types.h>
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 #include <stdio.h>
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 #include <string.h>
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 #include <strings.h>
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
12 #include "../include/etm.h"
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
13 #include "../include/tm3.h"
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 extern u_char rxpkt[];
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 extern size_t rxpkt_len;
934
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
17
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 extern int verbose;
934
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
19 extern FILE *logF;
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
21 static int
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
22 verify_cksum(pkt, pktlen)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
23 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
24 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
25 {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
26 int i, c;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
27
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
28 c = 0;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
29 for (i = 1; i < pktlen; i++)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
30 c ^= pkt[i];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
31 if (c == 0)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
32 return(0);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
33 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
34 return(-1);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
35 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
36
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
37 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
38 etm_core_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
39 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
40 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
41 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
42 {
936
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
43 if (pktlen < 4) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
44 runt: strcpy(outbuf, "ETM_CORE runt");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
45 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
46 }
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
47 switch (pkt[2]) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
48 case TMCORE_OPC_MEM:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
49 if (pktlen < 5)
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
50 goto runt;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
51 switch (pkt[3]) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
52 case 0x01:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
53 strcpy(outbuf, "r8");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
54 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
55 case 0x02:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
56 strcpy(outbuf, "r16");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
57 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
58 case 0x04:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
59 strcpy(outbuf, "r32");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
60 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
61 case 0x11:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
62 strcpy(outbuf, "w8");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
63 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
64 case 0x12:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
65 strcpy(outbuf, "w16");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
66 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
67 case 0x14:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
68 strcpy(outbuf, "w32");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
69 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
70 default:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
71 sprintf(outbuf, "ETM_CORE mem opcode 0x%02X", pkt[3]);
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
72 }
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
73 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
74 case TMCORE_OPC_ECHO:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
75 strcpy(outbuf, "ping");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
76 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
77 case TMCORE_OPC_RESET:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
78 strcpy(outbuf, "tgtreset");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
79 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
80 case TMCORE_OPC_DEBUG:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
81 strcpy(outbuf, "ETM_CORE debug opc");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
82 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
83 case TMCORE_OPC_VERSION:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
84 strcpy(outbuf, "version");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
85 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
86 case TMCORE_OPC_CODEC_RD:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
87 strcpy(outbuf, "abbr");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
88 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
89 case TMCORE_OPC_CODEC_WR:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
90 strcpy(outbuf, "abbw");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
91 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
92 case TMCORE_OPC_DIEID:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
93 strcpy(outbuf, "dieid");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
94 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
95 default:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
96 sprintf(outbuf, "ETM_CORE opcode 0x%02X", pkt[2]);
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
97 }
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
98 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
99
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
100 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
101 tmffs2_cmd_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
102 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
103 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
104 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
105 {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
106 /* classification code to be filled */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
107 strcpy(outbuf, "FFS2");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
108 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
109
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
110 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
111 audio_cmd_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
112 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
113 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
114 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
115 {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
116 /* classification code to be filled */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
117 strcpy(outbuf, "ETM_AUDIO");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
118 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
119
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
120 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
121 tm_classify(pkt, pktlen, is_cmd, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
122 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
123 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
124 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
125 {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
126 if (pktlen < 3) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
127 strcpy(outbuf, "RUNT");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
128 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
129 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
130 if (verify_cksum(pkt, pktlen) < 0) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
131 strcpy(outbuf, "BAD CKSUM");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
132 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
133 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
134 switch (pkt[1]) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
135 case ETM_CORE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
136 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
137 etm_core_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
138 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
139 strcpy(outbuf, "ETM_CORE");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
140 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
141 case ETM_FFS1:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
142 strcpy(outbuf, "FFS1");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
143 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
144 case ETM_FFS2:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
145 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
146 tmffs2_cmd_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
147 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
148 strcpy(outbuf, "FFS2");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
149 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
150 case ETM_AUDIO:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
151 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
152 audio_cmd_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
153 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
154 strcpy(outbuf, "ETM_AUDIO");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
155 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
156 case ETM_BSIM:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
157 strcpy(outbuf, "BSIM");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
158 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
159 /* TM3 */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
160 case MEM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
161 strcpy(outbuf, "omr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
162 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
163 case MEM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
164 strcpy(outbuf, "omw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
165 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
166 case CODEC_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
167 strcpy(outbuf, "oabbr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
168 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
169 case CODEC_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
170 strcpy(outbuf, "oabbw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
171 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
172 /* L1TM */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
173 case TM_INIT:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
174 strcpy(outbuf, "tminit");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
175 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
176 case TM_MODE_SET:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
177 strcpy(outbuf, "tms");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
178 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
179 case VERSION_GET:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
180 strcpy(outbuf, "tm3ver");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
181 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
182 case RF_ENABLE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
183 strcpy(outbuf, "rfe");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
184 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
185 case STATS_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
186 strcpy(outbuf, "sr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
187 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
188 case STATS_CONFIG_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
189 strcpy(outbuf, "scw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
190 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
191 case STATS_CONFIG_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
192 strcpy(outbuf, "scr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
193 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
194 case RF_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
195 strcpy(outbuf, "rfpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
196 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
197 case RF_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
198 strcpy(outbuf, "rfpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
199 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
200 case RF_TABLE_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
201 strcpy(outbuf, "rftw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
202 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
203 case RF_TABLE_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
204 strcpy(outbuf, "rftr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
205 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
206 case RX_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
207 strcpy(outbuf, "rxpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
208 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
209 case RX_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
210 strcpy(outbuf, "rxpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
211 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
212 case TX_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
213 strcpy(outbuf, "txpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
214 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
215 case TX_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
216 strcpy(outbuf, "txpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
217 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
218 case TX_TEMPLATE_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
219 strcpy(outbuf, "ttw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
220 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
221 case TX_TEMPLATE_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
222 strcpy(outbuf, "ttr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
223 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
224 case MISC_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
225 strcpy(outbuf, "mpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
226 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
227 case MISC_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
228 strcpy(outbuf, "mpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
229 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
230 case MISC_ENABLE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
231 strcpy(outbuf, "me");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
232 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
233 default:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
234 sprintf(outbuf, "mid 0x%02X", pkt[1]);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
235 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
236 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
237
934
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
238 static void
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
239 hexdump_out(line)
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
240 char *line;
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
241 {
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
242 if (logF)
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
243 fprintf(logF, "%s\n", line);
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
244 else
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
245 printf("%s\n", line);
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
246 }
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
247
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
248 void
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
249 log_sent_tm(pkt, pktlen)
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
250 u_char *pkt;
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
251 {
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
252 char summary[32], headline[80];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
253
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
254 tm_classify(pkt, pktlen, 1, summary);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
255 sprintf(headline, "Sent Test Mode cmd (%s)", summary);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
256 output_line(headline);
933
bd6dd6120180 rvinterf: -v enables TM hex dump, -vv enables TCH hex dump
Mychaela Falconia <falcon@freecalypso.org>
parents: 932
diff changeset
257 if (verbose >= 1)
934
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
258 packet_hex_dump(pkt, pktlen, hexdump_out);
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
259 }
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
260
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
261 void
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
262 print_tm_output_new()
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
263 {
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
264 char summary[32], headline[80];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
265
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
266 tm_classify(rxpkt, (unsigned) rxpkt_len, 0, summary);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
267 sprintf(headline, "Rx Test Mode resp (%s)", summary);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
268 output_line(headline);
933
bd6dd6120180 rvinterf: -v enables TM hex dump, -vv enables TCH hex dump
Mychaela Falconia <falcon@freecalypso.org>
parents: 932
diff changeset
269 if (verbose >= 1)
934
0d6be90ae74f rvinterf -v TM: send hex dump only to log file if we have one
Mychaela Falconia <falcon@freecalypso.org>
parents: 933
diff changeset
270 packet_hex_dump(rxpkt, (unsigned) rxpkt_len, hexdump_out);
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
271 }