-
Notifications
You must be signed in to change notification settings - Fork 11
/
gprs_new_patch
156 lines (138 loc) · 6.25 KB
/
gprs_new_patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c
index ecf934d..5568cb7 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -209,7 +209,7 @@ static int gsm48_rx_imm_ass(struct msgb *msg, struct osmocom_ms *ms)
int rv;
/* Discard packet TBF assignement */
- if (ia->page_mode & 0xf0)
+ if ((ia->page_mode & 0xf0) != 0x10)
return 0;
/* If we're not ready yet, or just busy ... */
@@ -649,7 +649,7 @@ void layer3_rx_burst(struct osmocom_ms *ms, struct msgb *msg)
app_state.dch_badcnt = 0;
/* Release condition */
- do_rel = app_state.dch_badcnt >= 6;
+ do_rel = app_state.dch_badcnt >= 600;
}
}
diff --git a/src/target/firmware/include/layer1/tdma_sched.h b/src/target/firmware/include/layer1/tdma_sched.h
index f58d59b..3a8c91a 100644
--- a/src/target/firmware/include/layer1/tdma_sched.h
+++ b/src/target/firmware/include/layer1/tdma_sched.h
@@ -10,8 +10,8 @@
* bucket contains of a list of callbacks which are executed when the bucket
* index reaches that particular bucket. */
-#define TDMASCHED_NUM_FRAMES 25
-#define TDMASCHED_NUM_CB 8
+#define TDMASCHED_NUM_FRAMES 32
+#define TDMASCHED_NUM_CB 16
#define TDMA_IFLG_TPU (1<<0)
#define TDMA_IFLG_DSP (1<<1)
diff --git a/src/target/firmware/include/stdint.h b/src/target/firmware/include/stdint.h
index 627403f..279e74f 100644
--- a/src/target/firmware/include/stdint.h
+++ b/src/target/firmware/include/stdint.h
@@ -16,7 +16,7 @@
one of the compilers producing working code right now. */
#if __GNUC__ > 3
-#include_next <stdint.h>
+//#include_next <stdint.h>
#endif
#ifndef __int8_t_defined
diff --git a/src/target/firmware/layer1/prim_sniff.c b/src/target/firmware/layer1/prim_sniff.c
index 37dcd32..46c1d58 100644
--- a/src/target/firmware/layer1/prim_sniff.c
+++ b/src/target/firmware/layer1/prim_sniff.c
@@ -175,15 +175,17 @@ l1s_sniff_resp(uint8_t ul, uint8_t burst_id, uint16_t p3)
bi->frame_nr = htonl(rx_time.fn);
/* ARFCN */
- if (ul)
+ if (ul) {
rf_arfcn |= ARFCN_UPLINK;
+ burst_id += 3;
+ }
bi->band_arfcn = htons(rf_arfcn);
/* Set Channel Number depending on MFrame Task ID */
- bi->chan_nr = mframe_task2chan_nr(mf_task_id, tn);
+ bi->chan_nr = mframe_task2chan_nr(mf_task_id, (tn+burst_id)%8);
/* Set burst id */
- bi->flags = burst_id;
+ bi->flags = 0; //burst_id;
/* Set SACCH indication */
if (mf_task_flags & MF_F_SACCH)
@@ -242,9 +244,9 @@ l1s_sniff_cmd(uint8_t ul, __unused uint8_t burst_id, __unused uint16_t p3)
dsp_api.db_w->d_ctrl_system |= (1 << B_BCCH_FREQ_IND);
if (ul) {
- l1s_rx_win_ctrl(arfcn | ARFCN_UPLINK, L1_RXWIN_NB, 3);
+ l1s_rx_win_ctrl(arfcn | ARFCN_UPLINK, L1_RXWIN_NB, burst_id);
} else {
- l1s_rx_win_ctrl(arfcn, L1_RXWIN_NB, 0);
+ l1s_rx_win_ctrl(arfcn, L1_RXWIN_NB, burst_id);
}
return 0;
@@ -252,28 +254,56 @@ l1s_sniff_cmd(uint8_t ul, __unused uint8_t burst_id, __unused uint16_t p3)
const struct tdma_sched_item sniff_xcch_dl_sched_set[] = {
SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_END_FRAME(),
- SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 1), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 2), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -5, 0, 1), SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 3), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -5, 0, 2), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -5, 0, 3), SCHED_END_FRAME(),
+ SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_END_FRAME(),
SCHED_END_SET()
};
const struct tdma_sched_item sniff_xcch_ul_sched_set[] = {
SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 0), SCHED_END_FRAME(),
- SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 1), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 2), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -4, 1, 1), SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 3), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -4, 1, 2), SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -4, 1, 3), SCHED_END_FRAME(),
+ SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_END_FRAME(),
SCHED_END_SET()
};
+/* Single slot capture */
+#if 0
const struct tdma_sched_item sniff_tch_sched_set[] = {
- SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 3, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 0, 1, 0), SCHED_END_FRAME(),
SCHED_END_FRAME(),
- SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM(l1s_sniff_resp, -4, 1, 0), SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM(l1s_sniff_resp, -5, 1, 0), SCHED_END_FRAME(),
SCHED_END_SET()
};
+#endif
+/* Multislot capture */
+
+// Downlink
+#if 1
+const struct tdma_sched_item sniff_tch_sched_set[] = {
+ SCHED_ITEM_DT(l1s_sniff_cmd, 0, 0, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 2, 0, 2),
+ SCHED_ITEM_DT(l1s_sniff_cmd, 4, 0, 4), SCHED_ITEM_DT(l1s_sniff_cmd, 6, 0, 6), SCHED_END_FRAME(),
+ SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 0, 0), SCHED_ITEM(l1s_sniff_resp, -4, 0, 2),
+ SCHED_ITEM(l1s_sniff_resp, -3, 0, 4), SCHED_ITEM(l1s_sniff_resp, -2, 0, 6), SCHED_END_FRAME(),
+ SCHED_END_SET()
+};
+
+#else
+
+// Uplink
+const struct tdma_sched_item sniff_tch_sched_set[] = {
+ SCHED_ITEM_DT(l1s_sniff_cmd, 0, 1, 0), SCHED_ITEM_DT(l1s_sniff_cmd, 2, 1, 2),
+ SCHED_ITEM_DT(l1s_sniff_cmd, 4, 1, 4), SCHED_ITEM_DT(l1s_sniff_cmd, 6, 1, 6), SCHED_END_FRAME(),
+ SCHED_END_FRAME(),
+ SCHED_ITEM(l1s_sniff_resp, -5, 1, 0), SCHED_ITEM(l1s_sniff_resp, -4, 1, 2),
+ SCHED_ITEM(l1s_sniff_resp, -3, 1, 4), SCHED_ITEM(l1s_sniff_resp, -2, 1, 6), SCHED_END_FRAME(),
+ SCHED_END_SET()
+};
+#endif