annotate rvinterf/lowlevel/rviftmode.c @ 954:21604c3413c1

rvinterf: disallow -Petmoff mode
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 07 Jun 2023 20:15:43 +0000
parents ec5f51d33fdc
children
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"
937
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
14 #include "../include/tmffs2.h"
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16 extern u_char rxpkt[];
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 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
18
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 extern int verbose;
940
ec5f51d33fdc rvinterf code structure: factor out output_cont_logpref()
Mychaela Falconia <falcon@freecalypso.org>
parents: 938
diff changeset
20
ec5f51d33fdc rvinterf code structure: factor out output_cont_logpref()
Mychaela Falconia <falcon@freecalypso.org>
parents: 938
diff changeset
21 extern void output_cont_logpref();
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
23 static int
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
24 verify_cksum(pkt, pktlen)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
25 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
26 unsigned pktlen;
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 int i, c;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
29
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
30 c = 0;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
31 for (i = 1; i < pktlen; i++)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
32 c ^= pkt[i];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
33 if (c == 0)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
34 return(0);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
35 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
36 return(-1);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
37 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
38
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
39 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
40 etm_core_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
41 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
42 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
43 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
44 {
936
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
45 if (pktlen < 4) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
46 runt: strcpy(outbuf, "ETM_CORE runt");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
47 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
48 }
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
49 switch (pkt[2]) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
50 case TMCORE_OPC_MEM:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
51 if (pktlen < 5)
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
52 goto runt;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
53 switch (pkt[3]) {
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
54 case 0x01:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
55 strcpy(outbuf, "r8");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
56 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
57 case 0x02:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
58 strcpy(outbuf, "r16");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
59 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
60 case 0x04:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
61 strcpy(outbuf, "r32");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
62 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
63 case 0x11:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
64 strcpy(outbuf, "w8");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
65 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
66 case 0x12:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
67 strcpy(outbuf, "w16");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
68 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
69 case 0x14:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
70 strcpy(outbuf, "w32");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
71 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
72 default:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
73 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
74 }
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
75 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
76 case TMCORE_OPC_ECHO:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
77 strcpy(outbuf, "ping");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
78 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
79 case TMCORE_OPC_RESET:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
80 strcpy(outbuf, "tgtreset");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
81 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
82 case TMCORE_OPC_DEBUG:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
83 strcpy(outbuf, "ETM_CORE debug opc");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
84 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
85 case TMCORE_OPC_VERSION:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
86 strcpy(outbuf, "version");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
87 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
88 case TMCORE_OPC_CODEC_RD:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
89 strcpy(outbuf, "abbr");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
90 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
91 case TMCORE_OPC_CODEC_WR:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
92 strcpy(outbuf, "abbw");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
93 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
94 case TMCORE_OPC_DIEID:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
95 strcpy(outbuf, "dieid");
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
96 return;
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
97 default:
f4e6f6b6548e rvinterf TM log: decode ETM_CORE commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 935
diff changeset
98 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
99 }
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
100 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
101
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
102 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
103 tmffs2_cmd_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
104 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
105 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
106 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
107 {
937
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
108 if (pktlen < 4) {
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
109 strcpy(outbuf, "ETM_FFS2 runt");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
110 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
111 }
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
112 switch (pkt[2]) {
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
113 case TMFFS_FORMAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
114 strcpy(outbuf, "FFS2 format");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
115 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
116 case TMFFS_PREFORMAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
117 strcpy(outbuf, "FFS2 preformat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
118 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
119 case TMFFS_MKDIR:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
120 strcpy(outbuf, "FFS2 mkdir");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
121 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
122 case TMFFS_OPENDIR:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
123 strcpy(outbuf, "FFS2 opendir");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
124 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
125 case TMFFS_READDIR:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
126 strcpy(outbuf, "FFS2 readdir");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
127 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
128 case TMFFS_REMOVE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
129 strcpy(outbuf, "FFS2 remove");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
130 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
131 case TMFFS_RENAME:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
132 strcpy(outbuf, "FFS2 rename");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
133 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
134 case TMFFS_XLSTAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
135 strcpy(outbuf, "FFS2 xlstat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
136 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
137 case TMFFS_SYMLINK:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
138 strcpy(outbuf, "FFS2 symlink");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
139 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
140 case TMFFS_READLINK:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
141 strcpy(outbuf, "FFS2 readlink");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
142 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
143 case TMFFS_OPEN:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
144 strcpy(outbuf, "FFS2 open");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
145 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
146 case TMFFS_CLOSE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
147 strcpy(outbuf, "FFS2 close");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
148 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
149 case TMFFS_READ:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
150 strcpy(outbuf, "FFS2 read");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
151 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
152 case TMFFS_WRITE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
153 strcpy(outbuf, "FFS2 write");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
154 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
155 case TMFFS_SEEK:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
156 strcpy(outbuf, "FFS2 seek");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
157 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
158 case TMFFS_FTRUNCATE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
159 strcpy(outbuf, "FFS2 ftruncate");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
160 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
161 case TMFFS_TRUNCATE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
162 strcpy(outbuf, "FFS2 truncate");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
163 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
164 case TMFFS_FILE_READ:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
165 strcpy(outbuf, "FFS2 fread");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
166 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
167 case TMFFS_FILE_WRITE:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
168 strcpy(outbuf, "FFS2 fwrite");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
169 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
170 case TMFFS_FSTAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
171 strcpy(outbuf, "FFS2 fstat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
172 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
173 case TMFFS_LSTAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
174 strcpy(outbuf, "FFS2 lstat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
175 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
176 case TMFFS_STAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
177 strcpy(outbuf, "FFS2 stat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
178 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
179 case TMFFS_FCONTROL:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
180 strcpy(outbuf, "FFS2 fcontrol");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
181 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
182 case TMFFS_QUERY:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
183 strcpy(outbuf, "FFS2 query");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
184 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
185 case TMFFS_INIT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
186 strcpy(outbuf, "FFS2 init");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
187 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
188 case TMFFS_EXIT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
189 strcpy(outbuf, "FFS2 exit");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
190 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
191 case TMFFS_DIRXLSTAT:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
192 strcpy(outbuf, "FFS2 dirxlstat");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
193 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
194 case TMFFS_VERSION:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
195 strcpy(outbuf, "FFS2 version");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
196 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
197 case TMFFS_TFFS:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
198 strcpy(outbuf, "FFS2 tffs");
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
199 return;
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
200 default:
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
201 sprintf(outbuf, "ETM_FFS2 opcode 0x%02X", pkt[2]);
06f96627ac9a rvinterf TM log: decode TMFFS2 commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 936
diff changeset
202 }
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
203 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
204
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
205 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
206 audio_cmd_classify(pkt, pktlen, outbuf)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
207 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
208 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
209 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
210 {
938
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
211 if (pktlen < 4) {
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
212 strcpy(outbuf, "ETM_AUDIO runt");
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
213 return;
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
214 }
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
215 switch (pkt[2]) {
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
216 case 'L':
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
217 strcpy(outbuf, "aul");
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
218 return;
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
219 case 'S':
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
220 strcpy(outbuf, "aus");
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
221 return;
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
222 case 'R':
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
223 strcpy(outbuf, "aur");
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
224 return;
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
225 case 'W':
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
226 strcpy(outbuf, "auw");
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
227 return;
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
228 default:
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
229 sprintf(outbuf, "ETM_AUDIO opcode 0x%02X", pkt[2]);
74930218c270 rvinterf TM log: decode ETM_AUDIO commands
Mychaela Falconia <falcon@freecalypso.org>
parents: 937
diff changeset
230 }
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
231 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
232
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
233 static void
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
234 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
235 u_char *pkt;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
236 unsigned pktlen;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
237 char *outbuf;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
238 {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
239 if (pktlen < 3) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
240 strcpy(outbuf, "RUNT");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
241 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
242 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
243 if (verify_cksum(pkt, pktlen) < 0) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
244 strcpy(outbuf, "BAD CKSUM");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
245 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
246 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
247 switch (pkt[1]) {
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
248 case ETM_CORE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
249 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
250 etm_core_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
251 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
252 strcpy(outbuf, "ETM_CORE");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
253 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
254 case ETM_FFS1:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
255 strcpy(outbuf, "FFS1");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
256 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
257 case ETM_FFS2:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
258 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
259 tmffs2_cmd_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
260 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
261 strcpy(outbuf, "FFS2");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
262 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
263 case ETM_AUDIO:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
264 if (is_cmd)
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
265 audio_cmd_classify(pkt, pktlen, outbuf);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
266 else
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
267 strcpy(outbuf, "ETM_AUDIO");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
268 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
269 case ETM_BSIM:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
270 strcpy(outbuf, "BSIM");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
271 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
272 /* TM3 */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
273 case MEM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
274 strcpy(outbuf, "omr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
275 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
276 case MEM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
277 strcpy(outbuf, "omw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
278 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
279 case CODEC_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
280 strcpy(outbuf, "oabbr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
281 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
282 case CODEC_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
283 strcpy(outbuf, "oabbw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
284 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
285 /* L1TM */
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
286 case TM_INIT:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
287 strcpy(outbuf, "tminit");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
288 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
289 case TM_MODE_SET:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
290 strcpy(outbuf, "tms");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
291 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
292 case VERSION_GET:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
293 strcpy(outbuf, "tm3ver");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
294 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
295 case RF_ENABLE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
296 strcpy(outbuf, "rfe");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
297 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
298 case STATS_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
299 strcpy(outbuf, "sr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
300 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
301 case STATS_CONFIG_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
302 strcpy(outbuf, "scw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
303 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
304 case STATS_CONFIG_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
305 strcpy(outbuf, "scr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
306 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
307 case RF_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
308 strcpy(outbuf, "rfpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
309 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
310 case RF_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
311 strcpy(outbuf, "rfpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
312 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
313 case RF_TABLE_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
314 strcpy(outbuf, "rftw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
315 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
316 case RF_TABLE_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
317 strcpy(outbuf, "rftr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
318 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
319 case RX_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
320 strcpy(outbuf, "rxpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
321 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
322 case RX_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
323 strcpy(outbuf, "rxpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
324 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
325 case TX_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
326 strcpy(outbuf, "txpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
327 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
328 case TX_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
329 strcpy(outbuf, "txpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
330 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
331 case TX_TEMPLATE_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
332 strcpy(outbuf, "ttw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
333 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
334 case TX_TEMPLATE_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
335 strcpy(outbuf, "ttr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
336 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
337 case MISC_PARAM_WRITE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
338 strcpy(outbuf, "mpw");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
339 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
340 case MISC_PARAM_READ:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
341 strcpy(outbuf, "mpr");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
342 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
343 case MISC_ENABLE:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
344 strcpy(outbuf, "me");
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
345 return;
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
346 default:
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
347 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
348 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
349 }
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
350
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
351 void
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
352 log_sent_tm(pkt, pktlen)
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
353 u_char *pkt;
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
354 {
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
355 char summary[32], headline[80];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
356
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
357 tm_classify(pkt, pktlen, 1, summary);
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
358 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
359 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
360 if (verbose >= 1)
940
ec5f51d33fdc rvinterf code structure: factor out output_cont_logpref()
Mychaela Falconia <falcon@freecalypso.org>
parents: 938
diff changeset
361 packet_hex_dump(pkt, pktlen, output_cont_logpref);
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
362 }
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
363
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
364 void
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
365 print_tm_output_new()
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
366 {
935
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
367 char summary[32], headline[80];
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
368
d203a9c7c4e6 rvinterf TM log: beginning of TM/ETM classification
Mychaela Falconia <falcon@freecalypso.org>
parents: 934
diff changeset
369 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
370 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
371 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
372 if (verbose >= 1)
940
ec5f51d33fdc rvinterf code structure: factor out output_cont_logpref()
Mychaela Falconia <falcon@freecalypso.org>
parents: 938
diff changeset
373 packet_hex_dump(rxpkt, (unsigned) rxpkt_len,
ec5f51d33fdc rvinterf code structure: factor out output_cont_logpref()
Mychaela Falconia <falcon@freecalypso.org>
parents: 938
diff changeset
374 output_cont_logpref);
932
3d1abb9f05ef rvinterf proper: move TM logging to new module
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
375 }