annotate rvinterf/tmsh/l1resp.c @ 138:3803f838e1f3

RF table writing code implemented, linked into fc-tmsh
author Mychaela Falconia <falcon@freecalypso.org>
date Sun, 26 Feb 2017 22:37:47 +0000
parents 79e71354ba7b
children f5a797c291be
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);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
87 sprintf(buf, "%s index %u (0x%02X): %u (0x%04X)", op,
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
88 rvi_msg[4], rvi_msg[4], val, val);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
89 async_msg_output(buf);
5380872923a6 fc-tmsh: beginning of l1tm response handling
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
90 }
133
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
91
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
92 void
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
93 l1tm_rfe_response()
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
94 {
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
95 char buf[80];
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
96
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
97 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
98 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
99 return;
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 switch (rvi_msg[3]) {
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
102 case 0:
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
103 async_msg_output("rfe OK");
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
104 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
105 case 1:
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
106 async_msg_output("RF operation finished");
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
107 return;
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
108 default:
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
109 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
110 async_msg_output(buf);
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 }
4aa1c18c7a2f fc-tmsh: RF_ENABLE response handled intelligently
Mychaela Falconia <falcon@freecalypso.org>
parents: 132
diff changeset
113 }
134
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
114
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
115 void
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
116 l1tm_stats_response()
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
117 {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
118 char buf[80];
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
119 unsigned type, bitmask, val, offset;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
120 int expect_len;
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 if (rvi_msg_len < 5) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
123 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
124 return;
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[3]) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
127 if (rvi_msg_len != 5)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
128 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
129 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
130 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
131 return;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
132 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
133 if (rvi_msg_len < 9)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
134 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
135 type = rvi_msg[4] | (rvi_msg[5] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
136 bitmask = rvi_msg[6] | (rvi_msg[7] << 8);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
137 if (type < 1 || type > 2 || (bitmask & 0x0300)) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
138 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
139 return;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
140 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
141 expect_len = 9;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
142 if (bitmask & RSSI)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
143 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
144 if (bitmask & DSP_PM)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
145 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
146 if (bitmask & ANGLE_MEAN)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
147 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
148 if (bitmask & ANGLE_VAR)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
149 expect_len += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
150 if (bitmask & ANGLE_MIN)
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_MAX)
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 & SNR_MEAN)
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 & SNR_VAR)
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 & TOA_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 & TOA_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 & FRAME_NUMBER)
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 & RUNS)
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 & SUCCESSES)
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 & BSIC)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
169 expect_len += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
170 if (rvi_msg_len != expect_len)
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
171 goto wrong_len;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
172 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
173 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
174 offset = 8;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
175 if (bitmask & RSSI) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
176 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
177 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
178 sprintf(buf, "RSSI: %u (0x%04X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
179 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
180 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
181 if (bitmask & DSP_PM) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
182 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
183 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
184 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
185 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
186 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
187 if (bitmask & ANGLE_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
188 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
189 (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
190 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
191 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
192 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
193 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
194 if (bitmask & ANGLE_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
195 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
196 (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
197 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
198 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
199 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
200 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
201 if (bitmask & ANGLE_MIN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
202 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
203 (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
204 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
205 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
206 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
207 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
208 if (bitmask & ANGLE_MAX) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
209 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
210 (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
211 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
212 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
213 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
214 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
215 if (bitmask & SNR_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
216 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
217 (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
218 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
219 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
220 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
221 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
222 if (bitmask & SNR_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
223 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
224 (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
225 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
226 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
227 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
228 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
229 if (bitmask & TOA_MEAN) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
230 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
231 (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
232 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
233 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
234 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
235 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
236 if (bitmask & TOA_VAR) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
237 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
238 (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
239 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
240 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
241 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
242 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
243 if (bitmask & FRAME_NUMBER) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
244 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
245 (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
246 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
247 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
248 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
249 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
250 if (bitmask & RUNS) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
251 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
252 (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
253 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
254 sprintf(buf, "RUNS: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
255 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
256 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
257 if (bitmask & SUCCESSES) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
258 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
259 (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
260 offset += 4;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
261 sprintf(buf, "SUCCESSES: %u (0x%08X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
262 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
263 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
264 if (bitmask & BSIC) {
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
265 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
266 offset += 2;
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
267 sprintf(buf, "BSIC: %u (0x%04X)", val, val);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
268 async_msg_output(buf);
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
269 }
4c78649101f1 fc-tmsh: l1tm stats response display
Mychaela Falconia <falcon@freecalypso.org>
parents: 133
diff changeset
270 }
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
271
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
272 void
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
273 l1tm_rftr_response()
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
274 {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
275 char buf[80], *dp;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
276 unsigned i, j, l;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
277
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
278 if (rvi_msg[3]) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
279 if (rvi_msg_len == 5) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
280 sprintf(buf, "rftr error %u (0x%02X)",
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
281 rvi_msg[3], rvi_msg[3]);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
282 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
283 } else
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
284 print_etm_pkt_raw("rftr long error response");
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
285 return;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
286 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
287 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
288 print_etm_pkt_raw("rftr response wrong length");
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 rftr_table_index = rvi_msg[4];
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
292 rftr_table_size = rvi_msg_len - 6;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
293 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
294 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
295 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
296 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
297 for (i = 0; i < rftr_table_size; ) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
298 l = rftr_table_size - i;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
299 if (l > 16)
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
300 l = 16;
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
301 sprintf(buf, "offset %02X:", i);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
302 dp = index(buf, '\0');
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
303 for (j = 0; j < l; j++) {
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
304 if (j == 0 || j == 8)
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
305 *dp++ = ' ';
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
306 sprintf(dp, " %02X", rftr_table_data[i++]);
137
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
307 dp += 3;
135
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
308 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
309 async_msg_output(buf);
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
310 }
40807eb35ffe fc-tmsh: rftr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 134
diff changeset
311 }
136
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
312
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
313 void
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
314 l1tm_ttw_response()
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
315 {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
316 char buf[80];
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
317
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
318 if (rvi_msg[3]) {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
319 if (rvi_msg_len == 5) {
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
320 sprintf(buf, "ttw error %u (0x%02X)",
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
321 rvi_msg[3], rvi_msg[3]);
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
322 async_msg_output(buf);
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
323 } else
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
324 print_etm_pkt_raw("ttw long error response");
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
325 return;
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
326 }
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
327 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
328 print_etm_pkt_raw("ttw response wrong length");
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 async_msg_output("ttw OK");
da4d4af80fdd fc-tmsh: ttw response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 135
diff changeset
332 }
137
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
333
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
334 void
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
335 l1tm_ttr_response()
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
336 {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
337 char buf[80], *dp;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
338 unsigned i;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
339
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
340 if (rvi_msg[3]) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
341 if (rvi_msg_len == 5) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
342 sprintf(buf, "ttr error %u (0x%02X)",
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
343 rvi_msg[3], rvi_msg[3]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
344 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
345 } else
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
346 print_etm_pkt_raw("ttr long error response");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
347 return;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
348 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
349 if (rvi_msg_len != 38) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
350 print_etm_pkt_raw("ttr response wrong length");
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 sprintf(buf, "ttr index %u:", rvi_msg[4]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
354 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
355 bcopy(rvi_msg + 5, ttr_ramp_data, 32);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
356 strcpy(buf, "ramp-up ");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
357 dp = buf + 9;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
358 for (i = 0; i < 16; i++) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
359 sprintf(dp, "%4u", ttr_ramp_data[i]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
360 dp += 4;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
361 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
362 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
363 strcpy(buf, "ramp-down");
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
364 dp = buf + 9;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
365 for (i = 0; i < 16; i++) {
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
366 sprintf(dp, "%4u", ttr_ramp_data[i+16]);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
367 dp += 4;
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
368 }
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
369 async_msg_output(buf);
79e71354ba7b fc-tmsh: ttr response handling implemented
Mychaela Falconia <falcon@freecalypso.org>
parents: 136
diff changeset
370 }