annotate rvinterf/tmsh/l1resp.c @ 191:80bd2c652c46

doc/RF-cal/Architecture document written
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 23 Apr 2017 18:01:17 +0000
parents f5a797c291be
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * Handling of TM3 responses from L1TM
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 */
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5 #include <sys/types.h>
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 #include <stdio.h>
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
7 #include <string.h>
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
8 #include <strings.h>
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
9 #include "l1tm.h"
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11 extern u_char rvi_msg[];
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 extern int rvi_msg_len;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
14 unsigned rftr_table_index, rftr_table_size;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
15 u_char rftr_table_data[MAX_RF_TABLE_SIZE];
137
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
16 u_char ttr_ramp_data[32];
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
17
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18 void
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 l1tm_response_nodata(op)
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
20 char *op;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
21 {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
22 char buf[80];
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
23
133
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
24 if (rvi_msg_len != 5) {
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
25 sprintf(buf, "%s response wrong length", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
26 print_etm_pkt_raw(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
27 return;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
28 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
29 if (rvi_msg[3])
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
30 sprintf(buf, "%s error %u (0x%02X)", op,
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
31 rvi_msg[3], rvi_msg[3]);
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
32 else
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
33 sprintf(buf, "%s OK", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
34 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
35 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
36
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
37 void
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
38 l1tm_response_index(op)
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
39 char *op;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
40 {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
41 char buf[80];
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
42
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
43 if (rvi_msg[3]) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
44 if (rvi_msg_len == 5) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
45 sprintf(buf, "%s error %u (0x%02X)", op,
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
46 rvi_msg[3], rvi_msg[3]);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
47 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
48 } else {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
49 sprintf(buf, "%s long error response", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
50 print_etm_pkt_raw(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
51 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
52 return;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
53 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
54 if (rvi_msg_len != 6) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
55 sprintf(buf, "%s response wrong length", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
56 print_etm_pkt_raw(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
57 return;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
58 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
59 sprintf(buf, "%s index %u (0x%02X) OK", op, rvi_msg[4], rvi_msg[4]);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
60 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
61 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
62
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
63 void
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
64 l1tm_response_index_val(op)
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
65 char *op;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
66 {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
67 char buf[80];
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
68 unsigned val;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
69
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
70 if (rvi_msg[3]) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
71 if (rvi_msg_len == 5) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
72 sprintf(buf, "%s error %u (0x%02X)", op,
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
73 rvi_msg[3], rvi_msg[3]);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
74 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
75 } else {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
76 sprintf(buf, "%s long error response", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
77 print_etm_pkt_raw(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
78 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
79 return;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
80 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
81 if (rvi_msg_len != 8) {
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
82 sprintf(buf, "%s response wrong length", op);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
83 print_etm_pkt_raw(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
84 return;
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
85 }
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
86 val = rvi_msg[5] | (rvi_msg[6] << 8);
155
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
87 if (val >= 0x8000)
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
88 sprintf(buf, "%s index %u (0x%02X): 0x%04X (%u or %d)", op,
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
89 rvi_msg[4], rvi_msg[4], val, val, (int)val - 65536);
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
90 else
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
91 sprintf(buf, "%s index %u (0x%02X): 0x%04X (%u)", op,
f5a797c291be fc-tmsh l1tm response handling: returned values can be signed or unsigned
Mychaela Falconia <falcon@freecalypso.org>
parents: 137
diff changeset
92 rvi_msg[4], rvi_msg[4], val, val);
132
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
93 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
94 }
133
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
95
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
96 void
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
97 l1tm_rfe_response()
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
98 {
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
99 char buf[80];
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
100
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
101 if (rvi_msg_len < 5 || rvi_msg_len > 6) {
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
102 print_etm_pkt_raw("RF_ENABLE response wrong length");
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
103 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
104 }
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
105 switch (rvi_msg[3]) {
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
106 case 0:
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
107 async_msg_output("rfe OK");
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
108 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
109 case 1:
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
110 async_msg_output("RF operation finished");
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
111 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
112 default:
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
113 sprintf(buf, "rfe error %u (0x%02X)", rvi_msg[3], rvi_msg[3]);
133
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
114 async_msg_output(buf);
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
115 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
116 }
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
117 }
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
118
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
119 void
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
120 l1tm_stats_response()
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
121 {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
122 char buf[80];
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
123 unsigned type, bitmask, val, offset;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
124 int expect_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
125
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
126 if (rvi_msg_len < 5) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
127 wrong_len: print_etm_pkt_raw("STATS_READ response wrong length");
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
128 return;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
129 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
130 if (rvi_msg[3]) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
131 if (rvi_msg_len != 5)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
132 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
133 sprintf(buf, "sr error %u (0x%02X)", rvi_msg[3], rvi_msg[3]);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
134 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
135 return;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
136 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
137 if (rvi_msg_len < 9)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
138 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
139 type = rvi_msg[4] | (rvi_msg[5] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
140 bitmask = rvi_msg[6] | (rvi_msg[7] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
141 if (type < 1 || type > 2 || (bitmask & 0x0300)) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
142 print_etm_pkt_raw("STATS_READ response unable to parse");
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
143 return;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
144 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
145 expect_len = 9;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
146 if (bitmask & RSSI)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
147 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
148 if (bitmask & DSP_PM)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
149 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
150 if (bitmask & ANGLE_MEAN)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
151 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
152 if (bitmask & ANGLE_VAR)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
153 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
154 if (bitmask & ANGLE_MIN)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
155 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
156 if (bitmask & ANGLE_MAX)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
157 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
158 if (bitmask & SNR_MEAN)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
159 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
160 if (bitmask & SNR_VAR)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
161 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
162 if (bitmask & TOA_MEAN)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
163 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
164 if (bitmask & TOA_VAR)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
165 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
166 if (bitmask & FRAME_NUMBER)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
167 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
168 if (bitmask & RUNS)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
169 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
170 if (bitmask & SUCCESSES)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
171 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
172 if (bitmask & BSIC)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
173 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
174 if (rvi_msg_len != expect_len)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
175 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
176 sprintf(buf, "Stats type %u bitmask %04X:", type, bitmask);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
177 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
178 offset = 8;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
179 if (bitmask & RSSI) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
180 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
181 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
182 sprintf(buf, "RSSI: %u (0x%04X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
183 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
184 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
185 if (bitmask & DSP_PM) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
186 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
187 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
188 sprintf(buf, "DSP_PM: %u (0x%04X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
189 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
190 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
191 if (bitmask & ANGLE_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
192 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
193 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
194 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
195 sprintf(buf, "ANGLE_MEAN: %d (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
196 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
197 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
198 if (bitmask & ANGLE_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
199 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
200 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
201 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
202 sprintf(buf, "ANGLE_VAR: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
203 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
204 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
205 if (bitmask & ANGLE_MIN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
206 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
207 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
208 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
209 sprintf(buf, "ANGLE_MIN: %d (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
210 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
211 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
212 if (bitmask & ANGLE_MAX) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
213 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
214 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
215 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
216 sprintf(buf, "ANGLE_MAX: %d (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
217 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
218 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
219 if (bitmask & SNR_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
220 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
221 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
222 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
223 sprintf(buf, "SNR_MEAN: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
224 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
225 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
226 if (bitmask & SNR_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
227 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
228 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
229 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
230 sprintf(buf, "SNR_VAR: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
231 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
232 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
233 if (bitmask & TOA_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
234 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
235 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
236 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
237 sprintf(buf, "TOA_MEAN: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
238 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
239 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
240 if (bitmask & TOA_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
241 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
242 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
243 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
244 sprintf(buf, "TOA_VAR: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
245 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
246 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
247 if (bitmask & FRAME_NUMBER) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
248 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
249 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
250 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
251 sprintf(buf, "FRAME_NUMBER: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
252 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
253 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
254 if (bitmask & RUNS) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
255 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
256 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
257 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
258 sprintf(buf, "RUNS: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
259 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
260 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
261 if (bitmask & SUCCESSES) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
262 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8) |
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
263 (rvi_msg[offset+2] << 16) | (rvi_msg[offset+3] << 24);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
264 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
265 sprintf(buf, "SUCCESSES: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
266 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
267 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
268 if (bitmask & BSIC) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
269 val = rvi_msg[offset] | (rvi_msg[offset+1] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
270 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
271 sprintf(buf, "BSIC: %u (0x%04X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
272 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
273 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
274 }
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
275
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
276 void
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
277 l1tm_rftr_response()
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
278 {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
279 char buf[80], *dp;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
280 unsigned i, j, l;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
281
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
282 if (rvi_msg[3]) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
283 if (rvi_msg_len == 5) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
284 sprintf(buf, "rftr error %u (0x%02X)",
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
285 rvi_msg[3], rvi_msg[3]);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
286 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
287 } else
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
288 print_etm_pkt_raw("rftr long error response");
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
289 return;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
290 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
291 if (rvi_msg_len < 7 || rvi_msg_len > MAX_RF_TABLE_SIZE + 6) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
292 print_etm_pkt_raw("rftr response wrong length");
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
293 return;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
294 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
295 rftr_table_index = rvi_msg[4];
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
296 rftr_table_size = rvi_msg_len - 6;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
297 bcopy(rvi_msg + 5, rftr_table_data, rftr_table_size);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
298 sprintf(buf, "rftr index %u (0x%02X): %u bytes",
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
299 rftr_table_index, rftr_table_index, rftr_table_size);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
300 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
301 for (i = 0; i < rftr_table_size; ) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
302 l = rftr_table_size - i;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
303 if (l > 16)
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
304 l = 16;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
305 sprintf(buf, "offset %02X:", i);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
306 dp = index(buf, '\0');
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
307 for (j = 0; j < l; j++) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
308 if (j == 0 || j == 8)
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
309 *dp++ = ' ';
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
310 sprintf(dp, " %02X", rftr_table_data[i++]);
137
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
311 dp += 3;
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
312 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
313 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
314 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
315 }
136
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
316
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
317 void
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
318 l1tm_ttw_response()
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
319 {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
320 char buf[80];
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
321
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
322 if (rvi_msg[3]) {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
323 if (rvi_msg_len == 5) {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
324 sprintf(buf, "ttw error %u (0x%02X)",
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
325 rvi_msg[3], rvi_msg[3]);
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
326 async_msg_output(buf);
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
327 } else
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
328 print_etm_pkt_raw("ttw long error response");
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
329 return;
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
330 }
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
331 if (rvi_msg_len < 5 || rvi_msg_len > 6) {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
332 print_etm_pkt_raw("ttw response wrong length");
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
333 return;
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
334 }
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
335 async_msg_output("ttw OK");
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
336 }
137
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
337
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
338 void
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
339 l1tm_ttr_response()
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
340 {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
341 char buf[80], *dp;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
342 unsigned i;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
343
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
344 if (rvi_msg[3]) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
345 if (rvi_msg_len == 5) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
346 sprintf(buf, "ttr error %u (0x%02X)",
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
347 rvi_msg[3], rvi_msg[3]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
348 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
349 } else
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
350 print_etm_pkt_raw("ttr long error response");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
351 return;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
352 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
353 if (rvi_msg_len != 38) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
354 print_etm_pkt_raw("ttr response wrong length");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
355 return;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
356 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
357 sprintf(buf, "ttr index %u:", rvi_msg[4]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
358 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
359 bcopy(rvi_msg + 5, ttr_ramp_data, 32);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
360 strcpy(buf, "ramp-up ");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
361 dp = buf + 9;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
362 for (i = 0; i < 16; i++) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
363 sprintf(dp, "%4u", ttr_ramp_data[i]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
364 dp += 4;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
365 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
366 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
367 strcpy(buf, "ramp-down");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
368 dp = buf + 9;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
369 for (i = 0; i < 16; i++) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
370 sprintf(dp, "%4u", ttr_ramp_data[i+16]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
371 dp += 4;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
372 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
373 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
374 }