From gerrit-no-reply at lists.osmocom.org Tue Nov 1 09:26:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 09:26:09 +0000 Subject: libosmocore[master]: bitcomp: Remove the t4 decoding from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I021424444625a097560d086c217c81eac4a5ee44 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 09:51:00 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 09:51:00 +0000 Subject: [PATCH] libosmocore[master]: Fix typo in osmo_fsm_log_addr() Message-ID: Review at https://gerrit.osmocom.org/1177 Fix typo in osmo_fsm_log_addr() Previously function parameter was ignored, fsm_log_addr was always set to false. Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8 --- M src/fsm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/77/1177/1 diff --git a/src/fsm.c b/src/fsm.c index 31ed194..f525f40 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -99,7 +99,7 @@ */ void osmo_fsm_log_addr(bool log_addr) { - fsm_log_addr = false; + fsm_log_addr = log_addr; } /*! \brief register a FSM with the core -- To view, visit https://gerrit.osmocom.org/1177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 1 10:05:48 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 10:05:48 +0000 Subject: [PATCH] libosmocore[master]: Add osmo_fsm_unregister() to header Message-ID: Review at https://gerrit.osmocom.org/1178 Add osmo_fsm_unregister() to header Previously function was defined but not exposed so there were a way to register FSM but no way to unregister it. Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b --- M include/osmocom/core/fsm.h M tests/fsm/fsm_test.c 2 files changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/78/1178/1 diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index ce0db15..9b6072d 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -115,7 +115,7 @@ osmo_fsm_state_name((fi)->fsm, (fi)->state), ## args) int osmo_fsm_register(struct osmo_fsm *fsm); - +void osmo_fsm_unregister(struct osmo_fsm *fsm); struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id); struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 84c2ae4..29b31ef 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -151,5 +151,6 @@ osmo_select_main(0); } + osmo_fsm_unregister(&fsm); exit(0); } -- To view, visit https://gerrit.osmocom.org/1178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 1 10:25:51 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 10:25:51 +0000 Subject: [PATCH] libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1172 to look at the new patch set (#2). Add logging and testing for FSM deallocation osmo_fsm_inst_alloc() logs allocation but osmo_fsm_inst_free() is silent. Fix this by adding log message for deallocation to make FSM lifecycle tracking easier. Also make sure it's covered by test suite. Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 --- M src/fsm.c M tests/fsm/fsm_test.c 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/1172/2 diff --git a/src/fsm.c b/src/fsm.c index 31ed194..a599a58 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -233,6 +233,7 @@ */ void osmo_fsm_inst_free(struct osmo_fsm_inst *fi) { + LOGPFSM(fi, "Deallocated\n"); osmo_timer_del(&fi->timer); llist_del(&fi->list); talloc_free(fi); diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 84c2ae4..4a9be9d 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -89,7 +89,7 @@ .log_subsys = DMAIN, }; -static int foo(void) +static struct osmo_fsm_inst *foo(void) { struct osmo_fsm_inst *fi; @@ -115,7 +115,7 @@ OSMO_ASSERT(fi->state == ST_TWO); - return 0; + return fi; } static const struct log_info_cat default_categories[] = { @@ -134,6 +134,7 @@ int main(int argc, char **argv) { struct log_target *stderr_target; + struct osmo_fsm_inst *finst; osmo_fsm_log_addr(false); @@ -145,11 +146,11 @@ g_ctx = NULL; osmo_fsm_register(&fsm); - foo(); + finst = foo(); while (1) { osmo_select_main(0); } - + osmo_fsm_inst_free(finst); exit(0); } -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 1 10:26:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 10:26:29 +0000 Subject: libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Patch Set 2: asan was not triggered because this function is not called from tests/ -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 10:37:33 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 10:37:33 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: Is there some bug which prompted this fix? Would be nice to see the note in commit message as to when/why this happens. -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 10:54:17 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 10:54:17 +0000 Subject: [PATCH] openbsc[master]: Decrease count_codecs logging verbosity Message-ID: Review at https://gerrit.osmocom.org/1179 Decrease count_codecs logging verbosity Use channel type name instead of number and log it with DEBUG facility otherwise it produces lots of irrelevant messages for SDCCH* Change-Id: I11b04e0cb02bf6ed01f6076cb31a56d8921d735e --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/1179/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 9656961..f672750 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -112,8 +112,8 @@ break; } } else { - LOGP(DRSL, LOGL_ERROR, "count_codecs unknown lchan->type %x on channel %s\n", - lchan->type, gsm_ts_and_pchan_name(lchan->ts)); + LOGP(DRSL, LOGL_DEBUG, "count_codecs unknown lchan->type %s on channel %s\n", + gsm_lchant_name(lchan->type), gsm_ts_and_pchan_name(lchan->ts)); } } -- To view, visit https://gerrit.osmocom.org/1179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I11b04e0cb02bf6ed01f6076cb31a56d8921d735e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:33:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 11:33:29 +0000 Subject: libosmocore[master]: utils/conv_gen.py: don't mix print and write() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:35:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 11:35:43 +0000 Subject: openbsc[master]: pcu_if: original pcu sock interface from osmo-bts In-Reply-To: References: Message-ID: Patch Set 2: Wouldn't it be better to share code via some library instead of copy-pasted duplication? -- To view, visit https://gerrit.osmocom.org/1169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b0a65f1633c40053d43b57b786b042f20f12bd Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:39:54 2016 From: gerrit-no-reply at lists.osmocom.org (keith) Date: Tue, 1 Nov 2016 11:39:54 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: > Is there some bug which prompted this fix? Would be nice to see the > note in commit message as to when/why this happens. Max, it is something of the 1 million ????? question for me. We see it all the time, especially in communities where we run long distance Wifi Links between osmonitb and osmobts. However, in my experiments, I find it difficult to provoke by loading the network link. I can also say that last week, I saw 'BROKEN UNUSABLE Error reason: activation timeout' channels on a fairwaves UmSite, suggesting that the osmobts (or trx) process stalled causing osmobts to not ACK within the time. Holger and I one day pondered if maybe latency with ARM<->DSP msgq in the Litecel might also provoke it. -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:44:04 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 11:44:04 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: I've noticed that if I add lots of heavy LOGP() statements to lc15 code than I got 2nd call failure due to some problem with channel (re)activation not working properly. Not sure if this is related. How does problem manifests for you? Do you see failed calls or smth like that? -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:44:22 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 1 Nov 2016 11:44:22 +0000 Subject: openbsc[master]: pcu_if: original pcu sock interface from osmo-bts In-Reply-To: References: Message-ID: Patch Set 2: > Wouldn't it be better to share code via some library instead of > copy-pasted duplication? I committed that for reference, maybe a bit to early. I already changed quite some bits. Maybe later it could go into a library, but lets first see what else need to change. (Currently I can send the BTS-Info, theoretically I should be able to send RACH-Requests too, but currently I am not able to receive any RACH-Requests since there are still problems with SI13) -- To view, visit https://gerrit.osmocom.org/1169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b0a65f1633c40053d43b57b786b042f20f12bd Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:46:43 2016 From: gerrit-no-reply at lists.osmocom.org (keith) Date: Tue, 1 Nov 2016 11:46:43 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: The likes of: <0007> paging.c:83 Going to send paging commands: imsi: '334020332908489' tmsi: '0xffffffff' <0004> abis_rsl.c:1422 BTS 5 CHAN RQD: no resources for SDCCH 0x3 <0004> abis_rsl.c:1422 BTS 5 CHAN RQD: no resources for SDCCH 0xa and then: OpenBSC# show lchan s BTS 0, TRX 0, Timeslot 1, Lchan 1, Type SDCCH - L1 MS Power: 33 dBm RXL-FULL-dl: -59 dBm RXL-FULL-ul: -69 dBm BTS 2, TRX 0, Timeslot 1, Lchan 0, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -87 dBm RXL-FULL-ul: -88 dBm BTS 2, TRX 0, Timeslot 1, Lchan 2, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -99 dBm RXL-FULL-ul: -99 dBm BTS 2, TRX 0, Timeslot 1, Lchan 3, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -95 dBm RXL-FULL-ul: -95 dBm BTS 2, TRX 0, Timeslot 1, Lchan 4, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -83 dBm RXL-FULL-ul: -84 dBm BTS 2, TRX 0, Timeslot 1, Lchan 5, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -84 dBm RXL-FULL-ul: -86 dBm BTS 2, TRX 0, Timeslot 1, Lchan 6, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -77 dBm RXL-FULL-ul: -91 dBm BTS 2, TRX 0, Timeslot 1, Lchan 7, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -79 dBm RXL-FULL-ul: -105 dBm BTS 2, TRX 0, Timeslot 2, Lchan 0, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -100 dBm RXL-FULL-ul: -94 dBm BTS 2, TRX 0, Timeslot 3, Lchan 0, Type NONE - L1 MS Power: 33 dBm RXL-FULL-dl: -99 dBm RXL-FULL-ul: -96 dBm etc... -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 11:48:07 2016 From: gerrit-no-reply at lists.osmocom.org (keith) Date: Tue, 1 Nov 2016 11:48:07 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: And of course, lchan (not summary) for one of those BROKEN channels is: BTS 2, TRX 0, Timeslot 1, Lchan 0: Type NONE Connection: 0, State: BROKEN UNUSABLE Error reason: activation timeout BS Power: 37 dBm, MS Power: 33 dBm No Subscriber Bound IP: 0.0.0.0 Port 0 RTP_TYPE2=0 CONN_ID=0 Measurement Report: Flags: DLinval RXL-FULL-ul: -88 dBm, RXL-SUB-ul: -47 dBm RXQ-FULL-ul: 0, RXQ-SUB-ul: 0 This does not recover, ever without manual intervention, leading to a complete loss of service. -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 12:04:36 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 12:04:36 +0000 Subject: openbsc[master]: gsm0408: Adding log output for 3g specific RR messages In-Reply-To: References: Message-ID: Patch Set 7: Please add reference to issue and retrigger build - seems like it was failing due to missing piece in libosmocore that have been merged now. -- To view, visit https://gerrit.osmocom.org/1037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I41f2242fdf59c3eb4b3f8f7f003c17f7e0df01aa Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:21:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 1 Nov 2016 15:21:45 +0000 Subject: openbsc[master]: Decrease count_codecs logging verbosity In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 (1 comment) https://gerrit.osmocom.org/#/c/1179/1/openbsc/src/libbsc/abis_rsl.c File openbsc/src/libbsc/abis_rsl.c: Line 115: LOGP(DRSL, LOGL_DEBUG, "count_codecs unknown lchan->type %s on channel %s\n", At first it seems that the ERROR level is a good choice, but in fact count_codecs() is called on every chan act ack, also for channels other than TCH/F and TCH/H. So this logging apparently happens a lot during normal operation. I would favor to drop this logging altogether, at least put it in another logging category (RSL is about the RSL communications, not whether our internal code tries to count lchan codecs for the wrong channel types). Anyway, this patch is an improvement. -- To view, visit https://gerrit.osmocom.org/1179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11b04e0cb02bf6ed01f6076cb31a56d8921d735e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:23:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 1 Nov 2016 15:23:02 +0000 Subject: libosmocore[master]: Fix typo in osmo_fsm_log_addr() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:27:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 1 Nov 2016 15:27:06 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: I tested this by hacking a chan act ack delay into osmo-bts, see osmo-bts branch neels/delay_tch_h_act_ack. It should be caused by BTS<->BSC latency (for any given reason). Once this patch is through, lchans should recover from this without having to restart the NITB, only on sysmoBTS though. I'll hopefully get a chance to test this again later today. -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:35:18 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 1 Nov 2016 15:35:18 +0000 Subject: [PATCH] libosmocore[master]: utils/conv_gen.py: don't mix print and write() In-Reply-To: References: Message-ID: Hello tnt, Max, Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1164 to look at the new patch set (#2). utils/conv_gen.py: don't mix print and write() This is mostly a code style change, but it also increases the compatibility with Python 3. Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb --- M utils/conv_gen.py 1 file changed, 34 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/64/1164/2 diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 5eb7ac1..78b2335 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -168,51 +168,53 @@ sum([x << (self.rate_inv - i - 1) for i, x in enumerate(n)]) num_states = 1 << (self.k - 1) - print >>fi, \ - "\nstatic const uint8_t %s_state[][2] = {" % self.name + fi.write("static const uint8_t %s_state[][2] = {\n" % self.name) self._print_x(fi, num_states) - print >>fi, \ - "};\n\nstatic const uint8_t %s_output[][2] = {" % self.name + fi.write("};\n\n") + + fi.write("static const uint8_t %s_output[][2] = {\n" % self.name) self._print_x(fi, num_states, pack) - print >>fi, "};" + fi.write("};\n\n") if self.recursive: - print >>fi, \ - "\nstatic const uint8_t %s_term_state[] = {" % self.name + fi.write("static const uint8_t %s_term_state[] = {\n" % self.name) self._print_term(fi, num_states) + fi.write("};\n\n") - print >>fi, \ - "};\n\nstatic const uint8_t %s_term_output[] = {" % self.name + fi.write("static const uint8_t %s_term_output[] = {\n" % self.name) self._print_term(fi, num_states, pack) - print >>fi, "};" + fi.write("};\n\n") if len(self.puncture): - print >>fi, "\nstatic const int %s_puncture[] = {" % self.name + fi.write("static const int %s_puncture[] = {\n" % self.name) self._print_puncture(fi) - print >>fi, "};" + fi.write("};\n\n") # Write description as a multi-line comment if self.description is not None: - print >>fi, "\n/**" + fi.write("/**\n") for line in self.description: - print >>fi, " * %s" % line - print >>fi, " */" + fi.write(" * %s\n" % line) + fi.write(" */\n") # Print a final convolutional code definition - print >>fi, "const struct osmo_conv_code %s_%s = {" % (pref, self.name) - print >>fi, "\t.N = %d," % self.rate_inv - print >>fi, "\t.K = %d," % self.k - print >>fi, "\t.len = %d," % self.block_len + fi.write("const struct osmo_conv_code %s_%s = {\n" % (pref, self.name)) + fi.write("\t.N = %d,\n" % self.rate_inv) + fi.write("\t.K = %d,\n" % self.k) + fi.write("\t.len = %d,\n" % self.block_len) + fi.write("\t.next_output = %s_output,\n" % self.name) + fi.write("\t.next_state = %s_state,\n" % self.name) + if self.term_type is not None: - print >>fi, "\t.term = %s," % self.term_type - print >>fi, "\t.next_output = %s_output," % self.name - print >>fi, "\t.next_state = %s_state," % self.name + fi.write("\t.term = %s,\n" % self.term_type) + if self.recursive: - print >>fi, "\t.next_term_output = %s_term_output," % self.name - print >>fi, "\t.next_term_state = %s_term_state," % self.name + fi.write("\t.next_term_output = %s_term_output,\n" % self.name) + fi.write("\t.next_term_state = %s_term_state,\n" % self.name) + if len(self.puncture): - print >>fi, "\t.puncture = %s_puncture," % self.name - print >>fi, "};" + fi.write("\t.puncture = %s_puncture,\n" % self.name) + fi.write("};\n\n") poly = lambda *args: sum([(1 << x) for x in args]) @@ -939,17 +941,17 @@ path = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() prefix = "gsm0503" - print >>sys.stderr, "Generating convolutional codes..." + sys.stderr.write("Generating convolutional codes...\n") # Open a new file for writing f = open(os.path.join(path, "gsm0503_conv.c"), 'w') - print >>f, mod_license - print >>f, "#include " - print >>f, "#include " + f.write(mod_license + "\n") + f.write("#include \n") + f.write("#include \n\n") # Generate the tables one by one for code in conv_codes: - print >>sys.stderr, "Generate '%s' definition" % code.name + sys.stderr.write("Generate '%s' definition\n" % code.name) code.gen_tables(prefix, f) - print >>sys.stderr, "Generation complete." + sys.stderr.write("Generation complete.\n") -- To view, visit https://gerrit.osmocom.org/1164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:35:19 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 1 Nov 2016 15:35:19 +0000 Subject: [PATCH] libosmocore[master]: utils/conv_gen.py: explicitly import reduce() Message-ID: Review at https://gerrit.osmocom.org/1180 utils/conv_gen.py: explicitly import reduce() This change finally makes the script able to be executed in Python 3 environment. Due to new Python 3 restrictions, the reduce() should be imported explicitly. Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005 --- M utils/conv_gen.py 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/80/1180/1 diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 78b2335..62fa8ad 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -24,6 +24,7 @@ """ import sys, os, math +from functools import reduce class ConvolutionalCode(object): -- To view, visit https://gerrit.osmocom.org/1180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:40:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 15:40:39 +0000 Subject: [MERGED] openbsc[master]: Decrease count_codecs logging verbosity In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Decrease count_codecs logging verbosity ...................................................................... Decrease count_codecs logging verbosity Use channel type name instead of number and log it with DEBUG facility otherwise it produces lots of irrelevant messages for SDCCH* Change-Id: I11b04e0cb02bf6ed01f6076cb31a56d8921d735e --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 9656961..f672750 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -112,8 +112,8 @@ break; } } else { - LOGP(DRSL, LOGL_ERROR, "count_codecs unknown lchan->type %x on channel %s\n", - lchan->type, gsm_ts_and_pchan_name(lchan->ts)); + LOGP(DRSL, LOGL_DEBUG, "count_codecs unknown lchan->type %s on channel %s\n", + gsm_lchant_name(lchan->type), gsm_ts_and_pchan_name(lchan->ts)); } } -- To view, visit https://gerrit.osmocom.org/1179 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I11b04e0cb02bf6ed01f6076cb31a56d8921d735e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 1 15:40:56 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 15:40:56 +0000 Subject: [MERGED] libosmocore[master]: Fix typo in osmo_fsm_log_addr() In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix typo in osmo_fsm_log_addr() ...................................................................... Fix typo in osmo_fsm_log_addr() Previously function parameter was ignored, fsm_log_addr was always set to false. Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8 --- M src/fsm.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/fsm.c b/src/fsm.c index 31ed194..f525f40 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -99,7 +99,7 @@ */ void osmo_fsm_log_addr(bool log_addr) { - fsm_log_addr = false; + fsm_log_addr = log_addr; } /*! \brief register a FSM with the core -- To view, visit https://gerrit.osmocom.org/1177 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I74f06eab2dfa81dbb95e01f0b4b26448fd1b98f8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 1 17:18:02 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 17:18:02 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL: add AMR HR support to scheduling check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1174 to look at the new patch set (#3). DTX DL: add AMR HR support to scheduling check superfemto.sh: Expand log converter to use case-insensitive matching to accommodate for spelling differences in DSP logs. Add strings/events specific to AMR HR. dtx_check.gawk: Remove redundand variables from output. Add checks specific to AMR HR. Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a --- M contrib/dtx_check.gawk M contrib/superfemto.sh 2 files changed, 38 insertions(+), 19 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/1174/3 diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 9e753e4..7ac8b6d 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -27,9 +27,17 @@ CHK = "FAIL: missing ONSET (" $2 ") after " TYPE "." ERR++ } - if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2) { + if ("SID_P1" == $2) { + CHK = "FAIL: regular AMR payload with FT SID and STI=0 (should be either pyaload Update or STI=1)." + ERR++ + } + if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2 || "FORCED_F_P2" == $2 || "FORCED_F_INH" == $2 || "FORCED_U_INH" == $2) { CHK = "FAIL: event " $2 " inserted by DSP." FORCE++ + ERR++ + } + if ("FIRST_P2" != $2 && "FIRST_P1" == TYPE) { + CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } if ("OK" == CHK) { # check inter-SID distances: @@ -65,7 +73,7 @@ if ("UPDATE" == $2 || "FIRST" == $2) { # silence SILENCE = 1 } - print $1, $2, CHK, TYPE, DELTA, SILENCE + print $1, $2, CHK if ($2 != "EMPTY") { # skip over EMPTY records TYPE = $2 FN = $1 diff --git a/contrib/superfemto.sh b/contrib/superfemto.sh index cb871c0..19dc410 100755 --- a/contrib/superfemto.sh +++ b/contrib/superfemto.sh @@ -19,21 +19,32 @@ ULST="_DecodeAndIdentify" # DL sed filters: -D_EMP='s/ Empty frame request!/EMPTY/' -D_FAC='s/ Coding a FACCH\/F frame !!/FACCH/' -D_FST='s/ Coding a RTP SID First frame !!/FIRST/' -D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/' -D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/' -D_ONS='s/ Coding a Onset frame !!/ONSET/' -D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/' -D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/' +D_EMP='s/ Empty frame request!/EMPTY/i' +D_FAC='s/ Coding a FACCH\/. frame !!/FACCH/i' +D_FST='s/ Coding a RTP SID First frame !!/FIRST/i' +D_FS1='s/ Coding a SID First P1 frame !!/FIRST_P1/i' +D_FS2='s/ Coding a SID First P2 frame !!/FIRST_P2/i' +D_RP1='s/ Coding a RTP SID P1 frame !!/SID_P1/i' +D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/i' +D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/i' +D_ONS='s/ Coding a Onset frame !!/ONSET/i' +D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/i' +D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/i' +D_FP2='s/ A speech frame is following a NoData or SID_FIRST_P2 without an Onset./FORCED_F_P2/i' +D_FIN='s/ A speech frame is following a SID_FIRST without inhibit. A SID_FIRST_INH will be inserted./FORCED_F_INH/i' +D_UIN='s/ A speech frame is following a SID_UPDATE without inhibit. A SID_UPDATE_INH will be inserted./FORCED_U_INH/i' # UL sed filters: -U_NOD='s/ It is a No Data frame !!/NODATA/' -U_ONS='s/ It is an ONSET frame !!/ONSET/' -U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/' -U_FST='s/ It is a SID FIRST frame !!/FIRST/' -U_SPE='s/ It is a SPEECH frame !!/SPEECH/' +U_NOD='s/ It is a No Data frame !!/NODATA/i' +U_ONS='s/ It is an ONSET frame !!/ONSET/i' +U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/i' +U_FST='s/ It is a SID FIRST frame !!/FIRST/i' +U_FP1='s/ It is a SID-First P1 frame !!/FIRST_P1/i' +U_FP2='s/ It is a SID-First P2 frame !!/FIRST_P2/i' +U_SPE='s/ It is a SPEECH frame *!!/SPEECH/i' +U_UIN='s/ It is a SID update InH frame !!/UPD_INH/i' +U_FIN='s/ It is a SID-First InH frame !!/FST_INH/i' +U_RAT='s/ It is a RATSCCH data frame !!/RATSCCH/i' DL () { # filter downlink-related entries grep $DLST $1 > $1.DL.tmp @@ -47,7 +58,7 @@ UL $1 FIX() { # add MO/MT marker from preceding line to inserted ONSETs so filtering works as expected - cat $1.DL.tmp | awk 'BEGIN{ FS="h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix + cat $1.DL.tmp | awk 'BEGIN{ FS=" h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix } FIX $1 @@ -66,7 +77,7 @@ MT $1.UL PREP() { # prepare logs for reformatting - cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1 + cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/\[ u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1 } PREP "$1.DL.MT" @@ -75,11 +86,11 @@ PREP "$1.UL.MO" RD() { # reformat DL logs for consistency checks - cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_UPD" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" > $1.tmp2 + cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_FS1" | sed "$D_FS2" | sed "$D_UIN" | sed "$D_FIN" | sed "$D_UPD" | sed "$D_INH" | sed "$D_RP1" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" | sed "$D_FP2" > $1.tmp2 } RU() { # reformat UL logs for consistency checks - cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" > $1.tmp2 + cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_FP1" | sed "$U_FP2" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" | sed "$U_UIN" | sed "$U_FIN" | sed "$U_RAT" > $1.tmp2 } RD "$1.DL.MT" -- To view, visit https://gerrit.osmocom.org/1174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 1 17:18:02 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 17:18:02 +0000 Subject: [PATCH] osmo-bts[master]: DTX fix ONSET handling In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1175 to look at the new patch set (#3). DTX fix ONSET handling * re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case multiple FACCH occur duriing DTX silence period. * produce ONSET event after both SID FIRST and UPDATE in case of AMR FR. * always dispatch E_SID_F (SID FIRST) signal if in talkspurt. * allow E_SID_* right after ONSET (zero-length talkspurt). * add missing E_ONSET signal description. * fix FSM transitions for AMR HR *Inhibited and First P*. * fix incorrect return from l1if_tch_encode() in ONSET FACCH with incoming SID UPDATE Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Related: OS#1801 --- M include/osmo-bts/dtx_dl_amr_fsm.h M src/common/bts.c M src/common/dtx_dl_amr_fsm.c M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 9 files changed, 66 insertions(+), 32 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/1175/3 diff --git a/include/osmo-bts/dtx_dl_amr_fsm.h b/include/osmo-bts/dtx_dl_amr_fsm.h index 5c13c19..8b19595 100644 --- a/include/osmo-bts/dtx_dl_amr_fsm.h +++ b/include/osmo-bts/dtx_dl_amr_fsm.h @@ -16,6 +16,7 @@ ST_U_INH, ST_SID_U, ST_ONSET_V, + ST_ONSET_F, ST_FACCH_V, ST_FACCH, }; diff --git a/src/common/bts.c b/src/common/bts.c index 6f621c4..2005e42 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -176,6 +177,8 @@ INIT_LLIST_HEAD(&btsb->smscb_state.queue); INIT_LLIST_HEAD(&btsb->oml_queue); + /* register DTX DL FSM */ + osmo_fsm_register(&dtx_dl_amr_fsm); return rc; } diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c index a75fd00..5075957 100644 --- a/src/common/dtx_dl_amr_fsm.c +++ b/src/common/dtx_dl_amr_fsm.c @@ -53,7 +53,7 @@ osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; case E_COMPL: osmo_fsm_inst_state_chg(fi, ST_SID_F2, 0, 0); @@ -81,7 +81,10 @@ osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); + break; + case E_ONSET: + osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -97,7 +100,7 @@ osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -110,7 +113,7 @@ { switch (event) { case E_VOICE: - osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); @@ -126,7 +129,7 @@ { switch (event) { case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; case E_VOICE: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); @@ -152,6 +155,7 @@ void dtx_fsm_onset_v(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { + case E_SID_F: case E_SID_U: case E_VOICE: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); @@ -169,6 +173,7 @@ void dtx_fsm_onset_f(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { + case E_SID_F: case E_SID_U: break; case E_VOICE: @@ -234,15 +239,15 @@ start of silence period (might be interrupted in case of AMR HR) */ [ST_SID_F1]= { .in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_COMPL) | X(E_INHIB) | X(E_ONSET), - .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V), + .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V), .name = "SID-FIRST (P1)", .action = dtx_fsm_sid_f1, }, /* SID-FIRST P2 (only for AMR HR): actual start of silence period in case of AMR HR*/ [ST_SID_F2]= { - .in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH), + .in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_ONSET), + .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_ONSET_V), .name = "SID-FIRST (P2)", .action = dtx_fsm_sid_f2, }, @@ -258,23 +263,30 @@ incoming SPEECH or FACCH (only for AMR HR) */ [ST_U_INH]= { .in_event_mask = X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), + .out_state_mask = X(ST_VOICE) | X(ST_FACCH), .name = "SID-UPDATE (Inh)", .action = dtx_fsm_u_inh, }, /* Silence period with periodic comfort noise data updates */ [ST_SID_U]= { .in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_INHIB) | X(E_SID_U) | X(E_SID_F) | X(E_ONSET), - .out_state_mask = X(ST_FACCH) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V), + .out_state_mask = X(ST_ONSET_F) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V), .name = "SID-UPDATE", .action = dtx_fsm_sid_upd, }, /* ONSET - end of silent period due to incoming SPEECH frame */ [ST_ONSET_V]= { - .in_event_mask = X(E_VOICE) | X(E_FACCH), + .in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH), .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), .name = "ONSET (SPEECH)", .action = dtx_fsm_onset_v, + }, + /* ONSET - end of silent period due to incoming FACCH frame */ + [ST_ONSET_F]= { + .in_event_mask = X(E_VOICE) | X(E_FACCH) | X(E_SID_U) | X(E_SID_F), + .out_state_mask = X(ST_VOICE) | X(ST_FACCH), + .name = "ONSET (FACCH)", + .action = dtx_fsm_onset_f, }, /* FACCH sending state: SPEECH was observed before so once we're done FSM should get back to VOICE state */ @@ -296,6 +308,7 @@ const struct value_string dtx_dl_amr_fsm_event_names[] = { { E_VOICE, "Voice" }, + { E_ONSET, "ONSET" }, { E_FACCH, "FACCH" }, { E_COMPL, "Complete P1 -> P2" }, { E_INHIB, "Inhibit" }, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 13d8a94..ef24800 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1145,10 +1145,12 @@ /* Init DTX DL FSM if necessary */ //FIXME: only do it for AMR TCH/* - osmo_fsm_register(&dtx_dl_amr_fsm); - lchan->tch.dtx.dl_amr_fsm = osmo_fsm_inst_alloc(&dtx_dl_amr_fsm, - tall_bts_ctx, lchan, - LOGL_DEBUG, lchan->name); + if (trx->bts->dtxd) + lchan->tch.dtx.dl_amr_fsm = osmo_fsm_inst_alloc(&dtx_dl_amr_fsm, + tall_bts_ctx, + lchan, + LOGL_DEBUG, + lchan->name); return 0; } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 4b21366..851aacb 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -33,6 +33,8 @@ #include #include +#define STI_BIT_MASK 16 + static int check_fom(struct abis_om_hdr *omh, size_t len) { if (omh->length != len) { @@ -182,14 +184,15 @@ return 0; if (osmo_amr_is_speech(ft)) { - if (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 || - lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) /* AMR HR */ - if (lchan->type == GSM_LCHAN_TCH_H && marker) - return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_INHIB, - (void *)lchan); - /* AMR FR */ - if (marker && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) + /* AMR HR - Inhibition */ + if (lchan->type == GSM_LCHAN_TCH_H && marker && + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1) + return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, + E_INHIB, (void *)lchan); + /* AMR FR & HR - generic */ + if (marker && (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 || + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F2 || + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U )) return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_ONSET, (void *)lchan); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_VOICE, @@ -198,6 +201,9 @@ if (ft == AMR_SID) { dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, sti); + if (lchan->tch.dtx.dl_amr_fsm->state == ST_VOICE) + return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, + E_SID_F, (void *)lchan); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, sti ? E_SID_U : E_SID_F, (void *)lchan); @@ -215,6 +221,16 @@ return 0; } +static inline void dtx_sti_set(struct gsm_lchan *lchan) +{ + lchan->tch.dtx.cache[6 + 2] |= STI_BIT_MASK; +} +/* STI is located in payload byte 6, cache contains 2 byte prefix (CMR/CMI) */ +static inline void dtx_sti_unset(struct gsm_lchan *lchan) +{ + lchan->tch.dtx.cache[6 + 2] &= ~STI_BIT_MASK; +} + /*! \brief Check if enough time has passed since last SID (if any) to repeat it * \param[in] lchan Logical channel on which we check scheduling * \param[in] fn Frame Number for which we check scheduling @@ -226,9 +242,10 @@ uint32_t dx26 = 120 * (fn - lchan->tch.dtx.fn); /* We're resuming after FACCH interruption */ - if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { /* force STI bit to 0 so cache is treated as SID FIRST */ - lchan->tch.dtx.cache[6 + 2] &= ~16; + dtx_sti_unset(lchan); lchan->tch.dtx.is_update = false; osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_SID_F, (void *)lchan); @@ -306,7 +323,7 @@ lchan->tch.dtx.fn = fn; /* enforce SID UPDATE for next repetition - it might have been altered by FACCH handling */ - lchan->tch.dtx.cache[6 + 2] |= 16; + dtx_sti_set(lchan); if (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) lchan->tch.dtx.is_update = true; return lchan->tch.dtx.len + 1; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 795172b..0b1bad4 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -410,7 +410,7 @@ memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; } diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 70764f5..4337d68 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -328,8 +328,7 @@ return -EAGAIN; case ST_FACCH_V: case ST_FACCH: - /* FIXME: if this possible at all? */ - return 0; + return -EBADMSG; default: LOGP(DRTP, LOGL_ERROR, "Unhandled DTX DL AMR FSM state " "%d\n", lchan->tch.dtx.dl_amr_fsm->state); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f7585ce..51bde8b 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -405,7 +405,7 @@ memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; } diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index fbb42b2..db5ca78 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -426,8 +426,7 @@ return -EAGAIN; case ST_FACCH_V: case ST_FACCH: - /* FIXME: if this possible at all? */ - return 0; + return -EBADMSG; default: LOGP(DRTP, LOGL_ERROR, "Unhandled DTX DL AMR FSM state " "%d\n", lchan->tch.dtx.dl_amr_fsm->state); -- To view, visit https://gerrit.osmocom.org/1175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 1 17:53:46 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 17:53:46 +0000 Subject: osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Patch Set 5: I don't think SAPI is exposed here - it was and remains an implementation details. Look at the changes in common/* in this patch: the BTS have to expose enqueue*rel_marker() functions which can be implemented in any way (with or without SAPI queue). I can change the name of the functions to make it clearer but it would make patch bigger. What would be better name for those? -- To view, visit https://gerrit.osmocom.org/1046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 17:55:13 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 1 Nov 2016 17:55:13 +0000 Subject: [PATCH] osmo-bts[master]: Fix AGCH/PCH proportional allocation In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1099 to look at the new patch set (#2). Fix AGCH/PCH proportional allocation Do not assume that 1 == BS_AG_BLKS_RES but take that information from SI3. Note: due to current implementation quirks we activate channels before SI3 obtained, than we deactivate channels upon receiving SI3 and activate them again. This might not be necessary once we migrate to proper OML state machines. This affects lc15 and sysmo hw. Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Related: OS#1575 --- M include/osmo-bts/bts.h M include/osmo-bts/rsl.h M src/common/l1sap.c M src/common/paging.c M src/common/rsl.c M src/common/sysinfo.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/oml.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/oml.c 10 files changed, 44 insertions(+), 50 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/99/1099/2 diff --git a/include/osmo-bts/bts.h b/include/osmo-bts/bts.h index ec58edd..567772e 100644 --- a/include/osmo-bts/bts.h +++ b/include/osmo-bts/bts.h @@ -36,7 +36,7 @@ int lchan_init_lapdm(struct gsm_lchan *lchan); void load_timer_start(struct gsm_bts *bts); - +uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg); void bts_update_status(enum bts_global_status which, int on); int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx); diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 4311ffd..3ec314a 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -9,6 +9,7 @@ LCHAN_REL_ACT_RSL, LCHAN_REL_ACT_PCU, LCHAN_REL_ACT_OML, + LCHAN_REL_ACT_REACT, }; #define LCHAN_FN_DUMMY 0xFFFFFFFF diff --git a/src/common/l1sap.c b/src/common/l1sap.c index c944874..3276555 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -205,7 +205,8 @@ /* send primitive as gsmtap */ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *ss, uint32_t fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len, + uint8_t num_agch) { struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr, link_id; @@ -229,10 +230,9 @@ } else if (L1SAP_IS_CHAN_BCCH(chan_nr)) { *chan_type = GSMTAP_CHANNEL_BCCH; } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { -#warning Set BS_AG_BLKS_RES /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ - if (L1SAP_FN2CCCHBLOCK(fn) >= 1) + if (L1SAP_FN2CCCHBLOCK(fn) >= num_agch) *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; @@ -312,7 +312,7 @@ &len); else rc = gsmtap_ph_data(l1sap, &chan_type, &ss, fn, &data, - &len); + &len, num_agch(trx, "GSMTAP")); break; case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION): rc = gsmtap_ph_rach(l1sap, &chan_type, &tn, &ss, &fn, &data, @@ -617,10 +617,9 @@ } } else if (L1SAP_IS_CHAN_AGCH_PCH(chan_nr)) { p = msgb_put(msg, GSM_MACBLOCK_LEN); -#warning "TODO: Yet another assumption that BS_AG_BLKS_RES=1" - /* if CCCH block is 0, it is AGCH */ rc = bts_ccch_copy_msg(trx->bts, p, &g_time, - (L1SAP_FN2CCCHBLOCK(fn) < 1)); + (L1SAP_FN2CCCHBLOCK(fn) < + num_agch(trx, "PH-RTS-IND"))); if (rc <= 0) memcpy(p, fill_frame, GSM_MACBLOCK_LEN); } diff --git a/src/common/paging.c b/src/common/paging.c index f75f12d..957d609 100644 --- a/src/common/paging.c +++ b/src/common/paging.c @@ -538,12 +538,6 @@ struct paging_state *ps = btsb->paging_state; struct gsm48_system_information_type_3 *si3 = (void *) bts->si_buf[SYSINFO_TYPE_3]; -#warning "TODO: Remove this when setting u8NbrOfAgch is implemented properly" - if (si3->control_channel_desc.bs_ag_blks_res != 1) - LOGP(DPAG, LOGL_ERROR, - "Paging: BS_AG_BLKS_RES = %d != 1 not fully supported\n", - si3->control_channel_desc.bs_ag_blks_res); - paging_si_update(ps, &si3->control_channel_desc); } return 0; diff --git a/src/common/rsl.c b/src/common/rsl.c index 6c8f5cc..af8939a 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -295,6 +295,14 @@ LOGP(DRSL, LOGL_INFO, " Rx RSL BCCH INFO (SI%s)\n", get_value_string(osmo_sitype_strs, osmo_si)); + if (SYSINFO_TYPE_3 == osmo_si && trx->nr == 0 && + num_agch(trx, "RSL") != 1) { + lchan_deactivate(&trx->bts->c0->ts[0].lchan[CCCH_LCHAN]); + /* will be reactivated by sapi_deactivate_cb() */ + trx->bts->c0->ts[0].lchan[CCCH_LCHAN].rel_act_kind = + LCHAN_REL_ACT_REACT; + } + if (SYSINFO_TYPE_2quater == osmo_si) { si2q = (struct gsm48_system_information_type_2quater *) bts->si_buf[SYSINFO_TYPE_2quater]; diff --git a/src/common/sysinfo.c b/src/common/sysinfo.c index ee42da2..d0a476d 100644 --- a/src/common/sysinfo.c +++ b/src/common/sysinfo.c @@ -22,6 +22,7 @@ #include #include +#include #include #define BTS_HAS_SI(bts, sinum) ((bts)->si_valid & (1 << sinum)) @@ -132,6 +133,19 @@ return NULL; } +uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg) +{ + struct gsm_bts *b = trx->bts; + struct gsm48_system_information_type_3 *si3; + if (BTS_HAS_SI(b, SYSINFO_TYPE_3)) { + si3 = GSM_BTS_SI(b, SYSINFO_TYPE_3); + return si3->control_channel_desc.bs_ag_blks_res; + } + LOGP(DL1P, LOGL_ERROR, "%s: Unable to determine actual BS_AG_BLKS_RES " + "value as SI3 is not available yet, fallback to 1\n", arg); + return 1; +} + uint8_t *lchan_sacch_get(struct gsm_lchan *lchan) { uint32_t tmp; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 795172b..0662fd5 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -1181,22 +1181,6 @@ return l1if_handle_ind(fl1h, msg); } -#if 0 -/* called by RSL if the BCCH SI has been modified */ -int sysinfo_has_changed(struct gsm_bts *bts, int si) -{ - /* FIXME: Determine BS_AG_BLKS_RES and - * * set cfgParams.u.agch.u8NbrOfAgch - * * determine implications on paging - */ - /* FIXME: Check for Extended BCCH presence */ - /* FIXME: Check for CCCH_CONF */ - /* FIXME: Check for BS_PA_MFRMS: update paging */ - - return 0; -} -#endif - static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) { diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 453f53a..61db0c8 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1023,8 +1023,7 @@ lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic; break; case GsmL1_Sapi_Agch: -#warning Set BS_AG_BLKS_RES - lch_par->agch.u8NbrOfAgch = 1; + lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx, lchan->name); break; case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: @@ -1564,6 +1563,12 @@ lchan_set_state(lchan, LCHAN_S_NONE); mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0); + + /* Reactivate CCCH due to SI3 update in RSL */ + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + lchan_activate(lchan); + } return 0; } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f7585ce..3596eb4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -1169,22 +1169,6 @@ return l1if_handle_ind(fl1h, msg); } -#if 0 -/* called by RSL if the BCCH SI has been modified */ -int sysinfo_has_changed(struct gsm_bts *bts, int si) -{ - /* FIXME: Determine BS_AG_BLKS_RES and - * * set cfgParams.u.agch.u8NbrOfAgch - * * determine implications on paging - */ - /* FIXME: Check for Extended BCCH presence */ - /* FIXME: Check for CCCH_CONF */ - /* FIXME: Check for BS_PA_MFRMS: update paging */ - - return 0; -} -#endif - static int activate_rf_compl_cb(struct gsm_bts_trx *trx, struct msgb *resp, void *data) { diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index fd03e22..16e6cd3 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1038,8 +1038,7 @@ lch_par->rach.u8Bsic = lchan->ts->trx->bts->bsic; break; case GsmL1_Sapi_Agch: -#warning Set BS_AG_BLKS_RES - lch_par->agch.u8NbrOfAgch = 1; + lch_par->agch.u8NbrOfAgch = num_agch(lchan->ts->trx, lchan->name); break; case GsmL1_Sapi_TchH: case GsmL1_Sapi_TchF: @@ -1584,6 +1583,12 @@ lchan_set_state(lchan, LCHAN_S_NONE); mph_info_chan_confirm(lchan, PRIM_INFO_DEACTIVATE, 0); + + /* Reactivate CCCH due to SI3 update in RSL */ + if (lchan->rel_act_kind == LCHAN_REL_ACT_REACT) { + lchan->rel_act_kind = LCHAN_REL_ACT_RSL; + lchan_activate(lchan); + } return 0; } -- To view, visit https://gerrit.osmocom.org/1099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:53:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:53:15 +0000 Subject: [PATCH] openbsc[master]: mncc_builtin: Properly reject DTMF Message-ID: Review at https://gerrit.osmocom.org/1181 mncc_builtin: Properly reject DTMF As per TS 23.014, a GSM MSC must implement mobile-originated DTMF generation. We gate the DTMF signalling messages to MNCC, and expect the external MNCC handler to deal with it. However, the internal MNCC handler simply ignored such singalling messages, rather than rejecting DTMF altogether. It turns out failure to respond to START DTMF will cause some phones to behave in interesting ways, particularly with modem firmware v6.01.00, see https://osmocom.org/issues/1817). In this case the phone is not able to release the call as the pending response to the START DTMF is probably keping a reference or lock of some sort. Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac --- M openbsc/src/libmsc/mncc_builtin.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/81/1181/1 diff --git a/openbsc/src/libmsc/mncc_builtin.c b/openbsc/src/libmsc/mncc_builtin.c index 9b25ede..067cc92 100644 --- a/openbsc/src/libmsc/mncc_builtin.c +++ b/openbsc/src/libmsc/mncc_builtin.c @@ -386,8 +386,10 @@ case MNCC_FACILITY_IND: break; case MNCC_START_DTMF_IND: + rc = mncc_tx_to_cc(net, MNCC_START_DTMF_REJ, data); break; case MNCC_STOP_DTMF_IND: + rc = mncc_tx_to_cc(net, MNCC_STOP_DTMF_RSP, data); break; case MNCC_MODIFY_IND: mncc_set_cause(data, GSM48_CAUSE_LOC_PRN_S_LU, -- To view, visit https://gerrit.osmocom.org/1181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:53:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:53:50 +0000 Subject: openbsc[master]: mncc_builtin: Properly reject DTMF In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:54:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:54:53 +0000 Subject: libosmocore[master]: utils/conv_gen.py: don't mix print and write() In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:55:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:55:04 +0000 Subject: libosmocore[master]: utils/conv_gen.py: explicitly import reduce() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:56:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:56:24 +0000 Subject: [MERGED] openbsc[master]: OML: Improve OML attribute handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OML: Improve OML attribute handling ...................................................................... OML: Improve OML attribute handling the OML attribute tables are hardcoded. To set variable parameters, the hardcoded data structure (tlv) is patched on byte level during runtime. This patch replaces this mechanism. - Replace hardcoded OML attribute tables with dynamically generated TLV structures. - Add unit tests to check if the OML attribute tables are generated correctly - Put OML attribute table generator code in a separate file: bts_ipaccess_nanobts_omlattr.c Change-Id: Ibeb34a84912d6cf695f553a34c69320fca7d08fa --- M openbsc/.gitignore M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h M openbsc/src/libbsc/Makefile.am M openbsc/src/libbsc/bts_ipaccess_nanobts.c A openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c M openbsc/tests/Makefile.am A openbsc/tests/nanobts_omlattr/Makefile.am A openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c A openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok M openbsc/tests/testsuite.at 12 files changed, 638 insertions(+), 221 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/.gitignore b/openbsc/.gitignore index 6fbd463..3324069 100644 --- a/openbsc/.gitignore +++ b/openbsc/.gitignore @@ -85,6 +85,7 @@ tests/sndcp_xid/sndcp_xid_test tests/slhc/slhc_test tests/v42bis/v42bis_test +tests/nanobts_omlattr/nanobts_omlattr_test tests/atconfig tests/atlocal diff --git a/openbsc/configure.ac b/openbsc/configure.ac index e2575c1..b18ecc1 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -244,6 +244,7 @@ tests/sndcp_xid/Makefile tests/slhc/Makefile tests/v42bis/Makefile + tests/nanobts_omlattr/Makefile doc/Makefile doc/examples/Makefile Makefile) diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index c6a0149..5737a4b 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -11,6 +11,7 @@ bsc_nat_sccp.h \ bsc_rll.h \ bss.h \ + bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ crc24.h \ ctrl.h \ diff --git a/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h b/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h new file mode 100644 index 0000000..bc7860b --- /dev/null +++ b/openbsc/include/openbsc/bts_ipaccess_nanobts_omlattr.h @@ -0,0 +1,32 @@ +/* OML attribute table generator for ipaccess nanobts */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#pragma once + +#include +#include + +struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts); +struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts); +struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts); +struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts); +struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, + struct gsm_bts_trx *trx); diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am index 4728e23..8c53817 100644 --- a/openbsc/src/libbsc/Makefile.am +++ b/openbsc/src/libbsc/Makefile.am @@ -49,5 +49,6 @@ bsc_ctrl_lookup.c \ net_init.c \ bsc_dyn_ts.c \ + bts_ipaccess_nanobts_omlattr.c \ $(NULL) diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts.c b/openbsc/src/libbsc/bts_ipaccess_nanobts.c index a6c8e29..a1bde77 100644 --- a/openbsc/src/libbsc/bts_ipaccess_nanobts.c +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts.c @@ -39,6 +39,7 @@ #include #include #include +#include extern struct gsm_network *bsc_gsmnet; @@ -100,211 +101,6 @@ }, }; -static unsigned char nanobts_attr_bts[] = { - NM_ATT_INTERF_BOUND, 0x55, 0x5b, 0x61, 0x67, 0x6d, 0x73, - /* interference avg. period in numbers of SACCH multifr */ - NM_ATT_INTAVE_PARAM, 0x06, - /* conn fail based on SACCH error rate */ - NM_ATT_CONN_FAIL_CRIT, 0x00, 0x02, 0x01, 0x10, - NM_ATT_T200, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, 0xa8, - NM_ATT_MAX_TA, 0x3f, - NM_ATT_OVERL_PERIOD, 0x00, 0x01, 10, /* seconds */ - NM_ATT_CCCH_L_T, 10, /* percent */ - NM_ATT_CCCH_L_I_P, 1, /* seconds */ - NM_ATT_RACH_B_THRESH, 10, /* busy threshold in - dBm */ - NM_ATT_LDAVG_SLOTS, 0x03, 0xe8, /* rach load averaging 1000 slots */ - NM_ATT_BTS_AIR_TIMER, 128, /* miliseconds */ - NM_ATT_NY1, 10, /* 10 retransmissions of physical config */ - NM_ATT_BCCH_ARFCN, HARDCODED_ARFCN >> 8, HARDCODED_ARFCN & 0xff, - NM_ATT_BSIC, HARDCODED_BSIC, - NM_ATT_IPACC_CGI, 0, 7, 0x00, 0xf1, 0x10, 0x00, 0x01, 0x00, 0x00, -}; - -static unsigned char nanobts_attr_radio[] = { - NM_ATT_RF_MAXPOWR_R, 0x0c, /* number of -2dB reduction steps / Pn */ - NM_ATT_ARFCN_LIST, 0x00, 0x02, HARDCODED_ARFCN >> 8, HARDCODED_ARFCN & 0xff, -}; - -static unsigned char nanobts_attr_nse[] = { - NM_ATT_IPACC_NSEI, 0, 2, 0x03, 0x9d, /* NSEI 925 */ - /* all timers in seconds */ - NM_ATT_IPACC_NS_CFG, 0, 7, 3, /* (un)blocking timer (Tns-block) */ - 3, /* (un)blocking retries */ - 3, /* reset timer (Tns-reset) */ - 3, /* reset retries */ - 30, /* test timer (Tns-test) */ - 3, /* alive timer (Tns-alive) */ - 10, /* alive retrires */ - /* all timers in seconds, unless otherwise stated */ - NM_ATT_IPACC_BSSGP_CFG, 0, 11, - 3, /* blockimg timer (T1) */ - 3, /* blocking retries */ - 3, /* unblocking retries */ - 3, /* reset timer (T2) */ - 3, /* reset retries */ - 10, /* suspend timer (T3) in 100ms */ - 3, /* suspend retries */ - 10, /* resume timer (T4) in 100ms */ - 3, /* resume retries */ - 10, /* capability update timer (T5) */ - 3, /* capability update retries */ -}; - -static unsigned char nanobts_attr_cell[] = { - NM_ATT_IPACC_RAC, 0, 1, 1, /* routing area code */ - NM_ATT_IPACC_GPRS_PAGING_CFG, 0, 2, - 5, /* repeat time (50ms) */ - 3, /* repeat count */ - NM_ATT_IPACC_BVCI, 0, 2, 0x03, 0x9d, /* BVCI 925 */ - /* all timers in seconds, unless otherwise stated */ - NM_ATT_IPACC_RLC_CFG, 0, 9, - 20, /* T3142 */ - 5, /* T3169 */ - 5, /* T3191 */ - 160, /* T3193 (units of 10ms) */ - 5, /* T3195 */ - 10, /* N3101 */ - 4, /* N3103 */ - 8, /* N3105 */ - 15, /* RLC CV countdown */ - NM_ATT_IPACC_CODING_SCHEMES, 0, 2, 0x0f, 0x00, /* CS1..CS4 */ - NM_ATT_IPACC_RLC_CFG_2, 0, 5, - 0x00, 250, /* T downlink TBF extension (0..500) */ - 0x00, 250, /* T uplink TBF extension (0..500) */ - 2, /* CS2 */ -#if 0 - /* EDGE model only, breaks older models. - * Should inquire the BTS capabilities */ - NM_ATT_IPACC_RLC_CFG_3, 0, 1, - 2, /* MCS2 */ -#endif -}; - -static unsigned char nanobts_attr_nsvc0[] = { - NM_ATT_IPACC_NSVCI, 0, 2, 0x03, 0x9d, /* 925 */ - NM_ATT_IPACC_NS_LINK_CFG, 0, 8, - 0x59, 0xd8, /* remote udp port (23000) */ - 192, 168, 100, 11, /* remote ip address */ - 0x59, 0xd8, /* local udp port (23000) */ -}; - -static void patch_16(uint8_t *data, const uint16_t val) -{ - memcpy(data, &val, sizeof(val)); -} - -static void patch_32(uint8_t *data, const uint32_t val) -{ - memcpy(data, &val, sizeof(val)); -} - -/* - * Patch the various SYSTEM INFORMATION tables to update - * the LAI - */ -static void patch_nm_tables(struct gsm_bts *bts) -{ - uint8_t arfcn_low = bts->c0->arfcn & 0xff; - uint8_t arfcn_high = (bts->c0->arfcn >> 8) & 0x0f; - - /* patch ARFCN into BTS Attributes */ - nanobts_attr_bts[42] &= 0xf0; - nanobts_attr_bts[42] |= arfcn_high; - nanobts_attr_bts[43] = arfcn_low; - - /* patch the RACH attributes */ - if (bts->rach_b_thresh != -1) { - nanobts_attr_bts[33] = bts->rach_b_thresh & 0xff; - } - - if (bts->rach_ldavg_slots != -1) { - uint8_t avg_high = bts->rach_ldavg_slots & 0xff; - uint8_t avg_low = (bts->rach_ldavg_slots >> 8) & 0x0f; - - nanobts_attr_bts[35] = avg_high; - nanobts_attr_bts[36] = avg_low; - } - - /* patch BSIC */ - nanobts_attr_bts[sizeof(nanobts_attr_bts)-11] = bts->bsic; - - /* patch CGI */ - abis_nm_ipaccess_cgi(nanobts_attr_bts+sizeof(nanobts_attr_bts)-7, bts); - - /* patch CON_FAIL_CRIT */ - nanobts_attr_bts[13] = - get_radio_link_timeout(&bts->si_common.cell_options); - - /* patch the power reduction */ - nanobts_attr_radio[1] = bts->c0->max_power_red / 2; - - /* patch NSEI */ - nanobts_attr_nse[3] = bts->gprs.nse.nsei >> 8; - nanobts_attr_nse[4] = bts->gprs.nse.nsei & 0xff; - memcpy(nanobts_attr_nse+8, bts->gprs.nse.timer, - ARRAY_SIZE(bts->gprs.nse.timer)); - memcpy(nanobts_attr_nse+18, bts->gprs.cell.timer, - ARRAY_SIZE(bts->gprs.cell.timer)); - - /* patch NSVCI */ - nanobts_attr_nsvc0[3] = bts->gprs.nsvc[0].nsvci >> 8; - nanobts_attr_nsvc0[4] = bts->gprs.nsvc[0].nsvci & 0xff; - - /* patch IP address as SGSN IP */ - patch_16(nanobts_attr_nsvc0 + 8, - htons(bts->gprs.nsvc[0].remote_port)); - patch_32(nanobts_attr_nsvc0 + 10, - htonl(bts->gprs.nsvc[0].remote_ip)); - patch_16(nanobts_attr_nsvc0 + 14, - htons(bts->gprs.nsvc[0].local_port)); - - /* patch BVCI */ - nanobts_attr_cell[12] = bts->gprs.cell.bvci >> 8; - nanobts_attr_cell[13] = bts->gprs.cell.bvci & 0xff; - /* patch RAC */ - nanobts_attr_cell[3] = bts->gprs.rac; - - if (bts->gprs.mode == BTS_GPRS_EGPRS) { - /* patch EGPRS coding schemes MCS 1..9 */ - nanobts_attr_cell[29] = 0x8f; - nanobts_attr_cell[30] = 0xff; - } -} - -static uint8_t *nanobts_attr_bts_get(struct gsm_bts *bts, size_t *data_len) -{ - patch_nm_tables(bts); - *data_len = sizeof(nanobts_attr_bts); - return nanobts_attr_bts; -} - -static uint8_t *nanobts_attr_nse_get(struct gsm_bts *bts, size_t *data_len) -{ - patch_nm_tables(bts); - *data_len = sizeof(nanobts_attr_nse); - return nanobts_attr_nse; -} - -static uint8_t *nanobts_attr_cell_get(struct gsm_bts *bts, size_t *data_len) -{ - patch_nm_tables(bts); - *data_len = sizeof(nanobts_attr_cell); - return nanobts_attr_cell; -} - -static uint8_t *nanobts_attr_nscv_get(struct gsm_bts *bts, size_t *data_len) -{ - patch_nm_tables(bts); - *data_len = sizeof(nanobts_attr_nsvc0); - return nanobts_attr_nsvc0; -} - -static uint8_t *nanobts_attr_radio_get(struct gsm_bts *bts, size_t *data_len) -{ - patch_nm_tables(bts); - *data_len = sizeof(nanobts_attr_radio); - return nanobts_attr_radio; -} /* Callback function to be called whenever we get a GSM 12.21 state change event */ static int nm_statechg_event(int evt, struct nm_statechg_signal_data *nsd) @@ -318,8 +114,7 @@ struct gsm_bts_trx_ts *ts; struct gsm_bts_gprs_nsvc *nsvc; - uint8_t *data; - size_t data_len; + struct msgb *msgb; if (!is_ipaccess_bts(nsd->bts)) return 0; @@ -343,8 +138,9 @@ case NM_OC_BTS: bts = obj; if (new_state->availability == NM_AVSTATE_DEPENDENCY) { - data = nanobts_attr_bts_get(bts, &data_len); - abis_nm_set_bts_attr(bts, data, data_len); + msgb = nanobts_attr_bts_get(bts); + abis_nm_set_bts_attr(bts, msgb->data, msgb->len); + msgb_free(msgb); abis_nm_chg_adm_state(bts, obj_class, bts->bts_nr, 0xff, 0xff, NM_STATE_UNLOCKED); @@ -385,9 +181,11 @@ if (bts->gprs.mode == BTS_GPRS_NONE) break; if (new_state->availability == NM_AVSTATE_DEPENDENCY) { - data = nanobts_attr_nse_get(bts, &data_len); + msgb = nanobts_attr_nse_get(bts); abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr, - 0xff, 0xff, data, data_len); + 0xff, 0xff, msgb->data, + msgb->len); + msgb_free(msgb); abis_nm_opstart(bts, obj_class, bts->bts_nr, 0xff, 0xff); } @@ -397,9 +195,11 @@ if (bts->gprs.mode == BTS_GPRS_NONE) break; if (new_state->availability == NM_AVSTATE_DEPENDENCY) { - data = nanobts_attr_cell_get(bts, &data_len); + msgb = nanobts_attr_cell_get(bts); abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr, - 0, 0xff, data, data_len); + 0, 0xff, msgb->data, + msgb->len); + msgb_free(msgb); abis_nm_opstart(bts, obj_class, bts->bts_nr, 0, 0xff); abis_nm_chg_adm_state(bts, obj_class, bts->bts_nr, @@ -418,10 +218,11 @@ break; if ((new_state->availability == NM_AVSTATE_OFF_LINE) || (new_state->availability == NM_AVSTATE_DEPENDENCY)) { - data = nanobts_attr_nscv_get(bts, &data_len); + msgb = nanobts_attr_nscv_get(bts); abis_nm_ipaccess_set_attr(bts, obj_class, bts->bts_nr, nsvc->id, 0xff, - data, data_len); + msgb->data, msgb->len); + msgb_free(msgb); abis_nm_opstart(bts, obj_class, bts->bts_nr, nsvc->id, 0xff); abis_nm_chg_adm_state(bts, obj_class, bts->bts_nr, @@ -471,12 +272,9 @@ */ int rc_state = trx->mo.nm_state.administrative; /* Patch ARFCN into radio attribute */ - size_t data_len; - uint8_t *data = nanobts_attr_radio_get(trx->bts, &data_len); - data[5] &= 0xf0; - data[5] |= trx->arfcn >> 8; - data[6] = trx->arfcn & 0xff; - abis_nm_set_radio_attr(trx, data, data_len); + struct msgb *msgb = nanobts_attr_radio_get(trx->bts, trx); + abis_nm_set_radio_attr(trx, msgb->data, msgb->len); + msgb_free(msgb); abis_nm_chg_adm_state(trx->bts, foh->obj_class, trx->bts->bts_nr, trx->nr, 0xff, rc_state); diff --git a/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c new file mode 100644 index 0000000..0291129 --- /dev/null +++ b/openbsc/src/libbsc/bts_ipaccess_nanobts_omlattr.c @@ -0,0 +1,232 @@ +/* ip.access nanoBTS specific code, OML attribute table generator */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +static void patch_16(uint8_t *data, const uint16_t val) +{ + memcpy(data, &val, sizeof(val)); +} + +static void patch_32(uint8_t *data, const uint32_t val) +{ + memcpy(data, &val, sizeof(val)); +} + +struct msgb *nanobts_attr_bts_get(struct gsm_bts *bts) +{ + struct msgb *msgb; + uint8_t buf[256]; + msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + memcpy(buf, "\x55\x5b\x61\x67\x6d\x73", 6); + msgb_tv_fixed_put(msgb, NM_ATT_INTERF_BOUND, 6, buf); + + /* interference avg. period in numbers of SACCH multifr */ + msgb_tv_put(msgb, NM_ATT_INTAVE_PARAM, 0x06); + + /* conn fail based on SACCH error rate */ + buf[0] = 0x01; + buf[1] = get_radio_link_timeout(&bts->si_common.cell_options); + msgb_tl16v_put(msgb, NM_ATT_CONN_FAIL_CRIT, 2, buf); + + memcpy(buf, "\x1e\x24\x24\xa8\x34\x21\xa8", 7); + msgb_tv_fixed_put(msgb, NM_ATT_T200, 7, buf); + + msgb_tv_put(msgb, NM_ATT_MAX_TA, 0x3f); + + /* seconds */ + memcpy(buf, "\x00\x01\x0a", 3); + msgb_tv_fixed_put(msgb, NM_ATT_OVERL_PERIOD, 3, buf); + + /* percent */ + msgb_tv_put(msgb, NM_ATT_CCCH_L_T, 10); + + /* seconds */ + msgb_tv_put(msgb, NM_ATT_CCCH_L_I_P, 1); + + /* busy threshold in - dBm */ + buf[0] = 10; + if (bts->rach_b_thresh != -1) + buf[0] = bts->rach_b_thresh & 0xff; + msgb_tv_put(msgb, NM_ATT_RACH_B_THRESH, buf[0]); + + /* rach load averaging 1000 slots */ + buf[0] = 0x03; + buf[1] = 0xe8; + if (bts->rach_ldavg_slots != -1) { + buf[0] = (bts->rach_ldavg_slots >> 8) & 0x0f; + buf[1] = bts->rach_ldavg_slots & 0xff; + } + msgb_tv_fixed_put(msgb, NM_ATT_LDAVG_SLOTS, 2, buf); + + /* miliseconds */ + msgb_tv_put(msgb, NM_ATT_BTS_AIR_TIMER, 128); + + /* 10 retransmissions of physical config */ + msgb_tv_put(msgb, NM_ATT_NY1, 10); + + buf[0] = (bts->c0->arfcn >> 8) & 0x0f; + buf[1] = bts->c0->arfcn & 0xff; + msgb_tv_fixed_put(msgb, NM_ATT_BCCH_ARFCN, 2, buf); + + msgb_tv_put(msgb, NM_ATT_BSIC, bts->bsic); + + abis_nm_ipaccess_cgi(buf, bts); + msgb_tl16v_put(msgb, NM_ATT_IPACC_CGI, 7, buf); + + return msgb; +} + +struct msgb *nanobts_attr_nse_get(struct gsm_bts *bts) +{ + struct msgb *msgb; + uint8_t buf[256]; + msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + /* NSEI 925 */ + buf[0] = bts->gprs.nse.nsei >> 8; + buf[1] = bts->gprs.nse.nsei & 0xff; + msgb_tl16v_put(msgb, NM_ATT_IPACC_NSEI, 2, buf); + + /* all timers in seconds */ + OSMO_ASSERT(ARRAY_SIZE(bts->gprs.nse.timer) < sizeof(buf)); + memcpy(buf, bts->gprs.nse.timer, ARRAY_SIZE(bts->gprs.nse.timer)); + msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_CFG, 7, buf); + + /* all timers in seconds */ + buf[0] = 3; /* blockimg timer (T1) */ + buf[1] = 3; /* blocking retries */ + buf[2] = 3; /* unblocking retries */ + buf[3] = 3; /* reset timer (T2) */ + buf[4] = 3; /* reset retries */ + buf[5] = 10; /* suspend timer (T3) in 100ms */ + buf[6] = 3; /* suspend retries */ + buf[7] = 10; /* resume timer (T4) in 100ms */ + buf[8] = 3; /* resume retries */ + buf[9] = 10; /* capability update timer (T5) */ + buf[10] = 3; /* capability update retries */ + + OSMO_ASSERT(ARRAY_SIZE(bts->gprs.cell.timer) < sizeof(buf)); + memcpy(buf, bts->gprs.cell.timer, ARRAY_SIZE(bts->gprs.cell.timer)); + msgb_tl16v_put(msgb, NM_ATT_IPACC_BSSGP_CFG, 11, buf); + + return msgb; +} + +struct msgb *nanobts_attr_cell_get(struct gsm_bts *bts) +{ + struct msgb *msgb; + uint8_t buf[256]; + msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + /* routing area code */ + buf[0] = bts->gprs.rac; + msgb_tl16v_put(msgb, NM_ATT_IPACC_RAC, 1, buf); + + buf[0] = 5; /* repeat time (50ms) */ + buf[1] = 3; /* repeat count */ + msgb_tl16v_put(msgb, NM_ATT_IPACC_GPRS_PAGING_CFG, 2, buf); + + /* BVCI 925 */ + buf[0] = bts->gprs.cell.bvci >> 8; + buf[1] = bts->gprs.cell.bvci & 0xff; + msgb_tl16v_put(msgb, NM_ATT_IPACC_BVCI, 2, buf); + + /* all timers in seconds, unless otherwise stated */ + buf[0] = 20; /* T3142 */ + buf[1] = 5; /* T3169 */ + buf[2] = 5; /* T3191 */ + buf[3] = 160; /* T3193 (units of 10ms) */ + buf[4] = 5; /* T3195 */ + buf[5] = 10; /* N3101 */ + buf[6] = 4; /* N3103 */ + buf[7] = 8; /* N3105 */ + buf[8] = 15; /* RLC CV countdown */ + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG, 9, buf); + + if (bts->gprs.mode == BTS_GPRS_EGPRS) { + buf[0] = 0x8f; + buf[1] = 0xff; + } else { + buf[0] = 0x0f; + buf[1] = 0x00; + } + msgb_tl16v_put(msgb, NM_ATT_IPACC_CODING_SCHEMES, 2, buf); + + buf[0] = 0; /* T downlink TBF extension (0..500, high byte) */ + buf[1] = 250; /* T downlink TBF extension (0..500, low byte) */ + buf[2] = 0; /* T uplink TBF extension (0..500, high byte) */ + buf[3] = 250; /* T uplink TBF extension (0..500, low byte) */ + buf[4] = 2; /* CS2 */ + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_2, 5, buf); + +#if 0 + /* EDGE model only, breaks older models. + * Should inquire the BTS capabilities */ + buf[0] = 2; /* MCS2 */ + msgb_tl16v_put(msgb, NM_ATT_IPACC_RLC_CFG_3, 1, buf); +#endif + + return msgb; +} + +struct msgb *nanobts_attr_nscv_get(struct gsm_bts *bts) +{ + struct msgb *msgb; + uint8_t buf[256]; + msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + /* 925 */ + buf[0] = bts->gprs.nsvc[0].nsvci >> 8; + buf[1] = bts->gprs.nsvc[0].nsvci & 0xff; + msgb_tl16v_put(msgb, NM_ATT_IPACC_NSVCI, 2, buf); + + /* remote udp port */ + patch_16(&buf[0], htons(bts->gprs.nsvc[0].remote_port)); + /* remote ip address */ + patch_32(&buf[2], htonl(bts->gprs.nsvc[0].remote_ip)); + /* local udp port */ + patch_16(&buf[6], htons(bts->gprs.nsvc[0].local_port)); + msgb_tl16v_put(msgb, NM_ATT_IPACC_NS_LINK_CFG, 8, buf); + + return msgb; +} + +struct msgb *nanobts_attr_radio_get(struct gsm_bts *bts, + struct gsm_bts_trx *trx) +{ + struct msgb *msgb; + uint8_t buf[256]; + msgb = msgb_alloc(1024, "nanobts_attr_bts"); + + /* number of -2dB reduction steps / Pn */ + msgb_tv_put(msgb, NM_ATT_RF_MAXPOWR_R, trx->max_power_red / 2); + + buf[0] = trx->arfcn >> 8; + buf[1] = trx->arfcn & 0xff; + msgb_tl16v_put(msgb, NM_ATT_ARFCN_LIST, 2, buf); + + return msgb; +} diff --git a/openbsc/tests/Makefile.am b/openbsc/tests/Makefile.am index 468edd2..9cbc1c1 100644 --- a/openbsc/tests/Makefile.am +++ b/openbsc/tests/Makefile.am @@ -9,6 +9,7 @@ trau \ subscr \ mm_auth \ + nanobts_omlattr \ $(NULL) if BUILD_NAT diff --git a/openbsc/tests/nanobts_omlattr/Makefile.am b/openbsc/tests/nanobts_omlattr/Makefile.am new file mode 100644 index 0000000..b03d50c --- /dev/null +++ b/openbsc/tests/nanobts_omlattr/Makefile.am @@ -0,0 +1,34 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(NULL) + +noinst_PROGRAMS = \ + nanobts_omlattr_test \ + $(NULL) + +EXTRA_DIST = \ + nanobts_omlattr_test.ok \ + $(NULL) + +nanobts_omlattr_test_SOURCES = \ + nanobts_omlattr_test.c \ + $(NULL) + +nanobts_omlattr_test_LDADD = \ + $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libtrau/libtrau.a \ + $(top_builddir)/src/libcommon/libcommon.a \ + $(LIBOSMOCORE_LIBS) \ + $(LIBOSMOGSM_LIBS) \ + $(LIBOSMOABIS_LIBS) \ + -ldbi \ + $(NULL) diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c new file mode 100644 index 0000000..ee138b8 --- /dev/null +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.c @@ -0,0 +1,284 @@ +/* Test OML attribute generator */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * All Rights Reserved + * + * Author: Philipp Maier + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +#include +#include +#include + +#include +#include + +struct gsm_bts_model bts_model_nanobts = { + .type = GSM_BTS_TYPE_NANOBTS, + .name = "nanobts", + .start = NULL, + .oml_rcvmsg = NULL, + .e1line_bind_ops = NULL, + .nm_att_tlvdef = { + .def = { + /* ip.access specifics */ + [NM_ATT_IPACC_DST_IP] = {TLV_TYPE_FIXED, 4}, + [NM_ATT_IPACC_DST_IP_PORT] = + {TLV_TYPE_FIXED, 2}, + [NM_ATT_IPACC_STREAM_ID] = {TLV_TYPE_TV,}, + [NM_ATT_IPACC_SEC_OML_CFG] = + {TLV_TYPE_FIXED, 6}, + [NM_ATT_IPACC_IP_IF_CFG] = + {TLV_TYPE_FIXED, 8}, + [NM_ATT_IPACC_IP_GW_CFG] = + {TLV_TYPE_FIXED, 12}, + [NM_ATT_IPACC_IN_SERV_TIME] = + {TLV_TYPE_FIXED, 4}, + [NM_ATT_IPACC_LOCATION] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_PAGING_CFG] = + {TLV_TYPE_FIXED, 2}, + [NM_ATT_IPACC_UNIT_ID] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_UNIT_NAME] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_SNMP_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_PRIM_OML_CFG_LIST] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_NV_FLAGS] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_FREQ_CTRL] = + {TLV_TYPE_FIXED, 2}, + [NM_ATT_IPACC_PRIM_OML_FB_TOUT] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_CUR_SW_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_TIMING_BUS] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_CGI] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_RAC] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_OBJ_VERSION] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_GPRS_PAGING_CFG] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_NSEI] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_BVCI] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_NSVCI] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_NS_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_BSSGP_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_NS_LINK_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_RLC_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_ALM_THRESH_LIST] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_MONIT_VAL_LIST] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_TIB_CONTROL] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_SUPP_FEATURES] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_CODING_SCHEMES] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_RLC_CFG_2] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_HEARTB_TOUT] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_UPTIME] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_RLC_CFG_3] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_SSL_CFG] = {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_SEC_POSSIBLE] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_IML_SSL_STATE] = + {TLV_TYPE_TL16V}, + [NM_ATT_IPACC_REVOC_DATE] = {TLV_TYPE_TL16V}, + }, + }, +}; + +static void test_nanobts_attr_bts_get(struct gsm_bts *bts, uint8_t *expected) +{ + struct msgb *msgb; + + printf("Testing nanobts_attr_bts_get()...\n"); + + msgb = nanobts_attr_bts_get(bts); + printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); + printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); + OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + msgb_free(msgb); + + printf("ok.\n"); + printf("\n"); +} + +static void test_nanobts_attr_nse_get(struct gsm_bts *bts, uint8_t *expected) +{ + struct msgb *msgb; + + printf("Testing nanobts_attr_nse_get()...\n"); + + msgb = nanobts_attr_nse_get(bts); + printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); + printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); + OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + msgb_free(msgb); + + printf("ok.\n"); + printf("\n"); +} + +static void test_nanobts_attr_cell_get(struct gsm_bts *bts, uint8_t *expected) +{ + struct msgb *msgb; + + printf("Testing nanobts_attr_cell_get()...\n"); + + msgb = nanobts_attr_cell_get(bts); + printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); + printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); + OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + msgb_free(msgb); + + printf("ok.\n"); + printf("\n"); +} + +static void test_nanobts_attr_nscv_get(struct gsm_bts *bts, uint8_t *expected) +{ + struct msgb *msgb; + + printf("Testing nanobts_attr_nscv_get()...\n"); + + msgb = nanobts_attr_nscv_get(bts); + printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); + printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); + OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + msgb_free(msgb); + + printf("ok.\n"); + printf("\n"); +} + +static void test_nanobts_attr_radio_get(struct gsm_bts *bts, + struct gsm_bts_trx *trx, + uint8_t *expected) +{ + struct msgb *msgb; + + printf("Testing nanobts_attr_nscv_get()...\n"); + + msgb = nanobts_attr_radio_get(bts, trx); + printf("result= %s\n", osmo_hexdump_nospc(msgb->data, msgb->len)); + printf("expected=%s\n", osmo_hexdump_nospc(expected, msgb->len)); + OSMO_ASSERT(memcmp(msgb->data, expected, msgb->len) == 0); + msgb_free(msgb); + + printf("ok.\n"); + printf("\n"); +} + +int main(int argc, char **argv) +{ + void *ctx; + + struct gsm_bts *bts; + struct gsm_network *net; + struct gsm_bts_trx *trx; + + ctx = talloc_named_const(NULL, 0, "ctx"); + + /* Allocate environmental structs (bts, net, trx) */ + net = talloc_zero(ctx, struct gsm_network); + INIT_LLIST_HEAD(&net->bts_list); + gsm_bts_model_register(&bts_model_nanobts); + bts = gsm_bts_alloc_register(net, GSM_BTS_TYPE_NANOBTS, 63); + OSMO_ASSERT(bts); + trx = talloc_zero(ctx, struct gsm_bts_trx); + + /* Parameters needed by nanobts_attr_bts_get() */ + bts->rach_b_thresh = -1; + bts->rach_ldavg_slots = -1; + bts->c0->arfcn = 866; + bts->cell_identity = 1337; + bts->network->country_code = 1; + bts->network->network_code = 1; + bts->location_area_code = 1; + bts->gprs.rac = 0; + uint8_t attr_bts_expected[] = + { 0x19, 0x55, 0x5b, 0x61, 0x67, 0x6d, 0x73, 0x18, 0x06, 0x0e, 0x00, + 0x02, 0x01, 0x20, 0x33, 0x1e, 0x24, 0x24, 0xa8, 0x34, 0x21, + 0xa8, 0x1f, 0x3f, 0x25, + 0x00, 0x01, 0x0a, 0x0c, 0x0a, 0x0b, 0x01, 0x2a, 0x0a, 0x2b, + 0x03, 0xe8, 0x0a, 0x80, + 0x23, 0x0a, 0x08, 0x03, 0x62, 0x09, 0x3f, 0x99, 0x00, 0x07, + 0x00, 0xf1, 0x10, 0x00, + 0x01, 0x05, 0x39 + }; + + /* Parameters needed to test nanobts_attr_nse_get() */ + bts->gprs.nse.nsei = 101; + uint8_t attr_nse_expected[] = + { 0x9d, 0x00, 0x02, 0x00, 0x65, 0xa0, 0x00, 0x07, 0x03, 0x03, 0x03, + 0x03, 0x1e, 0x03, 0x0a, 0xa1, 0x00, 0x0b, 0x03, 0x03, 0x03, + 0x03, 0x03, 0x0a, 0x03, + 0x0a, 0x03, 0x0a, 0x03 + }; + + /* Parameters needed to test nanobts_attr_cell_get() */ + bts->gprs.rac = 0x00; + bts->gprs.cell.bvci = 2; + bts->gprs.mode = BTS_GPRS_GPRS; + uint8_t attr_cell_expected[] = + { 0x9a, 0x00, 0x01, 0x00, 0x9c, 0x00, 0x02, 0x05, 0x03, 0x9e, 0x00, + 0x02, 0x00, 0x02, 0xa3, 0x00, 0x09, 0x14, 0x05, 0x05, 0xa0, + 0x05, 0x0a, 0x04, 0x08, + 0x0f, 0xa8, 0x00, 0x02, 0x0f, 0x00, 0xa9, 0x00, 0x05, 0x00, + 0xfa, 0x00, 0xfa, 0x02 + }; + + /* Parameters needed to test nanobts_attr_nscv_get() */ + bts->gprs.nsvc[0].nsvci = 0x65; + bts->gprs.nsvc[0].remote_port = 0x59d8; + bts->gprs.nsvc[0].remote_ip = 0x0a090165; + bts->gprs.nsvc[0].local_port = 0x5a3c; + uint8_t attr_nscv_expected[] = + { 0x9f, 0x00, 0x02, 0x00, 0x65, 0xa2, 0x00, 0x08, 0x59, 0xd8, 0x0a, + 0x09, 0x01, 0x65, 0x5a, 0x3c + }; + + /* Parameters needed to test nanobts_attr_radio_get() */ + trx->arfcn = 866; + trx->max_power_red = 22; + bts->c0->max_power_red = 22; + uint8_t attr_radio_expected[] = + { 0x2d, 0x0b, 0x05, 0x00, 0x02, 0x03, 0x62 }; + + /* Run tests */ + test_nanobts_attr_bts_get(bts, attr_bts_expected); + test_nanobts_attr_nse_get(bts, attr_nse_expected); + test_nanobts_attr_cell_get(bts, attr_cell_expected); + test_nanobts_attr_nscv_get(bts, attr_nscv_expected); + test_nanobts_attr_radio_get(bts, trx, attr_radio_expected); + + printf("Done\n"); + talloc_free(bts); + talloc_free(net); + talloc_free(trx); + talloc_report_full(ctx, stderr); + OSMO_ASSERT(talloc_total_blocks(ctx) == 1); + return 0; +} + +/* stubs */ +struct osmo_prim_hdr; +int bssgp_prim_cb(struct osmo_prim_hdr *oph, void *ctx) +{ + abort(); +} diff --git a/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok new file mode 100644 index 0000000..91b655f --- /dev/null +++ b/openbsc/tests/nanobts_omlattr/nanobts_omlattr_test.ok @@ -0,0 +1,26 @@ +Testing nanobts_attr_bts_get()... +result= 19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 +expected=19555b61676d7318060e00020120331e2424a83421a81f3f2500010a0c0a0b012a0a2b03e80a80230a080362093f99000700f11000010539 +ok. + +Testing nanobts_attr_nse_get()... +result= 9d00020065a00007030303031e030aa1000b03030303030a030a030a03 +expected=9d00020065a00007030303031e030aa1000b03030303030a030a030a03 +ok. + +Testing nanobts_attr_cell_get()... +result= 9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 +expected=9a0001009c000205039e00020002a30009140505a0050a04080fa800020f00a9000500fa00fa02 +ok. + +Testing nanobts_attr_nscv_get()... +result= 9f00020065a2000859d80a0901655a3c +expected=9f00020065a2000859d80a0901655a3c +ok. + +Testing nanobts_attr_nscv_get()... +result= 2d0b0500020362 +expected=2d0b0500020362 +ok. + +Done diff --git a/openbsc/tests/testsuite.at b/openbsc/tests/testsuite.at index 4905cd1..b44d595 100644 --- a/openbsc/tests/testsuite.at +++ b/openbsc/tests/testsuite.at @@ -151,3 +151,9 @@ cat $abs_srcdir/v42bis/v42bis_test.ok > expout AT_CHECK([$abs_top_builddir/tests/v42bis/v42bis_test], [], [expout], [ignore]) AT_CLEANUP + +AT_SETUP([nanobts_omlattr]) +AT_KEYWORDS([nanobts_omlattr]) +cat $abs_srcdir/nanobts_omlattr/nanobts_omlattr_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/nanobts_omlattr/nanobts_omlattr_test], [], [expout], [ignore]) +AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/973 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibeb34a84912d6cf695f553a34c69320fca7d08fa Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:56:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:56:24 +0000 Subject: [MERGED] openbsc[master]: gsm0408: Adding log output for 3g specific RR messages In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm0408: Adding log output for 3g specific RR messages ...................................................................... gsm0408: Adding log output for 3g specific RR messages GSM 04.18, which is the successor of GSM 04.08, describes additional RR 3g specific message types. This commit adds log output for those messages. The behaviour is not changed all affected message types are still forwared to the MSC as they were before. See also 3GPP TS 04.18, section 10.4, table 10.4.1 The change requires to update libosmocore as well, see also commit f48fdb3a108da0dc23d7af4ac021e98e11f07152 in libosmocore.git for details. Change-Id: I41f2242fdf59c3eb4b3f8f7f003c17f7e0df01aa --- M openbsc/src/libbsc/bsc_api.c M openbsc/src/libmsc/gsm_04_08.c 2 files changed, 11 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_api.c b/openbsc/src/libbsc/bsc_api.c index cc12e9f..207e12a 100644 --- a/openbsc/src/libbsc/bsc_api.c +++ b/openbsc/src/libbsc/bsc_api.c @@ -34,6 +34,7 @@ #include #include +#include #include @@ -587,11 +588,13 @@ case GSM48_PDISC_RR: switch (msg_type) { case GSM48_MT_RR_GPRS_SUSP_REQ: - DEBUGP(DRR, "GRPS SUSPEND REQUEST\n"); + DEBUGP(DRR, "%s\n", + gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ)); break; case GSM48_MT_RR_STATUS: - LOGP(DRR, LOGL_NOTICE, "RR STATUS (cause: %s)\n", - rr_cause_name(gh->data[0])); + LOGP(DRR, LOGL_NOTICE, "%s (cause: %s)\n", + gsm48_rr_msg_name(GSM48_MT_RR_GPRS_SUSP_REQ), + rr_cause_name(gh->data[0])); break; case GSM48_MT_RR_MEAS_REP: /* This shouldn't actually end up here, as RSL treats @@ -643,8 +646,9 @@ /* Normally, a MSC should never receive RR * messages, but we'd rather forward what we * don't know than drop it... */ - LOGP(DRR, LOGL_NOTICE, "BSC: Passing unknown 04.08 " - "RR message type 0x%02x to MSC\n", msg_type); + LOGP(DRR, LOGL_NOTICE, + "BSC: Passing %s 04.08 RR message to MSC\n", + gsm48_rr_msg_name(msg_type)); if (api->dtap) api->dtap(conn, link_id, msg); } diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index a22e3c2..3e362fa 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -1270,8 +1270,8 @@ rc = gsm48_rx_rr_app_info(conn, msg); break; default: - LOGP(DRR, LOGL_NOTICE, "MSC: Unimplemented " - "GSM 04.08 RR msg type 0x%02x\n", gh->msg_type); + LOGP(DRR, LOGL_NOTICE, "MSC: Unimplemented %s GSM 04.08 RR " + "message\n", gsm48_rr_msg_name(gh->msg_type)); break; } -- To view, visit https://gerrit.osmocom.org/1037 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I41f2242fdf59c3eb4b3f8f7f003c17f7e0df01aa Gerrit-PatchSet: 9 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:56:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:56:25 +0000 Subject: [MERGED] openbsc[master]: Cosmetic: Add missing switch to usage help In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Cosmetic: Add missing switch to usage help ...................................................................... Cosmetic: Add missing switch to usage help Adds the -p --pcap option to the help text. Change-Id: I3e763c30ca13bc51c8b72af8a94558c92439f109 --- M openbsc/src/osmo-nitb/bsc_hack.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-nitb/bsc_hack.c b/openbsc/src/osmo-nitb/bsc_hack.c index 28dbb6f..552ab4f 100644 --- a/openbsc/src/osmo-nitb/bsc_hack.c +++ b/openbsc/src/osmo-nitb/bsc_hack.c @@ -108,6 +108,7 @@ printf(" -m --mncc-sock Same as `-M /tmp/bsc_mncc' (deprecated).\n"); printf(" -C --no-dbcounter Disable regular syncing of counters to database.\n"); printf(" -r --rf-ctl PATH A unix domain socket to listen for cmds.\n"); + printf(" -p --pcap PATH Write abis communication to pcap trace file.\n"); } static void handle_options(int argc, char **argv) -- To view, visit https://gerrit.osmocom.org/1076 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e763c30ca13bc51c8b72af8a94558c92439f109 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 1 21:59:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 21:59:29 +0000 Subject: openbsc[master]: pcu_if: original pcu sock interface from osmo-bts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 you can do this for a test, but we definitely don't want to introduce code duplication. It would be best to have one version of the pcu_if code, and share that between BSC and BTS. There are multiple ways to do this: a) put it in libosmocore/libosmogsm. maybe not such a good idea, as it really is only needed by BTS and BSC b) put it ina new library that is part of libosmocore.git. Maybe a bit ecessive. c) have one copy of the code (e.g. in the BSC) and pull the source into the BTS, like we do with gsm_data_shared. Not elegant, but as we already do it in one place, might not hurt to do more of that. -- To view, visit https://gerrit.osmocom.org/1169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b0a65f1633c40053d43b57b786b042f20f12bd Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 22:00:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 22:00:17 +0000 Subject: libosmocore[master]: Add osmo_fsm_unregister() to header In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 22:01:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 22:01:47 +0000 Subject: libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 1 22:02:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 1 Nov 2016 22:02:09 +0000 Subject: libosmocore[master]: bitcomp: Remove the t4 decoding from libosmocore In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I021424444625a097560d086c217c81eac4a5ee44 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 00:27:27 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 2 Nov 2016 00:27:27 +0000 Subject: openbsc[master]: WIP: OM2000: Full state machine implementation using osmo_fsm In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 there is still a segfault in here because the fsm gets finalized and access later resulting in undefinited behaviour or segfault. -- To view, visit https://gerrit.osmocom.org/1156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 06:15:23 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 2 Nov 2016 06:15:23 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run Function bitv... In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#3). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 55 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/3 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..718beda 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,60 @@ return bv->cur_bit; } +/* \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \returns Number of consecutive bits of \p b in \p bv + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + if (bv->cur_bit % 8 == 0) { + for (i = (bv->cur_bit/8); + i < (max_bits % 8 ? max_bits/8 + 1 : max_bits/8); + i++, count++) { + if ((b ? 0xFF : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + leading_bits(bv->data[i], b); + } + } + bv->cur_bit = (count * 8) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex); + } + int pos = bv->cur_bit/8; + + while (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) { + if (bv->cur_bit % 8 >= 0) + temp_res++; + else { + pos++; + for (i = pos; + i < (max_bits % 8 ? max_bits/8 + 1 : max_bits/8); + i++, count++) { + if ((b ? 0xFF : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + + temp_res) + readIndex; + return count * 8 + + leading_bits(bv->data[i], b) + + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + return temp_res + (count * 8); + } + } + bv->cur_bit--; + return temp_res; +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg From gerrit-no-reply at lists.osmocom.org Wed Nov 2 06:24:38 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 2 Nov 2016 06:24:38 +0000 Subject: osmo-pcu[master]: Refactoring write_packet_ack_nack_desc_egprs to support CRBB In-Reply-To: References: Message-ID: Patch Set 4: > Please drop the whitespace changes Did you mean the whitespace in src/encoding.cpp:335? src/encoding.cpp:335 : whitespace in base also can I remove it? -- To view, visit https://gerrit.osmocom.org/412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 07:09:53 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 07:09:53 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 8: Hi Holger, Any updates on this patch? -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 07:52:41 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 07:52:41 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 8: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/862/8/src/rlc.cpp File src/rlc.cpp: Line 109: unsigned dist = (unsigned)distance(); Sorry two parts. I said drop the cast (speciall c casts). int16_t -> unsigned is something that works without warning (and we assume unsigned is at least 32bits) Second part. If you have to write it into a comment, then let's change the return value of distance? So besides the technical mod_sns() we assume that m_v_s is always bigger/equal than m_v_a (send, bigger than acked). Sounds right to me? This comment applies to the other places as well. -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 08:37:56 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 2 Nov 2016 08:37:56 +0000 Subject: [MERGED] libosmocore[master]: utils/conv_gen.py: explicitly import reduce() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: utils/conv_gen.py: explicitly import reduce() ...................................................................... utils/conv_gen.py: explicitly import reduce() This change finally makes the script able to be executed in Python 3 environment. Due to new Python 3 restrictions, the reduce() should be imported explicitly. Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005 --- M utils/conv_gen.py 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 78b2335..62fa8ad 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -24,6 +24,7 @@ """ import sys, os, math +from functools import reduce class ConvolutionalCode(object): -- To view, visit https://gerrit.osmocom.org/1180 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icbc81c29f1a226aeed2c1245a5d60809fe124005 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Wed Nov 2 08:37:56 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Wed, 2 Nov 2016 08:37:56 +0000 Subject: [MERGED] libosmocore[master]: utils/conv_gen.py: don't mix print and write() In-Reply-To: References: Message-ID: Vadim Yanitskiy has submitted this change and it was merged. Change subject: utils/conv_gen.py: don't mix print and write() ...................................................................... utils/conv_gen.py: don't mix print and write() This is mostly a code style change, but it also increases the compatibility with Python 3. Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb --- M utils/conv_gen.py 1 file changed, 34 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 5eb7ac1..78b2335 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -168,51 +168,53 @@ sum([x << (self.rate_inv - i - 1) for i, x in enumerate(n)]) num_states = 1 << (self.k - 1) - print >>fi, \ - "\nstatic const uint8_t %s_state[][2] = {" % self.name + fi.write("static const uint8_t %s_state[][2] = {\n" % self.name) self._print_x(fi, num_states) - print >>fi, \ - "};\n\nstatic const uint8_t %s_output[][2] = {" % self.name + fi.write("};\n\n") + + fi.write("static const uint8_t %s_output[][2] = {\n" % self.name) self._print_x(fi, num_states, pack) - print >>fi, "};" + fi.write("};\n\n") if self.recursive: - print >>fi, \ - "\nstatic const uint8_t %s_term_state[] = {" % self.name + fi.write("static const uint8_t %s_term_state[] = {\n" % self.name) self._print_term(fi, num_states) + fi.write("};\n\n") - print >>fi, \ - "};\n\nstatic const uint8_t %s_term_output[] = {" % self.name + fi.write("static const uint8_t %s_term_output[] = {\n" % self.name) self._print_term(fi, num_states, pack) - print >>fi, "};" + fi.write("};\n\n") if len(self.puncture): - print >>fi, "\nstatic const int %s_puncture[] = {" % self.name + fi.write("static const int %s_puncture[] = {\n" % self.name) self._print_puncture(fi) - print >>fi, "};" + fi.write("};\n\n") # Write description as a multi-line comment if self.description is not None: - print >>fi, "\n/**" + fi.write("/**\n") for line in self.description: - print >>fi, " * %s" % line - print >>fi, " */" + fi.write(" * %s\n" % line) + fi.write(" */\n") # Print a final convolutional code definition - print >>fi, "const struct osmo_conv_code %s_%s = {" % (pref, self.name) - print >>fi, "\t.N = %d," % self.rate_inv - print >>fi, "\t.K = %d," % self.k - print >>fi, "\t.len = %d," % self.block_len + fi.write("const struct osmo_conv_code %s_%s = {\n" % (pref, self.name)) + fi.write("\t.N = %d,\n" % self.rate_inv) + fi.write("\t.K = %d,\n" % self.k) + fi.write("\t.len = %d,\n" % self.block_len) + fi.write("\t.next_output = %s_output,\n" % self.name) + fi.write("\t.next_state = %s_state,\n" % self.name) + if self.term_type is not None: - print >>fi, "\t.term = %s," % self.term_type - print >>fi, "\t.next_output = %s_output," % self.name - print >>fi, "\t.next_state = %s_state," % self.name + fi.write("\t.term = %s,\n" % self.term_type) + if self.recursive: - print >>fi, "\t.next_term_output = %s_term_output," % self.name - print >>fi, "\t.next_term_state = %s_term_state," % self.name + fi.write("\t.next_term_output = %s_term_output,\n" % self.name) + fi.write("\t.next_term_state = %s_term_state,\n" % self.name) + if len(self.puncture): - print >>fi, "\t.puncture = %s_puncture," % self.name - print >>fi, "};" + fi.write("\t.puncture = %s_puncture,\n" % self.name) + fi.write("};\n\n") poly = lambda *args: sum([(1 << x) for x in args]) @@ -939,17 +941,17 @@ path = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() prefix = "gsm0503" - print >>sys.stderr, "Generating convolutional codes..." + sys.stderr.write("Generating convolutional codes...\n") # Open a new file for writing f = open(os.path.join(path, "gsm0503_conv.c"), 'w') - print >>f, mod_license - print >>f, "#include " - print >>f, "#include " + f.write(mod_license + "\n") + f.write("#include \n") + f.write("#include \n\n") # Generate the tables one by one for code in conv_codes: - print >>sys.stderr, "Generate '%s' definition" % code.name + sys.stderr.write("Generate '%s' definition\n" % code.name) code.gen_tables(prefix, f) - print >>sys.stderr, "Generation complete." + sys.stderr.write("Generation complete.\n") -- To view, visit https://gerrit.osmocom.org/1164 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5c8271d973f766aeb9cbcab30c4eddfdab54fcbb Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Wed Nov 2 08:56:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 08:56:29 +0000 Subject: [MERGED] libosmocore[master]: Add osmo_fsm_unregister() to header In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add osmo_fsm_unregister() to header ...................................................................... Add osmo_fsm_unregister() to header Previously function was defined but not exposed so there were a way to register FSM but no way to unregister it. Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b --- M include/osmocom/core/fsm.h M tests/fsm/fsm_test.c 2 files changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/fsm.h b/include/osmocom/core/fsm.h index ce0db15..9b6072d 100644 --- a/include/osmocom/core/fsm.h +++ b/include/osmocom/core/fsm.h @@ -115,7 +115,7 @@ osmo_fsm_state_name((fi)->fsm, (fi)->state), ## args) int osmo_fsm_register(struct osmo_fsm *fsm); - +void osmo_fsm_unregister(struct osmo_fsm *fsm); struct osmo_fsm_inst *osmo_fsm_inst_alloc(struct osmo_fsm *fsm, void *ctx, void *priv, int log_level, const char *id); struct osmo_fsm_inst *osmo_fsm_inst_alloc_child(struct osmo_fsm *fsm, diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 84c2ae4..29b31ef 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -151,5 +151,6 @@ osmo_select_main(0); } + osmo_fsm_unregister(&fsm); exit(0); } -- To view, visit https://gerrit.osmocom.org/1178 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e749d896009784b77d6d5952fcc38e1c131db2b Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:20:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:20:55 +0000 Subject: [MERGED] openbsc[master]: mncc_builtin: Properly reject DTMF In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mncc_builtin: Properly reject DTMF ...................................................................... mncc_builtin: Properly reject DTMF As per TS 23.014, a GSM MSC must implement mobile-originated DTMF generation. We gate the DTMF signalling messages to MNCC, and expect the external MNCC handler to deal with it. However, the internal MNCC handler simply ignored such singalling messages, rather than rejecting DTMF altogether. It turns out failure to respond to START DTMF will cause some phones to behave in interesting ways, particularly with modem firmware v6.01.00, see https://osmocom.org/issues/1817). In this case the phone is not able to release the call as the pending response to the START DTMF is probably keping a reference or lock of some sort. Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac --- M openbsc/src/libmsc/mncc_builtin.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/mncc_builtin.c b/openbsc/src/libmsc/mncc_builtin.c index 9b25ede..067cc92 100644 --- a/openbsc/src/libmsc/mncc_builtin.c +++ b/openbsc/src/libmsc/mncc_builtin.c @@ -386,8 +386,10 @@ case MNCC_FACILITY_IND: break; case MNCC_START_DTMF_IND: + rc = mncc_tx_to_cc(net, MNCC_START_DTMF_REJ, data); break; case MNCC_STOP_DTMF_IND: + rc = mncc_tx_to_cc(net, MNCC_STOP_DTMF_RSP, data); break; case MNCC_MODIFY_IND: mncc_set_cause(data, GSM48_CAUSE_LOC_PRN_S_LU, -- To view, visit https://gerrit.osmocom.org/1181 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I336f0cd0a6396b522d228479a417fd4d606157ac Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:22:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:22:28 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run Function bitv... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:22:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:22:55 +0000 Subject: libosmo-abis[master]: lapd: adding support for ericsson's lapd dialect In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I892af57013d7ab4216e9e2d0873a69129aaeb8e5 Gerrit-PatchSet: 3 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:23:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:23:01 +0000 Subject: [MERGED] libosmo-abis[master]: lapd: adding support for ericsson's lapd dialect In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lapd: adding support for ericsson's lapd dialect ...................................................................... lapd: adding support for ericsson's lapd dialect Ericsson's RBS2111-BTS (and similar) implements a lapdm dialect which uses a link establishment method that differs from the standard. While the BSC is transmitting sabm frames on one specific timeslot, the BTS will periodically scan through all timeslots to check for incoming sabm frames. When the BTS detcts the sabm fames on one of the timeslots it will stay there and continue to commence the link establishment. The described procedure requires a slightly modified lapd profile, the t200 retransmission timeout has to be configured to exactly 300 msek. Otherwise the link establishment will fail. Since the BTS will switch from timeslot to timeslot most of the sabm frames will not be seen by the BTS, so the maximum retransmission has to be increased. This patch suggests a maximum retry count of 300, which is an educated guess and has worked fine during our tests. Change-Id: I892af57013d7ab4216e9e2d0873a69129aaeb8e5 --- M include/osmocom/abis/lapd.h M src/input/lapd.c 2 files changed, 37 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/abis/lapd.h b/include/osmocom/abis/lapd.h index 2987633..d618187 100644 --- a/include/osmocom/abis/lapd.h +++ b/include/osmocom/abis/lapd.h @@ -18,8 +18,10 @@ int short_address; }; +/* predefined lapd profiles (see lapd.c for definition) */ extern const struct lapd_profile lapd_profile_isdn; extern const struct lapd_profile lapd_profile_abis; +extern const struct lapd_profile lapd_profile_abis_ericsson; extern const struct lapd_profile lapd_profile_sat; struct lapd_instance { @@ -63,6 +65,13 @@ void *rx_cbdata), void *rx_cbdata, const struct lapd_profile *profile); +/* In rare cases (e.g. Ericsson's lapd dialect), it may be necessary to + * exchange the lapd profile on the fly. lapd_instance_set_profile() + * allwos to set the lapd profile on a lapd instance danymically to + * one of the lapd profiles define above. */ +void lapd_instance_set_profile(struct lapd_instance *li, + const struct lapd_profile *profile); + void lapd_instance_free(struct lapd_instance *li); /* Start a (user-side) SAP for the specified TEI/SAPI on the LAPD instance */ diff --git a/src/input/lapd.c b/src/input/lapd.c index ac24fd8..f5909b4 100644 --- a/src/input/lapd.c +++ b/src/input/lapd.c @@ -95,6 +95,27 @@ .short_address = 0 }; +/* Ericssons OM2000 lapd dialect requires a sabm frame retransmission + * timeout of exactly 300 msek. Shorter or longer retransmission will + * cause the link establishment to fail permanently. Since the BTS is + * periodically scanning through all timeslots to find the timeslot + * where the bsc is transmitting its sabm frames the normal maximum + * retransmission (n200) of 3 is not enough. In order not to miss + * the bts, n200 has been increased to 300, which is an educated + * guess. */ + +const struct lapd_profile lapd_profile_abis_ericsson = { + .k = LAPD_SET_K(2,1), + .n200 = 300, + .n201 = 260, + .n202 = 0, /* infinite */ + .t200_sec = 0, .t200_usec = 300000, + .t201_sec = 1, .t201_usec = 0, + .t202_sec = 2, .t202_usec = 0, + .t203_sec = 10, .t203_usec = 0, + .short_address = 0 +}; + const struct lapd_profile lapd_profile_sat = { .k = LAPD_SET_K(15,15), .n200 = 5, @@ -664,6 +685,13 @@ return li; } +/* Change lapd-profile on the fly (use with caution!) */ +void lapd_instance_set_profile(struct lapd_instance *li, + const struct lapd_profile *profile) +{ + memcpy(&li->profile, profile, sizeof(li->profile)); +} + void lapd_instance_free(struct lapd_instance *li) { struct lapd_tei *teip, *teip2; -- To view, visit https://gerrit.osmocom.org/1120 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I892af57013d7ab4216e9e2d0873a69129aaeb8e5 Gerrit-PatchSet: 4 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:23:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:23:46 +0000 Subject: openbsc[master]: rbs2000: Add missing bts feature definitions In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I777a67862084aa6cca39cfc43f5708e47608b0e6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:25:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:25:17 +0000 Subject: osmo-bts[master]: Fix AGCH/PCH proportional allocation In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:25:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:25:48 +0000 Subject: openbsc[master]: gsm_subscriber_connection: mark BSC specific items In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:28:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:28:40 +0000 Subject: osmo-trx[master]: transceiver: Fix mismatched allocations and deallocations In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Looks fine to me, but I'm not an osmo-trx maintainer. -- To view, visit https://gerrit.osmocom.org/1153 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9c8bbade8531e8c9c02dcd43bac38cb954b3c89f Gerrit-PatchSet: 1 Gerrit-Project: osmo-trx Gerrit-Branch: master Gerrit-Owner: pierre.baudry Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:29:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:29:30 +0000 Subject: osmo-bts[master]: Remove obsolete define In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:29:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:29:40 +0000 Subject: [MERGED] osmo-bts[master]: Remove obsolete define In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove obsolete define ...................................................................... Remove obsolete define It was moved to OpenBSC in 582e4f627674f46310a90d9061e82fb342051b42 as it's used by both projects. Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889 --- M include/osmo-bts/gsm_data.h 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/gsm_data.h b/include/osmo-bts/gsm_data.h index a2bb641..f1c9601 100644 --- a/include/osmo-bts/gsm_data.h +++ b/include/osmo-bts/gsm_data.h @@ -8,9 +8,6 @@ #include #include -/* lchans 0..3 are SDCCH in combined channel configuration: */ -#define CCCH_LCHAN 4 - #define GSM_FR_BITS 260 #define GSM_EFR_BITS 244 -- To view, visit https://gerrit.osmocom.org/1113 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:31:28 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 09:31:28 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run Function bitv... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (5 comments) Still lacks a testcase. https://gerrit.osmocom.org/#/c/415/3/src/bitvec.c File src/bitvec.c: Line 581: * \param[in] b The boolean, sequence of 1's or 0's to be checked max_bits is not documented Line 582: * \returns Number of consecutive bits of \p b in \p bv This doesn't mention that cur_bit will go up. Line 590: if (bv->cur_bit % 8 == 0) { Can't you re-order the code to first read up to a full byte.. and then do the byte aligned handling. Line 592: i < (max_bits % 8 ? max_bits/8 + 1 : max_bits/8); select the mask once.. max_bits should not change during the call. Line 594: if ((b ? 0xFF : 0) != bv->data[i]) { select the bytemask once in the beginning -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:32:01 +0000 Subject: osmo-gsm-manuals[master]: OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If90250123a85cd275f07c69ee64c6e10a7269f06 Gerrit-PatchSet: 5 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:32:04 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page ...................................................................... OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page Split both of the lengthy mscgen generated ladder diagrams in two so that the diagrams are split over two pages and don't bleed into the page footer. Change-Id: If90250123a85cd275f07c69ee64c6e10a7269f06 --- D OsmoBTS/abis/dyn_ts_ipa_style.msc A OsmoBTS/abis/dyn_ts_ipa_style1.msc A OsmoBTS/abis/dyn_ts_ipa_style2.msc D OsmoBTS/abis/dyn_ts_osmocom_style.msc A OsmoBTS/abis/dyn_ts_osmocom_style1.msc A OsmoBTS/abis/dyn_ts_osmocom_style2.msc M OsmoBTS/abis/rsl.adoc 7 files changed, 125 insertions(+), 103 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/dyn_ts_ipa_style.msc b/OsmoBTS/abis/dyn_ts_ipa_style.msc deleted file mode 100644 index ae7c0d0..0000000 --- a/OsmoBTS/abis/dyn_ts_ipa_style.msc +++ /dev/null @@ -1,39 +0,0 @@ -msc { - hscale = "1.2"; - phy,bts,pcu,bsc; - - phy box bsc [ label = "PDCH Deactivation" ]; - bsc => bts [ label = "IPAC PDCH DEACT" ]; - --- [ label = "Disconnect PDTCH" ]; - bts => pcu [ label = "info ind (Deactivate)" ]; - pcu => bts [ label = "chan Deactivate request" ]; - bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; - phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; - bts => phy [ label = "L1 chan Disconnect PDTCH" ]; - phy -> bts [ label = "L1 chan Disconnect confirm" ]; - --- [ label = "Connect TCH" ]; - bts => phy [ label = "L1 chan Connect TCH" ]; - phy -> bts [ label = "L1 chan Connect confirm" ]; - bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; - - phy box bsc [ label = "Now BSC may use TCH (example)" ]; - bsc => bts [ label = "Activate TCH/F" ]; - bts => phy [ label = "L1 chan Activate SAPIs" ]; - --- [ label = "Voice call..." ]; - bsc => bts [ label = "Deactivate TCH/F" ]; - bts => phy [ label = "L1 chan Deactivate SAPIs" ]; - - phy box bsc [ label = "PDCH Activation" ]; - bsc => bts [ label = "IPAC PDCH ACT" ]; - --- [ label = "Disconnect TCH" ]; - bts => phy [ label = "L1 chan Disconnect TCH" ]; - phy -> bts [ label = "L1 chan Disconnect confirm" ]; - --- [ label = "Connect PDTCH" ]; - bts => phy [ label = "L1 chan Connect PDTCH" ]; - phy -> bts [ label = "L1 chan Connect confirm" ]; - bts => pcu [ label = "info ind (Activate)" ]; - pcu => bts [ label = "chan Activate request" ]; - bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; - phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; - bts => bsc [ label = "IPAC PDCH ACT ACK" ]; -} diff --git a/OsmoBTS/abis/dyn_ts_ipa_style1.msc b/OsmoBTS/abis/dyn_ts_ipa_style1.msc new file mode 100644 index 0000000..ee91795 --- /dev/null +++ b/OsmoBTS/abis/dyn_ts_ipa_style1.msc @@ -0,0 +1,23 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + phy box bsc [ label = "PDCH Deactivation" ]; + bsc => bts [ label = "IPAC PDCH DEACT" ]; + --- [ label = "Disconnect PDTCH" ]; + bts => pcu [ label = "info ind (Deactivate)" ]; + pcu => bts [ label = "chan Deactivate request" ]; + bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect TCH" ]; + bts => phy [ label = "L1 chan Connect TCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => bsc [ label = "IPAC PDCH DEACT ACK" ]; + + phy box bsc [ label = "Now BSC may use TCH (example)" ]; + bsc => bts [ label = "Activate TCH/F" ]; + bts => phy [ label = "L1 chan Activate SAPIs" ]; + --- [ label = "Voice call..." ]; +} diff --git a/OsmoBTS/abis/dyn_ts_ipa_style2.msc b/OsmoBTS/abis/dyn_ts_ipa_style2.msc new file mode 100644 index 0000000..c287789 --- /dev/null +++ b/OsmoBTS/abis/dyn_ts_ipa_style2.msc @@ -0,0 +1,22 @@ +msc { + hscale = "1.2"; + phy,bts,pcu,bsc; + + --- [ label = "...Voice call ends" ]; + bsc => bts [ label = "Deactivate TCH/F" ]; + bts => phy [ label = "L1 chan Deactivate SAPIs" ]; + + phy box bsc [ label = "PDCH Activation" ]; + bsc => bts [ label = "IPAC PDCH ACT" ]; + --- [ label = "Disconnect TCH" ]; + bts => phy [ label = "L1 chan Disconnect TCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + --- [ label = "Connect PDTCH" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + bts => pcu [ label = "info ind (Activate)" ]; + pcu => bts [ label = "chan Activate request" ]; + bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; + bts => bsc [ label = "IPAC PDCH ACT ACK" ]; +} diff --git a/OsmoBTS/abis/dyn_ts_osmocom_style.msc b/OsmoBTS/abis/dyn_ts_osmocom_style.msc deleted file mode 100644 index c929648..0000000 --- a/OsmoBTS/abis/dyn_ts_osmocom_style.msc +++ /dev/null @@ -1,60 +0,0 @@ -msc { - hscale = "1.5"; - phy,bts,pcu,bsc; - - bts => bsc [ label = "RSL Chan Requested" ]; - phy box bsc [ label = "TS is in PDCH mode, deactivate" ]; - bsc => bts [ label = "RSL RF Channel Release (PDCH)" ]; - bts => pcu [ label = "Info Ind (Deactivate)" ]; - pcu => bts [ label = "Chan Deactivate request" ]; - bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; - phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; - bts -> bsc [ label = "RSL RF Channel Release Ack (PDCH)" ]; - - phy box bsc [ label = "Activate TCH/H" ]; - bsc => bts [ label = "RSL Channel Activation (TCH/H)" ]; - --- [ label = "BTS notices: chan still connected as PDTCH, reconnect" ]; - bts => phy [ label = "L1 chan Disconnect PDTCH" ]; - phy -> bts [ label = "L1 chan Disconnect confirm" ]; - bts => phy [ label = "L1 chan Connect TCH/H" ]; - phy -> bts [ label = "L1 chan Connect confirm" ]; - --- [ label = "chan reconnect as TCH/H complete" ]; - bts => phy [ label = "L1 chan Activate SAPIs" ]; - bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ]; - --- [ label = "Voice call 1 commences..." ]; - - phy box bsc [ label = "A second voice call is requested" ]; - bts => bsc [ label = "RSL Chan Requested" ]; - phy box bsc [ label = "BSC finds second slot on dynamic TS in TCH/H mode" ]; - bsc => bts [ label = "RSL Channel Activation (TCH/H)" ]; - bts => phy [ label = "L1 chan Activate SAPIs" ]; - bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ]; - --- [ label = "Voice call 2 commences..." ]; - - --- [ label = "...Voice call 1 ends" ]; - bts => bsc [ label = "Release Ind" ]; - bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ]; - bts => phy [ label = "L1 chan Deactivate SAPIs" ]; - bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ]; - --- [ label = "BSC notices: one chan still in use"]; - - --- [ label = "...Voice call 2 ends" ]; - bts => bsc [ label = "Release Ind" ]; - bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ]; - bts => phy [ label = "L1 chan Deactivate SAPIs" ]; - bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ]; - - phy box bsc [ label = "If all channels on TS are released, PDCH Activation" ]; - bsc => bts [ label = "RSL Channel Activation (PDCH)" ]; - bts -> bsc [ label = "RSL Channel Activation Ack (PDCH) (unconditionally)" ]; - --- [ label = "BTS notices: chan still connected as TCH/H, reconnect" ]; - bts => phy [ label = "L1 chan Disconnect TCH/H" ]; - phy -> bts [ label = "L1 chan Disconnect confirm" ]; - bts => phy [ label = "L1 chan Connect PDTCH" ]; - phy -> bts [ label = "L1 chan Connect confirm" ]; - --- [ label = "chan reconnect as PDTCH complete" ]; - bts => pcu [ label = "Info Ind (Activate)" ]; - pcu => bts [ label = "chan Activate request" ]; - bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; - phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; -} diff --git a/OsmoBTS/abis/dyn_ts_osmocom_style1.msc b/OsmoBTS/abis/dyn_ts_osmocom_style1.msc new file mode 100644 index 0000000..f02f6f6 --- /dev/null +++ b/OsmoBTS/abis/dyn_ts_osmocom_style1.msc @@ -0,0 +1,34 @@ +msc { + hscale = "1.5"; + phy,bts,pcu,bsc; + + bts => bsc [ label = "RSL Chan Requested" ]; + phy box bsc [ label = "TS is in PDCH mode, deactivate" ]; + bsc => bts [ label = "RSL RF Channel Release (PDCH)" ]; + bts => pcu [ label = "Info Ind (Deactivate)" ]; + pcu => bts [ label = "Chan Deactivate request" ]; + bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ]; + bts -> bsc [ label = "RSL RF Channel Release Ack (PDCH)" ]; + + phy box bsc [ label = "Activate TCH/H" ]; + bsc => bts [ label = "RSL Channel Activation (TCH/H)" ]; + --- [ label = "BTS notices: chan still connected as PDTCH, reconnect" ]; + bts => phy [ label = "L1 chan Disconnect PDTCH" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + bts => phy [ label = "L1 chan Connect TCH/H" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + --- [ label = "chan reconnect as TCH/H complete" ]; + bts => phy [ label = "L1 chan Activate SAPIs" ]; + bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ]; + --- [ label = "Voice call 1 commences..." ]; + + phy box bsc [ label = "A second voice call is requested" ]; + bts => bsc [ label = "RSL Chan Requested" ]; + phy box bsc [ label = "BSC finds second slot on dynamic TS in TCH/H mode" ]; + bsc => bts [ label = "RSL Channel Activation (TCH/H)" ]; + bts => phy [ label = "L1 chan Activate SAPIs" ]; + bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ]; + --- [ label = "Voice call 2 commences..." ]; + +} diff --git a/OsmoBTS/abis/dyn_ts_osmocom_style2.msc b/OsmoBTS/abis/dyn_ts_osmocom_style2.msc new file mode 100644 index 0000000..9ea65b6 --- /dev/null +++ b/OsmoBTS/abis/dyn_ts_osmocom_style2.msc @@ -0,0 +1,31 @@ +msc { + hscale = "1.5"; + phy,bts,pcu,bsc; + + --- [ label = "...Voice call 1 ends" ]; + bts => bsc [ label = "Release Ind" ]; + bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ]; + bts => phy [ label = "L1 chan Deactivate SAPIs" ]; + bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ]; + --- [ label = "BSC notices: one chan still in use"]; + + --- [ label = "...Voice call 2 ends" ]; + bts => bsc [ label = "Release Ind" ]; + bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ]; + bts => phy [ label = "L1 chan Deactivate SAPIs" ]; + bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ]; + + phy box bsc [ label = "If all channels on TS are released, PDCH Activation" ]; + bsc => bts [ label = "RSL Channel Activation (PDCH)" ]; + bts -> bsc [ label = "RSL Channel Activation Ack (PDCH) (unconditionally)" ]; + --- [ label = "BTS notices: chan still connected as TCH/H, reconnect" ]; + bts => phy [ label = "L1 chan Disconnect TCH/H" ]; + phy -> bts [ label = "L1 chan Disconnect confirm" ]; + bts => phy [ label = "L1 chan Connect PDTCH" ]; + phy -> bts [ label = "L1 chan Connect confirm" ]; + --- [ label = "chan reconnect as PDTCH complete" ]; + bts => pcu [ label = "Info Ind (Activate)" ]; + pcu => bts [ label = "chan Activate request" ]; + bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ]; + phy -> bts [ label = "L1 chan Activate SAPIs confirm" ]; +} diff --git a/OsmoBTS/abis/rsl.adoc b/OsmoBTS/abis/rsl.adoc index ed8676e..33ae26d 100644 --- a/OsmoBTS/abis/rsl.adoc +++ b/OsmoBTS/abis/rsl.adoc @@ -410,10 +410,16 @@ ===== IPA Style Dynamic Switchover Example -.Example for dynamic channel switchover, for IPA style dynamic timeslots +.Part 1: example for dynamic channel switchover, for IPA style dynamic timeslots ["mscgen"] ---- -include::dyn_ts_ipa_style.msc[] +include::dyn_ts_ipa_style1.msc[] +---- + +.Part 2: example for dynamic channel switchover, for IPA style dynamic timeslots +["mscgen"] +---- +include::dyn_ts_ipa_style2.msc[] ---- @@ -449,12 +455,17 @@ ===== Osmocom Style Dynamic Switchover Example -.Example for dynamic channel switchover, for Osmocom style dynamic timeslots +.Part 1: example for dynamic channel switchover, for Osmocom style dynamic timeslots ["mscgen"] ---- -include::dyn_ts_osmocom_style.msc[] +include::dyn_ts_osmocom_style1.msc[] ---- +.Part 2: example for dynamic channel switchover, for Osmocom style dynamic timeslots +["mscgen"] +---- +include::dyn_ts_osmocom_style2.msc[] +---- === Message Formats and Contents -- To view, visit https://gerrit.osmocom.org/1091 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If90250123a85cd275f07c69ee64c6e10a7269f06 Gerrit-PatchSet: 6 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:10 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 09:32:10 +0000 Subject: [PATCH] libosmocore[master]: bitcomp: Remove the t4 decoding from libosmocore In-Reply-To: References: Message-ID: Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1176 to look at the new patch set (#3). bitcomp: Remove the t4 decoding from libosmocore As outlined by mail on the 13th of July the tree based approach to decoding in the PCU is faster by order of magnitude. Instead of having a slow implementation in the library and a quick one in the PCU, let's only have a quick one in the PCU and at some point in the future move it to libosmocore. Execute the plan and remove t4_decode. Change-Id: I021424444625a097560d086c217c81eac4a5ee44 --- M include/osmocom/core/bitcomp.h M src/bitcomp.c M tests/bits/bitcomp_test.c M tests/bits/bitcomp_test.ok 4 files changed, 0 insertions(+), 151 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/76/1176/3 diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index 89eccbc..e87c0e1 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -37,6 +37,5 @@ int osmo_t4_encode(struct bitvec *bv); -int osmo_t4_decode(const struct bitvec *in, bool cc, struct bitvec *out); /*! @} */ diff --git a/src/bitcomp.c b/src/bitcomp.c index 8b3090e..9c01246 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -180,18 +180,10 @@ {8, 6, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8} }; -static const unsigned t4_min_term_length[] = {2, 4}; -static const unsigned t4_min_make_up_length[] = {10, 5}; - -static const unsigned t4_max_term_length[] = {12, 8}; -static const unsigned t4_max_make_up_length[] = {13, 9}; - static const unsigned t4_make_up_length[2][15] = { {10, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13}, {5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9} }; - -static const unsigned t4_make_up_ind[15] = {64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960}; static const unsigned t4_make_up[2][15] = { { @@ -229,30 +221,6 @@ 0b011010100 } }; - -/*! \brief Attempt to decode compressed bit vector - * - * \return length of RLE according to modified ITU-T T.4 from TS 44.060 - * Table 9.1.10.2 or -1 if no applicable RLE found N. B: we need - * explicit bit length to make decoding unambiguous -*/ -static inline int t4_rle_term(unsigned w, bool b, unsigned bits) -{ - unsigned i; - for (i = 0; i < 64; i++) - if (w == t4_term[b][i] && bits == t4_term_length[b][i]) - return i; - return -1; -} - -static inline int t4_rle_makeup(unsigned w, bool b, unsigned bits) -{ - unsigned i; - for (i = 0; i < 15; i++) - if (w == t4_make_up[b][i] && bits == t4_make_up_length[b][i]) - return t4_make_up_ind[i]; - return -1; -} /*! \brief Make-up codes for a given length * @@ -337,102 +305,6 @@ } return bitvec_set_uint(bv, t4_term[b][len], t4_term_length[b][len]); -} - -enum dec_state { - EXPECT_TERM, - TOO_LONG, - NEED_MORE_BITS, - CORRUPT, - OK -}; - -static inline enum dec_state _t4_step(struct bitvec *v, uint16_t w, bool b, unsigned bits, bool term_only) -{ - if (bits > t4_max_make_up_length[b]) - return TOO_LONG; - if (bits < t4_min_term_length[b]) - return NEED_MORE_BITS; - - if (term_only) { - if (bits > t4_max_term_length[b]) - return CORRUPT; - int t = t4_rle_term(w, b, bits); - if (-1 != t) { - bitvec_fill(v, t, b ? ONE : ZERO); - return OK; - } - return NEED_MORE_BITS; - } - - int m = t4_rle_makeup(w, b, bits); - if (-1 != m) { - bitvec_fill(v, m, b ? ONE : ZERO); - return EXPECT_TERM; - } - - m = t4_rle_term(w, b, bits); - if (-1 != m) { - bitvec_fill(v, m, b ? ONE : ZERO); - return OK; - } - - return NEED_MORE_BITS; -} - -/*! \brief decode T4-encoded bit vector - * Assumes MSB first encoding. - * \param[in] in bit vector with encoded data - * \param[in] cc color code (whether decoding should start with 1 or 0) - * \param[out] out the bit vector to store result into - * \return 0 on success, negative value otherwise - */ -int osmo_t4_decode(const struct bitvec *in, bool cc, struct bitvec *out) -{ - uint8_t orig[in->data_len]; - struct bitvec vec; - vec.data = orig; - vec.data_len = in->data_len; - bitvec_zero(&vec); - memcpy(vec.data, in->data, in->data_len); - vec.cur_bit = in->cur_bit; - - /* init decoder using known color code: */ - unsigned bits = t4_min_term_length[cc]; - enum dec_state d; - int16_t w = bitvec_get_int16_msb(&vec, bits); - bool b = cc; - bool term_only = false; - - while (vec.cur_bit > 0) { - d = _t4_step(out, w, b, bits, term_only); - - switch (d) { - case EXPECT_TERM: - bitvec_shiftl(&vec, bits); - bits = t4_min_term_length[b]; - w = bitvec_get_int16_msb(&vec, bits); - term_only = true; - break; - case OK: - bitvec_shiftl(&vec, bits); - bits = t4_min_term_length[!b]; - w = bitvec_get_int16_msb(&vec, bits); - b = !b; - term_only = false; - break; - case NEED_MORE_BITS: - bits++; - w = bitvec_get_int16_msb(&vec, bits); - break; - case TOO_LONG: - return -E2BIG; - case CORRUPT: - return -EINVAL; - } - } - - return 0; } /*! \brief encode bit vector in-place using T4 encoding diff --git a/tests/bits/bitcomp_test.c b/tests/bits/bitcomp_test.c index f6895cf..587dd72 100644 --- a/tests/bits/bitcomp_test.c +++ b/tests/bits/bitcomp_test.c @@ -41,11 +41,6 @@ bitvec_set_uint(&bv, 4, 3); bitvec_to_string_r(&bv, lol); printf(" %s [%d]\n", lol, bv.cur_bit); - int d = osmo_t4_decode(&bv, 0, &out); - printf("\nDecoded:\n%d", d); - bitvec_to_string_r(&out, lol); - printf("%s [%d]\n", lol, out.cur_bit); - printf("Expected:\n 00110111 01000111 10000001 1111 \n"); printf("\nTEST2:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); bitvec_zero(&bv); @@ -54,13 +49,6 @@ bitvec_set_uint(&bv, 0xFFFFFC00, 26); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n1 11011101 01000001 00 [18]\n", bv.cur_bit); - - bitvec_zero(&out); - d = osmo_t4_decode(&bv, 1, &out); - printf("\nDecoded:\n%d", d); - bitvec_to_string_r(&out, lol); - printf("%s [%d]\n", lol, out.cur_bit); - printf("Expected:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); return 0; } diff --git a/tests/bits/bitcomp_test.ok b/tests/bits/bitcomp_test.ok index 238f3c4..d2ac16a 100644 --- a/tests/bits/bitcomp_test.ok +++ b/tests/bits/bitcomp_test.ok @@ -10,11 +10,6 @@ 0 11011110 10001000 01110101 01100101 100 [35] 11011110 10001000 01110101 01100101 100 [35] -Decoded: -0 00110111 01000111 10000001 1111 [28] -Expected: - 00110111 01000111 10000001 1111 - TEST2: 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 @@ -22,8 +17,3 @@ 1 11011101 01000001 00 [18] Expected: 1 11011101 01000001 00 [18] - -Decoded: -0 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 [90] -Expected: - 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 -- To view, visit https://gerrit.osmocom.org/1176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I021424444625a097560d086c217c81eac4a5ee44 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:32:14 +0000 Subject: openggsn[master]: Only send TRAP for defined PDP peer In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5e02c1d42bb7aaf1ef81a9824aab7b12047cdd3e Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:32:29 +0000 Subject: openggsn[master]: Only send TRAP for defined PDP peer In-Reply-To: References: Message-ID: Patch Set 2: holgers comments are adressed, merging this now -- To view, visit https://gerrit.osmocom.org/1065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5e02c1d42bb7aaf1ef81a9824aab7b12047cdd3e Gerrit-PatchSet: 2 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:32:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 2 Nov 2016 09:32:31 +0000 Subject: [MERGED] openggsn[master]: Only send TRAP for defined PDP peer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Only send TRAP for defined PDP peer ...................................................................... Only send TRAP for defined PDP peer Do not attempt to send TRAP message on PDP context deletion if peer is unknown. Change-Id: I5e02c1d42bb7aaf1ef81a9824aab7b12047cdd3e Fixes: Coverity CID 150135 --- M ggsn/ggsn.c 1 file changed, 8 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/ggsn/ggsn.c b/ggsn/ggsn.c index 9609d52..181ba2d 100644 --- a/ggsn/ggsn.c +++ b/ggsn/ggsn.c @@ -138,10 +138,15 @@ DEBUGP(DGGSN, "Deleting PDP context\n"); struct ippoolm_t *member = pdp->peer; char v[NAMESIZE]; - snprintf(v, sizeof(v), "%" PRIu64 ",%s", pdp->imsi, inet_ntoa(member->addr)); - if (pdp->peer) + + if (pdp->peer) { + snprintf(v, sizeof(v), "%" PRIu64 ",%s", pdp->imsi, + inet_ntoa(member->addr)); + if (ctrl_cmd_send_trap(gsn->ctrl, "imsi-rem-ip", v) < 0) + LOGP(DGGSN, LOGL_ERROR, "Failed to create and send TRAP" + " for IMSI %" PRIu64 " PDP deletion.\n", pdp->imsi); ippool_freeip(ippool, (struct ippoolm_t *)pdp->peer); - else + } else SYS_ERR(DGGSN, LOGL_ERROR, 0, "Peer not defined!"); if (gtp_kernel_tunnel_del(pdp)) { @@ -149,9 +154,6 @@ "Cannot delete tunnel from kernel: %s\n", strerror(errno)); } -/* FIXME: naming? */ - if (ctrl_cmd_send_trap(gsn->ctrl, "imsi-rem-ip", v) < 0) - LOGP(DGGSN, LOGL_ERROR, "Trap creation failed.\n"); return 0; } -- To view, visit https://gerrit.osmocom.org/1065 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e02c1d42bb7aaf1ef81a9824aab7b12047cdd3e Gerrit-PatchSet: 3 Gerrit-Project: openggsn Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:38:26 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 09:38:26 +0000 Subject: [PATCH] libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1172 to look at the new patch set (#3). Add logging and testing for FSM deallocation osmo_fsm_inst_alloc() logs allocation but osmo_fsm_inst_free() is silent. Fix this by adding log message for deallocation to make FSM lifecycle tracking easier. Also make sure it's covered by test suite. Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 --- M src/fsm.c M tests/fsm/fsm_test.c 2 files changed, 6 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/72/1172/3 diff --git a/src/fsm.c b/src/fsm.c index f525f40..9dc6b98 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -233,6 +233,7 @@ */ void osmo_fsm_inst_free(struct osmo_fsm_inst *fi) { + LOGPFSM(fi, "Deallocated\n"); osmo_timer_del(&fi->timer); llist_del(&fi->list); talloc_free(fi); diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 29b31ef..edbba9e 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -89,7 +89,7 @@ .log_subsys = DMAIN, }; -static int foo(void) +static struct osmo_fsm_inst *foo(void) { struct osmo_fsm_inst *fi; @@ -115,7 +115,7 @@ OSMO_ASSERT(fi->state == ST_TWO); - return 0; + return fi; } static const struct log_info_cat default_categories[] = { @@ -134,6 +134,7 @@ int main(int argc, char **argv) { struct log_target *stderr_target; + struct osmo_fsm_inst *finst; osmo_fsm_log_addr(false); @@ -145,12 +146,12 @@ g_ctx = NULL; osmo_fsm_register(&fsm); - foo(); + finst = foo(); while (1) { osmo_select_main(0); } - + osmo_fsm_inst_free(finst); osmo_fsm_unregister(&fsm); exit(0); } -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:52:32 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 09:52:32 +0000 Subject: [PATCH] osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/862 to look at the new patch set (#9). EGPRS: fix for EPDAN out of window Fix alignment of EPDAN outside the RLC transmit window, according to section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7. The specification explains that a bit within the uncompressed bitmap whose corresponding BSN is not within the transmit window shall be ignored. Without this fix PCU was dropping the EPDAN message and not updating the status of BSNs which are inside the RLC window. This patch updates the status of the BSNs which are inside the window and ignores the remaining bits. Related: OS#1789 Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 --- M src/rlc.cpp M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 4 files changed, 149 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/62/862/9 diff --git a/src/rlc.cpp b/src/rlc.cpp index ee2635a..f6e327b 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -105,7 +105,14 @@ uint16_t first_bsn, uint16_t *lost, uint16_t *received) { - unsigned num_blocks = rbb->cur_bit; + /* + * TODO: Need to change the return type of function distance to unsigned + * besides "& mod_sns()", we assume that m_v_s is always + * bigger/equal than m_v_a (send, bigger than acked). + */ + unsigned dist = distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned bsn; /* first_bsn is in range V(A)..V(S) */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index c89cd03..95d9733 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -847,6 +847,16 @@ unsigned received_packets = 0, lost_packets = 0; unsigned num_blocks = strlen(show_rbb); + /* + * TODO: Need to change the return type of function distance to unsigned + * besides "& mod_sns()", we assume that m_v_s is always + * bigger/equal than m_v_a (send, bigger than acked). + */ + unsigned distance = m_window.distance(); + + num_blocks = num_blocks > distance + ? distance : num_blocks; + /* SSN - 1 is in range V(A)..V(S)-1 */ for (unsigned int bitpos = 0; bitpos < num_blocks; bitpos++) { bool is_received; @@ -919,13 +929,20 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, const struct bitvec *rbb) { - int16_t dist; /* must be signed */ + unsigned dist; uint16_t lost = 0, received = 0; char show_v_b[RLC_MAX_SNS + 1]; char show_rbb[RLC_MAX_SNS + 1]; int error_rate; struct ana_result ana_res; - unsigned num_blocks = rbb->cur_bit; + /* + * TODO: Need to change the return type of function distance to unsigned + * besides "& mod_sns()", we assume that m_v_s is always + * bigger/equal than m_v_a (send, bigger than acked). + */ + dist = m_window.distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned behind_last_bsn = m_window.mod_sns(first_bsn + num_blocks); Decoding::extract_rbb(rbb, show_rbb); @@ -933,25 +950,6 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- ack: (BSN=%d)\"%s\"" "(BSN=%d) R=ACK I=NACK\n", first_bsn, show_rbb, m_window.mod_sns(behind_last_bsn - 1)); - - /* apply received array to receive state (first_bsn..behind_last_bsn-1) */ - if (num_blocks > 0) { - /* calculate distance of ssn from V(S) */ - dist = m_window.mod_sns(m_window.v_s() - behind_last_bsn); - /* check if distance is less than distance V(A)..V(S) */ - if (dist >= m_window.distance()) { - /* this might happpen, if the downlink assignment - * was not received by ms and the ack refers - * to previous TBF - * FIXME: we should implement polling for - * control ack! - * TODO: check whether this FIXME still makes sense - */ - LOGP(DRLCMACDL, LOGL_NOTICE, "- ack range is out of " - "V(A)..V(S) range %s Free TBF!\n", tbf_name(this)); - return 1; /* indicate to free TBF */ - } - } error_rate = analyse_errors(show_rbb, behind_last_bsn, &ana_res); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 8fb8bfe..cc48392 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2101,17 +2101,11 @@ dl_tbf->rcvd_dl_ack( ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, bsn_begin, &bits); - /* - * TODO:status of BSN:1176,1177 shall be invalid - * status of BSN:1286,1287 shall be acked. - * both condition fails because of existing bug. Which shall be - * fixed in subsequent commit - */ - OSMO_ASSERT(prlcmvb->is_unacked(1176)); - OSMO_ASSERT(prlcmvb->is_unacked(1177)); - OSMO_ASSERT(prlcmvb->is_unacked(1286)); - OSMO_ASSERT(prlcmvb->is_unacked(1287)); + OSMO_ASSERT(prlcmvb->is_invalid(1176)); + OSMO_ASSERT(prlcmvb->is_invalid(1177)); + OSMO_ASSERT(prlcmvb->is_acked(1286)); + OSMO_ASSERT(prlcmvb->is_acked(1287)); bitvec_free(block); tbf_free(dl_tbf); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index f8e6503..fc3a113 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -446,7 +446,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=85)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=20) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=127, info='RRRRRRRRRRRRRRRRRRRRR$..........................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRR...........................................' - got ack for BSN=20 - got ack for BSN=19 - got ack for BSN=18 @@ -485,7 +485,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=86)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=21) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=20, info='R$..............................................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................' - got ack for BSN=21 - V(B): (V(A)=22)""(V(S)-1=21) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 @@ -6504,9 +6504,122 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge -- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1288) R=ACK I=NACK -- ack range is out of V(A)..V(S) range TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Free TBF! -DL packet loss of IMSI= / TLLI=0xffeeddcc: 100% +- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1287) R=ACK I=NACK +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) DL analysis, range=1176:1288, lost=73, recv=39, skipped=0, bsn=1944, info='RRRRRRRRRRRRRRRRRRRRRRRRRRLRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRR................................................................................................................................................................................................................................................................................................................................................................................' +- got ack for BSN=1176 +- got ack for BSN=1177 +- got ack for BSN=1178 +- got ack for BSN=1179 +- got ack for BSN=1180 +- got ack for BSN=1181 +- got ack for BSN=1182 +- got ack for BSN=1183 +- got ack for BSN=1184 +- got ack for BSN=1185 +- got NACK for BSN=1186 +- got NACK for BSN=1187 +- got NACK for BSN=1188 +- got NACK for BSN=1189 +- got NACK for BSN=1190 +- got NACK for BSN=1191 +- got NACK for BSN=1192 +- got NACK for BSN=1193 +- got NACK for BSN=1194 +- got NACK for BSN=1195 +- got NACK for BSN=1196 +- got NACK for BSN=1197 +- got NACK for BSN=1198 +- got NACK for BSN=1199 +- got NACK for BSN=1200 +- got NACK for BSN=1201 +- got NACK for BSN=1202 +- got NACK for BSN=1203 +- got NACK for BSN=1204 +- got NACK for BSN=1205 +- got NACK for BSN=1206 +- got NACK for BSN=1207 +- got NACK for BSN=1208 +- got NACK for BSN=1209 +- got NACK for BSN=1210 +- got NACK for BSN=1211 +- got NACK for BSN=1212 +- got NACK for BSN=1213 +- got NACK for BSN=1214 +- got NACK for BSN=1215 +- got NACK for BSN=1216 +- got NACK for BSN=1217 +- got NACK for BSN=1218 +- got NACK for BSN=1219 +- got NACK for BSN=1220 +- got NACK for BSN=1221 +- got NACK for BSN=1222 +- got NACK for BSN=1223 +- got NACK for BSN=1224 +- got NACK for BSN=1225 +- got NACK for BSN=1226 +- got NACK for BSN=1227 +- got NACK for BSN=1228 +- got NACK for BSN=1229 +- got NACK for BSN=1230 +- got NACK for BSN=1231 +- got NACK for BSN=1232 +- got NACK for BSN=1233 +- got NACK for BSN=1234 +- got NACK for BSN=1235 +- got NACK for BSN=1236 +- got NACK for BSN=1237 +- got NACK for BSN=1238 +- got NACK for BSN=1239 +- got NACK for BSN=1240 +- got NACK for BSN=1241 +- got NACK for BSN=1242 +- got NACK for BSN=1243 +- got NACK for BSN=1244 +- got NACK for BSN=1245 +- got NACK for BSN=1246 +- got NACK for BSN=1247 +- got NACK for BSN=1248 +- got NACK for BSN=1249 +- got NACK for BSN=1250 +- got NACK for BSN=1251 +- got NACK for BSN=1252 +- got NACK for BSN=1253 +- got NACK for BSN=1254 +- got NACK for BSN=1255 +- got NACK for BSN=1256 +- got NACK for BSN=1257 +- got ack for BSN=1258 +- got ack for BSN=1259 +- got ack for BSN=1260 +- got NACK for BSN=1261 +- got ack for BSN=1262 +- got ack for BSN=1263 +- got ack for BSN=1264 +- got ack for BSN=1265 +- got ack for BSN=1266 +- got ack for BSN=1267 +- got ack for BSN=1268 +- got ack for BSN=1269 +- got ack for BSN=1270 +- got ack for BSN=1271 +- got ack for BSN=1272 +- got ack for BSN=1273 +- got ack for BSN=1274 +- got ack for BSN=1275 +- got ack for BSN=1276 +- got ack for BSN=1277 +- got ack for BSN=1278 +- got ack for BSN=1279 +- got ack for BSN=1280 +- got ack for BSN=1281 +- got ack for BSN=1282 +- got ack for BSN=1283 +- got ack for BSN=1284 +- got ack for BSN=1285 +- got ack for BSN=1286 +- got ack for BSN=1287 +- V(B): (V(A)=1186)"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNAAANAAAAAAAAAAAAAAAAAAAAAAAAAA"(V(S)-1=1287) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid +DL packet loss of IMSI= / TLLI=0xffeeddcc: 78% TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:58:46 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 09:58:46 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 9: (1 comment) https://gerrit.osmocom.org/#/c/862/8/src/rlc.cpp File src/rlc.cpp: Line 109: * TODO: Need to change the return type of function distance to unsigned > Sorry two parts. for second part, I am assuming the suggestion was to change only the comment section not the function return type modification. As discussed with Neels earlier, we had decided to put separate patch for return type modifiation. please suggest -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:59:07 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 09:59:07 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 9: (1 comment) https://gerrit.osmocom.org/#/c/862/8/src/rlc.cpp File src/rlc.cpp: Line 109: * TODO: Need to change the return type of function distance to unsigned > for second part, I am assuming the suggestion was to change only the commen Done -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 9 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 09:59:51 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 09:59:51 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 8: (1 comment) https://gerrit.osmocom.org/#/c/862/8/src/rlc.cpp File src/rlc.cpp: Line 109: unsigned dist = (unsigned)distance(); > for second part, I am assuming the suggestion was to change only the commen Then do the change of return type first (and rebase the change to have the other patch first)? -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:08:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 10:08:24 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: Why only sysmobts? Is there some difference in rsl implementation with other hw? -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:18:31 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 10:18:31 +0000 Subject: [PATCH] osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/862 to look at the new patch set (#10). EGPRS: fix for EPDAN out of window Fix alignment of EPDAN outside the RLC transmit window, according to section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7. The specification explains that a bit within the uncompressed bitmap whose corresponding BSN is not within the transmit window shall be ignored. Without this fix PCU was dropping the EPDAN message and not updating the status of BSNs which are inside the RLC window. This patch updates the status of the BSNs which are inside the window and ignores the remaining bits. Related: OS#1789 Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 --- M src/rlc.cpp M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 4 files changed, 134 insertions(+), 37 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/62/862/10 diff --git a/src/rlc.cpp b/src/rlc.cpp index ee2635a..2bffccb 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -105,7 +105,9 @@ uint16_t first_bsn, uint16_t *lost, uint16_t *received) { - unsigned num_blocks = rbb->cur_bit; + unsigned dist = distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned bsn; /* first_bsn is in range V(A)..V(S) */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index c89cd03..f6836f8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -847,6 +847,11 @@ unsigned received_packets = 0, lost_packets = 0; unsigned num_blocks = strlen(show_rbb); + unsigned distance = m_window.distance(); + + num_blocks = num_blocks > distance + ? distance : num_blocks; + /* SSN - 1 is in range V(A)..V(S)-1 */ for (unsigned int bitpos = 0; bitpos < num_blocks; bitpos++) { bool is_received; @@ -919,13 +924,15 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, const struct bitvec *rbb) { - int16_t dist; /* must be signed */ + unsigned dist; uint16_t lost = 0, received = 0; char show_v_b[RLC_MAX_SNS + 1]; char show_rbb[RLC_MAX_SNS + 1]; int error_rate; struct ana_result ana_res; - unsigned num_blocks = rbb->cur_bit; + dist = m_window.distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned behind_last_bsn = m_window.mod_sns(first_bsn + num_blocks); Decoding::extract_rbb(rbb, show_rbb); @@ -933,25 +940,6 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- ack: (BSN=%d)\"%s\"" "(BSN=%d) R=ACK I=NACK\n", first_bsn, show_rbb, m_window.mod_sns(behind_last_bsn - 1)); - - /* apply received array to receive state (first_bsn..behind_last_bsn-1) */ - if (num_blocks > 0) { - /* calculate distance of ssn from V(S) */ - dist = m_window.mod_sns(m_window.v_s() - behind_last_bsn); - /* check if distance is less than distance V(A)..V(S) */ - if (dist >= m_window.distance()) { - /* this might happpen, if the downlink assignment - * was not received by ms and the ack refers - * to previous TBF - * FIXME: we should implement polling for - * control ack! - * TODO: check whether this FIXME still makes sense - */ - LOGP(DRLCMACDL, LOGL_NOTICE, "- ack range is out of " - "V(A)..V(S) range %s Free TBF!\n", tbf_name(this)); - return 1; /* indicate to free TBF */ - } - } error_rate = analyse_errors(show_rbb, behind_last_bsn, &ana_res); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 8fb8bfe..cc48392 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2101,17 +2101,11 @@ dl_tbf->rcvd_dl_ack( ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, bsn_begin, &bits); - /* - * TODO:status of BSN:1176,1177 shall be invalid - * status of BSN:1286,1287 shall be acked. - * both condition fails because of existing bug. Which shall be - * fixed in subsequent commit - */ - OSMO_ASSERT(prlcmvb->is_unacked(1176)); - OSMO_ASSERT(prlcmvb->is_unacked(1177)); - OSMO_ASSERT(prlcmvb->is_unacked(1286)); - OSMO_ASSERT(prlcmvb->is_unacked(1287)); + OSMO_ASSERT(prlcmvb->is_invalid(1176)); + OSMO_ASSERT(prlcmvb->is_invalid(1177)); + OSMO_ASSERT(prlcmvb->is_acked(1286)); + OSMO_ASSERT(prlcmvb->is_acked(1287)); bitvec_free(block); tbf_free(dl_tbf); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index f8e6503..fc3a113 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -446,7 +446,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=85)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=20) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=127, info='RRRRRRRRRRRRRRRRRRRRR$..........................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRR...........................................' - got ack for BSN=20 - got ack for BSN=19 - got ack for BSN=18 @@ -485,7 +485,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=86)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=21) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=20, info='R$..............................................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................' - got ack for BSN=21 - V(B): (V(A)=22)""(V(S)-1=21) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 @@ -6504,9 +6504,122 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge -- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1288) R=ACK I=NACK -- ack range is out of V(A)..V(S) range TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Free TBF! -DL packet loss of IMSI= / TLLI=0xffeeddcc: 100% +- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1287) R=ACK I=NACK +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) DL analysis, range=1176:1288, lost=73, recv=39, skipped=0, bsn=1944, info='RRRRRRRRRRRRRRRRRRRRRRRRRRLRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRR................................................................................................................................................................................................................................................................................................................................................................................' +- got ack for BSN=1176 +- got ack for BSN=1177 +- got ack for BSN=1178 +- got ack for BSN=1179 +- got ack for BSN=1180 +- got ack for BSN=1181 +- got ack for BSN=1182 +- got ack for BSN=1183 +- got ack for BSN=1184 +- got ack for BSN=1185 +- got NACK for BSN=1186 +- got NACK for BSN=1187 +- got NACK for BSN=1188 +- got NACK for BSN=1189 +- got NACK for BSN=1190 +- got NACK for BSN=1191 +- got NACK for BSN=1192 +- got NACK for BSN=1193 +- got NACK for BSN=1194 +- got NACK for BSN=1195 +- got NACK for BSN=1196 +- got NACK for BSN=1197 +- got NACK for BSN=1198 +- got NACK for BSN=1199 +- got NACK for BSN=1200 +- got NACK for BSN=1201 +- got NACK for BSN=1202 +- got NACK for BSN=1203 +- got NACK for BSN=1204 +- got NACK for BSN=1205 +- got NACK for BSN=1206 +- got NACK for BSN=1207 +- got NACK for BSN=1208 +- got NACK for BSN=1209 +- got NACK for BSN=1210 +- got NACK for BSN=1211 +- got NACK for BSN=1212 +- got NACK for BSN=1213 +- got NACK for BSN=1214 +- got NACK for BSN=1215 +- got NACK for BSN=1216 +- got NACK for BSN=1217 +- got NACK for BSN=1218 +- got NACK for BSN=1219 +- got NACK for BSN=1220 +- got NACK for BSN=1221 +- got NACK for BSN=1222 +- got NACK for BSN=1223 +- got NACK for BSN=1224 +- got NACK for BSN=1225 +- got NACK for BSN=1226 +- got NACK for BSN=1227 +- got NACK for BSN=1228 +- got NACK for BSN=1229 +- got NACK for BSN=1230 +- got NACK for BSN=1231 +- got NACK for BSN=1232 +- got NACK for BSN=1233 +- got NACK for BSN=1234 +- got NACK for BSN=1235 +- got NACK for BSN=1236 +- got NACK for BSN=1237 +- got NACK for BSN=1238 +- got NACK for BSN=1239 +- got NACK for BSN=1240 +- got NACK for BSN=1241 +- got NACK for BSN=1242 +- got NACK for BSN=1243 +- got NACK for BSN=1244 +- got NACK for BSN=1245 +- got NACK for BSN=1246 +- got NACK for BSN=1247 +- got NACK for BSN=1248 +- got NACK for BSN=1249 +- got NACK for BSN=1250 +- got NACK for BSN=1251 +- got NACK for BSN=1252 +- got NACK for BSN=1253 +- got NACK for BSN=1254 +- got NACK for BSN=1255 +- got NACK for BSN=1256 +- got NACK for BSN=1257 +- got ack for BSN=1258 +- got ack for BSN=1259 +- got ack for BSN=1260 +- got NACK for BSN=1261 +- got ack for BSN=1262 +- got ack for BSN=1263 +- got ack for BSN=1264 +- got ack for BSN=1265 +- got ack for BSN=1266 +- got ack for BSN=1267 +- got ack for BSN=1268 +- got ack for BSN=1269 +- got ack for BSN=1270 +- got ack for BSN=1271 +- got ack for BSN=1272 +- got ack for BSN=1273 +- got ack for BSN=1274 +- got ack for BSN=1275 +- got ack for BSN=1276 +- got ack for BSN=1277 +- got ack for BSN=1278 +- got ack for BSN=1279 +- got ack for BSN=1280 +- got ack for BSN=1281 +- got ack for BSN=1282 +- got ack for BSN=1283 +- got ack for BSN=1284 +- got ack for BSN=1285 +- got ack for BSN=1286 +- got ack for BSN=1287 +- V(B): (V(A)=1186)"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNAAANAAAAAAAAAAAAAAAAAAAAAAAAAA"(V(S)-1=1287) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid +DL packet loss of IMSI= / TLLI=0xffeeddcc: 78% TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:18:31 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 10:18:31 +0000 Subject: [PATCH] osmo-pcu[master]: Modify return type of gprs_rlc_dl_window::distance to uint16_t Message-ID: Review at https://gerrit.osmocom.org/1182 Modify return type of gprs_rlc_dl_window::distance to uint16_t Since there is a "&mod_sns()" present in this function, the outcome is always unsigned. Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4 --- M src/rlc.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/82/1182/1 diff --git a/src/rlc.h b/src/rlc.h index b693418..b2fcd95 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -300,7 +300,7 @@ const uint16_t v_s() const; const uint16_t v_s_mod(int offset) const; const uint16_t v_a() const; - const int16_t distance() const; + const uint16_t distance() const; /* Methods to manage reception */ int resend_needed(); @@ -539,7 +539,7 @@ m_v_a = (m_v_a + moves) & mod_sns(); } -inline const int16_t gprs_rlc_dl_window::distance() const +inline const uint16_t gprs_rlc_dl_window::distance() const { return (m_v_s - m_v_a) & mod_sns(); } -- To view, visit https://gerrit.osmocom.org/1182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:20:06 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 10:20:06 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 10: (1 comment) https://gerrit.osmocom.org/#/c/862/8/src/rlc.cpp File src/rlc.cpp: Line 109: unsigned num_blocks = rbb->cur_bit > dist > Then do the change of return type first (and rebase the change to have the Ok. I have uploaded an additional patch for the return type modification. -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:26:28 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 10:26:28 +0000 Subject: osmo-pcu[master]: Modify return type of gprs_rlc_dl_window::distance to uint16_t In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:27:00 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 10:27:00 +0000 Subject: [MERGED] osmo-pcu[master]: Modify return type of gprs_rlc_dl_window::distance to uint16_t In-Reply-To: References: Message-ID: arvind.sirsikar has submitted this change and it was merged. Change subject: Modify return type of gprs_rlc_dl_window::distance to uint16_t ...................................................................... Modify return type of gprs_rlc_dl_window::distance to uint16_t Since there is a "&mod_sns()" present in this function, the outcome is always unsigned. Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4 --- M src/rlc.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/rlc.h b/src/rlc.h index b693418..b2fcd95 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -300,7 +300,7 @@ const uint16_t v_s() const; const uint16_t v_s_mod(int offset) const; const uint16_t v_a() const; - const int16_t distance() const; + const uint16_t distance() const; /* Methods to manage reception */ int resend_needed(); @@ -539,7 +539,7 @@ m_v_a = (m_v_a + moves) & mod_sns(); } -inline const int16_t gprs_rlc_dl_window::distance() const +inline const uint16_t gprs_rlc_dl_window::distance() const { return (m_v_s - m_v_a) & mod_sns(); } -- To view, visit https://gerrit.osmocom.org/1182 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I66f3db4dc27a6cbef146c832bf8b43f1492358a4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:27:31 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 10:27:31 +0000 Subject: osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: Patch Set 10: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:28:28 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 10:28:28 +0000 Subject: [MERGED] osmo-pcu[master]: EGPRS: fix for EPDAN out of window In-Reply-To: References: Message-ID: arvind.sirsikar has submitted this change and it was merged. Change subject: EGPRS: fix for EPDAN out of window ...................................................................... EGPRS: fix for EPDAN out of window Fix alignment of EPDAN outside the RLC transmit window, according to section 9.1.8.2.4 in 44.060 version 7.27.0 Release 7. The specification explains that a bit within the uncompressed bitmap whose corresponding BSN is not within the transmit window shall be ignored. Without this fix PCU was dropping the EPDAN message and not updating the status of BSNs which are inside the RLC window. This patch updates the status of the BSNs which are inside the window and ignores the remaining bits. Related: OS#1789 Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 --- M src/rlc.cpp M src/tbf_dl.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err 4 files changed, 134 insertions(+), 37 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/rlc.cpp b/src/rlc.cpp index ee2635a..2bffccb 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -105,7 +105,9 @@ uint16_t first_bsn, uint16_t *lost, uint16_t *received) { - unsigned num_blocks = rbb->cur_bit; + unsigned dist = distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned bsn; /* first_bsn is in range V(A)..V(S) */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index c89cd03..f6836f8 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -847,6 +847,11 @@ unsigned received_packets = 0, lost_packets = 0; unsigned num_blocks = strlen(show_rbb); + unsigned distance = m_window.distance(); + + num_blocks = num_blocks > distance + ? distance : num_blocks; + /* SSN - 1 is in range V(A)..V(S)-1 */ for (unsigned int bitpos = 0; bitpos < num_blocks; bitpos++) { bool is_received; @@ -919,13 +924,15 @@ int gprs_rlcmac_dl_tbf::update_window(unsigned first_bsn, const struct bitvec *rbb) { - int16_t dist; /* must be signed */ + unsigned dist; uint16_t lost = 0, received = 0; char show_v_b[RLC_MAX_SNS + 1]; char show_rbb[RLC_MAX_SNS + 1]; int error_rate; struct ana_result ana_res; - unsigned num_blocks = rbb->cur_bit; + dist = m_window.distance(); + unsigned num_blocks = rbb->cur_bit > dist + ? dist : rbb->cur_bit; unsigned behind_last_bsn = m_window.mod_sns(first_bsn + num_blocks); Decoding::extract_rbb(rbb, show_rbb); @@ -933,25 +940,6 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- ack: (BSN=%d)\"%s\"" "(BSN=%d) R=ACK I=NACK\n", first_bsn, show_rbb, m_window.mod_sns(behind_last_bsn - 1)); - - /* apply received array to receive state (first_bsn..behind_last_bsn-1) */ - if (num_blocks > 0) { - /* calculate distance of ssn from V(S) */ - dist = m_window.mod_sns(m_window.v_s() - behind_last_bsn); - /* check if distance is less than distance V(A)..V(S) */ - if (dist >= m_window.distance()) { - /* this might happpen, if the downlink assignment - * was not received by ms and the ack refers - * to previous TBF - * FIXME: we should implement polling for - * control ack! - * TODO: check whether this FIXME still makes sense - */ - LOGP(DRLCMACDL, LOGL_NOTICE, "- ack range is out of " - "V(A)..V(S) range %s Free TBF!\n", tbf_name(this)); - return 1; /* indicate to free TBF */ - } - } error_rate = analyse_errors(show_rbb, behind_last_bsn, &ana_res); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 8fb8bfe..cc48392 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2101,17 +2101,11 @@ dl_tbf->rcvd_dl_ack( ack_nack->EGPRS_AckNack.Desc.FINAL_ACK_INDICATION, bsn_begin, &bits); - /* - * TODO:status of BSN:1176,1177 shall be invalid - * status of BSN:1286,1287 shall be acked. - * both condition fails because of existing bug. Which shall be - * fixed in subsequent commit - */ - OSMO_ASSERT(prlcmvb->is_unacked(1176)); - OSMO_ASSERT(prlcmvb->is_unacked(1177)); - OSMO_ASSERT(prlcmvb->is_unacked(1286)); - OSMO_ASSERT(prlcmvb->is_unacked(1287)); + OSMO_ASSERT(prlcmvb->is_invalid(1176)); + OSMO_ASSERT(prlcmvb->is_invalid(1177)); + OSMO_ASSERT(prlcmvb->is_acked(1286)); + OSMO_ASSERT(prlcmvb->is_acked(1287)); bitvec_free(block); tbf_free(dl_tbf); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index f8e6503..fc3a113 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -446,7 +446,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=91 block=9 data=07 00 28 0a 41 c6 c7 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=85)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=20) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=127, info='RRRRRRRRRRRRRRRRRRRRR$..........................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=0:21, lost=0, recv=21, skipped=0, bsn=0, info='RRRRRRRRRRRRRRRRRRRRR...........................................' - got ack for BSN=20 - got ack for BSN=19 - got ack for BSN=18 @@ -485,7 +485,7 @@ Sending data request: trx=0 ts=4 sapi=5 arfcn=0 fn=95 block=10 data=07 00 2a 4d 43 c0 01 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) downlink acknowledge - ack: (BSN=86)"RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR"(BSN=21) R=ACK I=NACK -TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=20, info='R$..............................................................' +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) DL analysis, range=21:22, lost=0, recv=1, skipped=0, bsn=21, info='R...............................................................' - got ack for BSN=21 - V(B): (V(A)=22)""(V(S)-1=21) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid Scheduling data message at RTS for DL TFI=0 (TRX=0, TS=4) prio=4 @@ -6504,9 +6504,122 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge -- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1288) R=ACK I=NACK -- ack range is out of V(A)..V(S) range TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) Free TBF! -DL packet loss of IMSI= / TLLI=0xffeeddcc: 100% +- ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1287) R=ACK I=NACK +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) DL analysis, range=1176:1288, lost=73, recv=39, skipped=0, bsn=1944, info='RRRRRRRRRRRRRRRRRRRRRRRRRRLRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRR................................................................................................................................................................................................................................................................................................................................................................................' +- got ack for BSN=1176 +- got ack for BSN=1177 +- got ack for BSN=1178 +- got ack for BSN=1179 +- got ack for BSN=1180 +- got ack for BSN=1181 +- got ack for BSN=1182 +- got ack for BSN=1183 +- got ack for BSN=1184 +- got ack for BSN=1185 +- got NACK for BSN=1186 +- got NACK for BSN=1187 +- got NACK for BSN=1188 +- got NACK for BSN=1189 +- got NACK for BSN=1190 +- got NACK for BSN=1191 +- got NACK for BSN=1192 +- got NACK for BSN=1193 +- got NACK for BSN=1194 +- got NACK for BSN=1195 +- got NACK for BSN=1196 +- got NACK for BSN=1197 +- got NACK for BSN=1198 +- got NACK for BSN=1199 +- got NACK for BSN=1200 +- got NACK for BSN=1201 +- got NACK for BSN=1202 +- got NACK for BSN=1203 +- got NACK for BSN=1204 +- got NACK for BSN=1205 +- got NACK for BSN=1206 +- got NACK for BSN=1207 +- got NACK for BSN=1208 +- got NACK for BSN=1209 +- got NACK for BSN=1210 +- got NACK for BSN=1211 +- got NACK for BSN=1212 +- got NACK for BSN=1213 +- got NACK for BSN=1214 +- got NACK for BSN=1215 +- got NACK for BSN=1216 +- got NACK for BSN=1217 +- got NACK for BSN=1218 +- got NACK for BSN=1219 +- got NACK for BSN=1220 +- got NACK for BSN=1221 +- got NACK for BSN=1222 +- got NACK for BSN=1223 +- got NACK for BSN=1224 +- got NACK for BSN=1225 +- got NACK for BSN=1226 +- got NACK for BSN=1227 +- got NACK for BSN=1228 +- got NACK for BSN=1229 +- got NACK for BSN=1230 +- got NACK for BSN=1231 +- got NACK for BSN=1232 +- got NACK for BSN=1233 +- got NACK for BSN=1234 +- got NACK for BSN=1235 +- got NACK for BSN=1236 +- got NACK for BSN=1237 +- got NACK for BSN=1238 +- got NACK for BSN=1239 +- got NACK for BSN=1240 +- got NACK for BSN=1241 +- got NACK for BSN=1242 +- got NACK for BSN=1243 +- got NACK for BSN=1244 +- got NACK for BSN=1245 +- got NACK for BSN=1246 +- got NACK for BSN=1247 +- got NACK for BSN=1248 +- got NACK for BSN=1249 +- got NACK for BSN=1250 +- got NACK for BSN=1251 +- got NACK for BSN=1252 +- got NACK for BSN=1253 +- got NACK for BSN=1254 +- got NACK for BSN=1255 +- got NACK for BSN=1256 +- got NACK for BSN=1257 +- got ack for BSN=1258 +- got ack for BSN=1259 +- got ack for BSN=1260 +- got NACK for BSN=1261 +- got ack for BSN=1262 +- got ack for BSN=1263 +- got ack for BSN=1264 +- got ack for BSN=1265 +- got ack for BSN=1266 +- got ack for BSN=1267 +- got ack for BSN=1268 +- got ack for BSN=1269 +- got ack for BSN=1270 +- got ack for BSN=1271 +- got ack for BSN=1272 +- got ack for BSN=1273 +- got ack for BSN=1274 +- got ack for BSN=1275 +- got ack for BSN=1276 +- got ack for BSN=1277 +- got ack for BSN=1278 +- got ack for BSN=1279 +- got ack for BSN=1280 +- got ack for BSN=1281 +- got ack for BSN=1282 +- got ack for BSN=1283 +- got ack for BSN=1284 +- got ack for BSN=1285 +- got ack for BSN=1286 +- got ack for BSN=1287 +- V(B): (V(A)=1186)"NNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNAAANAAAAAAAAAAAAAAAAAAAAAAAAAA"(V(S)-1=1287) A=Acked N=Nacked U=Unacked X=Resend-Unacked I=Invalid +DL packet loss of IMSI= / TLLI=0xffeeddcc: 78% TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) changes state from FLOW to RELEASING TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) free TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Software error: Pending downlink assignment. This may not happen, because the assignment message never gets transmitted. Please be sure not to free in this state. PLEASE FIX! -- To view, visit https://gerrit.osmocom.org/862 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id07d178970f168f5389016c1eea31eb6b82057b6 Gerrit-PatchSet: 10 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 10:31:14 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 2 Nov 2016 10:31:14 +0000 Subject: osmo-pcu[master]: Refactoring write_packet_ack_nack_desc_egprs to support CRBB In-Reply-To: References: Message-ID: Patch Set 4: (2 comments) https://gerrit.osmocom.org/#/c/412/4//COMMIT_MSG Commit Message: Line 7: Refactoring write_packet_ack_nack_desc_egprs to support CRBB CRBB is not supported by this patch yet. So maybe say prepare for CRBB support? https://gerrit.osmocom.org/#/c/412/4/src/encoding.cpp File src/encoding.cpp: Line 335: bitvec_write_field(dest, wp, tbf->current_cs().to_num()-1, 2); // CHANNEL_CODING_COMMAND even if the coding style is violated in the existing file, please do not modify.. it just creates noise. -- To view, visit https://gerrit.osmocom.org/412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 11:13:18 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 2 Nov 2016 11:13:18 +0000 Subject: [PATCH] openbsc[master]: rsl: support for ericssons propritary SI13 format Message-ID: Review at https://gerrit.osmocom.org/1183 rsl: support for ericssons propritary SI13 format Ericsson has introduced a propritary format to issue the S13 BCCH information. Normally the system info type field for SI13 would be encoded as 0x28. Ericsson encodes that field as 0x02 and ads a bcch mapping parameter, (IEI=F2) This patch sets the BCCH mapping to 0x00 (=BCCH Normal) statically (0xF200) Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/1183/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index c374903..20bc9d9 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -241,8 +241,17 @@ init_dchan_hdr(dh, RSL_MT_BCCH_INFO); dh->chan_nr = RSL_CHAN_BCCH; - msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (trx->bts->type == GSM_BTS_TYPE_RBS2000 + && type == RSL_SYSTEM_INFO_13) { + /* Ericsson proprietary encoding of SI13 */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, 0x0C); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + msgb_tv_put(msg, 0xF2, 0x00); + } else { + /* Normal encoding */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + } msg->dst = trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/1183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Wed Nov 2 11:18:07 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 2 Nov 2016 11:18:07 +0000 Subject: [PATCH] osmo-pcu[master]: Refactoring write_packet_ack_nack_desc_egprs to prepare for ... In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/412 to look at the new patch set (#5). Refactoring write_packet_ack_nack_desc_egprs to prepare for CRBB support Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 --- M src/encoding.cpp M tests/tbf/TbfTest.err 2 files changed, 37 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/12/412/5 diff --git a/src/encoding.cpp b/src/encoding.cpp index 7d3fa14..f3bdb55 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -612,14 +612,17 @@ gprs_rlc_ul_window *window, bool is_final) { int urbb_len = 0; - int crbb_len = 0; int len; bool bow = true; bool eow = true; int ssn = window->mod_sns(window->v_q() + 1); int num_blocks = window->mod_sns(window->v_r() - window->v_q()); int esn_crbb = window->mod_sns(ssn - 1); - int rest_bits = dest->data_len * 8 - wp; + /* Bit 0 at the end is mandatory Table 11.2.28.1 in 44.060 */ + int rest_bits = dest->data_len * 8 - wp - 1; + int is_compressed = 0; + bool len_coded = true; + uint8_t i; if (num_blocks > 0) /* V(Q) is NACK and omitted -> SSN = V(Q) + 1 */ @@ -627,33 +630,31 @@ if (num_blocks > window->ws()) num_blocks = window->ws(); + /* TODO Compression support */ + if (is_compressed == 0) { + /* Union bit takes 1 bit */ + /* Other fields in descr for uncompresed bitmap takes 15 bits*/ - if (num_blocks > rest_bits) { - eow = false; - urbb_len = rest_bits; - /* TODO: use compression, start encoding bits and stop when the - * space is exhausted. Use the first combination that encodes - * all bits. If there is none, use the combination that encodes - * the largest number of bits (e.g. by setting num_blocks to the - * max and repeating the construction). - */ - } else if (num_blocks > rest_bits - 9) { - /* union bit and length field take 9 bits */ - eow = false; - urbb_len = rest_bits - 9; - /* TODO: use compression (see above) */ - } else - urbb_len = num_blocks; - - if (urbb_len + crbb_len == rest_bits) - len = -1; - else if (crbb_len == 0) + if (num_blocks > rest_bits - 15 - 1) { + eow = false; + urbb_len = rest_bits - 15 - 1; + len_coded = false; + } else if (num_blocks == rest_bits - 15 - 1) { + urbb_len = rest_bits - 15 - 1; + len_coded = false; + /* Union bit takes 1 bit length field takes 8 bits*/ + } else if (num_blocks > rest_bits - 15 - 9) { + eow = false; + urbb_len = rest_bits - 15 - 9; + } else + urbb_len = num_blocks; len = urbb_len + 15; - else - len = urbb_len + crbb_len + 23; + } else { + /* TODO Compressed bitmap */ + } /* EGPRS Ack/Nack Description IE */ - if (len < 0) { + if (len_coded == false) { bitvec_write_field(dest, wp, 0, 1); // 0: don't have length } else { bitvec_write_field(dest, wp, 1, 1); // 1: have length @@ -664,17 +665,19 @@ bitvec_write_field(dest, wp, bow, 1); // BEGINNING_OF_WINDOW bitvec_write_field(dest, wp, eow, 1); // END_OF_WINDOW bitvec_write_field(dest, wp, ssn, 11); // STARTING_SEQUENCE_NUMBER - bitvec_write_field(dest, wp, 0, 1); // 0: don't have CRBB - - /* TODO: Add CRBB support */ - + if (is_compressed) { + /* TODO Add CRBB support */ + } else + bitvec_write_field(dest, wp, 0, 1); // CRBB_Exist LOGP(DRLCMACUL, LOGL_DEBUG, - " - EGPRS URBB, len = %d, SSN = %d, ESN_CRBB = %d, " + "EGPRS URBB, urbb len = %d, SSN = %d, ESN_CRBB = %d, " + "len present = %s,desc len = %d, " "SNS = %d, WS = %d, V(Q) = %d, V(R) = %d%s%s\n", - urbb_len, ssn, esn_crbb, + urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No", len, window->sns(), window->ws(), window->v_q(), window->v_r(), bow ? ", BOW" : "", eow ? ", EOW" : ""); - for (int i = urbb_len; i > 0; i--) { + + for (i = urbb_len; i > 0; i--) { /* Set bit at the appropriate position (see 3GPP TS 04.60 12.3.1) */ bool is_ack = window->m_v_n.is_received(esn_crbb + i); bitvec_write_field(dest, wp, is_ack, 1); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 8c6b78c..effae4c 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6278,7 +6278,7 @@ -- Frame 1 starts at offset 0, length=37, is_complete=0 - No gaps in received block, last block: BSN=1 CV=7 Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) - - EGPRS URBB, len = 0, SSN = 3, ESN_CRBB = 2, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 2, BOW, EOW +EGPRS URBB, urbb len = 0, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 15, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 2, BOW, EOW Uplink Ack/Nack bit count 98, max 184, message = 40 24 01 3f 3e 24 46 68 90 87 b0 06 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got RLC block, coding scheme: MCS-3, length: 42 (42)) UL data: 1d 20 40 c1 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 @@ -6291,7 +6291,7 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=37, data=00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - Raising V(R) to 5 Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) - - EGPRS URBB, len = 2, SSN = 3, ESN_CRBB = 2, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 5, BOW, EOW +EGPRS URBB, urbb len = 2, SSN = 3, ESN_CRBB = 2, len present = yes,desc len = 17, SNS = 2048, WS = 64, V(Q) = 2, V(R) = 5, BOW, EOW Uplink Ack/Nack bit count 100, max 184, message = 40 24 01 3f 3e 24 46 68 90 88 b0 06 8b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 Got MS: TLLI = 0xf1223344, TA = 7 -- To view, visit https://gerrit.osmocom.org/412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Wed Nov 2 11:29:43 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 11:29:43 +0000 Subject: [PATCH] osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/819 to look at the new patch set (#8). Fix: DL slot allocation based on direction configured Currently number of TS for second DL TBF is less compared to first DL TBF because PCU is considering the combined capacity of DL and UL for TS allocation. Since 2nd DL TBF has less DL slots compared to 2nd TBF, there is a difference in throughput between the 2 DL TBFs. This patch enables the user to maximize the number of DL TSs for the TBF based on the direction configured through VTY with cfg_pcu_ts_alloc_maximise_cmd. The maximise_direction is chosen to be an enum to be open for later additions. Related: OS#1792 Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 --- M src/bts.h M src/gprs_rlcmac_ts_alloc.cpp M src/pcu_main.cpp M src/pcu_vty.c M tests/alloc/AllocTest.cpp M tests/alloc/AllocTest.err M tests/alloc/AllocTest.ok 7 files changed, 674 insertions(+), 551 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/19/819/8 diff --git a/src/bts.h b/src/bts.h index 8bea371..a389b1b 100644 --- a/src/bts.h +++ b/src/bts.h @@ -44,6 +44,10 @@ #define LLC_CODEL_USE_DEFAULT (-1) #define MAX_GPRS_CS 9 +enum maximise_direction { + MAXIMISE_DIR_DL_ONLY, + MAXIMISE_DIR_NONE +}; struct BTS; struct GprsMs; @@ -200,6 +204,8 @@ /* 0 to support resegmentation in DL, 1 for no reseg */ uint8_t dl_arq_type; + enum maximise_direction maximise_dir; + uint32_t ms_idle_sec; uint8_t cs_adj_enabled; uint8_t cs_adj_upper_limit; diff --git a/src/gprs_rlcmac_ts_alloc.cpp b/src/gprs_rlcmac_ts_alloc.cpp index 57197b2..10a4093 100644 --- a/src/gprs_rlcmac_ts_alloc.cpp +++ b/src/gprs_rlcmac_ts_alloc.cpp @@ -775,9 +775,15 @@ rx_window & tx_window, 'C'), capacity); #endif - - if (capacity <= max_capacity) - continue; + switch (bts->maximise_dir) { + case MAXIMISE_DIR_DL_ONLY: + if (rx_window < max_dl_slots) + continue; + break; + default: + if (capacity <= max_capacity) + continue; + } max_capacity = capacity; max_ul_slots = tx_window; diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp index 4a75c79..57bccd1 100644 --- a/src/pcu_main.cpp +++ b/src/pcu_main.cpp @@ -217,6 +217,8 @@ */ bts->dl_arq_type = EGPRS_ARQ1; + bts->maximise_dir = MAXIMISE_DIR_NONE; + msgb_set_talloc_ctx(tall_pcu_ctx); osmo_init_logging(&gprs_log_info); diff --git a/src/pcu_vty.c b/src/pcu_vty.c index 535d512..290e819 100644 --- a/src/pcu_vty.c +++ b/src/pcu_vty.c @@ -497,6 +497,32 @@ return CMD_SUCCESS; } +#define MAXIMISE_STR "Maximise flow of TBF in a certain direction\n" + +DEFUN(cfg_pcu_maximise_direction, + cfg_pcu_maximise_direction_cmd, + "maximise-direction dl", + MAXIMISE_STR "Maximise DL capacity\n") +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->maximise_dir = MAXIMISE_DIR_DL_ONLY; + + return CMD_SUCCESS; +} + +DEFUN(cfg_pcu_no_maximise_direction, + cfg_pcu_no_maximise_direction_cmd, + "no maximise-direction", + NO_STR MAXIMISE_STR) +{ + struct gprs_rlcmac_bts *bts = bts_main_data(); + + bts->maximise_dir = MAXIMISE_DIR_NONE; + + return CMD_SUCCESS; +} + DEFUN(cfg_pcu_window_size, cfg_pcu_window_size_cmd, "window-size <0-1024> [<0-256>]", diff --git a/tests/alloc/AllocTest.cpp b/tests/alloc/AllocTest.cpp index f7794f7..8576c09 100644 --- a/tests/alloc/AllocTest.cpp +++ b/tests/alloc/AllocTest.cpp @@ -118,6 +118,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_a; + bts->maximise_dir = MAXIMISE_DIR_NONE; struct gprs_rlcmac_trx *trx = &bts->trx[0]; for (i = 0; i < 8; i += 1) @@ -196,6 +197,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = MAXIMISE_DIR_NONE; trx = &bts->trx[0]; trx->pdch[5].enable(); @@ -238,6 +240,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = MAXIMISE_DIR_NONE; trx = &bts->trx[0]; trx->pdch[5].enable(); @@ -285,6 +288,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = MAXIMISE_DIR_NONE; trx = &bts->trx[0]; trx->pdch[1].enable(); @@ -660,6 +664,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = algo; + bts->maximise_dir = MAXIMISE_DIR_NONE; trx = &bts->trx[0]; trx->pdch[3].enable(); @@ -698,6 +703,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = algo; + bts->maximise_dir = MAXIMISE_DIR_DL_ONLY; trx = &bts->trx[0]; trx->pdch[3].enable(); @@ -806,6 +812,7 @@ bts = the_bts.bts_data(); bts->alloc_algorithm = alloc_algorithm_b; + bts->maximise_dir = MAXIMISE_DIR_DL_ONLY; trx = &bts->trx[0]; trx->pdch[4].enable(); @@ -830,13 +837,8 @@ if (dl_tbf2->pdch[i]) numTs2++; } - - /* - * TODO: currently 2nd DL TBF gets 3 TS - * This behaviour will be fixed in subsequent patch - */ printf("TBF2: numTs(%d)\n", numTs2); - OSMO_ASSERT(numTs2 == 3); + OSMO_ASSERT(numTs2 == 4); tbf_free(dl_tbf1); tbf_free(dl_tbf2); diff --git a/tests/alloc/AllocTest.err b/tests/alloc/AllocTest.err index a74c42b..a5d07cc 100644 --- a/tests/alloc/AllocTest.err +++ b/tests/alloc/AllocTest.err @@ -566,7 +566,7 @@ - Failed to allocate a TFI Allocated 32 TBFs (previously -1) No USF available - Allocated 24 TBFs (previously 32) + Allocated 10 TBFs (previously 32) No TFI available. No TFI available. No TFI available. @@ -640,22 +640,6 @@ No TFI available. No TFI available. - Failed to allocate a TFI -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. -No TFI available. No TFI available. No TFI available. No TFI available. @@ -706,9 +690,150 @@ No TFI available. No TFI available. - Failed to find a usable TRX (TFI exhausted) - Allocated 97 TBFs (previously -1) + Allocated 81 TBFs (previously -1) - Failed to allocate a TS, no USF available - Allocated 24 TBFs (previously 97) + Allocated 10 TBFs (previously 81) +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. +No TFI available. No TFI available. No TFI available. No TFI available. @@ -729,7 +854,7 @@ No TFI available. No TFI available. - Failed to find a usable TRX (TFI exhausted) - Allocated 160 TBFs (previously 97) + Allocated 160 TBFs (previously 81) No TFI available. No TFI available. No TFI available. diff --git a/tests/alloc/AllocTest.ok b/tests/alloc/AllocTest.ok index cbb65aa..d63caf4 100644 --- a/tests/alloc/AllocTest.ok +++ b/tests/alloc/AllocTest.ok @@ -10229,565 +10229,521 @@ TBF[31] class 15 reserves .......C Successfully allocated 160 TBFs Going to test assignment with many connections, algorithm B - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. + TBF[3] class 4 reserves .....DCD TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. + TBF[5] class 6 reserves .....DCD + TBF[6] class 7 reserves .....DCD TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. - TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. - TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. - TBF[13] class 14 reserves ....CDDD - TBF[14] class 15 reserves ...CDDDD - TBF[15] class 16 reserves ...CDDDD - TBF[16] class 17 reserves ...CDDDD - TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves .......C - TBF[30] class 2 reserves ......DC - TBF[31] class 3 reserves ......DC - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ...DC... - TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ....DCD. - TBF[4] class 5 reserves ...CD... - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves ......CD - TBF[7] class 8 reserves ...DDCD. - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves ....DCD. - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD + TBF[8] class 9 reserves .....DCD + TBF[9] class 10 reserves ....DDCD + TBF[10] class 11 reserves ....DDCD + TBF[11] class 12 reserves ....DDCD TBF[12] class 13 reserves .....CDD - TBF[13] class 14 reserves ...CDDD. + TBF[13] class 14 reserves ....CDDD TBF[14] class 15 reserves ...CDDDD TBF[15] class 16 reserves ...CDDDD TBF[16] class 17 reserves ...CDDDD TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD - TBF[29] class 1 reserves ...C.... + TBF[18] class 19 reserves ....DDCD + TBF[19] class 20 reserves ....DDCD + TBF[20] class 21 reserves ....DDCD + TBF[21] class 22 reserves ....DDCD + TBF[22] class 23 reserves ....DDCD + TBF[23] class 24 reserves ....DDCD + TBF[24] class 25 reserves ....DDCD + TBF[25] class 26 reserves ....DDCD + TBF[26] class 27 reserves ....DDCD + TBF[27] class 28 reserves ....DDCD + TBF[28] class 29 reserves ....DDCD + TBF[29] class 1 reserves .......C + TBF[30] class 2 reserves ......DC + TBF[31] class 3 reserves ......DC + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC + TBF[2] class 3 reserves ......DC + TBF[3] class 4 reserves .....DCD + TBF[4] class 5 reserves ......CD + TBF[5] class 6 reserves .....DCD + TBF[6] class 7 reserves .....DCD + TBF[7] class 8 reserves ....DDCD + TBF[8] class 9 reserves .....DCD + TBF[9] class 10 reserves ....DDCD + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC + TBF[2] class 3 reserves ......DC + TBF[3] class 4 reserves .....DCD + TBF[4] class 5 reserves ......CD + TBF[5] class 6 reserves .....DCD + TBF[6] class 7 reserves .....DCD + TBF[7] class 8 reserves ....DDCD + TBF[8] class 9 reserves .....DCD + TBF[9] class 10 reserves ....DDCD + TBF[10] class 11 reserves ....DDCD + TBF[11] class 12 reserves ....DDCD + TBF[12] class 13 reserves .....CDD + TBF[13] class 14 reserves ....CDDD + TBF[14] class 15 reserves ...CDDDD + TBF[15] class 16 reserves ...CDDDD + TBF[16] class 17 reserves ...CDDDD + TBF[17] class 18 reserves ...CDDDD + TBF[18] class 19 reserves ....DDCD + TBF[19] class 20 reserves ....DDCD + TBF[20] class 21 reserves ....DDCD + TBF[21] class 22 reserves ....DDCD + TBF[22] class 23 reserves ....DDCD + TBF[23] class 24 reserves ....DDCD + TBF[24] class 25 reserves ....DDCD + TBF[25] class 26 reserves ....DDCD + TBF[26] class 27 reserves ....DDCD + TBF[27] class 28 reserves ....DDCD + TBF[28] class 29 reserves ....DDCD + TBF[29] class 1 reserves .......C + TBF[30] class 2 reserves ......DC + TBF[31] class 3 reserves ......DC + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC + TBF[2] class 3 reserves ......DC + TBF[3] class 4 reserves .....DCD + TBF[4] class 5 reserves ......CD + TBF[5] class 6 reserves .....DCD + TBF[6] class 7 reserves .....DCD + TBF[7] class 8 reserves ....DDCD + TBF[8] class 9 reserves .....DCD + TBF[9] class 10 reserves ....DDCD + TBF[10] class 11 reserves ....DDCD + TBF[11] class 12 reserves ....DDCD + TBF[12] class 13 reserves .....CDD + TBF[13] class 14 reserves ....CDDD + TBF[14] class 15 reserves ...CDDDD + TBF[15] class 16 reserves ...CDDDD + TBF[16] class 17 reserves ...CDDDD + TBF[17] class 18 reserves ...CDDDD + TBF[18] class 19 reserves ....DDCD + TBF[19] class 20 reserves ....DDCD + TBF[20] class 21 reserves ....DDCD + TBF[21] class 22 reserves ....DDCD + TBF[22] class 23 reserves ....DDCD + TBF[23] class 24 reserves ....DDCD + TBF[24] class 25 reserves ....DDCD + TBF[25] class 26 reserves ....DDCD + TBF[26] class 27 reserves ....DDCD + TBF[27] class 28 reserves ....DDCD + TBF[28] class 29 reserves ....DDCD + TBF[29] class 1 reserves .......C TBF[30] class 2 reserves ......DC TBF[31] class 3 reserves ......DC Successfully allocated 32 TBFs Going to test assignment with many connections, algorithm dynamic - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves ....DC.. + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC TBF[2] class 3 reserves ......DC - TBF[3] class 4 reserves ...DCD.. + TBF[3] class 4 reserves .....DCD TBF[4] class 5 reserves ......CD - TBF[5] class 6 reserves ...CD... - TBF[6] class 7 reserves .....CD. + TBF[5] class 6 reserves .....DCD + TBF[6] class 7 reserves .....DCD TBF[7] class 8 reserves ....DDCD - TBF[8] class 9 reserves ...DCD.. - TBF[9] class 10 reserves .....DCD - TBF[10] class 11 reserves ...DCD.. - TBF[11] class 12 reserves .....DCD - TBF[12] class 13 reserves ...CDD.. + TBF[8] class 9 reserves .....DCD + TBF[9] class 10 reserves ....DDCD + TBF[10] class 11 reserves ....DDCD + TBF[11] class 12 reserves ....DDCD + TBF[12] class 13 reserves .....CDD TBF[13] class 14 reserves ....CDDD TBF[14] class 15 reserves ...CDDDD TBF[15] class 16 reserves ...CDDDD TBF[16] class 17 reserves ...CDDDD TBF[17] class 18 reserves ...CDDDD - TBF[18] class 19 reserves .....DCD - TBF[19] class 20 reserves ...DCD.. - TBF[20] class 21 reserves .....DCD - TBF[21] class 22 reserves ...DCD.. - TBF[22] class 23 reserves .....DCD - TBF[23] class 24 reserves ...DCD.. - TBF[24] class 25 reserves .....DCD - TBF[25] class 26 reserves ...DCD.. - TBF[26] class 27 reserves .....DCD - TBF[27] class 28 reserves ...DCD.. - TBF[28] class 29 reserves .....DCD + TBF[18] class 19 reserves ....DDCD + TBF[19] class 20 reserves ....DDCD + TBF[20] class 21 reserves ....DDCD + TBF[21] class 22 reserves ....DDCD + TBF[22] class 23 reserves ....DDCD + TBF[23] class 24 reserves ....DDCD + TBF[24] class 25 reserves ....DDCD + TBF[25] class 26 reserves ....DDCD + TBF[26] class 27 reserves ....DDCD + TBF[27] class 28 reserves ....DDCD + TBF[28] class 29 reserves ....DDCD TBF[29] class 1 reserves .......C TBF[30] class 2 reserves ......DC TBF[31] class 3 reserves ......DC - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C + TBF[0] class 4 reserves ......C. + TBF[0] class 5 reserves ...C.... + TBF[1] class 6 reserves ...C.... + TBF[2] class 7 reserves ...C.... + TBF[3] class 8 reserves ...C.... + TBF[4] class 9 reserves ...C.... + TBF[5] class 10 reserves ...C.... TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[18] class 4 reserves ...C.... - TBF[18] class 5 reserves ....C... - TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[12] class 8 reserves .......C - TBF[20] class 9 reserves ...C.... - TBF[20] class 10 reserves ....C... - TBF[29] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[19] class 13 reserves .......C - TBF[22] class 14 reserves ...C.... - TBF[22] class 15 reserves ....C... - TBF[30] class 16 reserves .....C.. - TBF[19] class 17 reserves ......C. - TBF[21] class 18 reserves .......C - TBF[24] class 19 reserves ...C.... - TBF[24] class 20 reserves ....C... - TBF[31] class 21 reserves .....C.. - TBF[21] class 22 reserves ......C. - TBF[23] class 23 reserves .......C - TBF[26] class 24 reserves ...C.... - TBF[26] class 25 reserves ....C... - TBF[23] class 26 reserves ......C. - TBF[25] class 27 reserves .......C - TBF[28] class 28 reserves ...C.... - TBF[28] class 29 reserves ....C... - TBF[25] class 1 reserves ......C. - TBF[27] class 2 reserves .......C - TBF[29] class 3 reserves ...C.... - TBF[29] class 4 reserves ....C... - TBF[27] class 5 reserves ......C. - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[29] class 8 reserves ......C. - TBF[31] class 9 reserves ...C.... - TBF[31] class 10 reserves ....C... - TBF[0] class 1 reserves ...C.... - TBF[0] class 2 reserves ....DC.. - TBF[0] class 3 reserves ......DC - TBF[0] class 4 reserves ...DCD.. - TBF[0] class 5 reserves ......CD - TBF[1] class 6 reserves ...CD... - TBF[1] class 7 reserves .....CD. - TBF[1] class 8 reserves ....DDCD - TBF[1] class 9 reserves ...DCD.. - TBF[2] class 10 reserves .....DCD - TBF[2] class 11 reserves ...DCD.. - TBF[3] class 12 reserves .....DCD - TBF[2] class 13 reserves ...CDD.. - TBF[3] class 14 reserves ....CDDD - TBF[3] class 15 reserves ...CDDDD - TBF[4] class 16 reserves ...CDDDD - TBF[5] class 17 reserves ...CDDDD - TBF[6] class 18 reserves ...CDDDD - TBF[4] class 19 reserves .....DCD - TBF[4] class 20 reserves ...DCD.. - TBF[5] class 21 reserves .....DCD - TBF[5] class 22 reserves ...DCD.. - TBF[6] class 23 reserves .....DCD - TBF[6] class 24 reserves ...DCD.. - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. - TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... - TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... - TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... + TBF[7] class 12 reserves ...C.... + TBF[8] class 13 reserves ...C.... + TBF[9] class 14 reserves ...C.... + TBF[0] class 15 reserves ....C... TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C + TBF[1] class 17 reserves ....C... + TBF[11] class 18 reserves ...C.... + TBF[2] class 19 reserves ....C... + TBF[12] class 20 reserves ...C.... + TBF[3] class 21 reserves ....C... + TBF[13] class 22 reserves ...C.... + TBF[0] class 23 reserves .....C.. + TBF[4] class 24 reserves ....C... + TBF[18] class 25 reserves ...C.... + TBF[1] class 26 reserves .....C.. + TBF[5] class 27 reserves ....C... + TBF[19] class 28 reserves ...C.... + TBF[2] class 29 reserves .....C.. + TBF[6] class 1 reserves ....C... + TBF[20] class 2 reserves ...C.... + TBF[4] class 3 reserves .....C.. + TBF[8] class 4 reserves ....C... + TBF[21] class 5 reserves ...C.... + TBF[29] class 6 reserves .....C.. + TBF[12] class 7 reserves ....C... + TBF[22] class 8 reserves ...C.... + TBF[30] class 9 reserves .....C.. + TBF[29] class 10 reserves ....C... + TBF[23] class 11 reserves ...C.... + TBF[31] class 12 reserves .....C.. + TBF[30] class 13 reserves ....C... + TBF[24] class 14 reserves ...C.... + TBF[31] class 15 reserves ....C... + TBF[25] class 16 reserves ...C.... + TBF[26] class 17 reserves ...C.... + TBF[27] class 18 reserves ...C.... + TBF[29] class 19 reserves ......C. + TBF[28] class 20 reserves ...C.... + TBF[29] class 21 reserves ...C.... + TBF[30] class 22 reserves ...C.... + TBF[31] class 23 reserves ...C.... + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves ......DC + TBF[2] class 3 reserves ......DC + TBF[0] class 4 reserves .....DCD + TBF[1] class 5 reserves ......CD + TBF[2] class 6 reserves .....DCD + TBF[3] class 7 reserves .....DCD + TBF[4] class 8 reserves ....DDCD + TBF[5] class 9 reserves .....DCD + TBF[6] class 10 reserves ....DDCD + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves .......C + TBF[2] class 3 reserves .......C + TBF[1] class 4 reserves ......C. + TBF[2] class 5 reserves ......C. + TBF[3] class 6 reserves ......C. + TBF[4] class 7 reserves ......C. + TBF[5] class 8 reserves ......C. + TBF[6] class 9 reserves ......C. + TBF[7] class 10 reserves ......C. + TBF[8] class 11 reserves ......C. + TBF[9] class 12 reserves ......C. + TBF[3] class 13 reserves .....C.. + TBF[7] class 14 reserves ....C... + TBF[14] class 15 reserves ...C.... + TBF[15] class 16 reserves ...C.... + TBF[16] class 17 reserves ...C.... + TBF[17] class 18 reserves ...C.... + TBF[10] class 19 reserves ......C. + TBF[11] class 20 reserves ......C. + TBF[12] class 21 reserves ......C. + TBF[13] class 22 reserves ......C. + TBF[14] class 23 reserves ......C. + TBF[15] class 24 reserves ......C. + TBF[16] class 25 reserves ......C. + TBF[17] class 26 reserves ......C. + TBF[18] class 27 reserves ......C. + TBF[19] class 28 reserves ......C. + TBF[20] class 29 reserves ......C. + TBF[3] class 1 reserves .......C + TBF[4] class 2 reserves .......C + TBF[5] class 3 reserves .......C + TBF[0] class 4 reserves ......C. + TBF[0] class 5 reserves ...C.... + TBF[1] class 6 reserves ...C.... + TBF[2] class 7 reserves ...C.... + TBF[3] class 8 reserves ...C.... + TBF[4] class 9 reserves ...C.... + TBF[5] class 10 reserves ...C.... TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... + TBF[7] class 12 reserves ...C.... + TBF[8] class 13 reserves ...C.... + TBF[9] class 14 reserves ...C.... + TBF[0] class 15 reserves ....C... + TBF[10] class 16 reserves ...C.... + TBF[1] class 17 reserves ....C... + TBF[11] class 18 reserves ...C.... + TBF[2] class 19 reserves ....C... + TBF[12] class 20 reserves ...C.... + TBF[3] class 21 reserves ....C... + TBF[13] class 22 reserves ...C.... + TBF[0] class 23 reserves .....C.. + TBF[4] class 24 reserves ....C... + TBF[18] class 25 reserves ...C.... + TBF[1] class 26 reserves .....C.. + TBF[5] class 27 reserves ....C... + TBF[19] class 28 reserves ...C.... + TBF[2] class 29 reserves .....C.. + TBF[6] class 1 reserves ....C... + TBF[20] class 2 reserves ...C.... + TBF[4] class 3 reserves .....C.. + TBF[8] class 4 reserves ....C... + TBF[21] class 5 reserves ...C.... TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... + TBF[9] class 7 reserves ....C... + TBF[22] class 8 reserves ...C.... + TBF[6] class 9 reserves .....C.. + TBF[10] class 10 reserves ....C... + TBF[23] class 11 reserves ...C.... + TBF[7] class 12 reserves .....C.. + TBF[11] class 13 reserves ....C... + TBF[24] class 14 reserves ...C.... + TBF[12] class 15 reserves ....C... + TBF[25] class 16 reserves ...C.... + TBF[26] class 17 reserves ...C.... + TBF[27] class 18 reserves ...C.... + TBF[21] class 19 reserves ......C. + TBF[28] class 20 reserves ...C.... + TBF[29] class 21 reserves ...C.... + TBF[30] class 22 reserves ...C.... + TBF[31] class 23 reserves ...C.... + TBF[6] class 24 reserves .......C + TBF[7] class 25 reserves .......C + TBF[8] class 26 reserves .....C.. + TBF[8] class 27 reserves .......C + TBF[9] class 28 reserves .....C.. + TBF[9] class 29 reserves .......C + TBF[10] class 1 reserves .....C.. + TBF[10] class 2 reserves .......C + TBF[11] class 3 reserves .....C.. + TBF[11] class 4 reserves .......C + TBF[12] class 5 reserves .....C.. + TBF[12] class 6 reserves .......C + TBF[13] class 7 reserves ....C... + TBF[13] class 8 reserves .....C.. + TBF[13] class 9 reserves .......C + TBF[14] class 10 reserves ....C... + TBF[14] class 11 reserves .....C.. + TBF[14] class 12 reserves .......C + TBF[15] class 13 reserves ....C... + TBF[15] class 14 reserves .....C.. + TBF[15] class 15 reserves .......C + TBF[16] class 16 reserves ....C... + TBF[16] class 17 reserves .....C.. + TBF[16] class 18 reserves .......C + TBF[17] class 19 reserves ....C... + TBF[17] class 20 reserves .....C.. + TBF[17] class 21 reserves .......C + TBF[18] class 22 reserves ....C... + TBF[18] class 23 reserves .....C.. + TBF[18] class 24 reserves .......C TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... + TBF[19] class 26 reserves .....C.. + TBF[19] class 27 reserves .......C + TBF[20] class 28 reserves ....C... + TBF[20] class 29 reserves .....C.. + TBF[20] class 1 reserves .......C + TBF[21] class 2 reserves ....C... + TBF[21] class 3 reserves .....C.. + TBF[21] class 4 reserves .......C + TBF[22] class 5 reserves ....C... + TBF[22] class 6 reserves .....C.. + TBF[22] class 7 reserves ......C. + TBF[22] class 8 reserves .......C + TBF[23] class 9 reserves ....C... + TBF[23] class 10 reserves .....C.. + TBF[23] class 11 reserves ......C. + TBF[23] class 12 reserves .......C + TBF[24] class 13 reserves ....C... + TBF[24] class 14 reserves .....C.. + TBF[24] class 15 reserves ......C. + TBF[24] class 16 reserves .......C + TBF[25] class 17 reserves ....C... + TBF[25] class 18 reserves .....C.. + TBF[25] class 19 reserves ......C. + TBF[25] class 20 reserves .......C + TBF[26] class 21 reserves ....C... + TBF[26] class 22 reserves .....C.. + TBF[26] class 23 reserves ......C. + TBF[26] class 24 reserves .......C + TBF[27] class 25 reserves ....C... + TBF[27] class 26 reserves .....C.. + TBF[27] class 27 reserves ......C. + TBF[27] class 28 reserves .......C + TBF[28] class 29 reserves ....C... + TBF[28] class 1 reserves .....C.. + TBF[28] class 2 reserves ......C. + TBF[28] class 3 reserves .......C + TBF[29] class 4 reserves ....C... + TBF[29] class 5 reserves .....C.. + TBF[29] class 6 reserves ......C. + TBF[29] class 7 reserves .......C + TBF[30] class 8 reserves ....C... + TBF[30] class 9 reserves .....C.. + TBF[30] class 10 reserves ......C. + TBF[30] class 11 reserves .......C TBF[31] class 12 reserves ....C... TBF[31] class 13 reserves .....C.. TBF[31] class 14 reserves ......C. TBF[31] class 15 reserves .......C - TBF[0] class 1 reserves ...C.... - TBF[1] class 2 reserves .....C.. + TBF[0] class 1 reserves .......C + TBF[1] class 2 reserves .......C TBF[2] class 3 reserves .......C - TBF[1] class 4 reserves ....C... + TBF[1] class 4 reserves ......C. TBF[2] class 5 reserves ......C. - TBF[3] class 6 reserves ...C.... - TBF[3] class 7 reserves .....C.. - TBF[4] class 8 reserves ......C. - TBF[3] class 9 reserves ....C... - TBF[6] class 10 reserves ......C. - TBF[5] class 11 reserves ....C... - TBF[7] class 12 reserves ......C. - TBF[5] class 13 reserves ...C.... + TBF[3] class 6 reserves ......C. + TBF[4] class 7 reserves ......C. + TBF[5] class 8 reserves ......C. + TBF[6] class 9 reserves ......C. + TBF[7] class 10 reserves ......C. + TBF[8] class 11 reserves ......C. + TBF[9] class 12 reserves ......C. + TBF[3] class 13 reserves .....C.. TBF[7] class 14 reserves ....C... - TBF[8] class 15 reserves ...C.... - TBF[10] class 16 reserves ...C.... - TBF[12] class 17 reserves ...C.... - TBF[14] class 18 reserves ...C.... - TBF[9] class 19 reserves ......C. - TBF[8] class 20 reserves ....C... - TBF[11] class 21 reserves ......C. - TBF[10] class 22 reserves ....C... - TBF[13] class 23 reserves ......C. - TBF[12] class 24 reserves ....C... - TBF[14] class 25 reserves ......C. - TBF[13] class 26 reserves ....C... - TBF[15] class 27 reserves ......C. - TBF[14] class 28 reserves ....C... - TBF[16] class 29 reserves ......C. - TBF[4] class 1 reserves .......C - TBF[7] class 2 reserves .......C - TBF[9] class 3 reserves .......C - TBF[0] class 4 reserves .....C.. - TBF[1] class 5 reserves ...C.... - TBF[2] class 6 reserves ...C.... - TBF[0] class 7 reserves .......C - TBF[4] class 8 reserves ...C.... - TBF[0] class 9 reserves ....C... - TBF[1] class 10 reserves .......C + TBF[14] class 15 reserves ...C.... + TBF[15] class 16 reserves ...C.... + TBF[16] class 17 reserves ...C.... + TBF[17] class 18 reserves ...C.... + TBF[10] class 19 reserves ......C. + TBF[11] class 20 reserves ......C. + TBF[12] class 21 reserves ......C. + TBF[13] class 22 reserves ......C. + TBF[14] class 23 reserves ......C. + TBF[15] class 24 reserves ......C. + TBF[16] class 25 reserves ......C. + TBF[17] class 26 reserves ......C. + TBF[18] class 27 reserves ......C. + TBF[19] class 28 reserves ......C. + TBF[20] class 29 reserves ......C. + TBF[3] class 1 reserves .......C + TBF[4] class 2 reserves .......C + TBF[5] class 3 reserves .......C + TBF[0] class 4 reserves ......C. + TBF[0] class 5 reserves ...C.... + TBF[1] class 6 reserves ...C.... + TBF[2] class 7 reserves ...C.... + TBF[3] class 8 reserves ...C.... + TBF[4] class 9 reserves ...C.... + TBF[5] class 10 reserves ...C.... TBF[6] class 11 reserves ...C.... - TBF[2] class 12 reserves ....C... - TBF[0] class 13 reserves ......C. - TBF[3] class 14 reserves .......C - TBF[7] class 15 reserves ...C.... - TBF[4] class 16 reserves ....C... - TBF[1] class 17 reserves ......C. - TBF[5] class 18 reserves .......C - TBF[9] class 19 reserves ...C.... - TBF[6] class 20 reserves ....C... - TBF[3] class 21 reserves ......C. - TBF[6] class 22 reserves .......C - TBF[11] class 23 reserves ...C.... - TBF[9] class 24 reserves ....C... - TBF[2] class 25 reserves .....C.. - TBF[5] class 26 reserves ......C. - TBF[8] class 27 reserves .......C - TBF[13] class 28 reserves ...C.... - TBF[11] class 29 reserves ....C... - TBF[4] class 1 reserves .....C.. - TBF[8] class 2 reserves ......C. - TBF[10] class 3 reserves .......C - TBF[15] class 4 reserves ...C.... - TBF[15] class 5 reserves ....C... + TBF[7] class 12 reserves ...C.... + TBF[8] class 13 reserves ...C.... + TBF[9] class 14 reserves ...C.... + TBF[0] class 15 reserves ....C... + TBF[10] class 16 reserves ...C.... + TBF[1] class 17 reserves ....C... + TBF[11] class 18 reserves ...C.... + TBF[2] class 19 reserves ....C... + TBF[12] class 20 reserves ...C.... + TBF[3] class 21 reserves ....C... + TBF[13] class 22 reserves ...C.... + TBF[0] class 23 reserves .....C.. + TBF[4] class 24 reserves ....C... + TBF[18] class 25 reserves ...C.... + TBF[1] class 26 reserves .....C.. + TBF[5] class 27 reserves ....C... + TBF[19] class 28 reserves ...C.... + TBF[2] class 29 reserves .....C.. + TBF[6] class 1 reserves ....C... + TBF[20] class 2 reserves ...C.... + TBF[4] class 3 reserves .....C.. + TBF[8] class 4 reserves ....C... + TBF[21] class 5 reserves ...C.... TBF[5] class 6 reserves .....C.. - TBF[10] class 7 reserves ......C. - TBF[11] class 8 reserves .......C - TBF[16] class 9 reserves ...C.... - TBF[16] class 10 reserves ....C... - TBF[6] class 11 reserves .....C.. - TBF[12] class 12 reserves ......C. - TBF[12] class 13 reserves .......C - TBF[17] class 14 reserves ...C.... - TBF[17] class 15 reserves ....C... - TBF[7] class 16 reserves .....C.. - TBF[17] class 17 reserves ......C. - TBF[13] class 18 reserves .......C - TBF[18] class 19 reserves ...C.... - TBF[18] class 20 reserves ....C... - TBF[8] class 21 reserves .....C.. - TBF[18] class 22 reserves ......C. - TBF[14] class 23 reserves .......C - TBF[19] class 24 reserves ...C.... + TBF[9] class 7 reserves ....C... + TBF[22] class 8 reserves ...C.... + TBF[6] class 9 reserves .....C.. + TBF[10] class 10 reserves ....C... + TBF[23] class 11 reserves ...C.... + TBF[7] class 12 reserves .....C.. + TBF[11] class 13 reserves ....C... + TBF[24] class 14 reserves ...C.... + TBF[12] class 15 reserves ....C... + TBF[25] class 16 reserves ...C.... + TBF[26] class 17 reserves ...C.... + TBF[27] class 18 reserves ...C.... + TBF[21] class 19 reserves ......C. + TBF[28] class 20 reserves ...C.... + TBF[29] class 21 reserves ...C.... + TBF[30] class 22 reserves ...C.... + TBF[31] class 23 reserves ...C.... + TBF[6] class 24 reserves .......C + TBF[7] class 25 reserves .......C + TBF[8] class 26 reserves .....C.. + TBF[8] class 27 reserves .......C + TBF[9] class 28 reserves .....C.. + TBF[9] class 29 reserves .......C + TBF[10] class 1 reserves .....C.. + TBF[10] class 2 reserves .......C + TBF[11] class 3 reserves .....C.. + TBF[11] class 4 reserves .......C + TBF[12] class 5 reserves .....C.. + TBF[12] class 6 reserves .......C + TBF[13] class 7 reserves ....C... + TBF[13] class 8 reserves .....C.. + TBF[13] class 9 reserves .......C + TBF[14] class 10 reserves ....C... + TBF[14] class 11 reserves .....C.. + TBF[14] class 12 reserves .......C + TBF[15] class 13 reserves ....C... + TBF[15] class 14 reserves .....C.. + TBF[15] class 15 reserves .......C + TBF[16] class 16 reserves ....C... + TBF[16] class 17 reserves .....C.. + TBF[16] class 18 reserves .......C + TBF[17] class 19 reserves ....C... + TBF[17] class 20 reserves .....C.. + TBF[17] class 21 reserves .......C + TBF[18] class 22 reserves ....C... + TBF[18] class 23 reserves .....C.. + TBF[18] class 24 reserves .......C TBF[19] class 25 reserves ....C... - TBF[19] class 26 reserves ......C. - TBF[15] class 27 reserves .......C - TBF[20] class 28 reserves ...C.... - TBF[20] class 29 reserves ....C... - TBF[20] class 1 reserves ......C. - TBF[16] class 2 reserves .......C - TBF[21] class 3 reserves ...C.... - TBF[21] class 4 reserves ....C... - TBF[21] class 5 reserves ......C. - TBF[22] class 6 reserves ...C.... - TBF[22] class 7 reserves ....C... - TBF[22] class 8 reserves ......C. - TBF[23] class 9 reserves ...C.... - TBF[23] class 10 reserves ....C... - TBF[9] class 11 reserves .....C.. - TBF[10] class 12 reserves .....C.. - TBF[11] class 13 reserves .....C.. - TBF[12] class 14 reserves .....C.. - TBF[13] class 15 reserves .....C.. - TBF[14] class 16 reserves .....C.. - TBF[15] class 17 reserves .....C.. - TBF[16] class 18 reserves .....C.. - TBF[17] class 19 reserves .....C.. - TBF[17] class 20 reserves .......C - TBF[18] class 21 reserves .....C.. - TBF[18] class 22 reserves .......C - TBF[19] class 23 reserves .....C.. - TBF[19] class 24 reserves .......C - TBF[20] class 25 reserves .....C.. - TBF[20] class 26 reserves .......C - TBF[21] class 27 reserves .....C.. - TBF[21] class 28 reserves .......C - TBF[22] class 29 reserves .....C.. - TBF[22] class 1 reserves .......C - TBF[23] class 2 reserves .....C.. - TBF[23] class 3 reserves ......C. - TBF[23] class 4 reserves .......C - TBF[24] class 5 reserves ...C.... - TBF[24] class 6 reserves ....C... - TBF[24] class 7 reserves .....C.. - TBF[24] class 8 reserves ......C. - TBF[24] class 9 reserves .......C - TBF[25] class 10 reserves ...C.... - TBF[25] class 11 reserves ....C... - TBF[25] class 12 reserves .....C.. - TBF[25] class 13 reserves ......C. - TBF[25] class 14 reserves .......C - TBF[26] class 15 reserves ...C.... - TBF[26] class 16 reserves ....C... - TBF[26] class 17 reserves .....C.. - TBF[26] class 18 reserves ......C. - TBF[26] class 19 reserves .......C - TBF[27] class 20 reserves ...C.... - TBF[27] class 21 reserves ....C... - TBF[27] class 22 reserves .....C.. - TBF[27] class 23 reserves ......C. - TBF[27] class 24 reserves .......C - TBF[28] class 25 reserves ...C.... - TBF[28] class 26 reserves ....C... - TBF[28] class 27 reserves .....C.. - TBF[28] class 28 reserves ......C. - TBF[28] class 29 reserves .......C - TBF[29] class 1 reserves ...C.... - TBF[29] class 2 reserves ....C... - TBF[29] class 3 reserves .....C.. - TBF[29] class 4 reserves ......C. - TBF[29] class 5 reserves .......C - TBF[30] class 6 reserves ...C.... - TBF[30] class 7 reserves ....C... - TBF[30] class 8 reserves .....C.. - TBF[30] class 9 reserves ......C. - TBF[30] class 10 reserves .......C - TBF[31] class 11 reserves ...C.... + TBF[19] class 26 reserves .....C.. + TBF[19] class 27 reserves .......C + TBF[20] class 28 reserves ....C... + TBF[20] class 29 reserves .....C.. + TBF[20] class 1 reserves .......C + TBF[21] class 2 reserves ....C... + TBF[21] class 3 reserves .....C.. + TBF[21] class 4 reserves .......C + TBF[22] class 5 reserves ....C... + TBF[22] class 6 reserves .....C.. + TBF[22] class 7 reserves ......C. + TBF[22] class 8 reserves .......C + TBF[23] class 9 reserves ....C... + TBF[23] class 10 reserves .....C.. + TBF[23] class 11 reserves ......C. + TBF[23] class 12 reserves .......C + TBF[24] class 13 reserves ....C... + TBF[24] class 14 reserves .....C.. + TBF[24] class 15 reserves ......C. + TBF[24] class 16 reserves .......C + TBF[25] class 17 reserves ....C... + TBF[25] class 18 reserves .....C.. + TBF[25] class 19 reserves ......C. + TBF[25] class 20 reserves .......C + TBF[26] class 21 reserves ....C... + TBF[26] class 22 reserves .....C.. + TBF[26] class 23 reserves ......C. + TBF[26] class 24 reserves .......C + TBF[27] class 25 reserves ....C... + TBF[27] class 26 reserves .....C.. + TBF[27] class 27 reserves ......C. + TBF[27] class 28 reserves .......C + TBF[28] class 29 reserves ....C... + TBF[28] class 1 reserves .....C.. + TBF[28] class 2 reserves ......C. + TBF[28] class 3 reserves .......C + TBF[29] class 4 reserves ....C... + TBF[29] class 5 reserves .....C.. + TBF[29] class 6 reserves ......C. + TBF[29] class 7 reserves .......C + TBF[30] class 8 reserves ....C... + TBF[30] class 9 reserves .....C.. + TBF[30] class 10 reserves ......C. + TBF[30] class 11 reserves .......C TBF[31] class 12 reserves ....C... TBF[31] class 13 reserves .....C.. TBF[31] class 14 reserves ......C. @@ -10795,4 +10751,4 @@ Successfully allocated 160 TBFs Testing DL TS allocation for Multi UEs TBF1: numTs(4) -TBF2: numTs(3) +TBF2: numTs(4) -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 11:35:48 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 2 Nov 2016 11:35:48 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: Holger, I have run existing test case with my option. and uploaded the generated test file. Please let us know your opinion on this patch. Thanks, Aravind Sirsikar -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 12:58:07 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Wed, 2 Nov 2016 12:58:07 +0000 Subject: [PATCH] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1167 to look at the new patch set (#2). Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 296 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/1167/2 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..febc45c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -484,6 +524,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); @@ -550,8 +593,10 @@ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, m_bts.alpha, m_bts.gamma, -1, burst_type, sb); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -676,8 +721,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1326,6 +1374,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..19341af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1064,6 +1074,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..2e93efc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,6 +377,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -465,6 +466,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..920bc70 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,57 @@ m_window.set_ws(ws); } + + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..2c4735e 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -153,7 +153,6 @@ int8_t rssi = meas->have_rssi ? meas->rssi : 0; const uint16_t ws = m_window.ws(); - this->state_flags |= (1 << GPRS_RLCMAC_FLAG_UL_DATA); LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA TFI=%d received (V(Q)=%d .. " @@ -175,7 +174,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +516,57 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 2 13:17:24 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Wed, 2 Nov 2016 13:17:24 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 1: (5 comments) https://gerrit.osmocom.org/#/c/1167/1/src/bts.h File src/bts.h: Line 51: > unrelated change Done https://gerrit.osmocom.org/#/c/1167/1/src/tbf.cpp File src/tbf.cpp: Line 1004: bts->pkt_dl_assignemnt(); > When is it NULL? Done Line 1079: bts->pkt_ul_assignment(); > When is it NULL? Done https://gerrit.osmocom.org/#/c/1167/1/src/tbf_dl.cpp File src/tbf_dl.cpp: Line 652: coding_scheme = GprsCodingScheme::Scheme(cs); > yes Done https://gerrit.osmocom.org/#/c/1167/1/src/tbf_ul.cpp File src/tbf_ul.cpp: Line 179: coding_scheme = GprsCodingScheme::Scheme(rlc->cs); > separate function is prefered Done -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 2 13:24:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 13:24:30 +0000 Subject: openbsc[master]: pcu_if: original pcu sock interface from osmo-bts In-Reply-To: References: Message-ID: Patch Set 3: > c) have one copy of the code (e.g. in the BSC) and pull the source > into the BTS, like we do with gsm_data_shared. Not elegant, but as > we already do it in one place, might not hurt to do more of that. IMHO this would be the point where we should rather solve this properly. Including gsm_data_shared.h from osmo-bts is and always has been ugly, as far as I'm concerned. It's the only place where we include a c file from another source tree, instead of using things that are installed. If I checkout another branch without doing 'make install', I expect that to not affect any other code trees... my two cents. -- To view, visit https://gerrit.osmocom.org/1169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b0a65f1633c40053d43b57b786b042f20f12bd Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 13:35:19 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 13:35:19 +0000 Subject: [PATCH] openbsc[master]: log: count_codecs(): drop logging of non-TCH lchan types Message-ID: Review at https://gerrit.osmocom.org/1184 log: count_codecs(): drop logging of non-TCH lchan types count_codecs() is called on every chan act ack, also for channels other than TCH/F and TCH/H. So this logging happens a lot during normal operation but adds no real information. Also, RSL would be the wrong logging category for this -- RSL is about the RSL communications, not whether our internal code tries to count lchan codecs for the wrong channel types. Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/84/1184/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f672750..3788644 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -111,9 +111,6 @@ default: break; } - } else { - LOGP(DRSL, LOGL_DEBUG, "count_codecs unknown lchan->type %s on channel %s\n", - gsm_lchant_name(lchan->type), gsm_ts_and_pchan_name(lchan->ts)); } } -- To view, visit https://gerrit.osmocom.org/1184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 2 14:44:50 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 14:44:50 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 4: ok, so the reason why patch set 3 doesn't work is because apparently the lchan type on the broken channel is set to NONE. The dyn_ts_switchover_complete verifies whether the lchan->type matches the dyn.pchan_want. normally that would be e.g. GSM_LCHAN_TCH_F. The reason the type is NONE is apparently here: lchan_act_tmr_cb() actually calls lchan_free(). It's kind of untypical to call rsl_rf_chan_release() on a freed lchan, but it works because the channel type info in the IEs is derived from the pchan type, not the lchan->type. So we can do: * set the lchan->type back to the matching GSM_LCHAN_* before calling dyn_ts_switchover_complete(), or * remove the lchan type check from switchover complete, or * hack the dyn ts state like in patch set 4 to effect a switch back to PDCH (with the limitation that it probably needs a fix still, I'll submit another patch set) -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:34:50 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 15:34:50 +0000 Subject: [PATCH] openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/713 to look at the new patch set (#5). lchan: Release channel in case of late activation ack In case of the sysmoBTS and receiving a channel activation ack on a channel that was marked as broken, release it again. Use a normal release without SACCH deactivation and release the rqd_ta data. Also add a local variable 'ts' to shorten some lines. The typical situation where this would occur is with high latency between BTS and BSC (or NITB). If a channel activation ack does not arrive in time, a channel is marked broken, and never recovers after that. This patch will release the channel again, which will remove the BROKEN_UNUSABLE state and makes lchan available again. Reported by Rhizomatica. However, in case of packet loss, i.e. when the channel activation ack never arrives at the BSC, this patch does not provide a resolution of the BROKEN_UNUSABLE state. On dynamic timeslots: clearing the dyn ts state could possibly happen in lchan_free() instead of in rsl_rx_chan_act_ack(). That's to be done in a separate patch, if at all. Tweaked-By: nhofmeyr Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 28 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/13/713/5 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f672750..e3a98f5 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1175,6 +1175,7 @@ { struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts_trx_ts *ts = lchan->ts; /* BTS has confirmed channel activation, we now need * to assign the activated channel to the MS */ @@ -1184,8 +1185,32 @@ osmo_timer_del(&lchan->act_timer); if (lchan->state == LCHAN_S_BROKEN) { - LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK for broken channel.\n", - gsm_lchan_name(lchan)); + int do_release = is_sysmobts_v2(ts->trx->bts); + LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK for broken channel. %s\n", + gsm_lchan_name(lchan), + do_release ? "Releasing it" : "Keeping it broken"); + if (do_release) { + talloc_free(lchan->rqd_ref); + lchan->rqd_ref = NULL; + lchan->rqd_ta = 0; + rsl_lchan_set_state(msg->lchan, LCHAN_S_ACTIVE); + if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { + /* + * lchan_act_tmr_cb() already called + * lchan_free() and cleared the lchan->type, so + * calling dyn_ts_switchover_complete() here + * would not have the desired effect of + * mimicking an activated lchan that we can + * release. Instead hack the dyn ts state to + * make sure that rsl_rx_rf_chan_rel_ack() will + * switch back to PDCH, i.e. have pchan_is == + * pchan_want, both != GSM_PCHAN_PDCH: + */ + ts->dyn.pchan_is = GSM_PCHAN_NONE; + ts->dyn.pchan_want = GSM_PCHAN_NONE; + } + rsl_rf_chan_release(msg->lchan, 0, SACCH_NONE); + } return 0; } @@ -1195,7 +1220,7 @@ gsm_lchans_name(lchan->state)); rsl_lchan_set_state(lchan, LCHAN_S_ACTIVE); - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) + if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) dyn_ts_switchover_complete(lchan); if (lchan->rqd_ref) { -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX Message-ID: Review at https://gerrit.osmocom.org/1185 Documentation on AMR RTP in case of DTX Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b --- A OsmoBTS/abis/rtp-amr.adoc 1 file changed, 858 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/1185/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc new file mode 100644 index 0000000..6572766 --- /dev/null +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -0,0 +1,858 @@ += AMR-RTP in combination with DTX + +The purpose of this document is to describe the sometimes quite +intricate interactions between a MS, the BTS-PHY and the BTS softare +in case of AMR (Adaptive Multi Rate) codec and DTX (Discontinuous +Transmission). + +It is written with the OsmoBTS implementation and the Nutaq GSM PHY +API in mind, but should more or lesss be applicable to any GSM BTS +PHY or any BTS software implementation, assuming it uses RTP on the +back-haul towards the MGW. + +== Full-Rate (TCH/AFS) + +=== TCH/AFS Uplink (MS to Network) + +==== TCH/AFS Uplink: During talk-spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every four radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates a RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has beeon ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH/AFS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST shall be transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +The BTS sends an RTP frame with AMR Frame Type SID, in whihc the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contianed in sub-blocks 1-4 only + +ULSU2:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every 8 +voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<> + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-ul-onset]] +==== TCH/AFS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks its transmitter to perform transmission of SID_ONSET, which is a +special frame whose information is encoded only in sub-blocks 3+4 and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts are sent, containing + +* the only four transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits a RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + ...; +} +---- + +ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all +infomration is contained in blocks 5..8. + +=== TCH/AFS Downlink (Network to MS) + +[[afs-dl-talk]] +==== TCH/AFS Downlink: During talk-spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: A RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into eight +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every four bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has beeon ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AFS Downlink: End of Voice; Start of Silence + +When the BTS receives the first RTP frame with Frame Type SID, it will +generate a SID_FIRST AMR frame. The AMR frame is interleaved in a way +that all information is contained in the first four sub-blocks, with +the latter four sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise parameters +received in either the first AMR SID frame, or a subsequent AMR SID +frame received meanwhile. + +In between SID_FIRST and SID_UPDATE, and after the SID_UPDATE, the BTS +sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID First"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of SID_FIRST)", id="DLSF2"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="DLSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; +} +---- + +DLSF2:: sub-frames 5..8 of SID_FIRST are not transmitted, as all +information is contained in sub-frames 1..4 + +DLSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +afterthe SID_FIRST, resulting in two supressed voice frame periods of +empty bursts in between. + +==== TCH/AFS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +Frames, and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-dl-onset]] +==== TCH/AFS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let's not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see +<> + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS1:: The SID_ONSET and the first voice frame are sent in the same +block of four radio busts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. + +== Half-Rate (TCH/AHS) + +=== TCH/AHS Uplink (MS to Network) + +==== TCH/AHS Uplink: During talk-spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every two radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates a RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has beeon ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH AHS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST_P1 and SID_FIRST_P2 shall be +transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1 +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 + +The BTS sends an RTP frame with AMR Frame Type SID, in which the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF1:: There are two separate indications for P1 and P2, despite both +P1 and P2 being multiplexed together in one batch of four bursts. Not +sure why they result in two separate PH-DATA.ind. Based on what we +know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and +SidFirstP2 indications immediately after each other, both for the same +GSM frame number. + +ULSU1:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every +8 voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[ahs-ul-onset]] +==== TCH/AHS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks it's transmitter to perform transmission of SID_ONSET, which is a +special frame whose information is encoded only in sub-blocks 3+4 and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts are sent, containing + +* the only two transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits a RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_FIRST + +In case voice activity is detected again while the SID_FIRST_P1 +transmission is ongoing or completed, but the SID_FIRST_P2 has not +been transmitted yet, SID_FIRST can be inhibited by means of a +SID_FIRST_INH frame. This allows the first voice frame to be +transmitted with minimal delay, compared to first completing +the regular SID_FIRTS_P2 and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ms .. mgw [label="End of talk-spurt with inhibited SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 3 of last speech frame N + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of last speech frame N + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_FIRST_INH and sub-block 1 of speech frame N+1", id="SFI1"]; + ms => phy [label="L1 burst (block 2 of SID_FIRST_INH and sub-block 2 of speech frame N+1"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+2 + sub-block 1 of speech frame N+3)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+2 + sub-block 2 of speech frame N+3)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidInh", id="SFI2"]; + bts => bts [label="store CMI from SID_FIRST_INH"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_UPDATE + +In case voice activity is detected again while the SID_UPDATE +transmission of the first two sub-blocks is ongoing or completed, but +the second two sub-blocks have not been transmitted yet, SID_UPDATE can +be inhibited by means of a SID_UPDATE_INH frame. This allows the +first voice frame to be transmitted with minimal delay, compared to +first completing the regular SID_UPDATE and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="pre-empted SID Update (during silence period)"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; + ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +=== TCH/AHS Downlink (Network to MS) + +[[ahs-dl-talk]] +==== TCH/AHS Downlink: During talk-spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: A RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into four +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every two bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has beeon ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: End of Voice; Start of Silence + + +When the BTS receives the first RTP frame with Frame Type SID, it will +first issue a GsmL1_TchPlType_Amr_SidFirstP1 primitive towards the +BTS-PHY, followed by a GsmL1_TchPlType_Amr_SidFirstP2 primitive. + +The SID_FIRST_P2 is interleaved in a way that all information is +contained in the first two sub-blocks, with the latter two +sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise +parameters received in either the first RTP AMR SID frame, or a +subsequent RTP AMR SID frame received meanwhile. + +In between SID_FIRST_P2 and SID_UPDATE, and after the SID_UPDATE, the +BTS sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH +downlink frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; +} +---- + +ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +after the SID_FIRST, resulting in two supressed voice frame periods of +empty bursts in between. + +RTDSU1:: Not sure of BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +==== TCH/AHS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +Frames, and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +RTDSU2:: Not sure of BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +[[ahs-dl-onset]] +==== TCH/AHS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let?s not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see Section +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS2:: The SID_ONSET and the first voice frame are sent in the same +block of four radio busts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Uplink Message-ID: Review at https://gerrit.osmocom.org/1186 rtp-amr.adoc: TCH/AFS Uplink Add new chapter by Nutaq for Speech Frame Following a SID_FIRST frame Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 115 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/86/1186/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 6572766..f82b420 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -171,24 +171,131 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; - ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; - bts => bts [label="lchan_set_marker() and store CMI"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ...; } ---- ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all -infomration is contained in blocks 5..8. +information is contained in blocks 5..8. + +==== TCH/AFS Uplink: Speech Frame Following a SID_FIRST frame + +The four last bursts of a SID_FIRST frame can be replaced by an ONSET frame in order to quickly resume speech. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Speech Frame Following a SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AFS Uplink: FACCH/F Frame During DTX Operation + +As mentioned in section A.5.1.2.1 of 3GPP TS 26.093 : + +* If the frame preceding the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then an ONSET frame shall be signalled to the CHE, followed by the FACCH frame(s). +* If the frame following the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then a SID_FIRST shall be signalled to the CHE. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/F Frame During DTX"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH frame)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH frame)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH frame)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH frame)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 5 of FACCH frame + sub-block 1 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 6 of FACCH frame + sub-block 2 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 7 of FACCH frame + sub-block 3 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH frame + sub-block 4 of SID First frame)", id="Note"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/F"]; + bts => mgw [label="FACCH/F"]; + + ms -x phy [label="Supressed L1 burst", id="ULSF2"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ...; +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contained in sub-blocks 1-4 only + +Note:: It has been observed with some phones that the SID_FIRST is not sent following the FACCH/F +frame. If this case occures the No Data Frame and SID_UPDATE order resumes. === TCH/AFS Downlink (Network to MS) -- To view, visit https://gerrit.osmocom.org/1186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Downlink: Inhibiting Message-ID: Review at https://gerrit.osmocom.org/1187 rtp-amr.adoc: TCH/AFS Downlink: Inhibiting Add two new chapters contributed by Nutaq: * TCH/AFS Downlink: Inhibiting a SID_FIRST frame * TCH/AFS Downlink: FACCH/F During DTX Operation Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 85 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/87/1187/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index f82b420..c67a1ad 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -495,10 +495,91 @@ } ---- -DLOS1:: The SID_ONSET and the first voice frame are sent in the same -block of four radio busts. Hence, the BTS must be able ot to send -actual codec payload along with the GsmL1_TchPlType_Amr_Onset -primitive. +==== TCH/AFS Downlink: Inhibiting a SID_FIRST frame + +Here is the procedure to inhibit a SID_FIRST frame in order to quickly resume speech. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibiting a SID_FIRST frame"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of SID_FIRST)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; + } +---- + +==== TCH/AFS Downlink: FACCH/F During DTX Operation + +The following procedure must be observed if a FACCH/F frame must be transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/F Frame During DTX"]; + + bts <= mgw [label="FACCH/F"]; + phy => bts [label="PH-RTS.ind (FACCH/F)"]; + phy => bts [label="PH-RTS.ind (TCH/F)"]; + phy <= bts [label="PH-DATA.req (FACCH/F)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset(TCH/F)", id="NOTE"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH/F)"]; + + phy => bts [label="PH-RTS.ind (FACCH)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/F)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 5 of FACCH/F + sub-block 1 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 6 of FACCH/F + sub-block 2 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 7 of FACCH/F + sub-block 3 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 8 of FACCH/F + sub-block 4 of SID_FIRST)"]; + + phy => bts [label="PH-RTS.ind (FACCH)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/F)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (TCH/F)"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; +} +---- + +NOTE:: The ONSET and the FACCH/F PH-DATA requests must both be sent to the PHY. == Half-Rate (TCH/AHS) -- To view, visit https://gerrit.osmocom.org/1187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX Message-ID: Review at https://gerrit.osmocom.org/1188 rtp-amr: TCH/AHS Uplink: FACCH/H During DTX New chapter contributed by Nutaq: * TCH/AHS Uplink: FACCH/H During DTX operation Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/88/1188/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index c67a1ad..f9f20b0 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -843,7 +843,54 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: FACCH/H During DTX operation + +The following procedure must be observed if a FACCH/H frame must be transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="FACCH/H during DTX operation"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; + ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH/H + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/H"]; + bts => mgw [label="FACCH/H"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: New TCH/AHS downlink chapters Message-ID: Review at https://gerrit.osmocom.org/1189 rtp-amr.adoc: New TCH/AHS downlink chapters Nutaq contributed the following chapters: * TCH/AHS Downlink: FACCH/H During DTX Operation * TCH/AHS Downlink: Inhibited SID_UPDATE * TCH/AHS Downlink: Inhibited SID_FIRST_P1 Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 110 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/89/1189/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index f9f20b0..ef00aeb 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -1076,18 +1076,122 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } ---- -DLOS2:: The SID_ONSET and the first voice frame are sent in the same -block of four radio busts. Hence, the BTS must be able ot to send -actual codec payload along with the GsmL1_TchPlType_Amr_Onset -primitive. +==== TCH/AHS Downlink: Inhibited SID_FIRST_P1 + +The following procedure must be observed in case of a SID_FIRST must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_FIRST_P1"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_FIRST_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_FIRST_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: Inhibited SID_UPDATE + +The following procedure must be observed in case of a SID_UPDATE must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_UPDATE"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidUpdateInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_UPDATE_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_UPDATE_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: FACCH/H During DTX Operation + +The following procedure must be observed in case of a FACCH/H frame must be inserted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/H During DTX Operation"]; + + bts <= mgw [label="FACCH/H"]; + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req FACCH/H"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET, sub-block 1 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET, sub-block 2 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 3+4 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 7 of FACCH/H frame + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 8 of FACCH/H frame + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; +} +---- -- To view, visit https://gerrit.osmocom.org/1189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:36:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 15:36:52 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: Fixes to Message Sequence Charts Message-ID: Review at https://gerrit.osmocom.org/1190 rtp-amr.adoc: Fixes to Message Sequence Charts Nutaq added these clarifications/extensions/fixes tothe message sequence charts. Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 177 insertions(+), 60 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/90/1190/1 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index ef00aeb..3b0c1dd 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -65,11 +65,11 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID"]; - ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms -x phy [label="Supressed L1 burst"]; @@ -83,21 +83,29 @@ ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all -information bits are contianed in sub-blocks 1-4 only +ULSF2:: As per 3GPP TS 05.03 section 3.9.2.4 The last 4 bursts shall not be transmitted unless +the SID_FIRST frame is immediately followed by a speech frame. It has been observed that some phone +does not transmit the last 4 bursts even if it is not followed by a speech frame. ULSU2:: There must be exactly two supressed voice frames between the SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and @@ -125,7 +133,70 @@ ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -480,14 +551,15 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; - ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; @@ -603,10 +675,14 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-2)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; } @@ -636,40 +712,41 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N, sub-block 2 of SID_FIRST_P1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - ms -x phy [label="Supressed L1 burst"]; - ms -x phy [label="Supressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms -x phy [label="Supressed L1 burst"]; ms -x phy [label="Supressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2", id="NOTE"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF1:: There are two separate indications for P1 and P2, despite both -P1 and P2 being multiplexed together in one batch of four bursts. Not -sure why they result in two separate PH-DATA.ind. Based on what we -know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and -SidFirstP2 indications immediately after each other, both for the same -GSM frame number. +ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. + +NOTE:: It has been observed that not all phones transmit SID_FIRST_P2 so the PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 is not guaranteed to be sent to the BTS. ULSU1:: There must be exactly two supressed voice frames between the SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and @@ -695,10 +772,55 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -822,26 +944,27 @@ ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; ...; - ms .. mgw [label="pre-empted SID Update (during silence period)"]; + ms .. mgw [label="Inhibited SID Update (during silence period)"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; - ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; - bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + ms => phy [label="L1 burst (block 1 of SID_UPD_INH + sub-block 1 of speech frame N)", id="SFU1"]; + ms => phy [label="L1 burst (block 2 of SID_UPD_INH + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; } @@ -894,6 +1017,7 @@ } ---- + === TCH/AHS Downlink (Network to MS) [[ahs-dl-talk]] @@ -925,7 +1049,7 @@ ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } @@ -985,11 +1109,12 @@ ms x- phy [label="Supressed burst"]; ms x- phy [label="Supressed burst"]; + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; @@ -1004,9 +1129,6 @@ ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) after the SID_FIRST, resulting in two supressed voice frame periods of empty bursts in between. - -RTDSU1:: Not sure of BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? ==== TCH/AHS Downlink: During Silence @@ -1039,20 +1161,15 @@ bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- 8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM TDMA frames! - -RTDSU2:: Not sure of BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? [[ahs-dl-onset]] ==== TCH/AHS Downlink: End of Silence; Start of Voice -- To view, visit https://gerrit.osmocom.org/1190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 15:50:03 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Wed, 2 Nov 2016 15:50:03 +0000 Subject: [PATCH] libosmo-abis[master]: Mark arrays in header files as extern, so symbols aren't cre... Message-ID: Review at https://gerrit.osmocom.org/1191 Mark arrays in header files as extern, so symbols aren't created for each source file that includes the headers Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Signed-off-by: Arran Cudbard-Bell --- M include/osmocom/abis/e1_input.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/91/1191/1 diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index c99b133..4c7f8a0 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -21,7 +21,7 @@ E1INP_SIGN_OSMO, /* IPA CCM OSMO sub-type */ }; const char *e1inp_signtype_name(enum e1inp_sign_type tp); -const struct value_string e1inp_sign_type_names[5]; +extern const struct value_string e1inp_sign_type_names[5]; enum e1inp_ctr { E1I_CTR_HDLC_ABORT, @@ -68,7 +68,7 @@ E1INP_TS_TYPE_HDLC, }; const char *e1inp_tstype_name(enum e1inp_ts_type tp); -const struct value_string e1inp_ts_type_names[6]; +extern const struct value_string e1inp_ts_type_names[6]; /* A timeslot in the E1 interface */ struct e1inp_ts { -- To view, visit https://gerrit.osmocom.org/1191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell From gerrit-no-reply at lists.osmocom.org Wed Nov 2 16:00:57 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 16:00:57 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 verified that patch set 5 works for tch/h as well as pdch activation on dynamic timeslots: with late act ack, the ts leaves BROKEN state and becomes available == is activated as PDCH. -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 2 16:21:07 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 16:21:07 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Move RTP AMR doc to top level Message-ID: Review at https://gerrit.osmocom.org/1192 Move RTP AMR doc to top level Add it to Makefile with proper docinfo so it's build automatically alongside with other documentation. Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 --- M OsmoBTS/Makefile A OsmoBTS/rtp-amr-docinfo.xml R OsmoBTS/rtp-amr.adoc 3 files changed, 47 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/1192/1 diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 1e70eac..d93a52e 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -14,7 +14,7 @@ # htmlcss = TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis +ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml new file mode 100644 index 0000000..234394b --- /dev/null +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + November 2016 + HW + + Initial version + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2016 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc similarity index 100% rename from OsmoBTS/abis/rtp-amr.adoc rename to OsmoBTS/rtp-amr.adoc -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 16:52:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 16:52:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Move RTP AMR doc to top level In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1192 to look at the new patch set (#2). Move RTP AMR doc to top level Add it to Makefile with proper docinfo so it's build automatically alongside with other documentation. Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 --- M OsmoBTS/Makefile A OsmoBTS/rtp-amr-docinfo.xml R OsmoBTS/rtp-amr.adoc 3 files changed, 47 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/1192/2 diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 1e70eac..d93a52e 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -14,7 +14,7 @@ # htmlcss = TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis +ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml new file mode 100644 index 0000000..82131c4 --- /dev/null +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + October 2016 + HW + + Initial version + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2016 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc similarity index 100% rename from OsmoBTS/abis/rtp-amr.adoc rename to OsmoBTS/rtp-amr.adoc -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 2 16:52:29 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 2 Nov 2016 16:52:29 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR Message-ID: Review at https://gerrit.osmocom.org/1193 Add DTX implementation details to RTP AMR Add FSM and description. Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 --- A OsmoBTS/dtx.dot M OsmoBTS/rtp-amr-docinfo.xml M OsmoBTS/rtp-amr.adoc 3 files changed, 87 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/93/1193/1 diff --git a/OsmoBTS/dtx.dot b/OsmoBTS/dtx.dot new file mode 100644 index 0000000..95ab2d6 --- /dev/null +++ b/OsmoBTS/dtx.dot @@ -0,0 +1,50 @@ +digraph finite_state_machine { + node [shape = doublecircle]; ST_VOICE ST_FACCH_V ST_FACCH ST_SID_U; + node [shape = circle]; + ST_VOICE -> ST_SID_F1 [ label = "E_SID_F" ]; + ST_VOICE -> ST_SID_F1 [ label = "E_SID_U" ]; + ST_VOICE -> ST_VOICE [ label = "E_VOICE" ]; + ST_VOICE -> ST_VOICE [ label = "E_FACCH" ]; + + ST_SID_F1 -> ST_SID_F1 [ label = "E_SID_F" ]; + ST_SID_F1 -> ST_SID_U [ label = "E_SID_U" ]; + ST_SID_F1 -> ST_VOICE [ label = "E_VOICE" ]; + ST_SID_F1 -> ST_ONSET_F [ label = "E_FACCH" ]; + ST_SID_F1 -> ST_SID_F2 [ label = "E_COMPL" ]; + ST_SID_F1 -> ST_F1_INH [ label = "E_INHIB" ]; + ST_SID_F1 -> ST_ONSET_V [ label = "E_ONSET" ]; + + ST_SID_F2 -> ST_SID_U [ label = "E_SID_U" ]; + ST_SID_F2 -> ST_VOICE [ label = "E_VOICE" ]; + ST_SID_F2 -> ST_ONSET_F [ label = "E_FACCH" ]; + + ST_F1_INH -> ST_VOICE [ label = "E_VOICE" ]; + ST_F1_INH -> ST_FACCH_V [ label = "E_FACCH" ]; + + ST_U_INH -> ST_VOICE [ label = "E_VOICE" ]; + ST_U_INH -> ST_FACCH_V [ label = "E_FACCH" ]; + + ST_SID_U -> ST_ONSET_F [ label = "E_FACCH" ]; + ST_SID_U -> ST_VOICE [ label = "E_VOICE" ]; + ST_SID_U -> ST_U_INH [ label = "E_INHIB" ]; + ST_SID_U -> ST_SID_U [ label = "E_SID_U" ]; + ST_SID_U -> ST_SID_U [ label = "E_SID_F" ]; + ST_SID_U -> ST_ONSET_V [ label = "E_ONSET" ]; + + ST_ONSET_V -> ST_VOICE [ label = "E_VOICE" ]; + ST_ONSET_V -> ST_FACCH_V [ label = "E_FACCH" ]; + + ST_ONSET_F -> ST_VOICE [ label = "E_VOICE" ]; + ST_ONSET_F -> ST_FACCH [ label = "E_FACCH" ]; + ST_ONSET_F -> ST_ONSET_F [ label = "E_SID_U" ]; + + ST_FACCH_V -> ST_FACCH_V [ label = "E_FACCH" ]; + ST_FACCH_V -> ST_VOICE [ label = "E_VOICE" ]; + ST_FACCH_V -> ST_VOICE [ label = "E_SID_U" ]; + ST_FACCH_V -> ST_SID_F1 [ label = "E_SID_F" ]; + + ST_FACCH -> ST_FACCH [ label = "E_FACCH" ]; + ST_FACCH -> ST_VOICE [ label = "E_VOICE" ]; + ST_FACCH -> ST_SID_F1 [ label = "E_SID_U" ]; + ST_FACCH -> ST_SID_F1 [ label = "E_SID_F" ]; +} diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml index 82131c4..fe5d681 100644 --- a/OsmoBTS/rtp-amr-docinfo.xml +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -7,6 +7,14 @@ Initial version + + 2 + November 2016 + MS + + FSM added + + @@ -21,6 +29,17 @@ Managing Director + + Max + Suraev + msuraev at sysmocom.de + MS + + sysmocom + sysmocom - s.f.m.c. GmbH + Software Developer + + diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index ef00aeb..8ee69b1 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -1195,3 +1195,21 @@ ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; } ---- + +== Implementation details + +There is FSM implementing all the necessary states and transitions for DTX DL. + +[[dtx_dl_fsm]] +[graphviz] +---- +include::dtx.dot[] +---- + +The idea is that each state corresponds to the particular message type which have to be send to L1 while state transition happens on incoming events like FACCH or Voice frames. There are 3 different classes of of events driving this FSM: + +* Voice frame types: E_VOICE, E_SID_U, E_SID_F +* Incoming FACCH: E_FACCH +* Internal: E_ONSET, E_INHIB, E_COMPL + +They represent different types of incoming RTP frames (Voice, SID UPDATE and SID FIRST correspondingly), incoming FACCH events or important events internal to DTX operations. The latter are Onset (interruption of silence period), Inhibition (of currently transmitted SID FIRST or UPDATE) and Completion (of silence initiation). \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 2 17:22:26 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Wed, 2 Nov 2016 17:22:26 +0000 Subject: [PATCH] libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... Message-ID: Review at https://gerrit.osmocom.org/1194 Set SO_NOSIGPIPE on SCTP connections, for patforms which support it (macOS, FreeBSD etc...) Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Signed-off-by: Arran Cudbard-Bell --- M src/stream.c 1 file changed, 17 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/94/1194/1 diff --git a/src/stream.c b/src/stream.c index fd02b74..7d40df2 100644 --- a/src/stream.c +++ b/src/stream.c @@ -26,6 +26,14 @@ #include #endif +/* + * Platforms that don't have MSG_NOSIGNAL (which disables SIGPIPE) + * usually have SO_NOSIGPIPE (set via setsockopt). + */ +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + static int sctp_sock_activate_events(int fd) { #ifdef HAVE_LIBSCTP @@ -167,8 +175,16 @@ ofd->when &= ~BSC_FD_WRITE; LOGP(DLINP, LOGL_DEBUG, "connection done.\n"); cli->state = STREAM_CLI_STATE_CONNECTED; - if (cli->proto == IPPROTO_SCTP) + if (cli->proto == IPPROTO_SCTP) { +#ifdef SO_NOSIGPIPE + int val = 1; + + ret = setsockopt(ofd->fd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&val, sizeof(val)); + if (ret < 0) + LOGP(DLINP, LOGL_DEBUG, "Failed setting SO_NOSIGPIPE: %s\n", strerror(errno)); +#endif sctp_sock_activate_events(ofd->fd); + } if (cli->connect_cb) cli->connect_cb(cli); break; -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell From gerrit-no-reply at lists.osmocom.org Wed Nov 2 17:35:14 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Wed, 2 Nov 2016 17:35:14 +0000 Subject: [PATCH] libosmo-sccp[master]: Add missing xua.pc file Message-ID: Review at https://gerrit.osmocom.org/1195 Add missing xua.pc file Change-Id: I5081799e1d7c7f5f3206e5f38060540bb4e3289b Signed-off-by: Arran Cudbard-Bell --- M Makefile.am M configure.ac A libosmo-xua.pc.in 3 files changed, 12 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/95/1195/1 diff --git a/Makefile.am b/Makefile.am index 66b4d17..b1eff56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = include src tests pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc +pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc EXTRA_DIST = .version diff --git a/configure.ac b/configure.ac index 6446677..4c3c937 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ libosmo-sigtran.pc libosmo-sccp.pc libosmo-mtp.pc + libosmo-xua.pc include/sccp/Makefile include/mtp/Makefile include/osmocom/Makefile diff --git a/libosmo-xua.pc.in b/libosmo-xua.pc.in new file mode 100644 index 0000000..28f8285 --- /dev/null +++ b/libosmo-xua.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmo XUA Lib +Description: Osmo XUA Lib +Version: @VERSION@ +Libs: -L${libdir} -losmo-xua +Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5081799e1d7c7f5f3206e5f38060540bb4e3289b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell From gerrit-no-reply at lists.osmocom.org Wed Nov 2 17:46:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 2 Nov 2016 17:46:30 +0000 Subject: [PATCH] openbsc[master]: bsc_vty: include dyn TS info in vty show lchan Message-ID: Review at https://gerrit.osmocom.org/1196 bsc_vty: include dyn TS info in vty show lchan Extend both 'show lchan ' and 'show lchan summary' to include information on dynamic timeslots. Have one common function that prints " as foo" or " switching foo -> bar" to the vty, use it in lchan_dump_full_vty() and lchan_dump_short_vty(). In lchan_dump_short_vty(), split the vty_out call in two in order to interleave the dyn ts info right after the pchan. The summary hence looks e.g. like this for osmocom style dyn ts: BTS 0, TRX 0, Timeslot 5 TCH/F_TCH/H_PDCH as PDCH, Lchan 0, Type NONE, State ACTIVE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm or BTS 0, TRX 0, Timeslot 4 TCH/F_TCH/H_PDCH switching NONE -> PDCH, Lchan 0, Type NONE, State BROKEN UNUSABLE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 53 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/96/1196/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index cb0b1d8..9ed19aa 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1078,6 +1078,38 @@ { 0, NULL } }; +/* call vty_out() to print a string like " as TCH/H" for dynamic timeslots. + * Don't do anything if the ts is not dynamic. */ +static void vty_out_dyn_ts_status(struct vty *vty, struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (ts->dyn.pchan_is == ts->dyn.pchan_want) + vty_out(vty, " as %s", + gsm_pchan_name(ts->dyn.pchan_is)); + else + vty_out(vty, " switching %s -> %s", + gsm_pchan_name(ts->dyn.pchan_is), + gsm_pchan_name(ts->dyn.pchan_want)); + break; + case GSM_PCHAN_TCH_F_PDCH: + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) + vty_out(vty, " as %s", + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F"); + else + vty_out(vty, " switching %s -> %s", + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F", + (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" + : "TCH/F"); + break; + default: + /* no dyn ts */ + break; + } +} + static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan) { int idx; @@ -1085,6 +1117,22 @@ vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE); + /* show dyn TS details, if applicable */ + switch (lchan->ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + vty_out(vty, " Osmocom Dyn TS:"); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, VTY_NEWLINE); + break; + case GSM_PCHAN_TCH_F_PDCH: + vty_out(vty, " IPACC Dyn PDCH TS:"); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, VTY_NEWLINE); + break; + default: + /* no dyn ts */ + break; + } vty_out(vty, " Connection: %u, State: %s%s%s%s", lchan->conn ? 1: 0, gsm_lchans_name(lchan->state), @@ -1129,10 +1177,12 @@ lchan->meas_rep_idx, 1); mr = &lchan->meas_rep[idx]; - vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s, Lchan %u, Type %s, State %s - " - "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", + vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - gsm_pchan_name(lchan->ts->pchan), + gsm_pchan_name(lchan->ts->pchan)); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, ", Lchan %u, Type %s, State %s - " + "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", lchan->nr, gsm_lchant_name(lchan->type), gsm_lchans_name(lchan->state), mr->ms_l1.pwr, -- To view, visit https://gerrit.osmocom.org/1196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 2 23:04:53 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Wed, 2 Nov 2016 23:04:53 +0000 Subject: [PATCH] libosmo-sccp[master]: Fix the .pc files so the -l arg matches the installed libraries Message-ID: Review at https://gerrit.osmocom.org/1197 Fix the .pc files so the -l arg matches the installed libraries Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 --- M libosmo-mtp.pc.in M libosmo-sccp.pc.in 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/97/1197/1 diff --git a/libosmo-mtp.pc.in b/libosmo-mtp.pc.in index 675d0d3..5e99dd3 100644 --- a/libosmo-mtp.pc.in +++ b/libosmo-mtp.pc.in @@ -6,5 +6,5 @@ Name: Osmo MTP Lib Description: Osmo MTP Lib Version: @VERSION@ -Libs: -L${libdir} -lmtp +Libs: -L${libdir} -losmo-mtp Cflags: -I${includedir}/ diff --git a/libosmo-sccp.pc.in b/libosmo-sccp.pc.in index eda8d49..9dd18c1 100644 --- a/libosmo-sccp.pc.in +++ b/libosmo-sccp.pc.in @@ -6,5 +6,5 @@ Name: OpenBSC SCCP Lib Description: OpenBSC SCCP Lib Version: @VERSION@ -Libs: -L${libdir} -lsccp +Libs: -L${libdir} -losmo-sccp Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell From gerrit-no-reply at lists.osmocom.org Thu Nov 3 04:11:34 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 3 Nov 2016 04:11:34 +0000 Subject: [PATCH] libosmo-abis[master]: add basic unixsocket support Message-ID: Review at https://gerrit.osmocom.org/1198 add basic unixsocket support Allow to connect to a unix socket communicating with LAPD. Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a --- M src/Makefile.am M src/e1_input.c M src/e1_input_vty.c A src/input/unixsocket.c 4 files changed, 220 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/98/1198/1 diff --git a/src/Makefile.am b/src/Makefile.am index b24f2cf..760c1f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,7 +24,8 @@ input/lapd.c \ input/lapd_pcap.c \ input/misdn.c \ - input/rs232.c + input/rs232.c \ + input/unixsocket.c libosmotrau_la_CFLAGS = $(AM_CFLAGS) $(ORTP_CFLAGS) libosmotrau_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(TRAU_LIBVERSION) diff --git a/src/e1_input.c b/src/e1_input.c index 970bdb9..7222cee 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -815,6 +815,7 @@ void e1inp_dahdi_init(void); void e1inp_ipaccess_init(void); void e1inp_rs232_init(void); +void e1inp_unixsocket_init(void); void e1inp_init(void) { @@ -829,4 +830,5 @@ #endif e1inp_ipaccess_init(); e1inp_rs232_init(); + e1inp_unixsocket_init(); } diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c index 5320bb3..47bc5ba 100644 --- a/src/e1_input_vty.c +++ b/src/e1_input_vty.c @@ -38,12 +38,13 @@ /* CONFIG */ -#define E1_DRIVER_NAMES "(misdn|misdn_lapd|dahdi|ipa)" +#define E1_DRIVER_NAMES "(misdn|misdn_lapd|dahdi|ipa|unixsocket)" #define E1_DRIVER_HELP "mISDN supported E1 Card (kernel LAPD)\n" \ "mISDN supported E1 Card (userspace LAPD)\n" \ "DAHDI supported E1/T1/J1 Card\n" \ "IPA TCP/IP input\n" \ - "HSL TCP/IP input" + "HSL TCP/IP input\n" \ + "Unix socket input\n" #define E1_LINE_HELP "Configure E1/T1/J1 Line\n" "Line Number\n" diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c new file mode 100644 index 0000000..bcc86ed --- /dev/null +++ b/src/input/unixsocket.c @@ -0,0 +1,213 @@ +/* OpenBSC Abis receive lapd over a unix socket */ + +/* + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "internal.h" + +void *tall_unixsocket_ctx; +#define UNIXSOCKET_ALLOC_SIZE 1600 + +struct unixsocket_line { + struct osmo_fd fd; +}; + +static int ts_want_write(struct e1inp_ts *e1i_ts); + +static int unixsocket_exception_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + LOGP(DLINP, LOGL_ERROR, "unixsocket: closing socket. Exception cb called.\n"); + + close(bfd->fd); + + return 0; +} + +static int unixsocket_read_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + struct msgb *msg = msgb_alloc(UNIXSOCKET_ALLOC_SIZE, "UNIXSOCKET TS"); + int ret; + + if (!msg) + return -ENOMEM; + + ret = read(bfd->fd, msg->data, UNIXSOCKET_ALLOC_SIZE - 16); + if (ret == 0) { + unixsocket_exception_cb(bfd); + return ret; + } else if (ret < 0) { + perror("read "); + return ret; + } + msgb_put(msg, ret); + + return e1inp_rx_ts_lapd(&line->ts[0], msg); +} + +static void timeout_ts1_write(void *data) +{ + struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data; + + /* trigger write of ts1, due to tx delay timer */ + ts_want_write(e1i_ts); +} + +static int unixsocket_write_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + struct e1inp_ts *e1i_ts = &line->ts[0]; + struct msgb *msg; + struct e1inp_sign_link *sign_link; + + bfd->when &= ~BSC_FD_WRITE; + + /* get the next msg for this timeslot */ + msg = e1inp_tx_ts(e1i_ts, &sign_link); + if (!msg) { + /* no message after tx delay timer */ + LOGP(DLINP, LOGL_INFO, "unixsocket: no message available"); + return 0; + } + + /* set tx delay timer for next event */ + e1i_ts->sign.tx_timer.cb = timeout_ts1_write; + e1i_ts->sign.tx_timer.data = e1i_ts; + + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + + LOGP(DLINP, LOGL_INFO, "unixsocket: sending: %s", msgb_hexdump(msg)); + lapd_transmit(e1i_ts->lapd, sign_link->tei, + sign_link->sapi, msg); + + return 0; +} + +static int unixsocket_cb(struct osmo_fd *bfd, unsigned int what) +{ + int ret = 0; + + if (what & BSC_FD_READ) + ret = unixsocket_read_cb(bfd); + if (what & BSC_FD_WRITE) + ret = unixsocket_write_cb(bfd); + + return ret; +} + +static int ts_want_write(struct e1inp_ts *e1i_ts) +{ + struct unixsocket_line *line = e1i_ts->line->driver_data; + + line->fd.when |= BSC_FD_WRITE; + + return 0; +} + +/*! + * \brief unixsocket_write_msg lapd callback for data to unixsocket + * \param msg + * \param cbdata + */ +static void unixsocket_write_msg(struct msgb *msg, void *cbdata) +{ + struct osmo_fd *bfd = cbdata; + int ret; + + ret = write(bfd->fd, msg->data, msg->len); + msgb_free(msg); + if (ret == -1) + unixsocket_exception_cb(bfd); + else if (ret < 0) + LOGP(DLMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret); +} + +static int unixsocket_line_update(struct e1inp_line *line) +{ + struct unixsocket_line *config; + const char *sock_path = "/tmp/rsl_oml"; + int ret = 0; + int i; + + LOGP(DLINP, LOGL_NOTICE, "unixsocket: line update\n"); + + if (!line->driver_data) + line->driver_data = talloc_zero(line, struct unixsocket_line); + + if (!line->driver_data) { + LOGP(DLINP, LOGL_ERROR, "unixsocket: OOM in line update\n"); + return -ENOMEM; + } + + config = line->driver_data; + + config->fd.data = line; + config->fd.when = BSC_FD_READ; + config->fd.cb = unixsocket_cb; + ret = osmo_sock_unix_init(SOCK_SEQPACKET, 0, sock_path, OSMO_SOCK_F_CONNECT); + + if (ret < 0) { + talloc_free(config); + return ret; + } + + config->fd.fd = ret; + if (osmo_fd_register(&config->fd) < 0) { + close(config->fd.fd); + return -EIO; + } + + for (i = 0; i < ARRAY_SIZE(line->ts); i++) { + struct e1inp_ts *e1i_ts = &line->ts[i]; + + if (!e1i_ts->lapd) + e1i_ts->lapd = lapd_instance_alloc(1, + unixsocket_write_msg, &config->fd, e1inp_dlsap_up, + e1i_ts, &lapd_profile_abis); + } + + return ret; +} + +struct e1inp_driver unixsocket_driver = { + .name = "unixsocket", + .want_write = ts_want_write, + .line_update = unixsocket_line_update, + .default_delay = 0, +}; + +void e1inp_unixsocket_init(void) +{ + tall_unixsocket_ctx = talloc_named_const(libosmo_abis_ctx, 1, "unixsocket"); + e1inp_driver_register(&unixsocket_driver); +} -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Nov 3 04:13:38 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 3 Nov 2016 04:13:38 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 working, but WIP. -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 06:03:59 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 3 Nov 2016 06:03:59 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) https://gerrit.osmocom.org/#/c/1167/2/src/tbf_ul.cpp File src/tbf_ul.cpp: Line 156 unrelated change -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 06:11:09 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Thu, 3 Nov 2016 06:11:09 +0000 Subject: [PATCH] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1167 to look at the new patch set (#3). Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 297 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/1167/3 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..febc45c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -484,6 +524,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); @@ -550,8 +593,10 @@ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, m_bts.alpha, m_bts.gamma, -1, burst_type, sb); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -676,8 +721,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1326,6 +1374,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..19341af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1064,6 +1074,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..2e93efc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,6 +377,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -465,6 +466,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..920bc70 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,57 @@ m_window.set_ws(ws); } + + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..0b6b04f 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -153,7 +153,7 @@ int8_t rssi = meas->have_rssi ? meas->rssi : 0; const uint16_t ws = m_window.ws(); - + this->state_flags |= (1 << GPRS_RLCMAC_FLAG_UL_DATA); LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA TFI=%d received (V(Q)=%d .. " @@ -175,7 +175,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +517,57 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal From gerrit-no-reply at lists.osmocom.org Thu Nov 3 06:12:37 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Thu, 3 Nov 2016 06:12:37 +0000 Subject: [PATCH] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1167 to look at the new patch set (#4). Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 296 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/1167/4 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..febc45c 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -484,6 +524,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); @@ -550,8 +593,10 @@ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, m_bts.alpha, m_bts.gamma, -1, burst_type, sb); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -676,8 +721,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1326,6 +1374,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..19341af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1064,6 +1074,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..2e93efc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,6 +377,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -465,6 +466,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..920bc70 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,57 @@ m_window.set_ws(ws); } + + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..387aa76 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -175,7 +175,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +517,57 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal From gerrit-no-reply at lists.osmocom.org Thu Nov 3 09:47:01 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 3 Nov 2016 09:47:01 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#4). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 45 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/4 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..835c275 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,50 @@ return bv->cur_bit; } +/* \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:06:22 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:06:22 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1188 to look at the new patch set (#2). rtp-amr: TCH/AHS Uplink: FACCH/H During DTX New chapter contributed by Nutaq: * TCH/AHS Uplink: FACCH/H During DTX operation Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/88/1188/2 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index c67a1ad..8b76460 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -843,7 +843,54 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: FACCH/H During DTX operation + +The following procedure must be observed if a FACCH/H frame is transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="FACCH/H during DTX operation"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; + ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH/H + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/H"]; + bts => mgw [label="FACCH/H"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:06:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:06:40 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:11:08 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 11:11:08 +0000 Subject: openbsc[master]: log: count_codecs(): drop logging of non-TCH lchan types In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:36:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:36:17 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1185 to look at the new patch set (#2). Documentation on AMR RTP in case of DTX Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b --- A OsmoBTS/abis/rtp-amr.adoc 1 file changed, 858 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/85/1185/2 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc new file mode 100644 index 0000000..800545b --- /dev/null +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -0,0 +1,858 @@ += AMR-RTP in Combination with DTX + +The purpose of this document is to describe the sometimes quite +intricate interactions between a MS, the BTS-PHY and the BTS softare +in case of AMR (Adaptive Multi Rate) codec and DTX (Discontinuous +Transmission). + +It is written with the OsmoBTS implementation and the Nutaq GSM PHY +API in mind, but should more or less be applicable to any GSM BTS +PHY or any BTS software implementation, assuming it uses RTP on the +back-haul towards the MGW. + +== Full-Rate (TCH/AFS) + +=== TCH/AFS Uplink (MS to Network) + +==== TCH/AFS Uplink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every four radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates an RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH/AFS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST shall be transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +The BTS sends an RTP frame with AMR Frame Type SID, in which the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contained in sub-blocks 1-4 only. + +ULSU2:: There must be exactly two suppressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every 8 +voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-ul-onset]] +==== TCH/AFS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks its transmitter to perform transmission of SID_ONSET, which is a +special frame whose information is encoded only in sub-blocks 3+4, and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts is sent, containing + +* the only four transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits an RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + ...; +} +---- + +ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all +infomration is contained in blocks 5..8. + +=== TCH/AFS Downlink (Network to MS) + +[[afs-dl-talk]] +==== TCH/AFS Downlink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: an RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into eight +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every four bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AFS Downlink: End of Voice; Start of Silence + +When the BTS receives the first RTP frame with Frame Type SID, it will +generate a SID_FIRST AMR frame. The AMR frame is interleaved in a way +that all information is contained in the first four sub-blocks, with +the latter four sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise parameters +received in either the first AMR SID frame, or a subsequent AMR SID +frame received meanwhile. + +In between SID_FIRST and SID_UPDATE, and after the SID_UPDATE, the BTS +sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID First"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of SID_FIRST)", id="DLSF2"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="DLSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; +} +---- + +DLSF2:: sub-frames 5..8 of SID_FIRST are not transmitted, as all +information is contained in sub-frames 1..4 + +DLSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +after the SID_FIRST, resulting in two suppressed voice frame periods of +empty bursts in-between. + +==== TCH/AFS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +frames, and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-dl-onset]] +==== TCH/AFS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let's not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see +<> + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS1:: The SID_ONSET and the first voice frame are sent in the same +block of four radio busts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. + +== Half-Rate (TCH/AHS) + +=== TCH/AHS Uplink (MS to Network) + +==== TCH/AHS Uplink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every two radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates an RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH AHS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST_P1 and SID_FIRST_P2 shall be +transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1 +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 + +The BTS sends an RTP frame with AMR Frame Type SID, in which the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF1:: There are two separate indications for P1 and P2, despite both +P1 and P2 being multiplexed together in one batch of four bursts. Not +sure why they result in two separate PH-DATA.ind. Based on what we +know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and +SidFirstP2 indications immediately after each other, both for the same +GSM frame number. + +ULSU1:: There must be exactly two suppressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every +8 voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[ahs-ul-onset]] +==== TCH/AHS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks its transmitter to perform transmission of SID_ONSET, which is a +special frame which has information encoded only in sub-blocks 3+4, and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts is sent, containing + +* the only two transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits a RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_FIRST + +In case voice activity is detected again while the SID_FIRST_P1 +transmission is ongoing or completed, but the SID_FIRST_P2 has not +been transmitted yet, SID_FIRST can be inhibited by means of a +SID_FIRST_INH frame. This allows the first voice frame to be +transmitted with minimal delay, compared to first completing +the regular SID_FIRTS_P2 and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ms .. mgw [label="End of talk-spurt with inhibited SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 3 of last speech frame N + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of last speech frame N + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_FIRST_INH and sub-block 1 of speech frame N+1", id="SFI1"]; + ms => phy [label="L1 burst (block 2 of SID_FIRST_INH and sub-block 2 of speech frame N+1"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+2 + sub-block 1 of speech frame N+3)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+2 + sub-block 2 of speech frame N+3)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidInh", id="SFI2"]; + bts => bts [label="store CMI from SID_FIRST_INH"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_UPDATE + +In case voice activity is detected again while the SID_UPDATE +transmission of the first two sub-blocks is ongoing or completed, but +the second two sub-blocks have not been transmitted yet, SID_UPDATE can +be inhibited by means of a SID_UPDATE_INH frame. This allows the +first voice frame to be transmitted with minimal delay, compared to +first completing the regular SID_UPDATE and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="pre-empted SID Update (during silence period)"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; + ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +=== TCH/AHS Downlink (Network to MS) + +[[ahs-dl-talk]] +==== TCH/AHS Downlink: During Talk-Spurt + +During a talk-spurt, the system behaves identically to a system without +DTX enabled: an RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into four +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every two bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: End of Voice; Start of Silence + + +When the BTS receives the first RTP frame with Frame Type SID, it will +first issue a GsmL1_TchPlType_Amr_SidFirstP1 primitive towards the +BTS-PHY, followed by a GsmL1_TchPlType_Amr_SidFirstP2 primitive. + +The SID_FIRST_P2 is interleaved in a way that all information is +contained in the first two sub-blocks, with the latter two +sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise +parameters received in either the first RTP AMR SID frame, or a +subsequent RTP AMR SID frame received meanwhile. + +In between SID_FIRST_P2 and SID_UPDATE, and after the SID_UPDATE, the +BTS sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH +downlink frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; +} +---- + +ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +after the SID_FIRST, resulting in two suppressed voice frame periods of +empty bursts in between. + +RTDSU1:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +==== TCH/AHS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +frames and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +RTDSU2:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +[[ahs-dl-onset]] +==== TCH/AHS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let?s not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS2:: The SID_ONSET and the first voice frame are sent in the same +block of four radio bursts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:47:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:47:01 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) Fixed numerous typos / stylos, but this will create conflicts due to the way these patches are submitted. IMHO if a given file is known to belong in a different directory at time of patch submission, it makes sense to rebase the changes so that the first patch already has the correct location. Also, rtp-amr.doc is apparently at first added dangling, i.e. not actually included in any PDF output. I'm aware that it might be a time optimisation choice to not comb the commits before submitting for review, but in this case it might backfire by complicating the review process. marking -1 because of the question on line 54 https://gerrit.osmocom.org/#/c/1185/2/OsmoBTS/abis/rtp-amr.adoc File OsmoBTS/abis/rtp-amr.adoc: Line 54: related bursts have been received: missing list of primitives? -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:52:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:52:17 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: I guess it would be easiest to discard my edit and apply the changes once the entire patch series is merged... -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:52:47 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:52:47 +0000 Subject: openbsc[master]: log: count_codecs(): drop logging of non-TCH lchan types In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:52:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:52:52 +0000 Subject: [MERGED] openbsc[master]: log: count_codecs(): drop logging of non-TCH lchan types In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: log: count_codecs(): drop logging of non-TCH lchan types ...................................................................... log: count_codecs(): drop logging of non-TCH lchan types count_codecs() is called on every chan act ack, also for channels other than TCH/F and TCH/H. So this logging happens a lot during normal operation but adds no real information. Also, RSL would be the wrong logging category for this -- RSL is about the RSL communications, not whether our internal code tries to count lchan codecs for the wrong channel types. Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 0 insertions(+), 3 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index f672750..3788644 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -111,9 +111,6 @@ default: break; } - } else { - LOGP(DRSL, LOGL_DEBUG, "count_codecs unknown lchan->type %s on channel %s\n", - gsm_lchant_name(lchan->type), gsm_ts_and_pchan_name(lchan->ts)); } } -- To view, visit https://gerrit.osmocom.org/1184 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibdac3bbe48745fe6a1c31d6f87369c9066c0374a Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 11:54:57 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 11:54:57 +0000 Subject: openbsc[master]: Add empty libxsc In-Reply-To: References: Message-ID: Patch Set 1: right now my favorite choice would be to rename libxsc to libcommon-cs, showing that it is a library common to circuit-switched entities, i.e. libbsc and libmsc -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:00:33 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:00:33 +0000 Subject: libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Patch Set 1: for added comfort, it would be nice to enhance the test so that it calls the function and catches the use after free. -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:01:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:01:29 +0000 Subject: libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Patch Set 3: ah, you already did, sorry for the noise -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:09:26 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 12:09:26 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: Harald asked me to submit it as it is with my additions/corrections on top of it. So things like adding .pdf generation to Makefile etc are in the follow-up patches. -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:11:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:11:21 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 4: (3 comments) some whitespace... https://gerrit.osmocom.org/#/c/1167/4/src/bts.cpp File src/bts.cpp: Line 92: { "immediate.assignment_UL", "Immediate Assign UL "}, the code above uses tabs to indent between comma and description, below code should do the same. https://gerrit.osmocom.org/#/c/1167/4/src/tbf_dl.cpp File src/tbf_dl.cpp: Line 1335: (we typically have a single blank line to separate) https://gerrit.osmocom.org/#/c/1167/4/src/tbf_ul.cpp File src/tbf_ul.cpp: Line 541: (could drop this blank line) -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:17:23 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:17:23 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: fix build: abis: re-add dependencies Message-ID: Review at https://gerrit.osmocom.org/1199 fix build: abis: re-add dependencies Below commit accidentally removed osmobts-abis.pdf from the Makefile entirely. The pdf was re-added, but the dependencies are still missing, so that osmobts-abis.pdf is not rebuilt when abis/* is newer. Fix that. Culprit: 05f5adbe837f2cbfb9301cdb8c9b454ca0bfc825 "OsmoBTS: add vty reference documentation" Half-fix: 707827196f0734eefa74ce0c35c2ab2fe754cc4c "OsmoBTS: generate osmobts-abis.pdf again" Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b --- M OsmoBTS/Makefile 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/99/1199/1 diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 1e70eac..eadb940 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -19,6 +19,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc +osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc clean: -- To view, visit https://gerrit.osmocom.org/1199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:18:19 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:18:19 +0000 Subject: osmo-gsm-manuals[master]: fix build: abis: re-add dependencies In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 acouzens: no comment ;) -- To view, visit https://gerrit.osmocom.org/1199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:18:50 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:18:50 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: fix build: abis: re-add dependencies In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: fix build: abis: re-add dependencies ...................................................................... fix build: abis: re-add dependencies Below commit accidentally removed osmobts-abis.pdf from the Makefile entirely. The pdf was re-added, but the dependencies are still missing, so that osmobts-abis.pdf is not rebuilt when abis/* is newer. Fix that. Culprit: 05f5adbe837f2cbfb9301cdb8c9b454ca0bfc825 "OsmoBTS: add vty reference documentation" Half-fix: 707827196f0734eefa74ce0c35c2ab2fe754cc4c "OsmoBTS: generate osmobts-abis.pdf again" Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b --- M OsmoBTS/Makefile 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index 1e70eac..eadb940 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -19,6 +19,7 @@ include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc +osmobts-abis.pdf: abis/*.adoc abis/*.msc osmobts-usermanual.pdf: chapters/*.adoc clean: -- To view, visit https://gerrit.osmocom.org/1199 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:21:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:21:25 +0000 Subject: libosmo-abis[master]: Mark arrays in header files as extern, so symbols aren't cre... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) let me fix that up in gerrit... https://gerrit.osmocom.org/#/c/1191/1//COMMIT_MSG Commit Message: Line 7: Mark arrays in header files as extern, so symbols aren't created for each source file that includes the headers typically, the first line should be short (like 60 chars, 80 if really necessary) and add details in the commit log body -- To view, visit https://gerrit.osmocom.org/1191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:21:41 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 12:21:41 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: As for line 54 - I think it just should be swapped with next passage. -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:24:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:24:07 +0000 Subject: [PATCH] libosmo-abis[master]: e1_input.h: add missing extern for value string arrays In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1191 to look at the new patch set (#2). e1_input.h: add missing extern for value string arrays Mark two value string arrays as extern, so symbols aren't created for each source file that includes the headers. Tweaked-by: nhofmeyr (commit log) Signed-off-by: Arran Cudbard-Bell Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb --- M include/osmocom/abis/e1_input.h 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/91/1191/2 diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index c99b133..4c7f8a0 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -21,7 +21,7 @@ E1INP_SIGN_OSMO, /* IPA CCM OSMO sub-type */ }; const char *e1inp_signtype_name(enum e1inp_sign_type tp); -const struct value_string e1inp_sign_type_names[5]; +extern const struct value_string e1inp_sign_type_names[5]; enum e1inp_ctr { E1I_CTR_HDLC_ABORT, @@ -68,7 +68,7 @@ E1INP_TS_TYPE_HDLC, }; const char *e1inp_tstype_name(enum e1inp_ts_type tp); -const struct value_string e1inp_ts_type_names[6]; +extern const struct value_string e1inp_ts_type_names[6]; /* A timeslot in the E1 interface */ struct e1inp_ts { -- To view, visit https://gerrit.osmocom.org/1191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:24:10 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:24:10 +0000 Subject: libosmo-abis[master]: e1_input.h: add missing extern for value string arrays In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:24:33 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:24:33 +0000 Subject: [MERGED] libosmo-abis[master]: e1_input.h: add missing extern for value string arrays In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: e1_input.h: add missing extern for value string arrays ...................................................................... e1_input.h: add missing extern for value string arrays Mark two value string arrays as extern, so symbols aren't created for each source file that includes the headers. Tweaked-by: nhofmeyr (commit log) Signed-off-by: Arran Cudbard-Bell Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb --- M include/osmocom/abis/e1_input.h 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/abis/e1_input.h b/include/osmocom/abis/e1_input.h index c99b133..4c7f8a0 100644 --- a/include/osmocom/abis/e1_input.h +++ b/include/osmocom/abis/e1_input.h @@ -21,7 +21,7 @@ E1INP_SIGN_OSMO, /* IPA CCM OSMO sub-type */ }; const char *e1inp_signtype_name(enum e1inp_sign_type tp); -const struct value_string e1inp_sign_type_names[5]; +extern const struct value_string e1inp_sign_type_names[5]; enum e1inp_ctr { E1I_CTR_HDLC_ABORT, @@ -68,7 +68,7 @@ E1INP_TS_TYPE_HDLC, }; const char *e1inp_tstype_name(enum e1inp_ts_type tp); -const struct value_string e1inp_ts_type_names[6]; +extern const struct value_string e1inp_ts_type_names[6]; /* A timeslot in the E1 interface */ struct e1inp_ts { -- To view, visit https://gerrit.osmocom.org/1191 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iebf4b3922a48ca2cc20d478aba06224dd89d38cb Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:28:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:28:48 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Uplink In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:28:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:28:50 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Downlink: Inhibiting In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:29:35 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:29:35 +0000 Subject: libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 not familar with the topic, but looks good to me -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:29:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:29:42 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:29:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:29:54 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: New TCH/AHS downlink chapters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:30:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:30:01 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: Fixes to Message Sequence Charts In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:30:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:30:44 +0000 Subject: osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:31:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:31:28 +0000 Subject: osmo-bts[master]: DTX DL: add AMR HR support to scheduling check In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:31:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:31:35 +0000 Subject: osmo-bts[master]: DTX fix ONSET handling In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:31:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:31:38 +0000 Subject: [MERGED] osmo-bts[master]: DTX fix ONSET handling In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTX fix ONSET handling ...................................................................... DTX fix ONSET handling * re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case multiple FACCH occur duriing DTX silence period. * produce ONSET event after both SID FIRST and UPDATE in case of AMR FR. * always dispatch E_SID_F (SID FIRST) signal if in talkspurt. * allow E_SID_* right after ONSET (zero-length talkspurt). * add missing E_ONSET signal description. * fix FSM transitions for AMR HR *Inhibited and First P*. * fix incorrect return from l1if_tch_encode() in ONSET FACCH with incoming SID UPDATE Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Related: OS#1801 --- M include/osmo-bts/dtx_dl_amr_fsm.h M src/common/bts.c M src/common/dtx_dl_amr_fsm.c M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 9 files changed, 66 insertions(+), 32 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/dtx_dl_amr_fsm.h b/include/osmo-bts/dtx_dl_amr_fsm.h index 5c13c19..8b19595 100644 --- a/include/osmo-bts/dtx_dl_amr_fsm.h +++ b/include/osmo-bts/dtx_dl_amr_fsm.h @@ -16,6 +16,7 @@ ST_U_INH, ST_SID_U, ST_ONSET_V, + ST_ONSET_F, ST_FACCH_V, ST_FACCH, }; diff --git a/src/common/bts.c b/src/common/bts.c index 6f621c4..2005e42 100644 --- a/src/common/bts.c +++ b/src/common/bts.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -176,6 +177,8 @@ INIT_LLIST_HEAD(&btsb->smscb_state.queue); INIT_LLIST_HEAD(&btsb->oml_queue); + /* register DTX DL FSM */ + osmo_fsm_register(&dtx_dl_amr_fsm); return rc; } diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c index a75fd00..5075957 100644 --- a/src/common/dtx_dl_amr_fsm.c +++ b/src/common/dtx_dl_amr_fsm.c @@ -53,7 +53,7 @@ osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; case E_COMPL: osmo_fsm_inst_state_chg(fi, ST_SID_F2, 0, 0); @@ -81,7 +81,10 @@ osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); + break; + case E_ONSET: + osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -97,7 +100,7 @@ osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); break; case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -110,7 +113,7 @@ { switch (event) { case E_VOICE: - osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; case E_FACCH: osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); @@ -126,7 +129,7 @@ { switch (event) { case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); break; case E_VOICE: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); @@ -152,6 +155,7 @@ void dtx_fsm_onset_v(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { + case E_SID_F: case E_SID_U: case E_VOICE: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); @@ -169,6 +173,7 @@ void dtx_fsm_onset_f(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { + case E_SID_F: case E_SID_U: break; case E_VOICE: @@ -234,15 +239,15 @@ start of silence period (might be interrupted in case of AMR HR) */ [ST_SID_F1]= { .in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_COMPL) | X(E_INHIB) | X(E_ONSET), - .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V), + .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_SID_F2) | X(ST_F1_INH) | X(ST_ONSET_V), .name = "SID-FIRST (P1)", .action = dtx_fsm_sid_f1, }, /* SID-FIRST P2 (only for AMR HR): actual start of silence period in case of AMR HR*/ [ST_SID_F2]= { - .in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_FACCH), + .in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_ONSET), + .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_ONSET_V), .name = "SID-FIRST (P2)", .action = dtx_fsm_sid_f2, }, @@ -258,23 +263,30 @@ incoming SPEECH or FACCH (only for AMR HR) */ [ST_U_INH]= { .in_event_mask = X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), + .out_state_mask = X(ST_VOICE) | X(ST_FACCH), .name = "SID-UPDATE (Inh)", .action = dtx_fsm_u_inh, }, /* Silence period with periodic comfort noise data updates */ [ST_SID_U]= { .in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_INHIB) | X(E_SID_U) | X(E_SID_F) | X(E_ONSET), - .out_state_mask = X(ST_FACCH) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V), + .out_state_mask = X(ST_ONSET_F) | X(ST_VOICE) | X(ST_U_INH) | X(ST_SID_U) | X(ST_ONSET_V), .name = "SID-UPDATE", .action = dtx_fsm_sid_upd, }, /* ONSET - end of silent period due to incoming SPEECH frame */ [ST_ONSET_V]= { - .in_event_mask = X(E_VOICE) | X(E_FACCH), + .in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH), .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), .name = "ONSET (SPEECH)", .action = dtx_fsm_onset_v, + }, + /* ONSET - end of silent period due to incoming FACCH frame */ + [ST_ONSET_F]= { + .in_event_mask = X(E_VOICE) | X(E_FACCH) | X(E_SID_U) | X(E_SID_F), + .out_state_mask = X(ST_VOICE) | X(ST_FACCH), + .name = "ONSET (FACCH)", + .action = dtx_fsm_onset_f, }, /* FACCH sending state: SPEECH was observed before so once we're done FSM should get back to VOICE state */ @@ -296,6 +308,7 @@ const struct value_string dtx_dl_amr_fsm_event_names[] = { { E_VOICE, "Voice" }, + { E_ONSET, "ONSET" }, { E_FACCH, "FACCH" }, { E_COMPL, "Complete P1 -> P2" }, { E_INHIB, "Inhibit" }, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 13d8a94..ef24800 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -1145,10 +1145,12 @@ /* Init DTX DL FSM if necessary */ //FIXME: only do it for AMR TCH/* - osmo_fsm_register(&dtx_dl_amr_fsm); - lchan->tch.dtx.dl_amr_fsm = osmo_fsm_inst_alloc(&dtx_dl_amr_fsm, - tall_bts_ctx, lchan, - LOGL_DEBUG, lchan->name); + if (trx->bts->dtxd) + lchan->tch.dtx.dl_amr_fsm = osmo_fsm_inst_alloc(&dtx_dl_amr_fsm, + tall_bts_ctx, + lchan, + LOGL_DEBUG, + lchan->name); return 0; } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 4b21366..851aacb 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -33,6 +33,8 @@ #include #include +#define STI_BIT_MASK 16 + static int check_fom(struct abis_om_hdr *omh, size_t len) { if (omh->length != len) { @@ -182,14 +184,15 @@ return 0; if (osmo_amr_is_speech(ft)) { - if (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 || - lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) /* AMR HR */ - if (lchan->type == GSM_LCHAN_TCH_H && marker) - return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_INHIB, - (void *)lchan); - /* AMR FR */ - if (marker && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) + /* AMR HR - Inhibition */ + if (lchan->type == GSM_LCHAN_TCH_H && marker && + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1) + return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, + E_INHIB, (void *)lchan); + /* AMR FR & HR - generic */ + if (marker && (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 || + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F2 || + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U )) return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_ONSET, (void *)lchan); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_VOICE, @@ -198,6 +201,9 @@ if (ft == AMR_SID) { dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, sti); + if (lchan->tch.dtx.dl_amr_fsm->state == ST_VOICE) + return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, + E_SID_F, (void *)lchan); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, sti ? E_SID_U : E_SID_F, (void *)lchan); @@ -215,6 +221,16 @@ return 0; } +static inline void dtx_sti_set(struct gsm_lchan *lchan) +{ + lchan->tch.dtx.cache[6 + 2] |= STI_BIT_MASK; +} +/* STI is located in payload byte 6, cache contains 2 byte prefix (CMR/CMI) */ +static inline void dtx_sti_unset(struct gsm_lchan *lchan) +{ + lchan->tch.dtx.cache[6 + 2] &= ~STI_BIT_MASK; +} + /*! \brief Check if enough time has passed since last SID (if any) to repeat it * \param[in] lchan Logical channel on which we check scheduling * \param[in] fn Frame Number for which we check scheduling @@ -226,9 +242,10 @@ uint32_t dx26 = 120 * (fn - lchan->tch.dtx.fn); /* We're resuming after FACCH interruption */ - if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { /* force STI bit to 0 so cache is treated as SID FIRST */ - lchan->tch.dtx.cache[6 + 2] &= ~16; + dtx_sti_unset(lchan); lchan->tch.dtx.is_update = false; osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_SID_F, (void *)lchan); @@ -306,7 +323,7 @@ lchan->tch.dtx.fn = fn; /* enforce SID UPDATE for next repetition - it might have been altered by FACCH handling */ - lchan->tch.dtx.cache[6 + 2] |= 16; + dtx_sti_set(lchan); if (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) lchan->tch.dtx.is_update = true; return lchan->tch.dtx.len + 1; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 795172b..0b1bad4 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -410,7 +410,7 @@ memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; } diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 70764f5..4337d68 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -328,8 +328,7 @@ return -EAGAIN; case ST_FACCH_V: case ST_FACCH: - /* FIXME: if this possible at all? */ - return 0; + return -EBADMSG; default: LOGP(DRTP, LOGL_ERROR, "Unhandled DTX DL AMR FSM state " "%d\n", lchan->tch.dtx.dl_amr_fsm->state); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index f7585ce..51bde8b 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -405,7 +405,7 @@ memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && - lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; } diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index fbb42b2..db5ca78 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -426,8 +426,7 @@ return -EAGAIN; case ST_FACCH_V: case ST_FACCH: - /* FIXME: if this possible at all? */ - return 0; + return -EBADMSG; default: LOGP(DRTP, LOGL_ERROR, "Unhandled DTX DL AMR FSM state " "%d\n", lchan->tch.dtx.dl_amr_fsm->state); -- To view, visit https://gerrit.osmocom.org/1175 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:31:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:31:38 +0000 Subject: [MERGED] osmo-bts[master]: DTX DL: add AMR HR support to scheduling check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: DTX DL: add AMR HR support to scheduling check ...................................................................... DTX DL: add AMR HR support to scheduling check superfemto.sh: Expand log converter to use case-insensitive matching to accommodate for spelling differences in DSP logs. Add strings/events specific to AMR HR. dtx_check.gawk: Remove redundand variables from output. Add checks specific to AMR HR. Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a --- M contrib/dtx_check.gawk M contrib/superfemto.sh 2 files changed, 38 insertions(+), 19 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 9e753e4..7ac8b6d 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -27,9 +27,17 @@ CHK = "FAIL: missing ONSET (" $2 ") after " TYPE "." ERR++ } - if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2) { + if ("SID_P1" == $2) { + CHK = "FAIL: regular AMR payload with FT SID and STI=0 (should be either pyaload Update or STI=1)." + ERR++ + } + if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2 || "FORCED_F_P2" == $2 || "FORCED_F_INH" == $2 || "FORCED_U_INH" == $2) { CHK = "FAIL: event " $2 " inserted by DSP." FORCE++ + ERR++ + } + if ("FIRST_P2" != $2 && "FIRST_P1" == TYPE) { + CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } if ("OK" == CHK) { # check inter-SID distances: @@ -65,7 +73,7 @@ if ("UPDATE" == $2 || "FIRST" == $2) { # silence SILENCE = 1 } - print $1, $2, CHK, TYPE, DELTA, SILENCE + print $1, $2, CHK if ($2 != "EMPTY") { # skip over EMPTY records TYPE = $2 FN = $1 diff --git a/contrib/superfemto.sh b/contrib/superfemto.sh index cb871c0..19dc410 100755 --- a/contrib/superfemto.sh +++ b/contrib/superfemto.sh @@ -19,21 +19,32 @@ ULST="_DecodeAndIdentify" # DL sed filters: -D_EMP='s/ Empty frame request!/EMPTY/' -D_FAC='s/ Coding a FACCH\/F frame !!/FACCH/' -D_FST='s/ Coding a RTP SID First frame !!/FIRST/' -D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/' -D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/' -D_ONS='s/ Coding a Onset frame !!/ONSET/' -D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/' -D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/' +D_EMP='s/ Empty frame request!/EMPTY/i' +D_FAC='s/ Coding a FACCH\/. frame !!/FACCH/i' +D_FST='s/ Coding a RTP SID First frame !!/FIRST/i' +D_FS1='s/ Coding a SID First P1 frame !!/FIRST_P1/i' +D_FS2='s/ Coding a SID First P2 frame !!/FIRST_P2/i' +D_RP1='s/ Coding a RTP SID P1 frame !!/SID_P1/i' +D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/i' +D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/i' +D_ONS='s/ Coding a Onset frame !!/ONSET/i' +D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/i' +D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/i' +D_FP2='s/ A speech frame is following a NoData or SID_FIRST_P2 without an Onset./FORCED_F_P2/i' +D_FIN='s/ A speech frame is following a SID_FIRST without inhibit. A SID_FIRST_INH will be inserted./FORCED_F_INH/i' +D_UIN='s/ A speech frame is following a SID_UPDATE without inhibit. A SID_UPDATE_INH will be inserted./FORCED_U_INH/i' # UL sed filters: -U_NOD='s/ It is a No Data frame !!/NODATA/' -U_ONS='s/ It is an ONSET frame !!/ONSET/' -U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/' -U_FST='s/ It is a SID FIRST frame !!/FIRST/' -U_SPE='s/ It is a SPEECH frame !!/SPEECH/' +U_NOD='s/ It is a No Data frame !!/NODATA/i' +U_ONS='s/ It is an ONSET frame !!/ONSET/i' +U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/i' +U_FST='s/ It is a SID FIRST frame !!/FIRST/i' +U_FP1='s/ It is a SID-First P1 frame !!/FIRST_P1/i' +U_FP2='s/ It is a SID-First P2 frame !!/FIRST_P2/i' +U_SPE='s/ It is a SPEECH frame *!!/SPEECH/i' +U_UIN='s/ It is a SID update InH frame !!/UPD_INH/i' +U_FIN='s/ It is a SID-First InH frame !!/FST_INH/i' +U_RAT='s/ It is a RATSCCH data frame !!/RATSCCH/i' DL () { # filter downlink-related entries grep $DLST $1 > $1.DL.tmp @@ -47,7 +58,7 @@ UL $1 FIX() { # add MO/MT marker from preceding line to inserted ONSETs so filtering works as expected - cat $1.DL.tmp | awk 'BEGIN{ FS="h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix + cat $1.DL.tmp | awk 'BEGIN{ FS=" h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix } FIX $1 @@ -66,7 +77,7 @@ MT $1.UL PREP() { # prepare logs for reformatting - cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1 + cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/\[ u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1 } PREP "$1.DL.MT" @@ -75,11 +86,11 @@ PREP "$1.UL.MO" RD() { # reformat DL logs for consistency checks - cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_UPD" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" > $1.tmp2 + cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_FS1" | sed "$D_FS2" | sed "$D_UIN" | sed "$D_FIN" | sed "$D_UPD" | sed "$D_INH" | sed "$D_RP1" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" | sed "$D_FP2" > $1.tmp2 } RU() { # reformat UL logs for consistency checks - cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" > $1.tmp2 + cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_FP1" | sed "$U_FP2" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" | sed "$U_UIN" | sed "$U_FIN" | sed "$U_RAT" > $1.tmp2 } RD "$1.DL.MT" -- To view, visit https://gerrit.osmocom.org/1174 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:35:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:35:21 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/1198/1/src/input/unixsocket.c File src/input/unixsocket.c: Line 4: * please include a copyright statement pointing to sysmocom (as this was developed under contract), and add yourself as an author of the file. Possibly with 'based on ...' in case you started off a copy of one of the other e1inp drivers (not sure if that's the case). Line 158: const char *sock_path = "/tmp/rsl_oml"; I don't like thi shaving a fixed / global socket path. This means there can always ever be only one system-wide such socket. So multiple BTS with a single BSC wouldn't wokr - and also not multiple BSC (each with their distinct set of BTSs). Line 177: ret = osmo_sock_unix_init(SOCK_SEQPACKET, 0, sock_path, OSMO_SOCK_F_CONNECT); I'm not sure how portable SOCK_SEQPACKET is in case of unix domain sockets. would it e.g. break FreeBSD builds? -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:35:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:35:42 +0000 Subject: libosmo-sccp[master]: Fix the .pc files so the -l arg matches the installed libraries In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:35:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:35:44 +0000 Subject: [MERGED] libosmo-sccp[master]: Fix the .pc files so the -l arg matches the installed libraries In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix the .pc files so the -l arg matches the installed libraries ...................................................................... Fix the .pc files so the -l arg matches the installed libraries Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 --- M libosmo-mtp.pc.in M libosmo-sccp.pc.in 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/libosmo-mtp.pc.in b/libosmo-mtp.pc.in index 675d0d3..5e99dd3 100644 --- a/libosmo-mtp.pc.in +++ b/libosmo-mtp.pc.in @@ -6,5 +6,5 @@ Name: Osmo MTP Lib Description: Osmo MTP Lib Version: @VERSION@ -Libs: -L${libdir} -lmtp +Libs: -L${libdir} -losmo-mtp Cflags: -I${includedir}/ diff --git a/libosmo-sccp.pc.in b/libosmo-sccp.pc.in index eda8d49..9dd18c1 100644 --- a/libosmo-sccp.pc.in +++ b/libosmo-sccp.pc.in @@ -6,5 +6,5 @@ Name: OpenBSC SCCP Lib Description: OpenBSC SCCP Lib Version: @VERSION@ -Libs: -L${libdir} -lsccp +Libs: -L${libdir} -losmo-sccp Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:36:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:36:03 +0000 Subject: osmo-gsm-manuals[master]: Move RTP AMR doc to top level In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:36:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:36:20 +0000 Subject: osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 1 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:36:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:36:40 +0000 Subject: libosmo-sccp[master]: Add missing xua.pc file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5081799e1d7c7f5f3206e5f38060540bb4e3289b Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:36:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:36:42 +0000 Subject: [MERGED] libosmo-sccp[master]: Add missing xua.pc file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add missing xua.pc file ...................................................................... Add missing xua.pc file Change-Id: I5081799e1d7c7f5f3206e5f38060540bb4e3289b Signed-off-by: Arran Cudbard-Bell --- M Makefile.am M configure.ac A libosmo-xua.pc.in 3 files changed, 12 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/Makefile.am b/Makefile.am index 66b4d17..b1eff56 100644 --- a/Makefile.am +++ b/Makefile.am @@ -4,7 +4,7 @@ SUBDIRS = include src tests pkgconfigdir = $(libdir)/pkgconfig -pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc +pkgconfig_DATA = libosmo-sccp.pc libosmo-mtp.pc libosmo-sigtran.pc libosmo-xua.pc EXTRA_DIST = .version diff --git a/configure.ac b/configure.ac index 6446677..4c3c937 100644 --- a/configure.ac +++ b/configure.ac @@ -44,6 +44,7 @@ libosmo-sigtran.pc libosmo-sccp.pc libosmo-mtp.pc + libosmo-xua.pc include/sccp/Makefile include/mtp/Makefile include/osmocom/Makefile diff --git a/libosmo-xua.pc.in b/libosmo-xua.pc.in new file mode 100644 index 0000000..28f8285 --- /dev/null +++ b/libosmo-xua.pc.in @@ -0,0 +1,10 @@ +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +includedir=@includedir@ + +Name: Osmo XUA Lib +Description: Osmo XUA Lib +Version: @VERSION@ +Libs: -L${libdir} -losmo-xua +Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1195 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5081799e1d7c7f5f3206e5f38060540bb4e3289b Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:37:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:37:01 +0000 Subject: openbsc[master]: bsc_vty: include dyn TS info in vty show lchan In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:37:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 3 Nov 2016 12:37:03 +0000 Subject: [MERGED] openbsc[master]: bsc_vty: include dyn TS info in vty show lchan In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_vty: include dyn TS info in vty show lchan ...................................................................... bsc_vty: include dyn TS info in vty show lchan Extend both 'show lchan ' and 'show lchan summary' to include information on dynamic timeslots. Have one common function that prints " as foo" or " switching foo -> bar" to the vty, use it in lchan_dump_full_vty() and lchan_dump_short_vty(). In lchan_dump_short_vty(), split the vty_out call in two in order to interleave the dyn ts info right after the pchan. The summary hence looks e.g. like this for osmocom style dyn ts: BTS 0, TRX 0, Timeslot 5 TCH/F_TCH/H_PDCH as PDCH, Lchan 0, Type NONE, State ACTIVE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm or BTS 0, TRX 0, Timeslot 4 TCH/F_TCH/H_PDCH switching NONE -> PDCH, Lchan 0, Type NONE, State BROKEN UNUSABLE - L1 MS Power: 0 dBm RXL-FULL-dl: -110 dBm RXL-FULL-ul: -110 dBm Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 53 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index cb0b1d8..9ed19aa 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1078,6 +1078,38 @@ { 0, NULL } }; +/* call vty_out() to print a string like " as TCH/H" for dynamic timeslots. + * Don't do anything if the ts is not dynamic. */ +static void vty_out_dyn_ts_status(struct vty *vty, struct gsm_bts_trx_ts *ts) +{ + switch (ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + if (ts->dyn.pchan_is == ts->dyn.pchan_want) + vty_out(vty, " as %s", + gsm_pchan_name(ts->dyn.pchan_is)); + else + vty_out(vty, " switching %s -> %s", + gsm_pchan_name(ts->dyn.pchan_is), + gsm_pchan_name(ts->dyn.pchan_want)); + break; + case GSM_PCHAN_TCH_F_PDCH: + if ((ts->flags & TS_F_PDCH_PENDING_MASK) == 0) + vty_out(vty, " as %s", + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F"); + else + vty_out(vty, " switching %s -> %s", + (ts->flags & TS_F_PDCH_ACTIVE)? "PDCH" + : "TCH/F", + (ts->flags & TS_F_PDCH_ACT_PENDING)? "PDCH" + : "TCH/F"); + break; + default: + /* no dyn ts */ + break; + } +} + static void lchan_dump_full_vty(struct vty *vty, struct gsm_lchan *lchan) { int idx; @@ -1085,6 +1117,22 @@ vty_out(vty, "BTS %u, TRX %u, Timeslot %u, Lchan %u: Type %s%s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, lchan->nr, gsm_lchant_name(lchan->type), VTY_NEWLINE); + /* show dyn TS details, if applicable */ + switch (lchan->ts->pchan) { + case GSM_PCHAN_TCH_F_TCH_H_PDCH: + vty_out(vty, " Osmocom Dyn TS:"); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, VTY_NEWLINE); + break; + case GSM_PCHAN_TCH_F_PDCH: + vty_out(vty, " IPACC Dyn PDCH TS:"); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, VTY_NEWLINE); + break; + default: + /* no dyn ts */ + break; + } vty_out(vty, " Connection: %u, State: %s%s%s%s", lchan->conn ? 1: 0, gsm_lchans_name(lchan->state), @@ -1129,10 +1177,12 @@ lchan->meas_rep_idx, 1); mr = &lchan->meas_rep[idx]; - vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s, Lchan %u, Type %s, State %s - " - "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", + vty_out(vty, "BTS %u, TRX %u, Timeslot %u %s", lchan->ts->trx->bts->nr, lchan->ts->trx->nr, lchan->ts->nr, - gsm_pchan_name(lchan->ts->pchan), + gsm_pchan_name(lchan->ts->pchan)); + vty_out_dyn_ts_status(vty, lchan->ts); + vty_out(vty, ", Lchan %u, Type %s, State %s - " + "L1 MS Power: %u dBm RXL-FULL-dl: %4d dBm RXL-FULL-ul: %4d dBm%s", lchan->nr, gsm_lchant_name(lchan->type), gsm_lchans_name(lchan->state), mr->ms_l1.pwr, -- To view, visit https://gerrit.osmocom.org/1196 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3eb72ac7f0a520a8eefe171b9fb357f149aa3fda Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:42:15 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 12:42:15 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Documentation on AMR RTP in case of DTX In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Documentation on AMR RTP in case of DTX ...................................................................... Documentation on AMR RTP in case of DTX Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b --- A OsmoBTS/abis/rtp-amr.adoc 1 file changed, 858 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified Jenkins Builder: Verified Objections: Neels Hofmeyr: I would prefer this is not merged as is diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc new file mode 100644 index 0000000..800545b --- /dev/null +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -0,0 +1,858 @@ += AMR-RTP in Combination with DTX + +The purpose of this document is to describe the sometimes quite +intricate interactions between a MS, the BTS-PHY and the BTS softare +in case of AMR (Adaptive Multi Rate) codec and DTX (Discontinuous +Transmission). + +It is written with the OsmoBTS implementation and the Nutaq GSM PHY +API in mind, but should more or less be applicable to any GSM BTS +PHY or any BTS software implementation, assuming it uses RTP on the +back-haul towards the MGW. + +== Full-Rate (TCH/AFS) + +=== TCH/AFS Uplink (MS to Network) + +==== TCH/AFS Uplink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every four radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates an RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH/AFS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST shall be transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +The BTS sends an RTP frame with AMR Frame Type SID, in which the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contained in sub-blocks 1-4 only. + +ULSU2:: There must be exactly two suppressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every 8 +voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-ul-onset]] +==== TCH/AFS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks its transmitter to perform transmission of SID_ONSET, which is a +special frame whose information is encoded only in sub-blocks 3+4, and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts is sent, containing + +* the only four transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits an RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + ...; +} +---- + +ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all +infomration is contained in blocks 5..8. + +=== TCH/AFS Downlink (Network to MS) + +[[afs-dl-talk]] +==== TCH/AFS Downlink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: an RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into eight +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every four bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AFS Downlink: End of Voice; Start of Silence + +When the BTS receives the first RTP frame with Frame Type SID, it will +generate a SID_FIRST AMR frame. The AMR frame is interleaved in a way +that all information is contained in the first four sub-blocks, with +the latter four sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise parameters +received in either the first AMR SID frame, or a subsequent AMR SID +frame received meanwhile. + +In between SID_FIRST and SID_UPDATE, and after the SID_UPDATE, the BTS +sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID First"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of SID_FIRST)", id="DLSF2"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="DLSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; +} +---- + +DLSF2:: sub-frames 5..8 of SID_FIRST are not transmitted, as all +information is contained in sub-frames 1..4 + +DLSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +after the SID_FIRST, resulting in two suppressed voice frame periods of +empty bursts in-between. + +==== TCH/AFS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +frames, and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[afs-dl-onset]] +==== TCH/AFS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let's not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see +<> + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS1:: The SID_ONSET and the first voice frame are sent in the same +block of four radio busts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. + +== Half-Rate (TCH/AHS) + +=== TCH/AHS Uplink (MS to Network) + +==== TCH/AHS Uplink: During Talk-Spurt + +During a talk-spurt, the system behaves identical to a system without +DTX enabled: Every two radio bursts, the BTS-PHY has one AMR frame +ready and hands it up to the BTS process, which creates an RTP AMR +frame from it and sends that to the MGW. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +==== TCH AHS Uplink: End of Voice; Start of Silence + +When the voice encoder in the MS detects no voice activity anymore, it +signals towards the MS-PHY that SID_FIRST_P1 and SID_FIRST_P2 shall be +transmitted. + +The BTS-PHY reports the following primitives to the BTS after all four +related bursts have been received: + +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1 +* PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 + +The BTS sends an RTP frame with AMR Frame Type SID, in which the STI +is set to indicate a SID_FIRST message. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + +} +---- + +ULSF1:: There are two separate indications for P1 and P2, despite both +P1 and P2 being multiplexed together in one batch of four bursts. Not +sure why they result in two separate PH-DATA.ind. Based on what we +know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and +SidFirstP2 indications immediately after each other, both for the same +GSM frame number. + +ULSU1:: There must be exactly two suppressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +SID_UPDATE. + +==== TCH/AFS Uplink: During Silence + +While the period of silence is ongoing, the MS pauses all +transmissions, except the periodic scheduling of SID_UPDATE every +8 voice frames (160ms). + +NOTE:: Silence can also be interrupted at any time by ONSET, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +[[ahs-ul-onset]] +==== TCH/AHS Uplink: End of Silence; Start of Voice + +Once the voice encoder in the MS detects voice activity again, it +asks its transmitter to perform transmission of SID_ONSET, which is a +special frame which has information encoded only in sub-blocks 3+4, and +sub-blocks 1+2 are discarded before transmission. + +A set of four radio bursts is sent, containing + +* the only two transmitted sub-blocks of the SID_ONSET frame +* all four sub-blocks of the first voice codec frame +* the first two blocks of the second voice codec frame + +The BTS-PHY informs the BTS using two primitives: + +* PH-DATA.ind GsmL1_TchPlType_Amr_Onset indicates the presence of + SID_ONSET, including the Channel Mode Indication (irrespective of + CMI Phase) +* PH-DATA.ind GsmL1_TchPlType_Amr indicates the first voice frame + +The BTS transmits a RTP frame with AMR payload of the corresponding +speech frame type, and sets the RTP MARKER bit to indicate the ONSET +condition. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + ms -x phy [label="Suppressed L1 burst"]; + ms -x phy [label="Suppressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_FIRST + +In case voice activity is detected again while the SID_FIRST_P1 +transmission is ongoing or completed, but the SID_FIRST_P2 has not +been transmitted yet, SID_FIRST can be inhibited by means of a +SID_FIRST_INH frame. This allows the first voice frame to be +transmitted with minimal delay, compared to first completing +the regular SID_FIRTS_P2 and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ms .. mgw [label="End of talk-spurt with inhibited SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 3 of last speech frame N + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of last speech frame N + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_FIRST_INH and sub-block 1 of speech frame N+1", id="SFI1"]; + ms => phy [label="L1 burst (block 2 of SID_FIRST_INH and sub-block 2 of speech frame N+1"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+2 + sub-block 1 of speech frame N+3)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+2 + sub-block 2 of speech frame N+3)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidInh", id="SFI2"]; + bts => bts [label="store CMI from SID_FIRST_INH"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: Inhibited SID_UPDATE + +In case voice activity is detected again while the SID_UPDATE +transmission of the first two sub-blocks is ongoing or completed, but +the second two sub-blocks have not been transmitted yet, SID_UPDATE can +be inhibited by means of a SID_UPDATE_INH frame. This allows the +first voice frame to be transmitted with minimal delay, compared to +first completing the regular SID_UPDATE and SID_ONSET procedure. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="pre-empted SID Update (during silence period)"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; + ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; +} +---- + +=== TCH/AHS Downlink (Network to MS) + +[[ahs-dl-talk]] +==== TCH/AHS Downlink: During Talk-Spurt + +During a talk-spurt, the system behaves identically to a system without +DTX enabled: an RTP frame arrives every 20ms. + +The PHY sends a PH-RTS.ind in similar intervals, to which the BTS +responds with a PH-DATA.req containing GsmL1_TchPlType_Amr. + +The BTS-PHY then encodes and interleaves the codec frame into four +sub-blocks. Due to the interleaving, one new PH-RTS.ind is issued +every two bursts. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Regular AMR Speech (has been ongoing for some time)"]; + + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; + mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: End of Voice; Start of Silence + + +When the BTS receives the first RTP frame with Frame Type SID, it will +first issue a GsmL1_TchPlType_Amr_SidFirstP1 primitive towards the +BTS-PHY, followed by a GsmL1_TchPlType_Amr_SidFirstP2 primitive. + +The SID_FIRST_P2 is interleaved in a way that all information is +contained in the first two sub-blocks, with the latter two +sub-blocks being dropped and not transmitted. + +Three codec frames (60ms) later, the BTS needs to transmit a +SID_UPDATE AMR frame, which should consist of comfort noise +parameters received in either the first RTP AMR SID frame, or a +subsequent RTP AMR SID frame received meanwhile. + +In between SID_FIRST_P2 and SID_UPDATE, and after the SID_UPDATE, the +BTS sends PH-EMPTY-FRAME.req to all PH-RTS.ind, causing the BTS-PHY to +cease transmission in those periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH +downlink frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms x- phy [label="Suppressed burst"]; + ms x- phy [label="Suppressed burst"]; +} +---- + +ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) +after the SID_FIRST, resulting in two suppressed voice frame periods of +empty bursts in between. + +RTDSU1:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +==== TCH/AHS Downlink: During Silence + +During Silence periods, the BTS may at any time receive RTP AMR SID +frames and keep a copy of the last received frame around. + +Every eight voice frames (160ms), the BTS shall respond to the +PH-RTS.ind with a PH-DATA.req containing a GsmL1_TchPlType_Amr with +SID_UPDATE frame. + +At all other times, the BTS sends PH-EMPTY-FRAME.req to any received +PH-RTS.ind, causing the BTS-PHY to cease transmission in those +periods. + +NOTE:: At any time, the BTS can end the silence period by issuing +ONSET (in case of a new downlink talk-spurt or a FACCH downlink +frame). See Section <>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Every 8 voice frames (160ms)", id="8VF"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; +} +---- + +8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM +TDMA frames! + +RTDSU2:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the +"double-length" SID-UPDATE? + +[[ahs-dl-onset]] +==== TCH/AHS Downlink: End of Silence; Start of Voice + +Once the BTS receives a non-SID AMR RTP frame (which should also have +the MARKER bit set to 1, but let?s not take that for granted), the +contained AMR voice data is passed to the BTS-PHY in the next +PH-DATA.req (GsmL1_TchPlType_Amr_Onset). + +From that point onwards, regular transmission resumes, see +<>. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Once voice is active again"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +DLOS2:: The SID_ONSET and the first voice frame are sent in the same +block of four radio bursts. Hence, the BTS must be able ot to send +actual codec payload along with the GsmL1_TchPlType_Amr_Onset +primitive. -- To view, visit https://gerrit.osmocom.org/1185 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:46:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 12:46:09 +0000 Subject: libosmo-sccp[master]: Fix the .pc files so the -l arg matches the installed libraries In-Reply-To: References: Message-ID: Patch Set 1: I notice that the libs in src/ actually don't have 'osmo' in their name (hence neither in /usr/local/lib), so it might be that rather the .pc files have the wrong name and this patch actually breaks pkgconfig. However, having osmo in the libs' names would actually be desirable. Taking a look at whether this creates problems and which way to fix if necessary. -- To view, visit https://gerrit.osmocom.org/1197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 12:48:12 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Thu, 3 Nov 2016 12:48:12 +0000 Subject: [PATCH] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1167 to look at the new patch set (#5). Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 294 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/1167/5 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..432f832 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -484,6 +524,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); @@ -550,8 +593,10 @@ m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, m_bts.alpha, m_bts.gamma, -1, burst_type, sb); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -676,8 +721,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1326,6 +1374,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..19341af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1064,6 +1074,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..2e93efc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,6 +377,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -465,6 +466,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..185521d 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,56 @@ m_window.set_ws(ws); } + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..420fc1a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -175,7 +175,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +517,56 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:03:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 13:03:29 +0000 Subject: [PATCH] libosmo-sccp[master]: Revert "Fix the .pc files so the -l arg matches the installe... Message-ID: Review at https://gerrit.osmocom.org/1200 Revert "Fix the .pc files so the -l arg matches the installed libraries" This reverts commit ed9e76e46e530faf2560fc875ecbe83faff8d809. The libraries in src/ do not have 'osmo' in their name, hence neither in $prefix/lib. This patch caused linking failure. Reproduce: do not have libosmo-sccp installed in the system and make sure no older pkg-config pc files are around. Build all dependencies with an arbitrary --prefix passed to configure scripts. Point PKG_CONFIG_PATH (and optionally LD_LIBRARY_PATH) to this prefix. Finally, build openbsc using the same --prefix: even though libosmo-sccp has been installed, it complains: CCLD osmo-bsc_nat /usr/bin/ld: cannot find -losmo-sccp collect2: error: ld returned 1 exit status Makefile:447: recipe for target 'osmo-bsc_nat' failed Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a --- M libosmo-mtp.pc.in M libosmo-sccp.pc.in 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/00/1200/1 diff --git a/libosmo-mtp.pc.in b/libosmo-mtp.pc.in index 5e99dd3..675d0d3 100644 --- a/libosmo-mtp.pc.in +++ b/libosmo-mtp.pc.in @@ -6,5 +6,5 @@ Name: Osmo MTP Lib Description: Osmo MTP Lib Version: @VERSION@ -Libs: -L${libdir} -losmo-mtp +Libs: -L${libdir} -lmtp Cflags: -I${includedir}/ diff --git a/libosmo-sccp.pc.in b/libosmo-sccp.pc.in index 9dd18c1..eda8d49 100644 --- a/libosmo-sccp.pc.in +++ b/libosmo-sccp.pc.in @@ -6,5 +6,5 @@ Name: OpenBSC SCCP Lib Description: OpenBSC SCCP Lib Version: @VERSION@ -Libs: -L${libdir} -losmo-sccp +Libs: -L${libdir} -lsccp Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:03:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 13:03:29 +0000 Subject: libosmo-sccp[master]: Revert "Fix the .pc files so the -l arg matches the installe... In-Reply-To: References: Message-ID: Neels Hofmeyr has reverted this change. Change subject: Revert "Fix the .pc files so the -l arg matches the installed libraries" ...................................................................... Uploaded patch set 1. -- To view, visit https://gerrit.osmocom.org/1200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: revert Gerrit-Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:04:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 13:04:30 +0000 Subject: libosmo-sccp[master]: Revert "Fix the .pc files so the -l arg matches the installe... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 Verified+1 -- To view, visit https://gerrit.osmocom.org/1200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:04:34 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 13:04:34 +0000 Subject: [MERGED] libosmo-sccp[master]: Revert "Fix the .pc files so the -l arg matches the installe... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Revert "Fix the .pc files so the -l arg matches the installed libraries" ...................................................................... Revert "Fix the .pc files so the -l arg matches the installed libraries" This reverts commit ed9e76e46e530faf2560fc875ecbe83faff8d809. The libraries in src/ do not have 'osmo' in their name, hence neither in $prefix/lib. This patch caused linking failure. Reproduce: do not have libosmo-sccp installed in the system and make sure no older pkg-config pc files are around. Build all dependencies with an arbitrary --prefix passed to configure scripts. Point PKG_CONFIG_PATH (and optionally LD_LIBRARY_PATH) to this prefix. Finally, build openbsc using the same --prefix: even though libosmo-sccp has been installed, it complains: CCLD osmo-bsc_nat /usr/bin/ld: cannot find -losmo-sccp collect2: error: ld returned 1 exit status Makefile:447: recipe for target 'osmo-bsc_nat' failed Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a --- M libosmo-mtp.pc.in M libosmo-sccp.pc.in 2 files changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved; Verified Jenkins Builder: Verified diff --git a/libosmo-mtp.pc.in b/libosmo-mtp.pc.in index 5e99dd3..675d0d3 100644 --- a/libosmo-mtp.pc.in +++ b/libosmo-mtp.pc.in @@ -6,5 +6,5 @@ Name: Osmo MTP Lib Description: Osmo MTP Lib Version: @VERSION@ -Libs: -L${libdir} -losmo-mtp +Libs: -L${libdir} -lmtp Cflags: -I${includedir}/ diff --git a/libosmo-sccp.pc.in b/libosmo-sccp.pc.in index 9dd18c1..eda8d49 100644 --- a/libosmo-sccp.pc.in +++ b/libosmo-sccp.pc.in @@ -6,5 +6,5 @@ Name: OpenBSC SCCP Lib Description: OpenBSC SCCP Lib Version: @VERSION@ -Libs: -L${libdir} -losmo-sccp +Libs: -L${libdir} -lsccp Cflags: -I${includedir}/ -- To view, visit https://gerrit.osmocom.org/1200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:06:30 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 13:06:30 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Uplink In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1186 to look at the new patch set (#2). rtp-amr.adoc: TCH/AFS Uplink Add new chapter by Nutaq for Speech Frame Following a SID_FIRST frame Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 119 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/86/1186/2 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 800545b..12b5a9f 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -167,28 +167,135 @@ ...; --- [label="Once voice is active again"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; - ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; - bts => bts [label="lchan_set_marker() and store CMI"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ...; } ---- ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all -infomration is contained in blocks 5..8. +information is contained in blocks 5..8. + +==== TCH/AFS Uplink: Speech Frame Following a SID_FIRST frame + +The four last bursts of a SID_FIRST frame can be replaced by an ONSET frame in order to quickly resume speech. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Speech Frame Following a SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AFS Uplink: FACCH/F Frame During DTX Operation + +As mentioned in section A.5.1.2.1 of 3GPP TS 26.093 : + +* If the frame preceding the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then an ONSET frame shall be signalled to the CHE, followed by the FACCH frame(s). +* If the frame following the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then a SID_FIRST shall be signalled to the CHE. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/F Frame During DTX"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH frame)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH frame)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH frame)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH frame)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 5 of FACCH frame + sub-block 1 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 6 of FACCH frame + sub-block 2 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 7 of FACCH frame + sub-block 3 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH frame + sub-block 4 of SID First frame)", id="Note"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/F"]; + bts => mgw [label="FACCH/F"]; + + ms -x phy [label="Supressed L1 burst", id="ULSF2"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ...; +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contained in sub-blocks 1-4 only + +Note:: It has been observed with some phones that the SID_FIRST is not sent following the FACCH/F +frame. If this case occures the No Data Frame and SID_UPDATE order resumes. === TCH/AFS Downlink (Network to MS) -- To view, visit https://gerrit.osmocom.org/1186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:08:31 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 3 Nov 2016 13:08:31 +0000 Subject: libosmo-sccp[master]: Fix the .pc files so the -l arg matches the installed libraries In-Reply-To: References: Message-ID: Patch Set 1: this is reverted in gerrit #1200, see commit log for details. Our build server didn't catch the build breakage because such would only occur when we try to link libosmo-sccp while building openbsc. However, any subsequent openbsc build jobs should have failed because of this patch. Which way to go: adjust the pc files' names to drop 'osmo', or actually preferably adjust the libraries to add 'osmo' to their name (and also make them dynamic libraries). This would need further adjustments in at least openbsc. Since it's not a priority, I'm leaving that for now and would favor the easier fix of adjusting the .pc files' names. -- To view, visit https://gerrit.osmocom.org/1197 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I967f3c3031777837fee8717ca3f6bb59d6614149 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:15:15 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 13:15:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1188 to look at the new patch set (#3). rtp-amr: TCH/AHS Uplink: FACCH/H During DTX New chapter contributed by Nutaq: * TCH/AHS Uplink: FACCH/H During DTX operation Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 48 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/88/1188/3 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 6716800..fbd6b50 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -843,7 +843,54 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: FACCH/H During DTX operation + +The following procedure must be observed if a FACCH/H frame must be transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="FACCH/H during DTX operation"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; + ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH/H + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/H"]; + bts => mgw [label="FACCH/H"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:15:15 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 13:15:15 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: New TCH/AHS downlink chapters In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1189 to look at the new patch set (#2). rtp-amr.adoc: New TCH/AHS downlink chapters Nutaq contributed the following chapters: * TCH/AHS Downlink: FACCH/H During DTX Operation * TCH/AHS Downlink: Inhibited SID_UPDATE * TCH/AHS Downlink: Inhibited SID_FIRST_P1 Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 107 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/89/1189/2 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index fbd6b50..889a032 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -1087,7 +1087,110 @@ } ---- -DLOS2:: The SID_ONSET and the first voice frame are sent in the same -block of four radio bursts. Hence, the BTS must be able ot to send -actual codec payload along with the GsmL1_TchPlType_Amr_Onset -primitive. +==== TCH/AHS Downlink: Inhibited SID_FIRST_P1 + +The following procedure must be observed in case of a SID_FIRST must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_FIRST_P1"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_FIRST_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_FIRST_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: Inhibited SID_UPDATE + +The following procedure must be observed in case of a SID_UPDATE must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_UPDATE"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidUpdateInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_UPDATE_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_UPDATE_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: FACCH/H During DTX Operation + +The following procedure must be observed in case of a FACCH/H frame must be inserted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/H During DTX Operation"]; + + bts <= mgw [label="FACCH/H"]; + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req FACCH/H"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET, sub-block 1 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET, sub-block 2 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 3+4 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 7 of FACCH/H frame + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 8 of FACCH/H frame + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; +} +---- -- To view, visit https://gerrit.osmocom.org/1189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:22:04 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 13:22:04 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: rtp-amr.adoc: Fixes to Message Sequence Charts In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1190 to look at the new patch set (#2). rtp-amr.adoc: Fixes to Message Sequence Charts Nutaq added these clarifications/extensions/fixes tothe message sequence charts. Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 188 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/90/1190/2 diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 889a032..f601303 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -65,11 +65,11 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID"]; - ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms -x phy [label="Suppressed L1 burst"]; @@ -79,28 +79,36 @@ phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all -information bits are contained in sub-blocks 1-4 only. +ULSF2:: As per 3GPP TS 05.03 section 3.9.2.4 The last 4 bursts shall not be transmitted unless +the SID_FIRST frame is immediately followed by a speech frame. It has been observed that some phone +does not transmit the last 4 bursts even if it is not followed by a speech frame. -ULSU2:: There must be exactly two suppressed voice frames between the -SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +ULSU2:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and SID_UPDATE. ==== TCH/AFS Uplink: During Silence @@ -125,7 +133,70 @@ ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -480,14 +551,15 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; - ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; @@ -603,10 +675,14 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-2)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; } @@ -636,43 +712,44 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N, sub-block 2 of SID_FIRST_P1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2", id="NOTE"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF1:: There are two separate indications for P1 and P2, despite both -P1 and P2 being multiplexed together in one batch of four bursts. Not -sure why they result in two separate PH-DATA.ind. Based on what we -know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and -SidFirstP2 indications immediately after each other, both for the same -GSM frame number. +ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. -ULSU1:: There must be exactly two suppressed voice frames between the -SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +NOTE:: It has been observed that not all phones transmit SID_FIRST_P2 so the PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 is not guaranteed to be sent to the BTS. + +ULSU1:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and SID_UPDATE. ==== TCH/AFS Uplink: During Silence @@ -695,10 +772,55 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -822,26 +944,27 @@ ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; ...; - ms .. mgw [label="pre-empted SID Update (during silence period)"]; + ms .. mgw [label="Inhibited SID Update (during silence period)"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; - ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; - bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + ms => phy [label="L1 burst (block 1 of SID_UPD_INH + sub-block 1 of speech frame N)", id="SFU1"]; + ms => phy [label="L1 burst (block 2 of SID_UPD_INH + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; } @@ -925,7 +1048,7 @@ ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } @@ -985,11 +1108,12 @@ ms x- phy [label="Suppressed burst"]; ms x- phy [label="Suppressed burst"]; + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; @@ -1004,9 +1128,6 @@ ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) after the SID_FIRST, resulting in two suppressed voice frame periods of empty bursts in between. - -RTDSU1:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? ==== TCH/AHS Downlink: During Silence @@ -1039,20 +1160,15 @@ bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- 8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM TDMA frames! - -RTDSU2:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? [[ahs-dl-onset]] ==== TCH/AHS Downlink: End of Silence; Start of Voice @@ -1076,12 +1192,13 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } -- To view, visit https://gerrit.osmocom.org/1190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:30:38 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 3 Nov 2016 13:30:38 +0000 Subject: [PATCH] libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1198 to look at the new patch set (#2). add basic unixsocket support Allow to connect to a unix socket communicating with LAPD. Missing for merge: - SOL_PACKET is not portable to *BSD - unix socket path not configurable Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a --- M src/Makefile.am M src/e1_input.c M src/e1_input_vty.c A src/input/unixsocket.c 4 files changed, 223 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/98/1198/2 diff --git a/src/Makefile.am b/src/Makefile.am index b24f2cf..760c1f5 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -24,7 +24,8 @@ input/lapd.c \ input/lapd_pcap.c \ input/misdn.c \ - input/rs232.c + input/rs232.c \ + input/unixsocket.c libosmotrau_la_CFLAGS = $(AM_CFLAGS) $(ORTP_CFLAGS) libosmotrau_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(TRAU_LIBVERSION) diff --git a/src/e1_input.c b/src/e1_input.c index 970bdb9..7222cee 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -815,6 +815,7 @@ void e1inp_dahdi_init(void); void e1inp_ipaccess_init(void); void e1inp_rs232_init(void); +void e1inp_unixsocket_init(void); void e1inp_init(void) { @@ -829,4 +830,5 @@ #endif e1inp_ipaccess_init(); e1inp_rs232_init(); + e1inp_unixsocket_init(); } diff --git a/src/e1_input_vty.c b/src/e1_input_vty.c index 5320bb3..47bc5ba 100644 --- a/src/e1_input_vty.c +++ b/src/e1_input_vty.c @@ -38,12 +38,13 @@ /* CONFIG */ -#define E1_DRIVER_NAMES "(misdn|misdn_lapd|dahdi|ipa)" +#define E1_DRIVER_NAMES "(misdn|misdn_lapd|dahdi|ipa|unixsocket)" #define E1_DRIVER_HELP "mISDN supported E1 Card (kernel LAPD)\n" \ "mISDN supported E1 Card (userspace LAPD)\n" \ "DAHDI supported E1/T1/J1 Card\n" \ "IPA TCP/IP input\n" \ - "HSL TCP/IP input" + "HSL TCP/IP input\n" \ + "Unix socket input\n" #define E1_LINE_HELP "Configure E1/T1/J1 Line\n" "Line Number\n" diff --git a/src/input/unixsocket.c b/src/input/unixsocket.c new file mode 100644 index 0000000..6f758e5 --- /dev/null +++ b/src/input/unixsocket.c @@ -0,0 +1,216 @@ +/* OpenBSC Abis receive lapd over a unix socket */ + +/* (C) 2016 by sysmocom s.f.m.c. GmbH + * + * Author: Alexander Couzens + * Based on other e1_input drivers. + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * + */ + +#include +#include +#include + +#include +#include +#include + +#include +#include +#include + +#include "internal.h" + +void *tall_unixsocket_ctx; +#define UNIXSOCKET_ALLOC_SIZE 1600 + +struct unixsocket_line { + struct osmo_fd fd; +}; + +static int ts_want_write(struct e1inp_ts *e1i_ts); + +static int unixsocket_exception_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + LOGP(DLINP, LOGL_ERROR, "unixsocket: closing socket. Exception cb called.\n"); + + close(bfd->fd); + + return 0; +} + +static int unixsocket_read_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + struct msgb *msg = msgb_alloc(UNIXSOCKET_ALLOC_SIZE, "UNIXSOCKET TS"); + int ret; + + if (!msg) + return -ENOMEM; + + ret = read(bfd->fd, msg->data, UNIXSOCKET_ALLOC_SIZE - 16); + if (ret == 0) { + unixsocket_exception_cb(bfd); + return ret; + } else if (ret < 0) { + perror("read "); + return ret; + } + msgb_put(msg, ret); + + return e1inp_rx_ts_lapd(&line->ts[0], msg); +} + +static void timeout_ts1_write(void *data) +{ + struct e1inp_ts *e1i_ts = (struct e1inp_ts *)data; + + /* trigger write of ts1, due to tx delay timer */ + ts_want_write(e1i_ts); +} + +static int unixsocket_write_cb(struct osmo_fd *bfd) +{ + struct e1inp_line *line = bfd->data; + struct e1inp_ts *e1i_ts = &line->ts[0]; + struct msgb *msg; + struct e1inp_sign_link *sign_link; + + bfd->when &= ~BSC_FD_WRITE; + + /* get the next msg for this timeslot */ + msg = e1inp_tx_ts(e1i_ts, &sign_link); + if (!msg) { + /* no message after tx delay timer */ + LOGP(DLINP, LOGL_INFO, "unixsocket: no message available"); + return 0; + } + + /* set tx delay timer for next event */ + e1i_ts->sign.tx_timer.cb = timeout_ts1_write; + e1i_ts->sign.tx_timer.data = e1i_ts; + + osmo_timer_schedule(&e1i_ts->sign.tx_timer, 0, e1i_ts->sign.delay); + + LOGP(DLINP, LOGL_INFO, "unixsocket: sending: %s", msgb_hexdump(msg)); + lapd_transmit(e1i_ts->lapd, sign_link->tei, + sign_link->sapi, msg); + + return 0; +} + +static int unixsocket_cb(struct osmo_fd *bfd, unsigned int what) +{ + int ret = 0; + + if (what & BSC_FD_READ) + ret = unixsocket_read_cb(bfd); + if (what & BSC_FD_WRITE) + ret = unixsocket_write_cb(bfd); + + return ret; +} + +static int ts_want_write(struct e1inp_ts *e1i_ts) +{ + struct unixsocket_line *line = e1i_ts->line->driver_data; + + line->fd.when |= BSC_FD_WRITE; + + return 0; +} + +/*! + * \brief unixsocket_write_msg lapd callback for data to unixsocket + * \param msg + * \param cbdata + */ +static void unixsocket_write_msg(struct msgb *msg, void *cbdata) +{ + struct osmo_fd *bfd = cbdata; + int ret; + + ret = write(bfd->fd, msg->data, msg->len); + msgb_free(msg); + if (ret == -1) + unixsocket_exception_cb(bfd); + else if (ret < 0) + LOGP(DLMI, LOGL_NOTICE, "%s write failed %d\n", __func__, ret); +} + +static int unixsocket_line_update(struct e1inp_line *line) +{ + struct unixsocket_line *config; + const char *sock_path = "/tmp/rsl_oml"; + int ret = 0; + int i; + + LOGP(DLINP, LOGL_NOTICE, "unixsocket: line update\n"); + + if (!line->driver_data) + line->driver_data = talloc_zero(line, struct unixsocket_line); + + if (!line->driver_data) { + LOGP(DLINP, LOGL_ERROR, "unixsocket: OOM in line update\n"); + return -ENOMEM; + } + + config = line->driver_data; + + config->fd.data = line; + config->fd.when = BSC_FD_READ; + config->fd.cb = unixsocket_cb; + ret = osmo_sock_unix_init(SOCK_SEQPACKET, 0, sock_path, OSMO_SOCK_F_CONNECT); + + if (ret < 0) { + talloc_free(config); + return ret; + } + + config->fd.fd = ret; + if (osmo_fd_register(&config->fd) < 0) { + close(config->fd.fd); + return -EIO; + } + + for (i = 0; i < ARRAY_SIZE(line->ts); i++) { + struct e1inp_ts *e1i_ts = &line->ts[i]; + + if (!e1i_ts->lapd) + e1i_ts->lapd = lapd_instance_alloc(1, + unixsocket_write_msg, &config->fd, e1inp_dlsap_up, + e1i_ts, &lapd_profile_abis); + } + + return ret; +} + +struct e1inp_driver unixsocket_driver = { + .name = "unixsocket", + .want_write = ts_want_write, + .line_update = unixsocket_line_update, + .default_delay = 0, +}; + +void e1inp_unixsocket_init(void) +{ + tall_unixsocket_ctx = talloc_named_const(libosmo_abis_ctx, 1, "unixsocket"); + e1inp_driver_register(&unixsocket_driver); +} -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:31:26 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Thu, 3 Nov 2016 13:31:26 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 1: (2 comments) https://gerrit.osmocom.org/#/c/1198/1/src/input/unixsocket.c File src/input/unixsocket.c: Line 4: * > please include a copyright statement pointing to sysmocom (as this was deve Done Line 177: ret = osmo_sock_unix_init(SOCK_SEQPACKET, 0, sock_path, OSMO_SOCK_F_CONNECT); > I'm not sure how portable SOCK_SEQPACKET is in case of unix domain sockets. it already break the build on freebsd. -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 3 13:55:00 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Thu, 3 Nov 2016 13:55:00 +0000 Subject: libosmo-sccp[master]: Revert "Fix the .pc files so the -l arg matches the installe... In-Reply-To: References: Message-ID: Patch Set 2: This needs additional discussion. 1) The current makefiles only produce statically linkable .a files for sccp and mtp, which doesn't seem sensible. I'd applied a patch to fix that, and inadvertently changed the names of the libraries to be consistent with the rest of the osmocom libraries. Sorry about that... 2) Installing libraries without some sort of namespacing prefix is a bad idea... Can we create shared objects for xua, sccp and mtp, and give them a proper osmo- prefix and fixup anything that depends on them? -- To view, visit https://gerrit.osmocom.org/1200 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a113604b2f037b897954fe8d370291d3c1e2a0a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 14:00:53 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Thu, 3 Nov 2016 14:00:53 +0000 Subject: libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... In-Reply-To: References: Message-ID: Patch Set 1: It's a pretty standard way of dealing with this. I mean ideally your code doesn't attempt to write to a closed socket, but if it does, sigpipes aren't too useful. -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 14:26:10 2016 From: gerrit-no-reply at lists.osmocom.org (Arran Cudbard-bell) Date: Thu, 3 Nov 2016 14:26:10 +0000 Subject: libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... In-Reply-To: References: Message-ID: Patch Set 1: https://github.com/FreeRADIUS/freeradius-server/blob/v4.0.x/src/lib/socket.c#L109 You can mask it with SIG_IGN, but that generally doesn't work on the systems that support SO_NOSIGPIPE. -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 15:54:58 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 15:54:58 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Move RTP AMR doc to top level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1192 to look at the new patch set (#3). Move RTP AMR doc to top level Add it to Makefile with proper docinfo so it's build automatically alongside with other documentation. Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 --- M OsmoBTS/Makefile A OsmoBTS/rtp-amr-docinfo.xml R OsmoBTS/rtp-amr.adoc 3 files changed, 49 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/92/1192/3 diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index eadb940..58df0e3 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -14,7 +14,7 @@ # htmlcss = TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis +ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc @@ -26,6 +26,8 @@ -rm -rf $(cleanfiles) -rm osmobts-abis__*.png -rm osmobts-abis__*.svg + -rm rtp-amr__*.png + -rm rtp-amr__*.svg -rm osmobts-usermanual__*.png -rm osmobts-usermanual__*.svg -rm osmobts-abis*.check diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml new file mode 100644 index 0000000..82131c4 --- /dev/null +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + October 2016 + HW + + Initial version + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2016 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc similarity index 100% rename from OsmoBTS/abis/rtp-amr.adoc rename to OsmoBTS/rtp-amr.adoc -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 15:54:58 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 15:54:58 +0000 Subject: [PATCH] osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1193 to look at the new patch set (#2). Add DTX implementation details to RTP AMR Add FSM and description. Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 --- A OsmoBTS/dtx.dot M OsmoBTS/rtp-amr-docinfo.xml M OsmoBTS/rtp-amr.adoc 3 files changed, 102 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-gsm-manuals refs/changes/93/1193/2 diff --git a/OsmoBTS/dtx.dot b/OsmoBTS/dtx.dot new file mode 100644 index 0000000..1c60ee7 --- /dev/null +++ b/OsmoBTS/dtx.dot @@ -0,0 +1,65 @@ +digraph dtx_dl_amr_fsm { + node [shape = doublecircle] ST_VOICE ST_FACCH_V ST_FACCH ST_SID_U + node [shape = circle] + + // default state for non-DTX and DTX when SPEECH is in progress + ST_VOICE -> ST_SID_F1 [ label = "E_SID_F" ] + ST_VOICE -> ST_SID_F1 [ label = "E_SID_U" ] + ST_VOICE -> ST_VOICE [ label = "E_VOICE" ] + ST_VOICE -> ST_VOICE [ label = "E_FACCH" ] + + // SID-FIRST or SID-FIRST-P1 in case of AMR HR: start of silence period (might be interrupted in case of AMR HR) + ST_SID_F1 -> ST_SID_F1 [ label = "E_SID_F" ] + ST_SID_F1 -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_F1 -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_F1 -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_F1 -> ST_SID_F2 [ label = "E_COMPL" ] + ST_SID_F1 -> ST_F1_INH [ label = "E_INHIB" ] + ST_SID_F1 -> ST_ONSET_V [ label = "E_ONSET" ] + + // SID-FIRST P2 (only for AMR HR): actual start of silence period in case of AMR HR + ST_SID_F2 -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_F2 -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_F2 -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_F2 -> ST_ONSET_V [ label = "E_ONSET" ] + + // SID-FIRST Inhibited: incoming SPEECH or FACCH (only for AMR HR) + ST_F1_INH -> ST_VOICE [ label = "E_VOICE" ] + ST_F1_INH -> ST_FACCH_V [ label = "E_FACCH" ] + + // SID-UPDATE Inhibited: incoming SPEECH or FACCH (only for AMR HR) + ST_U_INH -> ST_VOICE [ label = "E_VOICE" ] + ST_U_INH -> ST_FACCH [ label = "E_FACCH" ] + + // Silence period with periodic comfort noise data updates + ST_SID_U -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_U -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_U -> ST_U_INH [ label = "E_INHIB" ] + ST_SID_U -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_U -> ST_SID_U [ label = "E_SID_F" ] + ST_SID_U -> ST_ONSET_V [ label = "E_ONSET" ] + + // ONSET - end of silent period due to incoming SPEECH frame + ST_ONSET_V -> ST_ONSET_V_REC [ label = "E_COMPL" ] + + // ONSET - end of silent period due to incoming FACCH frame + ST_ONSET_F -> ST_ONSET_F_REC [ label = "E_COMPL" ] + + // ONSET recursion in progress: ONSET itself was already sent, now have to send the voice that caused it + ST_ONSET_V_REC -> ST_VOICE [ label = "E_COMPL" ] + + // ONSET recursion in progress: ONSET itself was already sent, now have to send the data that caused it + ST_ONSET_F_REC -> ST_FACCH [ label = "E_COMPL" ] + + // FACCH sending state: SPEECH was observed before so once we're done FSM should get back to VOICE state + ST_FACCH_V -> ST_FACCH_V [ label = "E_FACCH" ] + ST_FACCH_V -> ST_VOICE [ label = "E_VOICE" ] + ST_FACCH_V -> ST_VOICE [ label = "E_SID_U" ] + ST_FACCH_V -> ST_SID_F1 [ label = "E_SID_F" ] + + // FACCH sending state: no SPEECH was observed before so once we're done FSM should get back to silent period via SID-FIRST + ST_FACCH -> ST_FACCH [ label = "E_FACCH" ] + ST_FACCH -> ST_VOICE [ label = "E_VOICE" ] + ST_FACCH -> ST_SID_F1 [ label = "E_SID_U" ] + ST_FACCH -> ST_SID_F1 [ label = "E_SID_F" ] +} diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml index 82131c4..fe5d681 100644 --- a/OsmoBTS/rtp-amr-docinfo.xml +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -7,6 +7,14 @@ Initial version + + 2 + November 2016 + MS + + FSM added + + @@ -21,6 +29,17 @@ Managing Director + + Max + Suraev + msuraev at sysmocom.de + MS + + sysmocom + sysmocom - s.f.m.c. GmbH + Software Developer + + diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index f601303..f7eda11 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -1311,3 +1311,21 @@ ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; } ---- + +== Implementation details + +There is FSM implementing all the necessary states and transitions for DTX DL. + +[[dtx_dl_fsm]] +[graphviz] +---- +include::dtx.dot[] +---- + +The idea is that each state corresponds to the particular message type which have to be send to L1 while state transition happens on incoming events like FACCH or Voice frames. There are 3 different classes of of events driving this FSM: + +* Voice frame types: E_VOICE, E_SID_U, E_SID_F +* Incoming FACCH: E_FACCH +* Internal: E_ONSET, E_INHIB, E_COMPL + +They represent different types of incoming RTP frames (Voice, SID UPDATE and SID FIRST correspondingly), incoming FACCH events or important events internal to DTX operations. The latter are Onset (interruption of silence period), Inhibition (of currently transmitted SID FIRST or UPDATE) and Completion (of silence initiation). \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 3 15:55:22 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 3 Nov 2016 15:55:22 +0000 Subject: osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 wip -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 3 21:25:32 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 3 Nov 2016 21:25:32 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-2 See previous two rounds of critical things not addressed. * No testcase * Side-effect of curbit being incremented not documented (and why should there be a side effect) * Not all parameters documented * Code duplication for actual matching.. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 4 06:25:27 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Fri, 4 Nov 2016 06:25:27 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 4: > See previous two rounds of critical things not addressed. > > * No testcase > * Side-effect of curbit being incremented not documented (and why > should there be a side effect) > * Not all parameters documented > * Code duplication for actual matching.. Testcase is added as a part of Tbftest.cpp file in osmo-pcu and that patch is under https://gerrit.osmocom.org/#/c/414/ I will do documentation for max_bits. For curbit I have documented (cur_bit will go to cur_bit + number of consecutive bit). What do you mean by Code duplication for actual matching ? will you please point it out. Thanks Pravin -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:13:21 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:13:21 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL: tighten check for enabled operation Message-ID: Review at https://gerrit.osmocom.org/1201 DTX DL: tighten check for enabled operation Introduce dtx_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 7 files changed, 17 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/1201/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 31bd172..452761d 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,6 +26,7 @@ }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); +bool dtx_enabled(const struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ef24800..805a980 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,7 +610,7 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && lchan->tch.dtx.dl_amr_fsm) + if (dtxd_facch && dtx_enabled(lchan)) osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_FACCH, (void *)lchan); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 851aacb..9f985c3 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -298,6 +298,13 @@ return false; } +bool dtx_enabled(const struct gsm_lchan *lchan) +{ + if (lchan->ts->trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm) + return true; + return false; +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0b1bad4..f041220 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -409,7 +409,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 4337d68..062eac2 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -275,7 +275,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -497,7 +497,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -524,7 +524,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 51bde8b..6144458 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -404,7 +404,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index db5ca78..ea26ad7 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -373,7 +373,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -599,7 +599,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -626,7 +626,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:13:22 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:13:22 +0000 Subject: [PATCH] osmo-bts[master]: DTX: wrap FSM signal dispatching Message-ID: Review at https://gerrit.osmocom.org/1202 DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c 3 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/1202/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 452761d..ab22eda 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -27,6 +27,7 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_enabled(const struct gsm_lchan *lchan); +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 805a980..71c4b0b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,10 +610,8 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && dtx_enabled(lchan)) - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_FACCH, - (void *)lchan); + if (dtxd_facch) + dtx_dispatch(lchan, E_FACCH); } msgb_free(pp.oph.msg); } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 9f985c3..018ed04 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_COMPL, - (void *)lchan); + dtx_dispatch(lchan, E_COMPL); return 0; } @@ -305,6 +304,13 @@ return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_enabled(lchan)) + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, e, + (void *)lchan); +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:35:01 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:35:01 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL: tighten check for enabled operation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1201 to look at the new patch set (#2). DTX DL: tighten check for enabled operation Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 7 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/1201/2 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 31bd172..42955f1 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,6 +26,7 @@ }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ef24800..805a980 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,7 +610,7 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && lchan->tch.dtx.dl_amr_fsm) + if (dtxd_facch && dtx_enabled(lchan)) osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_FACCH, (void *)lchan); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 851aacb..41d4654 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -298,6 +298,15 @@ return false; } +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) +{ + if (lchan->ts->trx->bts->dtxd && + lchan->tch.dtx.dl_amr_fsm && + lchan->tch_mode = GSM48_CMODE_SPEECH_AMR) + return true; + return false; +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0b1bad4..9d57c2f 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -409,7 +409,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 4337d68..7495073 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -275,7 +275,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -497,7 +497,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -524,7 +524,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 51bde8b..d14eac4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -404,7 +404,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index db5ca78..addb2ff 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -373,7 +373,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -599,7 +599,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -626,7 +626,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:39:19 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:39:19 +0000 Subject: [PATCH] osmo-bts[master]: DTX: wrap FSM signal dispatching In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1202 to look at the new patch set (#2). DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c 3 files changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/1202/2 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 42955f1..4f9868c 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include @@ -27,6 +28,7 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 805a980..71c4b0b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,10 +610,8 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && dtx_enabled(lchan)) - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_FACCH, - (void *)lchan); + if (dtxd_facch) + dtx_dispatch(lchan, E_FACCH); } msgb_free(pp.oph.msg); } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 41d4654..4647160 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_COMPL, - (void *)lchan); + dtx_dispatch(lchan, E_COMPL); return 0; } @@ -307,6 +306,13 @@ return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_enabled(lchan)) + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, e, + (void *)lchan); +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:45:11 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:45:11 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL: tighten check for enabled operation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1201 to look at the new patch set (#3). DTX DL: tighten check for enabled operation Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 7 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/1201/3 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 31bd172..42955f1 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,6 +26,7 @@ }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ef24800..805a980 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,7 +610,7 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && lchan->tch.dtx.dl_amr_fsm) + if (dtxd_facch && dtx_enabled(lchan)) osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_FACCH, (void *)lchan); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 851aacb..edf7123 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -298,6 +298,15 @@ return false; } +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) +{ + if (lchan->ts->trx->bts->dtxd && + lchan->tch.dtx.dl_amr_fsm && + lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + return true; + return false; +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0b1bad4..9d57c2f 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -409,7 +409,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 4337d68..7495073 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -275,7 +275,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -497,7 +497,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -524,7 +524,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 51bde8b..d14eac4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -404,7 +404,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index db5ca78..addb2ff 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -373,7 +373,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -599,7 +599,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -626,7 +626,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:52:59 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:52:59 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL: tighten check for enabled operation In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1201 to look at the new patch set (#4). DTX DL: tighten check for enabled operation Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 7 files changed, 19 insertions(+), 9 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/01/1201/4 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 31bd172..42955f1 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,6 +26,7 @@ }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ef24800..a7f84c5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,7 +610,7 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && lchan->tch.dtx.dl_amr_fsm) + if (dtxd_facch && dtx_dl_amr_enabled(lchan)) osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_FACCH, (void *)lchan); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 851aacb..edf7123 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -298,6 +298,15 @@ return false; } +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) +{ + if (lchan->ts->trx->bts->dtxd && + lchan->tch.dtx.dl_amr_fsm && + lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + return true; + return false; +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0b1bad4..9d57c2f 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -409,7 +409,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 4337d68..7495073 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -275,7 +275,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -497,7 +497,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -524,7 +524,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 51bde8b..d14eac4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -404,7 +404,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index db5ca78..addb2ff 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -373,7 +373,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -599,7 +599,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -626,7 +626,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 4 15:52:59 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 15:52:59 +0000 Subject: [PATCH] osmo-bts[master]: DTX: wrap FSM signal dispatching In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1202 to look at the new patch set (#3). DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c 3 files changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/02/1202/3 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 42955f1..4f9868c 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include @@ -27,6 +28,7 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index a7f84c5..71c4b0b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,10 +610,8 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && dtx_dl_amr_enabled(lchan)) - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_FACCH, - (void *)lchan); + if (dtxd_facch) + dtx_dispatch(lchan, E_FACCH); } msgb_free(pp.oph.msg); } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index edf7123..b876443 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_COMPL, - (void *)lchan); + dtx_dispatch(lchan, E_COMPL); return 0; } @@ -307,6 +306,13 @@ return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_dl_amr_enabled(lchan)) + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, e, + (void *)lchan); +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 4 16:08:49 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 16:08:49 +0000 Subject: [PATCH] osmo-bts[master]: Fix tests linking with libosmocodec Message-ID: Review at https://gerrit.osmocom.org/1203 Fix tests linking with libosmocodec Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459 --- M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/paging/Makefile.am 3 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/03/1203/1 diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 39cb83b..46b55e9 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = agch_test EXTRA_DIST = agch_test.ok diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index b80713a..d76dcd5 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = cipher_test EXTRA_DIST = cipher_test.ok diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index b6d6d78..be9de74 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = paging_test EXTRA_DIST = paging_test.ok -- To view, visit https://gerrit.osmocom.org/1203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 4 16:14:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 4 Nov 2016 16:14:18 +0000 Subject: osmo-bts[master]: Fix AGCH/PCH proportional allocation In-Reply-To: References: Message-ID: Patch Set 2: Fixed. Octbts and Osmo-trx will go into separate patch. -- To view, visit https://gerrit.osmocom.org/1099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 6 22:57:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 6 Nov 2016 22:57:29 +0000 Subject: openbsc[master]: Attempt at extending dynamic PDCH support to Ericcson RBS2000 In-Reply-To: References: Message-ID: Patch Set 3: I have taken another closer look, and in fact the Osmocom style dyn TS code should obsolete this patch. Code differences: * this patch does not have the RSL Act Type IE in the chan activ msg, which the ericsson spec describes as expected to be present. * this patch hooks into the dyn PDCH logic, thus there is no support for TCH/H. Instead of this patch, one should simply use the "TCH/F_TCH/H_PDCH" pchan type in the BSC vty config (note: *not* TCH/F_PDCH), and it should just work (tm). fyi, last week or so we did an initial test of this, which failed due to an OM2K bug in composing the TS setup message for TCH/F_TCH/H_PDCH, for which we have a patch already, to be tested. When that's done and successful, we will abandon this. -- To view, visit https://gerrit.osmocom.org/1155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48089fcf8328d52f57e97b003790ffdeed766367 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 7 05:24:54 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 7 Nov 2016 05:24:54 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#5). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c 2 files changed, 46 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/5 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..ba19e1f 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/* \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Mon Nov 7 10:33:16 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 7 Nov 2016 10:33:16 +0000 Subject: [PATCH] osmo-pcu[master]: Handle Immediate assignment reject Message-ID: Review at https://gerrit.osmocom.org/1204 Handle Immediate assignment reject When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 5 files changed, 157 insertions(+), 26 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/04/1204/1 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..345af76 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,12 +475,13 @@ uint8_t trx_no, ts_no = 0; uint8_t sb = 0; uint32_t sb_fn = 0; - int rc; + int rc = 0; int plen; uint8_t usf = 7; - uint8_t tsc, ta = qta2ta(qta); + uint8_t tsc = 0, ta = qta2ta(qta); uint16_t ms_class = 0; uint16_t priority = 0; + bool failure = false; rach_frame(); @@ -492,7 +493,8 @@ if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); if (rc < 0) - return rc; + failure = true; + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH qbit-ta=%d " "ra=0x%02x, Fn=%d (%d,%d,%d), SBFn=%d\n", qta, ra, @@ -516,25 +518,28 @@ if (!tbf) { LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); - /* FIXME: send reject */ - return -EBUSY; + rc = -EBUSY; + failure = true; + } else { + tbf->set_ta(ta); + tbf->set_state(GPRS_RLCMAC_FLOW); + tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + tbf_timer_start(tbf, 3169, m_bts.t3169, 0); + LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", + tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " + "qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)\n", + tbf_name(tbf), + qta, ra, Fn, (Fn / (26 * 51)) % 32, + Fn % 51, Fn % 26); + LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " + "Assignment Uplink (AGCH)\n", + tbf_name(tbf)); + trx_no = tbf->trx->trx_no; + ts_no = tbf->first_ts; + usf = tbf->m_usf[ts_no]; + tsc = tbf->tsc(); } - tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - tbf_timer_start(tbf, 3169, m_bts.t3169, 0); - LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", - tbf_name(tbf)); - LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " - "qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)\n", - tbf_name(tbf), - qta, ra, Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26); - LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " - "Assignment Uplink (AGCH)\n", tbf_name(tbf)); - trx_no = tbf->trx->trx_no; - ts_no = tbf->first_ts; - usf = tbf->m_usf[ts_no]; - tsc = tbf->tsc(); } bitvec *immediate_assignment = bitvec_alloc(22) /* without plen */; bitvec_unhex(immediate_assignment, @@ -545,17 +550,22 @@ trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, tbf ? tbf->tfi() : -1, usf); - plen = Encoding::write_immediate_assignment( - tbf, immediate_assignment, 0, ra, Fn, ta, - m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, - m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + if (failure == false) + plen = Encoding::write_immediate_assignment( + tbf, immediate_assignment, 0, ra, Fn, ta, + m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, + m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + else + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment, ra, Fn, + burst_type); if (plen >= 0) pcu_l1if_tx_agch(immediate_assignment, plen); bitvec_free(immediate_assignment); - return 0; + return rc; } uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/encoding.cpp b/src/encoding.cpp index 7d3fa14..970714d 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -215,6 +215,82 @@ } /* + * Immediate assignment reject, sent on the CCCH/AGCH + * see GSM 44.018, 9.1.20 + 10.5.2.30 + */ +int Encoding::write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type) +{ + unsigned wp = 0; + int plen; + int i; + + bitvec_write_field(dest, wp, 0x0, 4); // Skip Indicator + bitvec_write_field(dest, wp, 0x6, 4); // Protocol Discriminator + bitvec_write_field(dest, wp, 0x3A, 8); // Immediate Assign Message Type + + // feature indicator + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // no cs + bitvec_write_field(dest, wp, 0x1, 1); // implicit detach for PS + + bitvec_write_field(dest, wp, 0x0, 4); // Page Mode + /* + * 9.1.20.2 of 44.018 version 11.7.0 Release 11 + * Filling of the message + * If necessary the request reference information element and the + * wait indication information element should be duplicated to + * fill the message. + */ + for (i = 0; i < 4; i++) { + //10.5.2.30 Request Reference + if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + bitvec_write_field(dest, wp, 0x7f, 8); /* RACH value */ + } else { + bitvec_write_field(dest, wp, ra, 8); /* RACH value */ + } + + bitvec_write_field(dest, wp, + (ref_fn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, wp, ref_fn % 51, 6); // T3 + bitvec_write_field(dest, wp, ref_fn % 26, 5); // T2 + + /* TODO: Make it configurable */ + bitvec_write_field(dest, wp, 20, 8); //Wait Indication 1 + } + + plen = wp / 8; + + if ((wp % 8)) { + LOGP(DRLCMACUL, LOGL_ERROR, "Length of IMM.ASS.Rej without" + "rest octets is not multiple of 8 bits, PLEASE FIX!\n"); + return -1; + } + + // Extended RA + else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + uint8_t extended_ra = 0; + extended_ra = (ra & 0x1F); + bitvec_write_field(dest, wp, 0x1, 1); + bitvec_write_field(dest, wp, extended_ra, 5); /* Extended RA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); + } + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + + return plen; +} + +/* * Immediate assignment, sent on the CCCH/AGCH * see GSM 04.08, 9.1.18 and GSM 44.018, 9.1.18 + 10.5.2.16 */ diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..79dc32d 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -52,6 +52,12 @@ GSM_L1_BURST_TYPE_ACCESS_0, uint8_t sb = 1); + static int write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type + ); + static void write_packet_uplink_assignment( struct gprs_rlcmac_bts *bts, bitvec * dest, uint8_t old_tfi, diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 8b3cfd1..ee1c817 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -427,6 +427,42 @@ } } +void test_immediate_assign_rej() +{ + uint8_t plen; + bitvec *immediate_assignment_rej = bitvec_alloc(22); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_1); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x7f); + /* Extended RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[19] == 0xc0); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_0); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x70); + +} + int main(int argc, char **argv) { osmo_init_logging(&gprs_log_info); @@ -439,6 +475,7 @@ test_rlc_v_b(); test_rlc_v_n(); test_rlc_dl_ul_basic(); + test_immediate_assign_rej(); return EXIT_SUCCESS; } diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index cb40d39..fe5162c 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -6,3 +6,5 @@ rbb: 10 00 00 00 00 00 00 01 show_rbb: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR show_rbb: IIRRIIIR +assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b +assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Nov 7 12:15:15 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 7 Nov 2016 12:15:15 +0000 Subject: [PATCH] osmo-pcu[master]: BTS: accept also relative frame numbers with rach requst Message-ID: Review at https://gerrit.osmocom.org/1205 BTS: accept also relative frame numbers with rach requst The rach request contains a relative frame number (Fn % 42432), while BTS::rcv_rach() accepts the full frame number only. Since the BTS is always aware of the full frame number this is not a problem. But for BSC co-located PCU schemes it is a problem since the rach request only contains the relative frame number as mentioned above. The pcu continusly receives frame number updates with the GSM time indication message. It is simple to re-calculate the full frame number from that information. This patch makes BTS::rcv_rach() compatible with relative frame numbers, while not breaking the compatibility for full frame numbers Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775 --- M src/bts.cpp 1 file changed, 7 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/1205/1 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..8808537 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -484,6 +484,13 @@ rach_frame(); + /* Santizize frame number */ + Fn = Fn % 42432; + + /* Restore the full frame number + * (See also 3GPP TS 44.018, section 10.5.2.38) */ + Fn = Fn + m_cur_fn - m_cur_fn % 42432; + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); -- To view, visit https://gerrit.osmocom.org/1205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Nov 7 13:04:19 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 7 Nov 2016 13:04:19 +0000 Subject: [PATCH] osmo-pcu[master]: BTS: accept also relative frame numbers with rach requst In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1205 to look at the new patch set (#2). BTS: accept also relative frame numbers with rach requst The rach request contains a relative frame number (Fn % 42432), while BTS::rcv_rach() accepts the full frame number only. Since the BTS is always aware of the full frame number this is not a problem. But for BSC co-located PCU schemes it is a problem since the rach request only contains the relative frame number as mentioned above. The pcu continusly receives frame number updates with the GSM time indication message. It is simple to re-calculate the full frame number from that information. This patch makes BTS::rcv_rach() compatible with relative frame numbers, while not breaking the compatibility for full frame numbers Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775 --- M src/bts.cpp M tests/tbf/TbfTest.cpp 2 files changed, 11 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/05/1205/2 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..8808537 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -484,6 +484,13 @@ rach_frame(); + /* Santizize frame number */ + Fn = Fn % 42432; + + /* Restore the full frame number + * (See also 3GPP TS 44.018, section 10.5.2.38) */ + Fn = Fn + m_cur_fn - m_cur_fn % 42432; + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " "one:\n"); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..aa7f9ed 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -42,6 +42,8 @@ #include +#define DUMMY_FN 2654167 + void *tall_pcu_ctx; int16_t spoof_mnc = 0, spoof_mcc = 0; @@ -166,6 +168,7 @@ trx = &bts->trx[0]; trx->pdch[ts_no].enable(); + the_bts->set_current_frame_number(DUMMY_FN); } static gprs_rlcmac_dl_tbf *create_dl_tbf(BTS *the_bts, uint8_t ms_class, @@ -1350,7 +1353,7 @@ { BTS the_bts; int ts_no = 7; - uint32_t fn = 2654167; /* 17,25,9 */ + uint32_t fn = DUMMY_FN; /* 17,25,9 */ uint32_t tlli = 0xf1223344; const char *imsi = "0011223344"; uint16_t qta = 31; -- To view, visit https://gerrit.osmocom.org/1205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Nov 7 14:20:10 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 7 Nov 2016 14:20:10 +0000 Subject: [PATCH] libosmocore[master]: Add null-pointer check to osmo_amr_rtp_dec() Message-ID: Review at https://gerrit.osmocom.org/1206 Add null-pointer check to osmo_amr_rtp_dec() Check that RTP payload we're about to decode is not NULL and return proper error code instead of segfaulting. Add corresponding test case. Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b --- M src/codec/gsm690.c M tests/codec/codec_test.c 2 files changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/1206/1 diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c index 0f4bf8f..c3cb932 100644 --- a/src/codec/gsm690.c +++ b/src/codec/gsm690.c @@ -252,6 +252,9 @@ int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) { + if (payload_len < 2 || !rtppayload) + return -EINVAL; + /* RFC 4867 ? 4.4.2 ToC - compound payloads are not supported: F = 0 */ uint8_t type = (rtppayload[1] >> 3) & 0xf; @@ -261,9 +264,6 @@ if (payload_len - 2 < amr_len_by_ft[type]) return -ENOTSUP; - - if (payload_len < 2) - return -EINVAL; if (ft) *ft = type; diff --git a/tests/codec/codec_test.c b/tests/codec/codec_test.c index 5b934b1..f944f38 100644 --- a/tests/codec/codec_test.c +++ b/tests/codec/codec_test.c @@ -38,12 +38,17 @@ static void test_sid_dec(const uint8_t *t, size_t len) { - uint8_t cmr, tmp[SID_LEN]; + uint8_t cmr, tmp[SID_LEN], *t2 = NULL; enum osmo_amr_type ft; enum osmo_amr_quality bfi; int8_t sti, cmi; - memcpy(tmp, t, SID_LEN); - int rc = osmo_amr_rtp_dec(tmp, len, &cmr, &cmi, &ft, &bfi, &sti); + if (t) { + memcpy(tmp, t, SID_LEN); + t2 = tmp; + } + int rc = osmo_amr_rtp_dec(t2, len, &cmr, &cmi, &ft, &bfi, &sti); + if (rc < 0) + return; printf("[%d] decode RTP %s%s: FT %s, CMR %s, CMI is %d, SID type %s\t", rc, osmo_hexdump(tmp, len), cmpr(bfi, AMR_GOOD), get_value_string(osmo_amr_type_names, ft), @@ -94,6 +99,7 @@ printf("AMR RTP payload decoder test:\n"); test_sid_dec(sid_first, 7); test_sid_dec(sid_update, 7); + test_sid_dec(NULL, 7); test_amr_rt(0, AMR_NO_DATA, AMR_BAD); test_amr_rt(0, AMR_NO_DATA, AMR_GOOD); test_amr_rt(AMR_12_2, AMR_12_2, AMR_BAD); -- To view, visit https://gerrit.osmocom.org/1206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Nov 7 15:16:17 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 7 Nov 2016 15:16:17 +0000 Subject: [ABANDON] openbsc[master]: Attempt at extending dynamic PDCH support to Ericcson RBS2000 In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: Attempt at extending dynamic PDCH support to Ericcson RBS2000 ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1155 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I48089fcf8328d52f57e97b003790ffdeed766367 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 7 15:18:14 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 7 Nov 2016 15:18:14 +0000 Subject: [PATCH] osmo-bts[master]: Fix false-positive in DTX check Message-ID: Review at https://gerrit.osmocom.org/1207 Fix false-positive in DTX check Previously, if ONSET happened exactly at the place where next SID FIRST or UPDATE should be it was incorrectly detected as error. Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e --- M contrib/dtx_check.gawk 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/1207/1 diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 7ac8b6d..76e4b3c 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,7 +40,7 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } - if ("OK" == CHK) { # check inter-SID distances: + if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms." -- To view, visit https://gerrit.osmocom.org/1207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Nov 7 15:23:19 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 7 Nov 2016 15:23:19 +0000 Subject: [ABANDON] openbsc[master]: abis_rsl: Add mandatory IE for Ericsson RBS2000 PDCH activation In-Reply-To: References: Message-ID: dexter has abandoned this change. Change subject: abis_rsl: Add mandatory IE for Ericsson RBS2000 PDCH activation ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1157 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: I53bad674d3bb02f5210e71ca5b4280be9c956a57 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 7 15:39:00 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 7 Nov 2016 15:39:00 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 7 18:18:13 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 7 Nov 2016 18:18:13 +0000 Subject: [PATCH] osmo-bts[master]: Fix false-positives in DTX check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1207 to look at the new patch set (#2). Fix false-positives in DTX check Previously, if ONSET happened exactly at the place where next SID FIRST or UPDATE should be it was incorrectly detected as error. Similarly, continuos FACCH was misinterpreted as error. Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e --- M contrib/dtx_check.gawk 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/1207/2 diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 7ac8b6d..3a3fa26 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,7 +40,7 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } - if ("OK" == CHK) { # check inter-SID distances: + if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms." @@ -62,8 +62,8 @@ } } } - if ("FACCH" == TYPE && "FIRST" != $2 && 1 == SILENCE) { # check FACCH handling - CHK = "FAIL: incorrect silence resume after FACCH." + if ("FACCH" == TYPE && "FIRST" != $2 && "FACCH" != $2 && 1 == SILENCE) { # check FACCH handling + CHK = "FAIL: incorrect silence resume with " $2 " after FACCH." ERR++ } } -- To view, visit https://gerrit.osmocom.org/1207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 05:43:15 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 8 Nov 2016 05:43:15 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:28:06 2016 From: gerrit-no-reply at lists.osmocom.org (bhargava_abhyankar) Date: Tue, 8 Nov 2016 06:28:06 +0000 Subject: [PATCH] osmo-bts[master]: Initialize parameters in osmo-trx for 11bit RACH Message-ID: Review at https://gerrit.osmocom.org/1208 Initialize parameters in osmo-trx for 11bit RACH The parameters related to support 11bit RACH are initialized in osmo-trx. These parameter determaine the type of the RACH received in osmo-pcu. Change-Id: I164d449303373d0757719d5204f4716975fb517a --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/08/1208/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 463630c..0423e9f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -788,6 +788,10 @@ l1sap.u.rach_ind.acc_delay = (toa >= 0) ? toa : 0; l1sap.u.rach_ind.fn = fn; + /* 11bit RACH is not supported for osmo-trx */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; + /* forward primitive */ l1sap_up(l1t->trx, &l1sap); -- To view, visit https://gerrit.osmocom.org/1208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I164d449303373d0757719d5204f4716975fb517a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:53:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:53:09 +0000 Subject: osmo-bts[master]: Initialize parameters in osmo-trx for 11bit RACH In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I164d449303373d0757719d5204f4716975fb517a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:53:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:53:15 +0000 Subject: [MERGED] osmo-bts[master]: Initialize parameters in osmo-trx for 11bit RACH In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Initialize parameters in osmo-trx for 11bit RACH ...................................................................... Initialize parameters in osmo-trx for 11bit RACH The parameters related to support 11bit RACH are initialized in osmo-trx. These parameter determaine the type of the RACH received in osmo-pcu. Change-Id: I164d449303373d0757719d5204f4716975fb517a --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 463630c..0423e9f 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -788,6 +788,10 @@ l1sap.u.rach_ind.acc_delay = (toa >= 0) ? toa : 0; l1sap.u.rach_ind.fn = fn; + /* 11bit RACH is not supported for osmo-trx */ + l1sap.u.rach_ind.is_11bit = 0; + l1sap.u.rach_ind.burst_type = GSM_L1_BURST_TYPE_ACCESS_0; + /* forward primitive */ l1sap_up(l1t->trx, &l1sap); -- To view, visit https://gerrit.osmocom.org/1208 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I164d449303373d0757719d5204f4716975fb517a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: bhargava_abhyankar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:53:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:53:23 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:53:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:53:29 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:54:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:54:29 +0000 Subject: [PATCH] osmo-bts[master]: dtx_check.gawk: Fix false-positives in DTX check In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1207 to look at the new patch set (#3). dtx_check.gawk: Fix false-positives in DTX check Previously, if ONSET happened exactly at the place where next SID FIRST or UPDATE should be it was incorrectly detected as error. Similarly, continuos FACCH was misinterpreted as error. Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e --- M contrib/dtx_check.gawk 1 file changed, 3 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/07/1207/3 diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 7ac8b6d..3a3fa26 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,7 +40,7 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } - if ("OK" == CHK) { # check inter-SID distances: + if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms." @@ -62,8 +62,8 @@ } } } - if ("FACCH" == TYPE && "FIRST" != $2 && 1 == SILENCE) { # check FACCH handling - CHK = "FAIL: incorrect silence resume after FACCH." + if ("FACCH" == TYPE && "FIRST" != $2 && "FACCH" != $2 && 1 == SILENCE) { # check FACCH handling + CHK = "FAIL: incorrect silence resume with " $2 " after FACCH." ERR++ } } -- To view, visit https://gerrit.osmocom.org/1207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:54:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:54:30 +0000 Subject: osmo-bts[master]: dtx_check.gawk: Fix false-positives in DTX check In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:54:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:54:37 +0000 Subject: [MERGED] osmo-bts[master]: dtx_check.gawk: Fix false-positives in DTX check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dtx_check.gawk: Fix false-positives in DTX check ...................................................................... dtx_check.gawk: Fix false-positives in DTX check Previously, if ONSET happened exactly at the place where next SID FIRST or UPDATE should be it was incorrectly detected as error. Similarly, continuos FACCH was misinterpreted as error. Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e --- M contrib/dtx_check.gawk 1 file changed, 3 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 7ac8b6d..3a3fa26 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,7 +40,7 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } - if ("OK" == CHK) { # check inter-SID distances: + if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms." @@ -62,8 +62,8 @@ } } } - if ("FACCH" == TYPE && "FIRST" != $2 && 1 == SILENCE) { # check FACCH handling - CHK = "FAIL: incorrect silence resume after FACCH." + if ("FACCH" == TYPE && "FIRST" != $2 && "FACCH" != $2 && 1 == SILENCE) { # check FACCH handling + CHK = "FAIL: incorrect silence resume with " $2 " after FACCH." ERR++ } } -- To view, visit https://gerrit.osmocom.org/1207 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:55:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:55:09 +0000 Subject: libosmocore[master]: Add null-pointer check to osmo_amr_rtp_dec() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:55:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:55:15 +0000 Subject: [MERGED] libosmocore[master]: Add null-pointer check to osmo_amr_rtp_dec() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add null-pointer check to osmo_amr_rtp_dec() ...................................................................... Add null-pointer check to osmo_amr_rtp_dec() Check that RTP payload we're about to decode is not NULL and return proper error code instead of segfaulting. Add corresponding test case. Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b --- M src/codec/gsm690.c M tests/codec/codec_test.c 2 files changed, 12 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/codec/gsm690.c b/src/codec/gsm690.c index 0f4bf8f..c3cb932 100644 --- a/src/codec/gsm690.c +++ b/src/codec/gsm690.c @@ -252,6 +252,9 @@ int8_t *cmi, enum osmo_amr_type *ft, enum osmo_amr_quality *bfi, int8_t *sti) { + if (payload_len < 2 || !rtppayload) + return -EINVAL; + /* RFC 4867 ? 4.4.2 ToC - compound payloads are not supported: F = 0 */ uint8_t type = (rtppayload[1] >> 3) & 0xf; @@ -261,9 +264,6 @@ if (payload_len - 2 < amr_len_by_ft[type]) return -ENOTSUP; - - if (payload_len < 2) - return -EINVAL; if (ft) *ft = type; diff --git a/tests/codec/codec_test.c b/tests/codec/codec_test.c index 5b934b1..f944f38 100644 --- a/tests/codec/codec_test.c +++ b/tests/codec/codec_test.c @@ -38,12 +38,17 @@ static void test_sid_dec(const uint8_t *t, size_t len) { - uint8_t cmr, tmp[SID_LEN]; + uint8_t cmr, tmp[SID_LEN], *t2 = NULL; enum osmo_amr_type ft; enum osmo_amr_quality bfi; int8_t sti, cmi; - memcpy(tmp, t, SID_LEN); - int rc = osmo_amr_rtp_dec(tmp, len, &cmr, &cmi, &ft, &bfi, &sti); + if (t) { + memcpy(tmp, t, SID_LEN); + t2 = tmp; + } + int rc = osmo_amr_rtp_dec(t2, len, &cmr, &cmi, &ft, &bfi, &sti); + if (rc < 0) + return; printf("[%d] decode RTP %s%s: FT %s, CMR %s, CMI is %d, SID type %s\t", rc, osmo_hexdump(tmp, len), cmpr(bfi, AMR_GOOD), get_value_string(osmo_amr_type_names, ft), @@ -94,6 +99,7 @@ printf("AMR RTP payload decoder test:\n"); test_sid_dec(sid_first, 7); test_sid_dec(sid_update, 7); + test_sid_dec(NULL, 7); test_amr_rt(0, AMR_NO_DATA, AMR_BAD); test_amr_rt(0, AMR_NO_DATA, AMR_GOOD); test_amr_rt(AMR_12_2, AMR_12_2, AMR_BAD); -- To view, visit https://gerrit.osmocom.org/1206 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib6cda9900a41ed16bbfbde9df3de9d38e0a7469b Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:55:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:55:52 +0000 Subject: osmo-bts[master]: DTX: wrap FSM signal dispatching In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:02 +0000 Subject: osmo-bts[master]: Fix tests linking with libosmocodec In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:23 +0000 Subject: osmo-bts[master]: DTX DL: tighten check for enabled operation In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:39 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Uplink In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:47 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:49 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: New TCH/AHS downlink chapters In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:56 +0000 Subject: osmo-gsm-manuals[master]: rtp-amr.adoc: Fixes to Message Sequence Charts In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:56:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:56:59 +0000 Subject: osmo-gsm-manuals[master]: Move RTP AMR doc to top level In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:02 +0000 Subject: osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:03 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Add DTX implementation details to RTP AMR In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add DTX implementation details to RTP AMR ...................................................................... Add DTX implementation details to RTP AMR Add FSM and description. Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 --- A OsmoBTS/dtx.dot M OsmoBTS/rtp-amr-docinfo.xml M OsmoBTS/rtp-amr.adoc 3 files changed, 102 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: Max: I would prefer this is not merged as is diff --git a/OsmoBTS/dtx.dot b/OsmoBTS/dtx.dot new file mode 100644 index 0000000..1c60ee7 --- /dev/null +++ b/OsmoBTS/dtx.dot @@ -0,0 +1,65 @@ +digraph dtx_dl_amr_fsm { + node [shape = doublecircle] ST_VOICE ST_FACCH_V ST_FACCH ST_SID_U + node [shape = circle] + + // default state for non-DTX and DTX when SPEECH is in progress + ST_VOICE -> ST_SID_F1 [ label = "E_SID_F" ] + ST_VOICE -> ST_SID_F1 [ label = "E_SID_U" ] + ST_VOICE -> ST_VOICE [ label = "E_VOICE" ] + ST_VOICE -> ST_VOICE [ label = "E_FACCH" ] + + // SID-FIRST or SID-FIRST-P1 in case of AMR HR: start of silence period (might be interrupted in case of AMR HR) + ST_SID_F1 -> ST_SID_F1 [ label = "E_SID_F" ] + ST_SID_F1 -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_F1 -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_F1 -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_F1 -> ST_SID_F2 [ label = "E_COMPL" ] + ST_SID_F1 -> ST_F1_INH [ label = "E_INHIB" ] + ST_SID_F1 -> ST_ONSET_V [ label = "E_ONSET" ] + + // SID-FIRST P2 (only for AMR HR): actual start of silence period in case of AMR HR + ST_SID_F2 -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_F2 -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_F2 -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_F2 -> ST_ONSET_V [ label = "E_ONSET" ] + + // SID-FIRST Inhibited: incoming SPEECH or FACCH (only for AMR HR) + ST_F1_INH -> ST_VOICE [ label = "E_VOICE" ] + ST_F1_INH -> ST_FACCH_V [ label = "E_FACCH" ] + + // SID-UPDATE Inhibited: incoming SPEECH or FACCH (only for AMR HR) + ST_U_INH -> ST_VOICE [ label = "E_VOICE" ] + ST_U_INH -> ST_FACCH [ label = "E_FACCH" ] + + // Silence period with periodic comfort noise data updates + ST_SID_U -> ST_ONSET_F [ label = "E_FACCH" ] + ST_SID_U -> ST_VOICE [ label = "E_VOICE" ] + ST_SID_U -> ST_U_INH [ label = "E_INHIB" ] + ST_SID_U -> ST_SID_U [ label = "E_SID_U" ] + ST_SID_U -> ST_SID_U [ label = "E_SID_F" ] + ST_SID_U -> ST_ONSET_V [ label = "E_ONSET" ] + + // ONSET - end of silent period due to incoming SPEECH frame + ST_ONSET_V -> ST_ONSET_V_REC [ label = "E_COMPL" ] + + // ONSET - end of silent period due to incoming FACCH frame + ST_ONSET_F -> ST_ONSET_F_REC [ label = "E_COMPL" ] + + // ONSET recursion in progress: ONSET itself was already sent, now have to send the voice that caused it + ST_ONSET_V_REC -> ST_VOICE [ label = "E_COMPL" ] + + // ONSET recursion in progress: ONSET itself was already sent, now have to send the data that caused it + ST_ONSET_F_REC -> ST_FACCH [ label = "E_COMPL" ] + + // FACCH sending state: SPEECH was observed before so once we're done FSM should get back to VOICE state + ST_FACCH_V -> ST_FACCH_V [ label = "E_FACCH" ] + ST_FACCH_V -> ST_VOICE [ label = "E_VOICE" ] + ST_FACCH_V -> ST_VOICE [ label = "E_SID_U" ] + ST_FACCH_V -> ST_SID_F1 [ label = "E_SID_F" ] + + // FACCH sending state: no SPEECH was observed before so once we're done FSM should get back to silent period via SID-FIRST + ST_FACCH -> ST_FACCH [ label = "E_FACCH" ] + ST_FACCH -> ST_VOICE [ label = "E_VOICE" ] + ST_FACCH -> ST_SID_F1 [ label = "E_SID_U" ] + ST_FACCH -> ST_SID_F1 [ label = "E_SID_F" ] +} diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml index 82131c4..fe5d681 100644 --- a/OsmoBTS/rtp-amr-docinfo.xml +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -7,6 +7,14 @@ Initial version + + 2 + November 2016 + MS + + FSM added + + @@ -21,6 +29,17 @@ Managing Director + + Max + Suraev + msuraev at sysmocom.de + MS + + sysmocom + sysmocom - s.f.m.c. GmbH + Software Developer + + diff --git a/OsmoBTS/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc index f601303..f7eda11 100644 --- a/OsmoBTS/rtp-amr.adoc +++ b/OsmoBTS/rtp-amr.adoc @@ -1311,3 +1311,21 @@ ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; } ---- + +== Implementation details + +There is FSM implementing all the necessary states and transitions for DTX DL. + +[[dtx_dl_fsm]] +[graphviz] +---- +include::dtx.dot[] +---- + +The idea is that each state corresponds to the particular message type which have to be send to L1 while state transition happens on incoming events like FACCH or Voice frames. There are 3 different classes of of events driving this FSM: + +* Voice frame types: E_VOICE, E_SID_U, E_SID_F +* Incoming FACCH: E_FACCH +* Internal: E_ONSET, E_INHIB, E_COMPL + +They represent different types of incoming RTP frames (Voice, SID UPDATE and SID FIRST correspondingly), incoming FACCH events or important events internal to DTX operations. The latter are Onset (interruption of silence period), Inhibition (of currently transmitted SID FIRST or UPDATE) and Completion (of silence initiation). \ No newline at end of file -- To view, visit https://gerrit.osmocom.org/1193 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:03 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: Move RTP AMR doc to top level In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Move RTP AMR doc to top level ...................................................................... Move RTP AMR doc to top level Add it to Makefile with proper docinfo so it's build automatically alongside with other documentation. Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 --- M OsmoBTS/Makefile A OsmoBTS/rtp-amr-docinfo.xml R OsmoBTS/rtp-amr.adoc 3 files changed, 49 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/Makefile b/OsmoBTS/Makefile index eadb940..58df0e3 100644 --- a/OsmoBTS/Makefile +++ b/OsmoBTS/Makefile @@ -14,7 +14,7 @@ # htmlcss = TOPDIR := .. -ASCIIDOCS := osmobts-usermanual osmobts-abis +ASCIIDOCS := osmobts-usermanual osmobts-abis rtp-amr include $(TOPDIR)/build/Makefile.asciidoc.inc include $(TOPDIR)/build/Makefile.inc @@ -26,6 +26,8 @@ -rm -rf $(cleanfiles) -rm osmobts-abis__*.png -rm osmobts-abis__*.svg + -rm rtp-amr__*.png + -rm rtp-amr__*.svg -rm osmobts-usermanual__*.png -rm osmobts-usermanual__*.svg -rm osmobts-abis*.check diff --git a/OsmoBTS/rtp-amr-docinfo.xml b/OsmoBTS/rtp-amr-docinfo.xml new file mode 100644 index 0000000..82131c4 --- /dev/null +++ b/OsmoBTS/rtp-amr-docinfo.xml @@ -0,0 +1,46 @@ + + + 1 + October 2016 + HW + + Initial version + + + + + + + Harald + Welte + hwelte at sysmocom.de + HW + + sysmocom + sysmocom - s.f.m.c. GmbH + Managing Director + + + + + + 2016 + sysmocom - s.f.m.c. GmbH + + + + + Permission is granted to copy, distribute and/or modify this + document under the terms of the GNU Free Documentation License, + Version 1.3 or any later version published by the Free Software + Foundation; with no Invariant Sections, no Front-Cover Texts, + and no Back-Cover Texts. A copy of the license is included in + the section entitled "GNU Free Documentation License". + + + The Asciidoc source code of this manual can be found at + + http://git.osmocom.org/osmo-gsm-manuals/ + + + diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/rtp-amr.adoc similarity index 100% rename from OsmoBTS/abis/rtp-amr.adoc rename to OsmoBTS/rtp-amr.adoc -- To view, visit https://gerrit.osmocom.org/1192 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:03 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr.adoc: Fixes to Message Sequence Charts In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr.adoc: Fixes to Message Sequence Charts ...................................................................... rtp-amr.adoc: Fixes to Message Sequence Charts Nutaq added these clarifications/extensions/fixes tothe message sequence charts. Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 188 insertions(+), 71 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 889a032..f601303 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -65,11 +65,11 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID"]; - ms => phy [label="L1 burst (sub-block 5 of speech frame N-1, sub-block 1 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 6 of speech frame N-1, sub-block 2 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 7 of speech frame N-1, sub-block 3 of SID_FIRST)"]; - ms => phy [label="L1 burst (sub-block 8 of speech frame N-1, sub-block 4 of SID_FIRST)", id="ULSF2"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)", id="ULSF2"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms -x phy [label="Suppressed L1 burst"]; @@ -79,28 +79,36 @@ phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU2"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all -information bits are contained in sub-blocks 1-4 only. +ULSF2:: As per 3GPP TS 05.03 section 3.9.2.4 The last 4 bursts shall not be transmitted unless +the SID_FIRST frame is immediately followed by a speech frame. It has been observed that some phone +does not transmit the last 4 bursts even if it is not followed by a speech frame. -ULSU2:: There must be exactly two suppressed voice frames between the -SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +ULSU2:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and SID_UPDATE. ==== TCH/AFS Uplink: During Silence @@ -125,7 +133,70 @@ ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -480,14 +551,15 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; - ms <= phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms <= phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; @@ -603,10 +675,14 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-2)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; } @@ -636,43 +712,44 @@ ...; --- [label="Last AMR Speech (end of talk-spurt) and SID P1/P2"]; - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1, sub-block 1 of SID_FIRST_P1)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1, sub-block 2 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 3 of speech frame N, sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N, sub-block 2 of SID_FIRST_P1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1", id="ULSF1"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; - - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)", id="ULSU1"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2", id="NOTE"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -ULSF1:: There are two separate indications for P1 and P2, despite both -P1 and P2 being multiplexed together in one batch of four bursts. Not -sure why they result in two separate PH-DATA.ind. Based on what we -know: If the MS sends P1 and P2, the PHY should receive SidFirstP1 and -SidFirstP2 indications immediately after each other, both for the same -GSM frame number. +ULSF1:: Only SID_FIRST_P1 contains information so it must be the only one transmitted over RTP. -ULSU1:: There must be exactly two suppressed voice frames between the -SID_FIRST and the SID_UPDATE, i.e. 60ms between SID_FIRST and +NOTE:: It has been observed that not all phones transmit SID_FIRST_P2 so the PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP2 is not guaranteed to be sent to the BTS. + +ULSU1:: There must be exactly two supressed voice frames between the +SID_FIRST and the SID_UPDATE, i.e. there's 60ms between SID_FIRST and SID_UPDATE. ==== TCH/AFS Uplink: During Silence @@ -695,10 +772,55 @@ ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; + ms => phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_UPDATE)"]; bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- @@ -822,26 +944,27 @@ ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; ...; - ms .. mgw [label="pre-empted SID Update (during silence period)"]; + ms .. mgw [label="Inhibited SID Update (during silence period)"]; ms => phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms => phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_NA"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - ms => phy [label="L1 burst (sub-block 3 of SID_UPD_INH + sub-block 1 of speech frame N-1)", id="SFU1"]; - ms => phy [label="L1 burst (sub-block 4 of SID_UPD_INH + sub-block 2 of speech frame N-1)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; - bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; + ms => phy [label="L1 burst (block 1 of SID_UPD_INH + sub-block 1 of speech frame N)", id="SFU1"]; + ms => phy [label="L1 burst (block 2 of SID_UPD_INH + sub-block 2 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; bts -x mgw [label="Suppressed RTP frame"]; - - ms => phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N-1)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 4 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidUpdateInH", id="SFU2"]; + bts => bts [label="lchan_set_marker() and store CMI from SID_UPD_INH"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; } @@ -925,7 +1048,7 @@ ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of speech frame N)"]; mgw => bts [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } @@ -985,11 +1108,12 @@ ms x- phy [label="Suppressed burst"]; ms x- phy [label="Suppressed burst"]; + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)", id="ULSU2"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; @@ -1004,9 +1128,6 @@ ULSU2:: The SID_UPDATE must be sent exactly three voice frames (60ms) after the SID_FIRST, resulting in two suppressed voice frame periods of empty bursts in between. - -RTDSU1:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? ==== TCH/AHS Downlink: During Silence @@ -1039,20 +1160,15 @@ bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; - phy => bts [label="PH-RTS.ind (TCH)", id="RTDSU2"]; + phy => bts [label="PH-RTS.ind (TCH)"]; phy <= bts [label="PH-EMPTY-FRAME.req"]; ms <= phy [label="L1 burst (sub-block 5+6 of SID_UPDATE)"]; ms <= phy [label="L1 burst (sub-block 7+8 of SID_UPDATE)"]; - phy => bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; - bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- 8VF:: This happens every 8 *voice frames* (160ms), not every 8 GSM TDMA frames! - -RTDSU2:: Not sure whether BTS-PHY actually sends PH-RTS.ind during the -"double-length" SID-UPDATE? [[ahs-dl-onset]] ==== TCH/AHS Downlink: End of Silence; Start of Voice @@ -1076,12 +1192,13 @@ bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset", id="DLOS2"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; ms <= phy [label="L1 burst (sub-block 3 of SID_ONSET + sub-block 1 of speech frame N)"]; ms <= phy [label="L1 burst (sub-block 4 of SID_ONSET + sub-block 2 of speech frame N)"]; bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; phy => bts [label="PH-RTS.ind (TCH)"]; - phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; } -- To view, visit https://gerrit.osmocom.org/1190 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic699bda828947ff616c3d80783026e21d853f962 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:04 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr.adoc: New TCH/AHS downlink chapters In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr.adoc: New TCH/AHS downlink chapters ...................................................................... rtp-amr.adoc: New TCH/AHS downlink chapters Nutaq contributed the following chapters: * TCH/AHS Downlink: FACCH/H During DTX Operation * TCH/AHS Downlink: Inhibited SID_UPDATE * TCH/AHS Downlink: Inhibited SID_FIRST_P1 Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 107 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index fbd6b50..889a032 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -1087,7 +1087,110 @@ } ---- -DLOS2:: The SID_ONSET and the first voice frame are sent in the same -block of four radio bursts. Hence, the BTS must be able ot to send -actual codec payload along with the GsmL1_TchPlType_Amr_Onset -primitive. +==== TCH/AHS Downlink: Inhibited SID_FIRST_P1 + +The following procedure must be observed in case of a SID_FIRST must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_FIRST_P1"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N-1 + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N-1 + sub-block 2 of SID_FIRST_P1)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_FIRST_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_FIRST_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: Inhibited SID_UPDATE + +The following procedure must be observed in case of a SID_UPDATE must be inhibited. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibited SID_UPDATE"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + bts => phy [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 1+2 of SID_UPDATE)"]; + ms <= phy [label="L1 burst (sub-block 3+4 of SID_UPDATE)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidUpdateInh"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_UPDATE_INH, sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_UPDATE_INH, sub-block 2 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; +} +---- + +==== TCH/AHS Downlink: FACCH/H During DTX Operation + +The following procedure must be observed in case of a FACCH/H frame must be inserted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/H During DTX Operation"]; + + bts <= mgw [label="FACCH/H"]; + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req FACCH/H"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET, sub-block 1 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET, sub-block 2 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req"]; + ms <= phy [label="L1 burst (sub-block 3+4 of FACCH/H frame)"]; + ms <= phy [label="L1 burst (sub-block 5+6 of FACCH/H frame)"]; + + phy => bts [label="PH-RTS.ind (FACCH/H)"]; + phy => bts [label="PH-RTS.ind (TCH/H)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/H)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP1"]; + ms <= phy [label="L1 burst (sub-block 7 of FACCH/H frame + sub-block 1 of SID_FIRST_P1)"]; + ms <= phy [label="L1 burst (sub-block 8 of FACCH/H frame + sub-block 2 of SID_FIRST_P1)"]; + + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_SidFirstP2"]; + ms <= phy [label="L1 burst (sub-block 3 of SID_FIRST_P1, sub-block 1 of SID_FIRST_P2)"]; + ms <= phy [label="L1 burst (sub-block 4 of SID_FIRST_P1, sub-block 2 of SID_FIRST_P2)"]; +} +---- -- To view, visit https://gerrit.osmocom.org/1189 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:04 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr: TCH/AHS Uplink: FACCH/H During DTX ...................................................................... rtp-amr: TCH/AHS Uplink: FACCH/H During DTX New chapter contributed by Nutaq: * TCH/AHS Uplink: FACCH/H During DTX operation Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 48 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 6716800..fbd6b50 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -843,7 +843,54 @@ ms => phy [label="L1 burst (sub-block 3 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 4 of speech frame N + sub-block 2 of speech frame N+1)"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; +} +---- + +==== TCH/AHS Uplink: FACCH/H During DTX operation + +The following procedure must be observed if a FACCH/H frame must be transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + ms .. mgw [label="FACCH/H during DTX operation"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/H)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 3+4 of FACCH/H)"]; + ms => phy [label="L1 burst (sub-block 5+6 of FACCH/H)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 7 of FACCH/H + sub-block 1 of SID_FIRST_P1)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH/H + sub-block 2 of SID_FIRST_P1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/H"]; + bts => mgw [label="FACCH/H"]; + + ms => phy [label="L1 burst (sub-block 3 of SID_FIRST_P1 + block 1 of SID_FIRST_P2)"]; + ms => phy [label="L1 burst (sub-block 4 of SID_FIRST_P1 + block 2 of SID_FIRST_P2)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_SidFirstP1"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; } ---- -- To view, visit https://gerrit.osmocom.org/1188 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518 Gerrit-PatchSet: 3 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:04 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Uplink In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr.adoc: TCH/AFS Uplink ...................................................................... rtp-amr.adoc: TCH/AFS Uplink Add new chapter by Nutaq for Speech Frame Following a SID_FIRST frame Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 119 insertions(+), 12 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 800545b..12b5a9f 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -167,28 +167,135 @@ ...; --- [label="Once voice is active again"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms -x phy [label="Suppressed L1 burst"]; - ms => phy [label="L1 burst (sub-block 5 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; - ms => phy [label="L1 burst (sub-block 6 of SID_ONSET + sub-block 2 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 7 of SID_ONSET + sub-block 3 of speech frame N)"]; - ms => phy [label="L1 burst (sub-block 8 of SID_ONSET + sub-block 4 of speech frame N)"]; - phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; - bts => bts [label="lchan_set_marker() and store CMI"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)", id="ULSO2"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + ms => phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 3 of speech frame N+1)"]; ms => phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; - bts => mgw [label="RTP (AMR FT=0..7,Q=1), MARKER=1"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; ...; } ---- ULSO2:: sub-blocks 1..4 of SID_ONSET are never transmitted as all -infomration is contained in blocks 5..8. +information is contained in blocks 5..8. + +==== TCH/AFS Uplink: Speech Frame Following a SID_FIRST frame + +The four last bursts of a SID_FIRST frame can be replaced by an ONSET frame in order to quickly resume speech. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Speech Frame Following a SID_FIRST"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N, sub-block 1 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N, sub-block 2 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N, sub-block 3 of SID_FIRST)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N, sub-block 4 of SID_FIRST)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1)"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N+1)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N+1)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + + ms => phy [label="L1 burst (sub-block 5 of speech frame N+1 + sub-block 1 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 6 of speech frame N+1 + sub-block 2 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 7 of speech frame N+1 + sub-block 3 of speech frame N+2)"]; + ms => phy [label="L1 burst (sub-block 8 of speech frame N+1 + sub-block 4 of speech frame N+2)"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (N+1)"]; + bts => mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + ...; +} +---- + +==== TCH/AFS Uplink: FACCH/F Frame During DTX Operation + +As mentioned in section A.5.1.2.1 of 3GPP TS 26.093 : + +* If the frame preceding the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then an ONSET frame shall be signalled to the CHE, followed by the FACCH frame(s). +* If the frame following the FACCH frame is not of TX_TYPE='SPEECH_GOOD', then a SID_FIRST shall be signalled to the CHE. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/F Frame During DTX"]; + + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH frame)"]; + ms => phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH frame)"]; + ms => phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH frame)"]; + ms => phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH frame)"]; + phy -x bts [label="No PH-DATA.ind sent[BFI]"]; + bts -x mgw [label="Suppressed RTP frame"]; + + ms => phy [label="L1 burst (sub-block 5 of FACCH frame + sub-block 1 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 6 of FACCH frame + sub-block 2 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 7 of FACCH frame + sub-block 3 of SID First frame)"]; + ms => phy [label="L1 burst (sub-block 8 of FACCH frame + sub-block 4 of SID First frame)", id="Note"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr_Onset"]; + bts => bts [label="lchan_set_marker() and store CMI"]; + phy => bts [label="PH-DATA.ind FACCH/F"]; + bts => mgw [label="FACCH/F"]; + + ms -x phy [label="Supressed L1 burst", id="ULSF2"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + ms -x phy [label="Supressed L1 burst"]; + phy => bts [label="PH-DATA.ind GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => mgw [label="RTP (AMR FT=SID,Q=1)"]; + ...; +} +---- + +ULSF2:: The sub-blocks 5-8 of SID_FIRST are not transmitted, as all +information bits are contained in sub-blocks 1-4 only + +Note:: It has been observed with some phones that the SID_FIRST is not sent following the FACCH/F +frame. If this case occures the No Data Frame and SID_UPDATE order resumes. === TCH/AFS Downlink (Network to MS) -- To view, visit https://gerrit.osmocom.org/1186 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:57:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:57:04 +0000 Subject: [MERGED] osmo-gsm-manuals[master]: rtp-amr.adoc: TCH/AFS Downlink: Inhibiting In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rtp-amr.adoc: TCH/AFS Downlink: Inhibiting ...................................................................... rtp-amr.adoc: TCH/AFS Downlink: Inhibiting Add two new chapters contributed by Nutaq: * TCH/AFS Downlink: Inhibiting a SID_FIRST frame * TCH/AFS Downlink: FACCH/F During DTX Operation Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46 --- M OsmoBTS/abis/rtp-amr.adoc 1 file changed, 85 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/OsmoBTS/abis/rtp-amr.adoc b/OsmoBTS/abis/rtp-amr.adoc index 12b5a9f..6716800 100644 --- a/OsmoBTS/abis/rtp-amr.adoc +++ b/OsmoBTS/abis/rtp-amr.adoc @@ -495,10 +495,91 @@ } ---- -DLOS1:: The SID_ONSET and the first voice frame are sent in the same -block of four radio busts. Hence, the BTS must be able ot to send -actual codec payload along with the GsmL1_TchPlType_Amr_Onset -primitive. +==== TCH/AFS Downlink: Inhibiting a SID_FIRST frame + +Here is the procedure to inhibit a SID_FIRST frame in order to quickly resume speech. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="Inhibiting a SID_FIRST frame"]; + + bts <= mgw [label="RTP (AMR FT=SID,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + bts => bts [label="Store SID frame in case it contains comfort noise parameters"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N-1 + sub-block 1 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N-1 + sub-block 2 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N-1 + sub-block 3 of SID_FIRST)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N-1 + sub-block 4 of SID_FIRST)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1) MARKER=1"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N)"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of speech frame N)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of speech frame N)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of speech frame N)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of speech frame N)"]; + + bts <= mgw [label="RTP (AMR FT=0..7,Q=1)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (N+1)"]; + ms <= phy [label="L1 burst (sub-block 5 of speech frame N + sub-block 1 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 6 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 7 of speech frame N + sub-block 2 of speech frame N+1)"]; + ms <= phy [label="L1 burst (sub-block 8 of speech frame N + sub-block 2 of speech frame N+1)"]; + } +---- + +==== TCH/AFS Downlink: FACCH/F During DTX Operation + +The following procedure must be observed if a FACCH/F frame must be transmitted during DTX operation. + +["mscgen"] +---- +msc { + hscale = 2; + ms [label="MS"], phy [label="BTS-PHY"], bts [label="BTS"], mgw [label="MGW"]; + + ...; + --- [label="FACCH/F Frame During DTX"]; + + bts <= mgw [label="FACCH/F"]; + phy => bts [label="PH-RTS.ind (FACCH/F)"]; + phy => bts [label="PH-RTS.ind (TCH/F)"]; + phy <= bts [label="PH-DATA.req (FACCH/F)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr_Onset(TCH/F)", id="NOTE"]; + ms <= phy [label="L1 burst (block 1 of SID_ONSET + sub-block 1 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 2 of SID_ONSET + sub-block 2 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 3 of SID_ONSET + sub-block 3 of FACCH/F)"]; + ms <= phy [label="L1 burst (block 4 of SID_ONSET + sub-block 4 of FACCH/F)"]; + + phy => bts [label="PH-RTS.ind (FACCH)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/F)"]; + phy <= bts [label="PH-DATA.req GsmL1_TchPlType_Amr (SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 5 of FACCH/F + sub-block 1 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 6 of FACCH/F + sub-block 2 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 7 of FACCH/F + sub-block 3 of SID_FIRST)"]; + ms x- phy [label="L1 burst (sub-block 8 of FACCH/F + sub-block 4 of SID_FIRST)"]; + + phy => bts [label="PH-RTS.ind (FACCH)"]; + phy => bts [label="PH-RTS.ind (TCH)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (FACCH/F)"]; + phy <= bts [label="PH-EMPTY-FRAME.req (TCH/F)"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; + ms x- phy [label="Supressed burst"]; +} +---- + +NOTE:: The ONSET and the FACCH/F PH-DATA requests must both be sent to the PHY. == Half-Rate (TCH/AHS) -- To view, visit https://gerrit.osmocom.org/1187 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46 Gerrit-PatchSet: 2 Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:58:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:58:42 +0000 Subject: libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 06:58:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 06:58:43 +0000 Subject: [MERGED] libosmo-netif[master]: Set SO_NOSIGPIPE on SCTP connections, for patforms which sup... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Set SO_NOSIGPIPE on SCTP connections, for patforms which support it (macOS, FreeBSD etc...) ...................................................................... Set SO_NOSIGPIPE on SCTP connections, for patforms which support it (macOS, FreeBSD etc...) Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Signed-off-by: Arran Cudbard-Bell --- M src/stream.c 1 file changed, 17 insertions(+), 1 deletion(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/stream.c b/src/stream.c index fd02b74..7d40df2 100644 --- a/src/stream.c +++ b/src/stream.c @@ -26,6 +26,14 @@ #include #endif +/* + * Platforms that don't have MSG_NOSIGNAL (which disables SIGPIPE) + * usually have SO_NOSIGPIPE (set via setsockopt). + */ +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif + static int sctp_sock_activate_events(int fd) { #ifdef HAVE_LIBSCTP @@ -167,8 +175,16 @@ ofd->when &= ~BSC_FD_WRITE; LOGP(DLINP, LOGL_DEBUG, "connection done.\n"); cli->state = STREAM_CLI_STATE_CONNECTED; - if (cli->proto == IPPROTO_SCTP) + if (cli->proto == IPPROTO_SCTP) { +#ifdef SO_NOSIGPIPE + int val = 1; + + ret = setsockopt(ofd->fd, SOL_SOCKET, SO_NOSIGPIPE, (void*)&val, sizeof(val)); + if (ret < 0) + LOGP(DLINP, LOGL_DEBUG, "Failed setting SO_NOSIGPIPE: %s\n", strerror(errno)); +#endif sctp_sock_activate_events(ofd->fd); + } if (cli->connect_cb) cli->connect_cb(cli); break; -- To view, visit https://gerrit.osmocom.org/1194 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If4f2a99b2baf143551a7122f40ed1f9088c5936c Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Arran Cudbard-bell Gerrit-Reviewer: Arran Cudbard-bell Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 8 09:59:57 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 8 Nov 2016 09:59:57 +0000 Subject: [PATCH] osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Hello Max, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1204 to look at the new patch set (#2). Handle Immediate assignment reject When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 8 files changed, 519 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/04/1204/2 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..2937c46 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,32 +475,42 @@ uint8_t trx_no, ts_no = 0; uint8_t sb = 0; uint32_t sb_fn = 0; - int rc; + int rc = 0; int plen; uint8_t usf = 7; - uint8_t tsc, ta = qta2ta(qta); + uint8_t tsc = 0, ta = qta2ta(qta); uint16_t ms_class = 0; uint16_t priority = 0; + bool failure = false; rach_frame(); - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " - "one:\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, " + "so we provide one \n" + "ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); sb = is_single_block(ra, burst_type, is_11bit, &ms_class, &priority); if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); - if (rc < 0) - return rc; - LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH qbit-ta=%d " - "ra=0x%02x, Fn=%d (%d,%d,%d), SBFn=%d\n", - qta, ra, - Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, - sb_fn); - LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment Uplink " - "(AGCH)\n"); - tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + if (rc < 0) { + failure = true; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource for " + "single block allocation." + "sending Immediate " + "Assignment Uplink (AGCH) reject\n"); + } else { + tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH " + " qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)," + " SBFn=%d\n", + qta, ra, + Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, + sb_fn); + LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment " + "Uplink (AGCH)\n"); + } } else { // Create new TBF #warning "Copy and paste with other routines.." @@ -515,47 +525,59 @@ } if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); - /* FIXME: send reject */ - return -EBUSY; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " + "Immediate Assignment Uplink (AGCH) " + "reject\n"); + rc = -EBUSY; + failure = true; + } else { + tbf->set_ta(ta); + tbf->set_state(GPRS_RLCMAC_FLOW); + tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + tbf_timer_start(tbf, 3169, m_bts.t3169, 0); + LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", + tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " + "qbit-ta=%d ra=0x%02x, Fn=%d " + " (%d,%d,%d)\n", + tbf_name(tbf), + qta, ra, Fn, (Fn / (26 * 51)) % 32, + Fn % 51, Fn % 26); + LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " + "Assignment Uplink (AGCH)\n", + tbf_name(tbf)); + trx_no = tbf->trx->trx_no; + ts_no = tbf->first_ts; + usf = tbf->m_usf[ts_no]; + tsc = tbf->tsc(); } - tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - tbf_timer_start(tbf, 3169, m_bts.t3169, 0); - LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", - tbf_name(tbf)); - LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " - "qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)\n", - tbf_name(tbf), - qta, ra, Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26); - LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " - "Assignment Uplink (AGCH)\n", tbf_name(tbf)); - trx_no = tbf->trx->trx_no; - ts_no = tbf->first_ts; - usf = tbf->m_usf[ts_no]; - tsc = tbf->tsc(); } bitvec *immediate_assignment = bitvec_alloc(22) /* without plen */; bitvec_unhex(immediate_assignment, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); - LOGP(DRLCMAC, LOGL_DEBUG, - " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", - trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, - tbf ? tbf->tfi() : -1, usf); - plen = Encoding::write_immediate_assignment( - tbf, immediate_assignment, 0, ra, Fn, ta, - m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, - m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + if (failure == false) { + LOGP(DRLCMAC, LOGL_DEBUG, + " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", + trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, + tbf ? tbf->tfi() : -1, usf); + + plen = Encoding::write_immediate_assignment( + tbf, immediate_assignment, 0, ra, Fn, ta, + m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, + m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + } else + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment, ra, Fn, + burst_type); if (plen >= 0) pcu_l1if_tx_agch(immediate_assignment, plen); bitvec_free(immediate_assignment); - return 0; + return rc; } uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/encoding.cpp b/src/encoding.cpp index 7d3fa14..1af32a8 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -215,6 +215,84 @@ } /* + * Immediate assignment reject, sent on the CCCH/AGCH + * see GSM 44.018, 9.1.20 + 10.5.2.30 + */ +int Encoding::write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type) +{ + unsigned wp = 0; + int plen; + int i; + + bitvec_write_field(dest, wp, 0x0, 4); // Skip Indicator + bitvec_write_field(dest, wp, 0x6, 4); // Protocol Discriminator + bitvec_write_field(dest, wp, 0x3A, 8); // Immediate Assign Message Type + + // feature indicator + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // no cs + bitvec_write_field(dest, wp, 0x1, 1); // implicit detach for PS + + bitvec_write_field(dest, wp, 0x0, 4); // Page Mode + /* + * 9.1.20.2 of 44.018 version 11.7.0 Release 11 + * Filling of the message + * If necessary the request reference information element and the + * wait indication information element should be duplicated to + * fill the message. + * TODO: group rejection for multiple MS + */ + for (i = 0; i < 4; i++) { + //10.5.2.30 Request Reference + if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + bitvec_write_field(dest, wp, 0x7f, 8); /* RACH value */ + } else { + bitvec_write_field(dest, wp, ra, 8); /* RACH value */ + } + + bitvec_write_field(dest, wp, + (ref_fn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, wp, ref_fn % 51, 6); // T3 + bitvec_write_field(dest, wp, ref_fn % 26, 5); // T2 + + /* TODO: Make it configurable */ + bitvec_write_field(dest, wp, 20, 8); //Wait Indication 1 + } + + plen = wp / 8; + + if ((wp % 8)) { + LOGP(DRLCMACUL, LOGL_ERROR, "Length of IMM.ASS.Rej without" + "rest octets is not multiple of 8 bits, PLEASE FIX!\n"); + return -1; + } + + // Extended RA + else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + uint8_t extended_ra = 0; + + extended_ra = (ra & 0x1F); + bitvec_write_field(dest, wp, 0x1, 1); + bitvec_write_field(dest, wp, extended_ra, 5); /* Extended RA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); + } + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + + return plen; +} + +/* * Immediate assignment, sent on the CCCH/AGCH * see GSM 04.08, 9.1.18 and GSM 44.018, 9.1.18 + 10.5.2.16 */ diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..79dc32d 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -52,6 +52,12 @@ GSM_L1_BURST_TYPE_ACCESS_0, uint8_t sb = 1); + static int write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type + ); + static void write_packet_uplink_assignment( struct gprs_rlcmac_bts *bts, bitvec * dest, uint8_t old_tfi, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..339390b 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1372,6 +1372,88 @@ printf("=== end %s ===\n", __func__); } +/* + * Trigger rach for single block + */ +static void test_immediate_assign_rej_single_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + the_bts.bts_data()->trx[0].pdch[ts_no].disable(); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment + * Uplink reject on the AGCH + */ + rc = the_bts.rcv_rach(0x70, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EINVAL); + + printf("=== end %s ===\n", __func__); +} + +/* + * Trigger rach till resources(USF) exhaust + */ +static void test_immediate_assign_rej_multi_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment Uplink + * reject on the AGCH + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7f, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EBUSY); + + printf("=== end %s ===\n", __func__); +} + +static void test_immediate_assign_rej() +{ + test_immediate_assign_rej_multi_block(); + test_immediate_assign_rej_single_block(); +} + static void test_tbf_two_phase() { BTS the_bts; @@ -2791,6 +2873,7 @@ test_tbf_update_ws(); test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); + test_immediate_assign_rej(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fc3a113..627cdc3 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1510,7 +1510,8 @@ MSG = 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654167 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -1531,7 +1532,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -1584,9 +1585,10 @@ Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1669,9 +1671,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1803,9 +1806,10 @@ - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-4): 07 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654232 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8c f6 07 00 c0 0c 68 ab 2b 2b 2b 2b 2b 2b 2b @@ -1879,9 +1883,10 @@ Modifying MS object, TLLI: 0xf5667788 confirmed New MS: TLLI = 0xf5667788, TA = 7, IMSI = 0011223344, LLC = 1 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1972,9 +1977,10 @@ Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654224 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b ee 07 00 c0 0c 60 6b 2b 2b 2b 2b 2b 2b 2b @@ -2056,9 +2062,10 @@ - No gaps in received block, last block: BSN=0 CV=15 New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -2150,7 +2157,8 @@ ********** TBF ends here ********** Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654275 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -2171,7 +2179,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -2210,9 +2218,10 @@ - Scheduling Ack/Nack, because last block has CV==0. New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3344,9 +3353,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3436,9 +3446,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6198,9 +6209,10 @@ Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6370,9 +6382,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6627,3 +6640,209 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7f Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b +Destroying MS object, TLLI = 0x00000000 +MS requests UL TBF on RACH, so we provide one +ra=0x70 Fn=2654167 qta=31 is_11bit=0: +MS requests single block allocation +No PDCH available. +No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 2978d6d..f921dfc 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -68,3 +68,7 @@ === end test_tbf_li_decoding === === start test_tbf_epdan_out_of_rx_window === === end test_tbf_epdan_out_of_rx_window === +=== start test_immediate_assign_rej_multi_block === +=== end test_immediate_assign_rej_multi_block === +=== start test_immediate_assign_rej_single_block === +=== end test_immediate_assign_rej_single_block === diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 8b3cfd1..ee1c817 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -427,6 +427,42 @@ } } +void test_immediate_assign_rej() +{ + uint8_t plen; + bitvec *immediate_assignment_rej = bitvec_alloc(22); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_1); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x7f); + /* Extended RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[19] == 0xc0); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_0); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x70); + +} + int main(int argc, char **argv) { osmo_init_logging(&gprs_log_info); @@ -439,6 +475,7 @@ test_rlc_v_b(); test_rlc_v_n(); test_rlc_dl_ul_basic(); + test_immediate_assign_rej(); return EXIT_SUCCESS; } diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index cb40d39..fe5162c 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -6,3 +6,5 @@ rbb: 10 00 00 00 00 00 00 01 show_rbb: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR show_rbb: IIRRIIIR +assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b +assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Nov 8 10:26:41 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 10:26:41 +0000 Subject: [MERGED] osmo-bts[master]: Fix tests linking with libosmocodec In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Fix tests linking with libosmocodec ...................................................................... Fix tests linking with libosmocodec Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459 --- M tests/agch/Makefile.am M tests/cipher/Makefile.am M tests/paging/Makefile.am 3 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/agch/Makefile.am b/tests/agch/Makefile.am index 39cb83b..46b55e9 100644 --- a/tests/agch/Makefile.am +++ b/tests/agch/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = agch_test EXTRA_DIST = agch_test.ok diff --git a/tests/cipher/Makefile.am b/tests/cipher/Makefile.am index b80713a..d76dcd5 100644 --- a/tests/cipher/Makefile.am +++ b/tests/cipher/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = cipher_test EXTRA_DIST = cipher_test.ok diff --git a/tests/paging/Makefile.am b/tests/paging/Makefile.am index b6d6d78..be9de74 100644 --- a/tests/paging/Makefile.am +++ b/tests/paging/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(ORTP_CFLAGS) -LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(ORTP_CFLAGS) +LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCODEC_LIBS) $(ORTP_LIBS) noinst_PROGRAMS = paging_test EXTRA_DIST = paging_test.ok -- To view, visit https://gerrit.osmocom.org/1203 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 11:07:54 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Tue, 8 Nov 2016 11:07:54 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet assignement reject during EPDAN with channel d... Message-ID: Review at https://gerrit.osmocom.org/1209 Handle packet assignement reject during EPDAN with channel description When EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 --- M src/bts.cpp M src/bts.h M src/encoding.cpp M src/encoding.h M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 10 files changed, 142 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/1209/1 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..174c1dd 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1054,16 +1054,24 @@ } /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if(ul_tbf == NULL) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we pacekt access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } + else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } } /* get measurements */ if (tbf->ms()) { @@ -1156,16 +1164,23 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if(ul_tbf == NULL) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we send packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } + else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } } /* get measurements */ @@ -1248,14 +1263,20 @@ egprs_ms_class); ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, egprs_ms_class, tlli, ta, ms); - if (!ul_tbf) + if (!ul_tbf) { +#if 0 + bts()->send_packet_access_reject(tlli, true, 0 ,0,fn,0); +#endif + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; return; + } + + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; /* set control ts to current MS's TS, until assignment complete */ LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); ul_tbf->control_ts = ts_no; /* schedule uplink assignment */ - ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; /* get capabilities */ if (ul_tbf->ms()) diff --git a/src/bts.h b/src/bts.h index 8bea371..1bce185 100644 --- a/src/bts.h +++ b/src/bts.h @@ -304,6 +304,10 @@ int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit, enum ph_burst_type burst_type); + void send_packet_access_reject(uint32_t tlli, bool tlli_present, + bool packet_reference_present, + bool packet_reference, uint32_t fn, uint8_t tfi); + void trigger_dl_ass(gprs_rlcmac_dl_tbf *tbf, gprs_rlcmac_tbf *old_tbf); void snd_dl_ass(gprs_rlcmac_tbf *tbf, uint8_t poll, const char *imsi); diff --git a/src/encoding.cpp b/src/encoding.cpp index 7d3fa14..d4ce8ba 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -681,6 +681,29 @@ } } +/* + * Refer 44.060 version 7.27.0 Release 7 + * section 7.1.3.2.1 On receipt of a PACKET RESOURCE REQUEST message + * 8.1.2.5 Establishment of uplink TBF + */ +void Encoding::write_packet_access_reject( + bitvec * dest, uint32_t tlli) +{ + unsigned wp = 0; + bitvec_write_field(dest, wp, 0x1, 2); // Payload Type + bitvec_write_field(dest, wp, 0x0, 2); // Uplink block with TDMA framenumber (N+13) + bitvec_write_field(dest, wp, 0, 1); // No Polling Bit + bitvec_write_field(dest, wp, 0x0, 3); // Uplink state flag + bitvec_write_field(dest, wp, 0x21, 6); // MESSAGE TYPE + bitvec_write_field(dest, wp, 0, 2); // fixed 00 + bitvec_write_field(dest, wp, 0x0, 1); // TLLI / G-RNTI : bit (32) + bitvec_write_field(dest, wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI + bitvec_write_field(dest, wp, 1, 1); // WAIT_INDICATION size in seconds + /* TODO: make it configurable */ + bitvec_write_field(dest, wp, 100, 8); // WAIT_INDICATION value + bitvec_write_field(dest, wp, 0, 1); // WAIT_INDICATION size in seconds +} + static void write_packet_uplink_ack_egprs( struct gprs_rlcmac_bts *bts, bitvec * dest, unsigned& wp, struct gprs_rlcmac_ul_tbf *tbf, bool is_final) diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..54bbc8a 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -68,6 +68,9 @@ static void encode_rbb(const char *show_rbb, uint8_t *rbb); + static void write_packet_access_reject( + bitvec * dest, uint32_t tlli); + static void write_packet_uplink_ack( struct gprs_rlcmac_bts *bts, bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final, diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index f486075..9d35ad3 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -72,7 +72,8 @@ *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = dl_tbf; } @@ -137,7 +138,11 @@ */ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - msg = ul_ass_tbf->create_ul_ass(fn, ts); + if (tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else + msg = ul_ass_tbf->create_ul_ass(fn, ts); else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF) msg = dl_ass_tbf->create_dl_ass(fn, ts); else if (tbf == ul_ack_tbf) diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..d8ada70 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1013,6 +1013,27 @@ return msg; } +struct msgb *gprs_rlcmac_tbf::create_packet_access_reject() +{ + struct msgb *msg; + + msg = msgb_alloc(23, "rlcmac_ul_ass_rej"); + + bitvec *packet_access_rej = bitvec_alloc(23); + bitvec_unhex(packet_access_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + Encoding::write_packet_access_reject( + packet_access_rej, tlli()); + + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); + + bitvec_free(packet_access_rej); + ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + return msg; + +} + struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) { struct msgb *msg; diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..e044053 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,7 @@ enum gprs_rlcmac_tbf_ul_ass_state { GPRS_RLCMAC_UL_ASS_NONE = 0, GPRS_RLCMAC_UL_ASS_SEND_ASS, /* send uplink assignment on next RTS */ + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ, /* send assignment reject next RTS */ GPRS_RLCMAC_UL_ASS_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; @@ -103,6 +104,7 @@ struct msgb *create_dl_ass(uint32_t fn, uint8_t ts); struct msgb *create_ul_ass(uint32_t fn, uint8_t ts); + struct msgb *create_packet_access_reject(); GprsMs *ms() const; void set_ms(GprsMs *ms); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..926c535 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2749,6 +2749,27 @@ ARRAY_SIZE(default_categories), }; +void test_immediate_assign_rej() +{ + BTS the_bts; + uint32_t tlli = 0xffeeddcc; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, 4); + static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(&the_bts, 1); + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + struct msgb *msg = dl_tbf->create_packet_access_reject(); + + printf("packet reject: %s\n", + osmo_hexdump(msg->data, 23)); + + OSMO_ASSERT(!strcmp(osmo_hexdump(msg->data, 23), + "40 84 7f f7 6e e6 59 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ")); + printf("=== end %s ===\n", __func__); + +} + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -2791,6 +2812,7 @@ test_tbf_update_ws(); test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); + test_immediate_assign_rej(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fc3a113..d47a7da 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6627,3 +6627,27 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 2978d6d..1948745 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -68,3 +68,6 @@ === end test_tbf_li_decoding === === start test_tbf_epdan_out_of_rx_window === === end test_tbf_epdan_out_of_rx_window === +=== start test_immediate_assign_rej === +packet reject: 40 84 7f f7 6e e6 59 0b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_immediate_assign_rej === -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Tue Nov 8 11:26:03 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 11:26:03 +0000 Subject: [MERGED] osmo-bts[master]: DTX DL: tighten check for enabled operation In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: DTX DL: tighten check for enabled operation ...................................................................... DTX DL: tighten check for enabled operation Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled and FSM is allocated and use it for all corresponding checks. Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 7 files changed, 19 insertions(+), 9 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 31bd172..42955f1 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -26,6 +26,7 @@ }; void lchan_set_marker(bool t, struct gsm_lchan *lchan); +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index ef24800..a7f84c5 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,7 +610,7 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && lchan->tch.dtx.dl_amr_fsm) + if (dtxd_facch && dtx_dl_amr_enabled(lchan)) osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_FACCH, (void *)lchan); diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index 851aacb..edf7123 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -298,6 +298,15 @@ return false; } +bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) +{ + if (lchan->ts->trx->bts->dtxd && + lchan->tch.dtx.dl_amr_fsm && + lchan->tch_mode == GSM48_CMODE_SPEECH_AMR) + return true; + return false; +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 0b1bad4..9d57c2f 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -409,7 +409,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 4337d68..7495073 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -275,7 +275,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -497,7 +497,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -524,7 +524,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index 51bde8b..d14eac4 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -404,7 +404,7 @@ if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); - else if (trx->bts->dtxd && lchan->tch.dtx.dl_amr_fsm && + else if (dtx_dl_amr_enabled(lchan) && lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { if (sapi == GsmL1_Sapi_FacchF) { sapi = GsmL1_Sapi_TchF; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index db5ca78..addb2ff 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -373,7 +373,7 @@ l1_payload, marker, len, &ft); if (rc < 0) return rc; - if (!lchan->ts->trx->bts->dtxd) { + if (!dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); @@ -599,7 +599,7 @@ case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && - lchan->ts->trx->bts->dtxd) { + dtx_dl_amr_enabled(lchan)) { *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), @@ -626,7 +626,7 @@ return NULL; } - if (lchan->ts->trx->bts->dtxd) { + if (dtx_dl_amr_enabled(lchan)) { rc = repeat_last_sid(lchan, l1_payload, fn); if (!rc) { msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1201 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 11:32:35 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 11:32:35 +0000 Subject: [MERGED] osmo-bts[master]: DTX: wrap FSM signal dispatching In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: DTX: wrap FSM signal dispatching ...................................................................... DTX: wrap FSM signal dispatching Make wrapper function which checks that DTX is enabled for lchan before dispatching any events. Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c M src/common/msg_utils.c 3 files changed, 12 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 42955f1..4f9868c 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -5,6 +5,7 @@ #pragma once #include +#include #include @@ -27,6 +28,7 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/l1sap.c b/src/common/l1sap.c index a7f84c5..71c4b0b 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -610,10 +610,8 @@ memcpy(p, pp.oph.msg->data, GSM_MACBLOCK_LEN); /* check if it is a RR CIPH MODE CMD. if yes, enable RX ciphering */ check_for_ciph_cmd(pp.oph.msg, lchan, chan_nr); - if (dtxd_facch && dtx_dl_amr_enabled(lchan)) - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, - E_FACCH, - (void *)lchan); + if (dtxd_facch) + dtx_dispatch(lchan, E_FACCH); } msgb_free(pp.oph.msg); } diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index edf7123..b876443 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -151,8 +151,7 @@ if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_COMPL, - (void *)lchan); + dtx_dispatch(lchan, E_COMPL); return 0; } @@ -307,6 +306,13 @@ return false; } +void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) +{ + if (dtx_dl_amr_enabled(lchan)) + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, e, + (void *)lchan); +} + /* repeat last SID if possible, returns SID length + 1 or 0 */ /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling -- To view, visit https://gerrit.osmocom.org/1202 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 11:36:34 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 11:36:34 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 (1 comment) https://gerrit.osmocom.org/#/c/1204/2/src/bts.cpp File src/bts.cpp: Line 559: I would swap the branches and simply check if (failure) { but that's purely cosmetic. -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 8 12:02:22 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 12:02:22 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 14:20:52 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 14:20:52 +0000 Subject: [PATCH] osmo-bts[master]: Add libosmocodec for octphy build Message-ID: Review at https://gerrit.osmocom.org/1210 Add libosmocodec for octphy build Similar to 45822227577cba5c6c4a4d4d61a7a9e8b4992c25 fix build by linking with libosmocode explicitly. Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 --- M src/osmo-bts-octphy/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/10/1210/1 diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index e0df9af..ac6a83e 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(OCTSDR2G_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = l1_if.h l1_oml.h l1_utils.h octphy_hw_api.h octpkt.h -- To view, visit https://gerrit.osmocom.org/1210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 14:27:51 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 14:27:51 +0000 Subject: [PATCH] osmo-bts[master]: Add libosmocodec for octphy build In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1210 to look at the new patch set (#2). Add libosmocodec for octphy build Similar to 45822227577cba5c6c4a4d4d61a7a9e8b4992c25 fix build by linking with libosmocodec explicitly. Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 --- M src/osmo-bts-octphy/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/10/1210/2 diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index e0df9af..ac6a83e 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(OCTSDR2G_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = l1_if.h l1_oml.h l1_utils.h octphy_hw_api.h octpkt.h -- To view, visit https://gerrit.osmocom.org/1210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 14:37:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 8 Nov 2016 14:37:03 +0000 Subject: osmo-bts[master]: Add libosmocodec for octphy build In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 accepting to check whether it fixes jenkins build -- To view, visit https://gerrit.osmocom.org/1210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 14:37:31 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 14:37:31 +0000 Subject: [MERGED] osmo-bts[master]: Add libosmocodec for octphy build In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Add libosmocodec for octphy build ...................................................................... Add libosmocodec for octphy build Similar to 45822227577cba5c6c4a4d4d61a7a9e8b4992c25 fix build by linking with libosmocodec explicitly. Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 --- M src/osmo-bts-octphy/Makefile.am 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-octphy/Makefile.am b/src/osmo-bts-octphy/Makefile.am index e0df9af..ac6a83e 100644 --- a/src/osmo-bts-octphy/Makefile.am +++ b/src/osmo-bts-octphy/Makefile.am @@ -1,6 +1,6 @@ AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) -I$(OCTSDR2G_INCDIR) -AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) -COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) +AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOCODEC_CFLAGS) $(LIBOSMOGSM_CFLAGS) $(LIBOSMOVTY_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOABIS_CFLAGS) $(LIBOSMOCTRL_CFLAGS) $(ORTP_CFLAGS) +COMMON_LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOCODEC_LIBS) $(LIBOSMOGSM_LIBS) $(LIBOSMOVTY_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOABIS_LIBS) $(LIBOSMOCTRL_LIBS) $(ORTP_LIBS) EXTRA_DIST = l1_if.h l1_oml.h l1_utils.h octphy_hw_api.h octpkt.h -- To view, visit https://gerrit.osmocom.org/1210 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 8 15:10:09 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 15:10:09 +0000 Subject: [PATCH] osmo-bts[master]: dtx_check.gawk: add check for repetitive SID FIRST Message-ID: Review at https://gerrit.osmocom.org/1211 dtx_check.gawk: add check for repetitive SID FIRST Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967 --- M contrib/dtx_check.gawk 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/11/1211/1 diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 3a3fa26..9a3ddcf 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,6 +40,10 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } + if ("FIRST" == $2 && "FIRST" == TYPE) { + CHK = "FAIL: multiple SID FIRST in a row." + ERR++ + } if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { -- To view, visit https://gerrit.osmocom.org/1211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 8 17:26:42 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 8 Nov 2016 17:26:42 +0000 Subject: osmo-pcu[master]: Handle packet assignement reject during EPDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (4 comments) https://gerrit.osmocom.org/#/c/1209/1/src/bts.cpp File src/bts.cpp: Line 1065: if(ul_tbf == NULL) { I would swap the branches and just use if (ul_tbf) {... Also, note the whitespace between if and ( Line 1174: if(ul_tbf == NULL) { same as above Line 1267: #if 0 what's that and why is it here? If you don't need this code just remove it. If you need but it's not working than fix it. https://gerrit.osmocom.org/#/c/1209/1/src/encoding.cpp File src/encoding.cpp: Line 703: bitvec_write_field(dest, wp, 100, 8); // WAIT_INDICATION value space at end of line -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 8 19:33:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 19:33:18 +0000 Subject: openbsc[master]: rsl: support for ericssons propritary SI13 format In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/1183/1/openbsc/src/libbsc/abis_rsl.c File openbsc/src/libbsc/abis_rsl.c: PS1, Line 247: 0x0C) Please use a #defien for that (in libosmocore) Line 249: msgb_tv_put(msg, 0xF2, 0x00); please have a proper #define for this IE (like RSL_IE_ERIC_BCCH_MAPPING) rather than using a magic number. PS1, Line 249: 0x00 #define for ERIC_BCCH_MAP_NORMAL 0x00 and ERIC_BCCH_MAP_EXTD 0x01, also in libosmocore/gsm/protocol/gsm_08_58.h -- To view, visit https://gerrit.osmocom.org/1183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 8 19:33:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 19:33:28 +0000 Subject: osmo-bts[master]: dtx_check.gawk: add check for repetitive SID FIRST In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 19:33:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 19:33:30 +0000 Subject: [MERGED] osmo-bts[master]: dtx_check.gawk: add check for repetitive SID FIRST In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: dtx_check.gawk: add check for repetitive SID FIRST ...................................................................... dtx_check.gawk: add check for repetitive SID FIRST Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967 --- M contrib/dtx_check.gawk 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/dtx_check.gawk b/contrib/dtx_check.gawk index 3a3fa26..9a3ddcf 100755 --- a/contrib/dtx_check.gawk +++ b/contrib/dtx_check.gawk @@ -40,6 +40,10 @@ CHK = "FAIL: " TYPE " followed by " $2 " instead of P2." ERR++ } + if ("FIRST" == $2 && "FIRST" == TYPE) { + CHK = "FAIL: multiple SID FIRST in a row." + ERR++ + } if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances: if ("UPDATE" == TYPE) { if (DELTA > U_MAX) { -- To view, visit https://gerrit.osmocom.org/1211 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 8 19:35:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 19:35:17 +0000 Subject: libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 8 19:35:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 8 Nov 2016 19:35:20 +0000 Subject: [MERGED] libosmocore[master]: Add logging and testing for FSM deallocation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Add logging and testing for FSM deallocation ...................................................................... Add logging and testing for FSM deallocation osmo_fsm_inst_alloc() logs allocation but osmo_fsm_inst_free() is silent. Fix this by adding log message for deallocation to make FSM lifecycle tracking easier. Also make sure it's covered by test suite. Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 --- M src/fsm.c M tests/fsm/fsm_test.c 2 files changed, 6 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/fsm.c b/src/fsm.c index f525f40..9dc6b98 100644 --- a/src/fsm.c +++ b/src/fsm.c @@ -233,6 +233,7 @@ */ void osmo_fsm_inst_free(struct osmo_fsm_inst *fi) { + LOGPFSM(fi, "Deallocated\n"); osmo_timer_del(&fi->timer); llist_del(&fi->list); talloc_free(fi); diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c index 29b31ef..edbba9e 100644 --- a/tests/fsm/fsm_test.c +++ b/tests/fsm/fsm_test.c @@ -89,7 +89,7 @@ .log_subsys = DMAIN, }; -static int foo(void) +static struct osmo_fsm_inst *foo(void) { struct osmo_fsm_inst *fi; @@ -115,7 +115,7 @@ OSMO_ASSERT(fi->state == ST_TWO); - return 0; + return fi; } static const struct log_info_cat default_categories[] = { @@ -134,6 +134,7 @@ int main(int argc, char **argv) { struct log_target *stderr_target; + struct osmo_fsm_inst *finst; osmo_fsm_log_addr(false); @@ -145,12 +146,12 @@ g_ctx = NULL; osmo_fsm_register(&fsm); - foo(); + finst = foo(); while (1) { osmo_select_main(0); } - + osmo_fsm_inst_free(finst); osmo_fsm_unregister(&fsm); exit(0); } -- To view, visit https://gerrit.osmocom.org/1172 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e5b55a1fff8e36cf61c7fb61d3e79c1f00e29d2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 8 20:09:51 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 8 Nov 2016 20:09:51 +0000 Subject: [PATCH] openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... Message-ID: Review at https://gerrit.osmocom.org/1212 gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info In case the link_info is deleted we have to stop handling the stored messages inside link_info. Not doing so can lead to invalid memory being accessed. Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/include/openbsc/gb_proxy.h M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gb_proxy_tlli.c 3 files changed, 24 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/12/1212/1 diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h index c396d2b..e10894f 100644 --- a/openbsc/include/openbsc/gb_proxy.h +++ b/openbsc/include/openbsc/gb_proxy.h @@ -208,7 +208,7 @@ struct gbproxy_link_info *gbproxy_update_link_state_dl( struct gbproxy_peer *peer, time_t now, struct gprs_gb_parse_context *parse_ctx); -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx); int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now); diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 111f052..1f21208 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -318,7 +318,7 @@ link_info->vu_gen_tx_bss = GBPROXY_INIT_VU_GEN_TX; } -static void gbproxy_flush_stored_messages(struct gbproxy_peer *peer, +static int gbproxy_flush_stored_messages(struct gbproxy_peer *peer, struct msgb *msg, time_t now, struct gbproxy_link_info* link_info, @@ -349,8 +349,13 @@ peer, link_info, &len_change, &tmp_parse_ctx); - gbproxy_update_link_state_after(peer, link_info, now, - &tmp_parse_ctx); + rc = gbproxy_update_link_state_after(peer, link_info, now, + &tmp_parse_ctx); + if (rc == 1) { + LOGP(DLLC, LOGL_NOTICE, "link_info deleted while flushing stored messages\n"); + msgb_free(stored_msg); + return -1; + } rc = gbprox_relay2sgsn(peer->cfg, stored_msg, msgb_bvci(msg), link_info->sgsn_nsei); @@ -364,6 +369,8 @@ parse_ctx->llc_msg_name : "BSSGP"); msgb_free(stored_msg); } + + return 0; } static int gbproxy_gsm48_to_peer(struct gbproxy_peer *peer, @@ -466,8 +473,9 @@ gsm48_hdr_msg_type(parse_ctx->g48_hdr) == GSM48_MT_GMM_ID_RESP; /* The IMSI is now available */ - gbproxy_flush_stored_messages(peer, msg, now, link_info, - parse_ctx); + if (gbproxy_flush_stored_messages(peer, msg, now, link_info, + parse_ctx) < 0) + return !is_ident_resp; gbproxy_reset_imsi_acquisition(link_info); diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c index 0aa0632..3b3b976 100644 --- a/openbsc/src/gprs/gb_proxy_tlli.c +++ b/openbsc/src/gprs/gb_proxy_tlli.c @@ -348,18 +348,18 @@ gbproxy_attach_link_info(peer, now, link_info); } -static void gbproxy_unregister_link_info(struct gbproxy_peer *peer, +static int gbproxy_unregister_link_info(struct gbproxy_peer *peer, struct gbproxy_link_info *link_info) { if (!link_info) - return; + return 1; if (link_info->tlli.ptmsi == GSM_RESERVED_TMSI && !link_info->imsi_len) { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list (P-TMSI or IMSI are not set)\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); - return; + return 1; } link_info->tlli.current = 0; @@ -371,7 +371,7 @@ gbproxy_reset_link(link_info); - return; + return 0; } int gbproxy_imsi_matches(struct gbproxy_config *cfg, @@ -668,12 +668,13 @@ return link_info; } -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx) { + int rc = 0; if (parse_ctx->invalidate_tlli && link_info) { int keep_info = peer->cfg->keep_link_infos == GBPROX_KEEP_ALWAYS || @@ -684,11 +685,12 @@ if (keep_info) { LOGP(DGPRS, LOGL_INFO, "Unregistering TLLI %08x\n", link_info->tlli.current); - gbproxy_unregister_link_info(peer, link_info); + rc = gbproxy_unregister_link_info(peer, link_info); } else { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); + rc = 1; } } else if (parse_ctx->to_bss && parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && link_info) { @@ -714,6 +716,8 @@ } gbproxy_remove_stale_link_infos(peer, now); + + return rc; } -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Tue Nov 8 20:09:52 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 8 Nov 2016 20:09:52 +0000 Subject: [PATCH] openbsc[master]: test/gbproxy: Test for possible memory corruption when link_... Message-ID: Review at https://gerrit.osmocom.org/1213 test/gbproxy: Test for possible memory corruption when link_info is freed This test is to trigger the use-after free issue in commit bff7b0d80972. If compiled with address-sanitizer the test will abort without the fix. Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/tests/gbproxy/gbproxy_test.c M openbsc/tests/gbproxy/gbproxy_test.ok 2 files changed, 296 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/13/1213/1 diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index b32ccb5..577daa9 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -4817,6 +4817,100 @@ cleanup_test(); } +static void test_gbproxy_stored_messages() +{ + struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); + struct sockaddr_in bss_peer[1] = {{0},}; + struct sockaddr_in sgsn_peer= {0}; + struct gprs_ra_id rai_bss = + {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96}; + struct gprs_ra_id rai_unknown = + {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96}; + uint16_t cell_id = 0x1234; + + const uint32_t ptmsi = 0xefe2b700; + const uint32_t local_tlli = 0xefe2b700; + + const uint32_t foreign_tlli1 = 0x8000dead; + + struct gbproxy_peer *peer; + unsigned bss_nu = 0; + unsigned sgsn_nu = 0; + + OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL)); + + bssgp_nsi = nsi; + gbcfg.nsi = bssgp_nsi; + gbcfg.nsip_sgsn_nsei = SGSN_NSEI; + gbcfg.core_mcc = 0; + gbcfg.core_mnc = 0; + gbcfg.core_apn = talloc_zero_size(NULL, 100); + gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar"); + gbcfg.patch_ptmsi = 0; + gbcfg.acquire_imsi = 1; + gbcfg.keep_link_infos = 0; + + configure_sgsn_peer(&sgsn_peer); + configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer)); + + printf("=== %s ===\n", __func__); + printf("--- Initialise SGSN ---\n\n"); + + connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI); + + printf("--- Initialise BSS 1 ---\n\n"); + + setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000); + setup_bssgp(nsi, &bss_peer[0], 0x1002); + + peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000); + OSMO_ASSERT(peer != NULL); + + send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002); + + gprs_dump_nsi(nsi); + dump_global(stdout, 0); + dump_peers(stdout, 0, 0, &gbcfg); + + printf("--- Establish first LLC connection ---\n\n"); + + send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_unknown, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_attach_req, sizeof(dtap_attach_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002, + foreign_tlli1, 0, NULL, 0, + GPRS_SAPI_GMM, sgsn_nu++, + dtap_identity_req, sizeof(dtap_identity_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "DETACH ACCEPT", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_detach_acc, sizeof(dtap_detach_acc)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_identity_resp, sizeof(dtap_identity_resp)); + + dump_peers(stdout, 0, 0, &gbcfg); + + dump_global(stdout, 0); + + gbprox_reset(&gbcfg); + gprs_ns_destroy(nsi); + nsi = NULL; + + cleanup_test(); +} + static struct log_info_cat gprs_categories[] = { [DGPRS] = { .name = "DGPRS", @@ -4870,6 +4964,7 @@ test_gbproxy_secondary_sgsn(); test_gbproxy_keep_info(); test_gbproxy_tlli_expire(); + test_gbproxy_stored_messages(); printf("===== GbProxy test END\n\n"); exit(EXIT_SUCCESS); diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 0ef976f..89f1f42 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -7059,5 +7059,206 @@ TLLI-Cache: 1 TLLI c0000d80, IMSI 12345678, AGE 0, IMSI matches +=== test_gbproxy_stored_messages === +--- Initialise SGSN --- + +MESSAGE to SGSN at 0x05060708:32000, msg length 12 +02 00 81 01 01 82 01 01 04 82 01 00 + +PROCESSING RESET_ACK from 0x05060708:32000 +03 01 82 01 01 04 82 01 00 + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0a + +result (RESET_ACK) = 1 + +PROCESSING ALIVE_ACK from 0x05060708:32000 +0b + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +06 + +result (ALIVE_ACK) = 1 + +PROCESSING UNBLOCK_ACK from 0x05060708:32000 +07 + +==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000 + +result (UNBLOCK_ACK) = 0 + +PROCESSING ALIVE from 0x05060708:32000 +0a + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0b + +result (ALIVE) = 1 + +--- Initialise BSS 1 --- + +Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096) + +PROCESSING RESET from 0x01020304:1111 +02 00 81 01 01 82 10 01 04 82 10 00 + +==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 9 +03 01 82 10 01 04 82 10 00 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0a + +result (RESET) = 9 + +PROCESSING ALIVE from 0x01020304:1111 +0a + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0b + +result (ALIVE) = 1 + +PROCESSING UNBLOCK from 0x01020304:1111 +06 + +==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +07 + +result (UNBLOCK) = 1 + +PROCESSING ALIVE_ACK from 0x01020304:1111 +0b + +result (ALIVE_ACK) = 0 + +Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098) + +PROCESSING BVC_RESET from 0x01020304:1111 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +CALLBACK, event 0, msg length 18, bvci 0x0000 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 22 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +result (BVC_RESET) = 22 + +PROCESSING BVC_RESET_ACK from 0x05060708:32000 +00 00 00 00 23 04 82 10 02 + +CALLBACK, event 0, msg length 5, bvci 0x0000 +00 00 00 00 23 04 82 10 02 + +NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 9 +00 00 00 00 23 04 82 10 02 + +result (BVC_RESET_ACK) = 9 + +Current NS-VCIs: + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + NS-VC Block count : 1 + +Gbproxy global: +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + TLLI-Cache: 0 +--- Establish first LLC connection --- + +PROCESSING ATTACH REQUEST from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +CALLBACK, event 0, msg length 75, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 28 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36 + +result (ATTACH REQUEST) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING IDENT REQUEST from 0x05060708:32000 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +CALLBACK, event 0, msg length 23, bvci 0x1002 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 27 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +result (IDENT REQUEST) = 27 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING DETACH ACCEPT from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +CALLBACK, event 0, msg length 32, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +result (DETACH ACCEPT) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 2, IMSI acquisition in progress +PROCESSING DETACH ACCEPT from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 09 08 06 00 0b 58 e3 + +CALLBACK, event 0, msg length 32, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 09 08 06 00 0b 58 e3 + +result (DETACH ACCEPT) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 3, IMSI acquisition in progress +PROCESSING IDENT RESPONSE from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 0d 08 16 08 11 12 13 14 15 16 17 18 b7 1b 9a + +CALLBACK, event 0, msg length 40, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 0d 08 16 08 11 12 13 14 15 16 17 18 b7 1b 9a + +NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 79 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 32 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 36 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +result (IDENT RESPONSE) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 00000000, IMSI 12131415161718, AGE 0, DE-REGISTERED +Gbproxy global: ===== GbProxy test END -- To view, visit https://gerrit.osmocom.org/1213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Wed Nov 9 09:30:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 09:30:47 +0000 Subject: osmo-pcu[master]: Handle Timing Advance IE properly In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I786bf7fc999d401cc3d9e7f1e7a1fba953b5d458 Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 09:30:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 09:30:49 +0000 Subject: [MERGED] osmo-pcu[master]: Handle Timing Advance IE properly In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Handle Timing Advance IE properly ...................................................................... Handle Timing Advance IE properly Move writing Timing Advance IE and Timing Advance Index into separate functions to simplify adding PTCCH support. This also fixes previous incorrect (and unused) code for writing Packet TA IE which has not set TS for TA. Change-Id: I786bf7fc999d401cc3d9e7f1e7a1fba953b5d458 Related: OS#1545 --- M src/encoding.cpp 1 file changed, 43 insertions(+), 31 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/encoding.cpp b/src/encoding.cpp index 7d3fa14..fb80eeb 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -35,6 +35,43 @@ #include #include +/* { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > } */ +static inline bool write_tai(bitvec *dest, unsigned& wp, int8_t tai) +{ + if (tai < 0) { /* No TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, wp, 0, 1); + return false; + } + /* TIMING_ADVANCE_INDEX: */ + bitvec_write_field(dest, wp, 1, 1); + bitvec_write_field(dest, wp, tai, 4); + return true; +} + +/* { 0 | 1 < TIMING_ADVANCE_VALUE : bit (6) > } */ +static inline void write_ta(bitvec *dest, unsigned& wp, int8_t ta) +{ + if (ta < 0) /* No TIMING_ADVANCE_VALUE: */ + bitvec_write_field(dest, wp, 0, 1); + else { /* TIMING_ADVANCE_VALUE: */ + bitvec_write_field(dest, wp, 1, 1); + bitvec_write_field(dest, wp, ta, 6); + } +} + +/* 3GPP TS 44.060 ? 12.12: + { 0 | 1 < TIMING_ADVANCE_VALUE : bit (6) > } + { 0 | 1 < TIMING_ADVANCE_INDEX : bit (4) > + < TIMING_ADVANCE_TIMESLOT_NUMBER : bit (3) > } + */ +static inline void write_ta_ie(bitvec *dest, unsigned& wp, + int8_t ta, int8_t tai, uint8_t ts) +{ + write_ta(dest, wp, ta); + if (write_tai(dest, wp, tai)) /* TIMING_ADVANCE_TIMESLOT_NUMBER: */ + bitvec_write_field(dest, wp, ts, 3); +} + static int write_ia_rest_downlink( gprs_rlcmac_dl_tbf *tbf, bitvec * dest, unsigned& wp, @@ -62,12 +99,7 @@ bitvec_write_field(dest, wp,gamma,5); // GAMMA power control parameter bitvec_write_field(dest, wp,polling,1); // Polling Bit bitvec_write_field(dest, wp, ta_valid, 1); // N. B: NOT related to TAI! - if (ta_idx < 0) { - bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off - } else { - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on - bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX - } + write_tai(dest, wp, ta_idx); if (polling) { bitvec_write_field(dest, wp,0x1,1); // TBF Starting TIME present bitvec_write_field(dest, wp,(fn / (26 * 51)) % 32,5); // T1' @@ -110,12 +142,7 @@ } else bitvec_write_field(dest, wp,0x0,1); // ALPHA = not present bitvec_write_field(dest, wp,gamma,5); // GAMMA power control parameter - if (ta_idx < 0) { - bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off - } else { - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on - bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX - } + write_tai(dest, wp, ta_idx); bitvec_write_field(dest, wp, 1, 1); // TBF_STARTING_TIME_FLAG bitvec_write_field(dest, wp,(fn / (26 * 51)) % 32,5); // T1' bitvec_write_field(dest, wp,fn % 51,6); // T3 @@ -311,6 +338,8 @@ // TODO We should use our implementation of encode RLC/MAC Control messages. unsigned wp = 0; uint8_t ts; + /* timeslot assigned for the Continuous Timing Advance procedure */ + uint8_t ta_ts = 0; /* FIXME: supply it as parameter from caller */ bitvec_write_field(dest, wp,0x1,2); // Payload Type bitvec_write_field(dest, wp,0x0,2); // Uplink block with TDMA framenumber (N+13) @@ -334,15 +363,7 @@ bitvec_write_field(dest, wp,0x0,1); // Message escape bitvec_write_field(dest, wp,tbf->current_cs().to_num()-1, 2); // CHANNEL_CODING_COMMAND bitvec_write_field(dest, wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_VALUE = on - bitvec_write_field(dest, wp,tbf->ta(),6); // TIMING_ADVANCE_VALUE - if (ta_idx < 0) { - bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off - } else { - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on - bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX - } - + write_ta_ie(dest, wp,tbf->ta(), ta_idx, ta_ts); } else { /* EPGRS */ unsigned int ws_enc = (tbf->m_window.ws() - 64) / 32; bitvec_write_field(dest, wp,0x1,1); // Message escape @@ -357,16 +378,7 @@ bitvec_write_field(dest, wp,0x0,1); // No ARAC RETRANSMISSION REQUEST bitvec_write_field(dest, wp,0x1,1); // TLLI_BLOCK_CHANNEL_CODING bitvec_write_field(dest, wp,0x0,1); // No BEP_PERIOD2 - - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_VALUE = on - bitvec_write_field(dest, wp,tbf->ta(),6); // TIMING_ADVANCE_VALUE - if (ta_idx < 0) { - bitvec_write_field(dest, wp,0x0,1); // switch TIMING_ADVANCE_INDEX = off - } else { - bitvec_write_field(dest, wp,0x1,1); // switch TIMING_ADVANCE_INDEX = on - bitvec_write_field(dest, wp,ta_idx,4); // TIMING_ADVANCE_INDEX - } - + write_ta_ie(dest, wp,tbf->ta(), ta_idx, ta_ts); bitvec_write_field(dest, wp,0x0,1); // No Packet Extended Timing Advance } -- To view, visit https://gerrit.osmocom.org/552 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I786bf7fc999d401cc3d9e7f1e7a1fba953b5d458 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 9 09:33:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 09:33:45 +0000 Subject: osmo-bts[master]: Fix AGCH/PCH proportional allocation In-Reply-To: References: Message-ID: Patch Set 2: can you please explain how this was tested? was it tested with both BS_AG_BLKS_RES == 1 as well as other settings? -- To view, visit https://gerrit.osmocom.org/1099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:10:28 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 9 Nov 2016 10:10:28 +0000 Subject: [PATCH] openbsc[master]: test/gbproxy: Test for possible memory corruption when link_... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1213 to look at the new patch set (#2). test/gbproxy: Test for possible memory corruption when link_info is freed This test is to trigger the use-after free issue in commit bff7b0d80972. If compiled with address-sanitizer the test will abort without the fix. Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/tests/gbproxy/gbproxy_test.c M openbsc/tests/gbproxy/gbproxy_test.ok 2 files changed, 276 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/13/1213/2 diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index b32ccb5..577daa9 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -4817,6 +4817,100 @@ cleanup_test(); } +static void test_gbproxy_stored_messages() +{ + struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); + struct sockaddr_in bss_peer[1] = {{0},}; + struct sockaddr_in sgsn_peer= {0}; + struct gprs_ra_id rai_bss = + {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96}; + struct gprs_ra_id rai_unknown = + {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96}; + uint16_t cell_id = 0x1234; + + const uint32_t ptmsi = 0xefe2b700; + const uint32_t local_tlli = 0xefe2b700; + + const uint32_t foreign_tlli1 = 0x8000dead; + + struct gbproxy_peer *peer; + unsigned bss_nu = 0; + unsigned sgsn_nu = 0; + + OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL)); + + bssgp_nsi = nsi; + gbcfg.nsi = bssgp_nsi; + gbcfg.nsip_sgsn_nsei = SGSN_NSEI; + gbcfg.core_mcc = 0; + gbcfg.core_mnc = 0; + gbcfg.core_apn = talloc_zero_size(NULL, 100); + gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar"); + gbcfg.patch_ptmsi = 0; + gbcfg.acquire_imsi = 1; + gbcfg.keep_link_infos = 0; + + configure_sgsn_peer(&sgsn_peer); + configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer)); + + printf("=== %s ===\n", __func__); + printf("--- Initialise SGSN ---\n\n"); + + connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI); + + printf("--- Initialise BSS 1 ---\n\n"); + + setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000); + setup_bssgp(nsi, &bss_peer[0], 0x1002); + + peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000); + OSMO_ASSERT(peer != NULL); + + send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002); + + gprs_dump_nsi(nsi); + dump_global(stdout, 0); + dump_peers(stdout, 0, 0, &gbcfg); + + printf("--- Establish first LLC connection ---\n\n"); + + send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_unknown, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_attach_req, sizeof(dtap_attach_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002, + foreign_tlli1, 0, NULL, 0, + GPRS_SAPI_GMM, sgsn_nu++, + dtap_identity_req, sizeof(dtap_identity_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "DETACH ACCEPT", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_detach_acc, sizeof(dtap_detach_acc)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_identity_resp, sizeof(dtap_identity_resp)); + + dump_peers(stdout, 0, 0, &gbcfg); + + dump_global(stdout, 0); + + gbprox_reset(&gbcfg); + gprs_ns_destroy(nsi); + nsi = NULL; + + cleanup_test(); +} + static struct log_info_cat gprs_categories[] = { [DGPRS] = { .name = "DGPRS", @@ -4870,6 +4964,7 @@ test_gbproxy_secondary_sgsn(); test_gbproxy_keep_info(); test_gbproxy_tlli_expire(); + test_gbproxy_stored_messages(); printf("===== GbProxy test END\n\n"); exit(EXIT_SUCCESS); diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 0ef976f..737aec0 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -7059,5 +7059,186 @@ TLLI-Cache: 1 TLLI c0000d80, IMSI 12345678, AGE 0, IMSI matches +=== test_gbproxy_stored_messages === +--- Initialise SGSN --- + +MESSAGE to SGSN at 0x05060708:32000, msg length 12 +02 00 81 01 01 82 01 01 04 82 01 00 + +PROCESSING RESET_ACK from 0x05060708:32000 +03 01 82 01 01 04 82 01 00 + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0a + +result (RESET_ACK) = 1 + +PROCESSING ALIVE_ACK from 0x05060708:32000 +0b + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +06 + +result (ALIVE_ACK) = 1 + +PROCESSING UNBLOCK_ACK from 0x05060708:32000 +07 + +==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000 + +result (UNBLOCK_ACK) = 0 + +PROCESSING ALIVE from 0x05060708:32000 +0a + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0b + +result (ALIVE) = 1 + +--- Initialise BSS 1 --- + +Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096) + +PROCESSING RESET from 0x01020304:1111 +02 00 81 01 01 82 10 01 04 82 10 00 + +==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 9 +03 01 82 10 01 04 82 10 00 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0a + +result (RESET) = 9 + +PROCESSING ALIVE from 0x01020304:1111 +0a + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0b + +result (ALIVE) = 1 + +PROCESSING UNBLOCK from 0x01020304:1111 +06 + +==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +07 + +result (UNBLOCK) = 1 + +PROCESSING ALIVE_ACK from 0x01020304:1111 +0b + +result (ALIVE_ACK) = 0 + +Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098) + +PROCESSING BVC_RESET from 0x01020304:1111 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +CALLBACK, event 0, msg length 18, bvci 0x0000 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 22 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +result (BVC_RESET) = 22 + +PROCESSING BVC_RESET_ACK from 0x05060708:32000 +00 00 00 00 23 04 82 10 02 + +CALLBACK, event 0, msg length 5, bvci 0x0000 +00 00 00 00 23 04 82 10 02 + +NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 9 +00 00 00 00 23 04 82 10 02 + +result (BVC_RESET_ACK) = 9 + +Current NS-VCIs: + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + NS-VC Block count : 1 + +Gbproxy global: +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + TLLI-Cache: 0 +--- Establish first LLC connection --- + +PROCESSING ATTACH REQUEST from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +CALLBACK, event 0, msg length 75, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 28 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36 + +result (ATTACH REQUEST) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING IDENT REQUEST from 0x05060708:32000 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +CALLBACK, event 0, msg length 23, bvci 0x1002 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 27 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +result (IDENT REQUEST) = 27 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING DETACH ACCEPT from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +CALLBACK, event 0, msg length 32, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +result (DETACH ACCEPT) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 2, IMSI acquisition in progress +PROCESSING IDENT RESPONSE from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3 + +CALLBACK, event 0, msg length 40, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 79 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +result (IDENT RESPONSE) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI-Cache: 0 +Gbproxy global: ===== GbProxy test END -- To view, visit https://gerrit.osmocom.org/1213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:43:19 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 10:43:19 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1209 to look at the new patch set (#2). Handle packet access reject during EPDAN/PDAN with channel description When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 9 files changed, 137 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/1209/2 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..5d69300 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1054,16 +1054,23 @@ } /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we pacekt access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ if (tbf->ms()) { @@ -1156,16 +1163,23 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we send packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ diff --git a/src/encoding.cpp b/src/encoding.cpp index fb80eeb..6af2395 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -1313,3 +1313,27 @@ return AR_NEED_MORE_BLOCKS; } + +/* + * Refer 44.060 version 7.27.0 Release 7 + * section 7.1.3.2.1 On receipt of a PACKET RESOURCE REQUEST message + * 8.1.2.5 Establishment of uplink TBF + */ +void Encoding::write_packet_access_reject( + bitvec * dest, uint32_t tlli) +{ + unsigned wp = 0; + + bitvec_write_field(dest, wp, 0x1, 2); // Payload Type + bitvec_write_field(dest, wp, 0x0, 2); // Uplink block with TDMA FN + bitvec_write_field(dest, wp, 0, 1); // No Polling Bit + bitvec_write_field(dest, wp, 0x0, 3); // Uplink state flag + bitvec_write_field(dest, wp, 0x21, 6); // MESSAGE TYPE + bitvec_write_field(dest, wp, 0, 2); // fixed 00 + bitvec_write_field(dest, wp, 0x0, 1); // TLLI / G-RNTI : bit (32) + bitvec_write_field(dest, wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI + bitvec_write_field(dest, wp, 1, 1); // WAIT_INDICATION size in seconds + /* TODO: make it configurable */ + bitvec_write_field(dest, wp, 5, 8); // WAIT_INDICATION value + bitvec_write_field(dest, wp, 0, 1); // WAIT_INDICATION size in seconds +} diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..54bbc8a 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -68,6 +68,9 @@ static void encode_rbb(const char *show_rbb, uint8_t *rbb); + static void write_packet_access_reject( + bitvec * dest, uint32_t tlli); + static void write_packet_uplink_ack( struct gprs_rlcmac_bts *bts, bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final, diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index f486075..a3723df 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -72,7 +72,8 @@ *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = dl_tbf; } @@ -137,7 +138,11 @@ */ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - msg = ul_ass_tbf->create_ul_ass(fn, ts); + if (tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else + msg = ul_ass_tbf->create_ul_ass(fn, ts); else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF) msg = dl_ass_tbf->create_dl_ass(fn, ts); else if (tbf == ul_ack_tbf) diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..83ec05d 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1013,6 +1013,31 @@ return msg; } +struct msgb *gprs_rlcmac_tbf::create_packet_access_reject() +{ + struct msgb *msg; + + msg = msgb_alloc(23, "rlcmac_ul_ass_rej"); + + bitvec *packet_access_rej = bitvec_alloc(23); + + bitvec_unhex(packet_access_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + Encoding::write_packet_access_reject( + packet_access_rej, tlli()); + + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); + + bitvec_free(packet_access_rej); + ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + + /* start timer */ + tbf_timer_start(this, 0, Tassign_pacch); + return msg; + +} + struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) { struct msgb *msg; diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..e044053 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,7 @@ enum gprs_rlcmac_tbf_ul_ass_state { GPRS_RLCMAC_UL_ASS_NONE = 0, GPRS_RLCMAC_UL_ASS_SEND_ASS, /* send uplink assignment on next RTS */ + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ, /* send assignment reject next RTS */ GPRS_RLCMAC_UL_ASS_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; @@ -103,6 +104,7 @@ struct msgb *create_dl_ass(uint32_t fn, uint8_t ts); struct msgb *create_ul_ass(uint32_t fn, uint8_t ts); + struct msgb *create_packet_access_reject(); GprsMs *ms() const; void set_ms(GprsMs *ms); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..9689f08 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2749,6 +2749,29 @@ ARRAY_SIZE(default_categories), }; +void test_packet_access_rej_epdan() +{ + BTS the_bts; + uint32_t tlli = 0xffeeddcc; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, 4); + static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(&the_bts, 1); + + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + struct msgb *msg = dl_tbf->create_packet_access_reject(); + + printf("packet reject: %s\n", + osmo_hexdump(msg->data, 23)); + + OSMO_ASSERT(!strcmp(osmo_hexdump(msg->data, 23), + "40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ")); + printf("=== end %s ===\n", __func__); + +} + + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -2791,6 +2814,7 @@ test_tbf_update_ws(); test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); + test_packet_access_rej_epdan(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fc3a113..b6d9c66 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6627,3 +6627,28 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) starting timer 0. diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 2978d6d..1895a2c 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -68,3 +68,6 @@ === end test_tbf_li_decoding === === start test_tbf_epdan_out_of_rx_window === === end test_tbf_epdan_out_of_rx_window === +=== start test_packet_access_rej_epdan === +packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_packet_access_rej_epdan === -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:43:20 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 10:43:20 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during packet resource request Message-ID: Review at https://gerrit.osmocom.org/1216 Handle packet access reject during packet resource request When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 7 files changed, 329 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/16/1216/1 diff --git a/src/bts.cpp b/src/bts.cpp index 5d69300..62dfd55 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1262,8 +1262,13 @@ egprs_ms_class); ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, egprs_ms_class, tlli, ta, ms); - if (!ul_tbf) + + /* if no resource send packet resource request */ + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); return; + } /* set control ts to current MS's TS, until assignment complete */ LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a3723df..a8b716d 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -56,7 +56,9 @@ *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || ul_tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } @@ -136,8 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - - if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) + if (tbf == ul_ass_tbf && tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else if (tbf == ul_ass_tbf && tbf->direction == + GPRS_RLCMAC_DL_TBF) if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) msg = ul_ass_tbf->create_packet_access_reject(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 83ec05d..8fa09ba 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1262,3 +1262,32 @@ { return ts == control_ts; } + +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts) +{ + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); + if (!ul_tbf) + return; + + talloc_set_destructor(ul_tbf, ul_tbf_dtor); + new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + if (!ms) + ms = bts->bts->ms_alloc(0, 0); + + ms->set_tlli(tlli); + + llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + ul_tbf->bts->tbf_ul_created(); + ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + + ul_tbf->set_ms(ms); + ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + ul_tbf->control_ts = ts; + ul_tbf->trx = trx; +} diff --git a/src/tbf.h b/src/tbf.h index e044053..518c2ce 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -264,6 +264,8 @@ uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 9689f08..96e8790 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2749,6 +2749,81 @@ ARRAY_SIZE(default_categories), }; +static void test_packet_access_rej_prr() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + uint8_t trx_no = 0; + RlcMacUplink_t ulreq = {0}; + Packet_Resource_Request_t *presreq = NULL; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + uint32_t rach_fn = fn - 51; + uint32_t sba_fn = fn + 52; + uint32_t tlli = 0xffeeddcc; + MS_Radio_Access_capability_t *pmsradiocap = NULL; + Multislot_capability_t *pmultislotcap = NULL; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + int rc = 0; + + /* + * Trigger rach till resources(USF) exhaust + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + presreq = &ulreq.u.Packet_Resource_Request; + presreq->PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + presreq->ID.UnionType = 1; /* != 0 */ + presreq->ID.u.TLLI = tlli; + presreq->Exist_MS_Radio_Access_capability = 1; + pmsradiocap = &presreq->MS_Radio_Access_capability; + pmsradiocap->Count_MS_RA_capability_value = 1; + pmsradiocap->MS_RA_capability_value[0].u.Content. + Exist_Multislot_capability = 1; + pmultislotcap = &pmsradiocap->MS_RA_capability_value[0]. + u.Content.Multislot_capability; + + pmultislotcap->Exist_GPRS_multislot_class = 1; + pmultislotcap->GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + pmultislotcap->Exist_EGPRS_multislot_class = 1; + pmultislotcap->EGPRS_multislot_class = egprs_ms_class; + } + + send_ul_mac_block(&the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* trigger packet access reject */ + uint8_t bn = fn2bn(fn); + + rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), + trx_no, ts_no, fn, bn); + + OSMO_ASSERT(rc == 0); + + printf("=== end %s ===\n", __func__); +} + void test_packet_access_rej_epdan() { BTS the_bts; @@ -2815,6 +2890,7 @@ test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); test_packet_access_rej_epdan(); + test_packet_access_rej_prr(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index b6d9c66..efe20db 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6652,3 +6652,209 @@ The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) starting timer 0. +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled! +MS supports EGPRS multislot class 11. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource +Creating MS object, TLLI = 0x00000000 +Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN +Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer 0. +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Destroying MS object, TLLI = 0x00000000 diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 1895a2c..b73d1e3 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -71,3 +71,5 @@ === start test_packet_access_rej_epdan === packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_packet_access_rej_epdan === +=== start test_packet_access_rej_prr === +=== end test_packet_access_rej_prr === -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:43:56 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 10:43:56 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 2: (4 comments) https://gerrit.osmocom.org/#/c/1209/1/src/bts.cpp File src/bts.cpp: Line 1065: if (ul_tbf) { > I would swap the branches and just use if (ul_tbf) {... Done Line 1174: if (ul_tbf) { > same as above Done Line 1267: > what's that and why is it here? If you don't need this code just remove it. Done https://gerrit.osmocom.org/#/c/1209/1/src/encoding.cpp File src/encoding.cpp: Line 703: tbf->current_cs().to_num() - 1, 4); > space at end of line Done -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:45:07 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 9 Nov 2016 10:45:07 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d61 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:57:23 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 10:57:23 +0000 Subject: [PATCH] osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Hello Max, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1204 to look at the new patch set (#3). Handle Immediate assignment reject When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 8 files changed, 520 insertions(+), 68 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/04/1204/3 diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..4e6b5e9 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,32 +475,42 @@ uint8_t trx_no, ts_no = 0; uint8_t sb = 0; uint32_t sb_fn = 0; - int rc; + int rc = 0; int plen; uint8_t usf = 7; - uint8_t tsc, ta = qta2ta(qta); + uint8_t tsc = 0, ta = qta2ta(qta); uint16_t ms_class = 0; uint16_t priority = 0; + bool failure = false; rach_frame(); - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " - "one:\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, " + "so we provide one \n" + "ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); sb = is_single_block(ra, burst_type, is_11bit, &ms_class, &priority); if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); - if (rc < 0) - return rc; - LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH qbit-ta=%d " - "ra=0x%02x, Fn=%d (%d,%d,%d), SBFn=%d\n", - qta, ra, - Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, - sb_fn); - LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment Uplink " - "(AGCH)\n"); - tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + if (rc < 0) { + failure = true; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource for " + "single block allocation." + "sending Immediate " + "Assignment Uplink (AGCH) reject\n"); + } else { + tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH " + " qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)," + " SBFn=%d\n", + qta, ra, + Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, + sb_fn); + LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment " + "Uplink (AGCH)\n"); + } } else { // Create new TBF #warning "Copy and paste with other routines.." @@ -515,47 +525,60 @@ } if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); - /* FIXME: send reject */ - return -EBUSY; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " + "Immediate Assignment Uplink (AGCH) " + "reject\n"); + rc = -EBUSY; + failure = true; + } else { + tbf->set_ta(ta); + tbf->set_state(GPRS_RLCMAC_FLOW); + tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + tbf_timer_start(tbf, 3169, m_bts.t3169, 0); + LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", + tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " + "qbit-ta=%d ra=0x%02x, Fn=%d " + " (%d,%d,%d)\n", + tbf_name(tbf), + qta, ra, Fn, (Fn / (26 * 51)) % 32, + Fn % 51, Fn % 26); + LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " + "Assignment Uplink (AGCH)\n", + tbf_name(tbf)); + trx_no = tbf->trx->trx_no; + ts_no = tbf->first_ts; + usf = tbf->m_usf[ts_no]; + tsc = tbf->tsc(); } - tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - tbf_timer_start(tbf, 3169, m_bts.t3169, 0); - LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", - tbf_name(tbf)); - LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " - "qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)\n", - tbf_name(tbf), - qta, ra, Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26); - LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " - "Assignment Uplink (AGCH)\n", tbf_name(tbf)); - trx_no = tbf->trx->trx_no; - ts_no = tbf->first_ts; - usf = tbf->m_usf[ts_no]; - tsc = tbf->tsc(); } bitvec *immediate_assignment = bitvec_alloc(22) /* without plen */; bitvec_unhex(immediate_assignment, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); - LOGP(DRLCMAC, LOGL_DEBUG, - " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", - trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, - tbf ? tbf->tfi() : -1, usf); - plen = Encoding::write_immediate_assignment( - tbf, immediate_assignment, 0, ra, Fn, ta, - m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, - m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + if (failure) + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment, ra, Fn, + burst_type); + else { + LOGP(DRLCMAC, LOGL_DEBUG, + " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", + trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, + tbf ? tbf->tfi() : -1, usf); + + plen = Encoding::write_immediate_assignment( + tbf, immediate_assignment, 0, ra, Fn, ta, + m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, + m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + } if (plen >= 0) pcu_l1if_tx_agch(immediate_assignment, plen); bitvec_free(immediate_assignment); - return 0; + return rc; } uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/encoding.cpp b/src/encoding.cpp index fb80eeb..ca72b0f 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -242,6 +242,84 @@ } /* + * Immediate assignment reject, sent on the CCCH/AGCH + * see GSM 44.018, 9.1.20 + 10.5.2.30 + */ +int Encoding::write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type) +{ + unsigned wp = 0; + int plen; + int i; + + bitvec_write_field(dest, wp, 0x0, 4); // Skip Indicator + bitvec_write_field(dest, wp, 0x6, 4); // Protocol Discriminator + bitvec_write_field(dest, wp, 0x3A, 8); // Immediate Assign Message Type + + // feature indicator + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // no cs + bitvec_write_field(dest, wp, 0x1, 1); // implicit detach for PS + + bitvec_write_field(dest, wp, 0x0, 4); // Page Mode + /* + * 9.1.20.2 of 44.018 version 11.7.0 Release 11 + * Filling of the message + * If necessary the request reference information element and the + * wait indication information element should be duplicated to + * fill the message. + * TODO: group rejection for multiple MS + */ + for (i = 0; i < 4; i++) { + //10.5.2.30 Request Reference + if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + bitvec_write_field(dest, wp, 0x7f, 8); /* RACH value */ + } else { + bitvec_write_field(dest, wp, ra, 8); /* RACH value */ + } + + bitvec_write_field(dest, wp, + (ref_fn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, wp, ref_fn % 51, 6); // T3 + bitvec_write_field(dest, wp, ref_fn % 26, 5); // T2 + + /* TODO: Make it configurable */ + bitvec_write_field(dest, wp, 20, 8); //Wait Indication 1 + } + + plen = wp / 8; + + if ((wp % 8)) { + LOGP(DRLCMACUL, LOGL_ERROR, "Length of IMM.ASS.Rej without" + "rest octets is not multiple of 8 bits, PLEASE FIX!\n"); + return -1; + } + + // Extended RA + else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + uint8_t extended_ra = 0; + + extended_ra = (ra & 0x1F); + bitvec_write_field(dest, wp, 0x1, 1); + bitvec_write_field(dest, wp, extended_ra, 5); /* Extended RA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); + } + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + + return plen; +} + +/* * Immediate assignment, sent on the CCCH/AGCH * see GSM 04.08, 9.1.18 and GSM 44.018, 9.1.18 + 10.5.2.16 */ diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..79dc32d 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -52,6 +52,12 @@ GSM_L1_BURST_TYPE_ACCESS_0, uint8_t sb = 1); + static int write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type + ); + static void write_packet_uplink_assignment( struct gprs_rlcmac_bts *bts, bitvec * dest, uint8_t old_tfi, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..339390b 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1372,6 +1372,88 @@ printf("=== end %s ===\n", __func__); } +/* + * Trigger rach for single block + */ +static void test_immediate_assign_rej_single_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + the_bts.bts_data()->trx[0].pdch[ts_no].disable(); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment + * Uplink reject on the AGCH + */ + rc = the_bts.rcv_rach(0x70, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EINVAL); + + printf("=== end %s ===\n", __func__); +} + +/* + * Trigger rach till resources(USF) exhaust + */ +static void test_immediate_assign_rej_multi_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment Uplink + * reject on the AGCH + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7f, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EBUSY); + + printf("=== end %s ===\n", __func__); +} + +static void test_immediate_assign_rej() +{ + test_immediate_assign_rej_multi_block(); + test_immediate_assign_rej_single_block(); +} + static void test_tbf_two_phase() { BTS the_bts; @@ -2791,6 +2873,7 @@ test_tbf_update_ws(); test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); + test_immediate_assign_rej(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fc3a113..627cdc3 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1510,7 +1510,8 @@ MSG = 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654167 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -1531,7 +1532,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -1584,9 +1585,10 @@ Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1669,9 +1671,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1803,9 +1806,10 @@ - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-4): 07 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654232 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8c f6 07 00 c0 0c 68 ab 2b 2b 2b 2b 2b 2b 2b @@ -1879,9 +1883,10 @@ Modifying MS object, TLLI: 0xf5667788 confirmed New MS: TLLI = 0xf5667788, TA = 7, IMSI = 0011223344, LLC = 1 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1972,9 +1977,10 @@ Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654224 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b ee 07 00 c0 0c 60 6b 2b 2b 2b 2b 2b 2b 2b @@ -2056,9 +2062,10 @@ - No gaps in received block, last block: BSN=0 CV=15 New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -2150,7 +2157,8 @@ ********** TBF ends here ********** Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654275 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -2171,7 +2179,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -2210,9 +2218,10 @@ - Scheduling Ack/Nack, because last block has CV==0. New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3344,9 +3353,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3436,9 +3446,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6198,9 +6209,10 @@ Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6370,9 +6382,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6627,3 +6640,209 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7f Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b +Destroying MS object, TLLI = 0x00000000 +MS requests UL TBF on RACH, so we provide one +ra=0x70 Fn=2654167 qta=31 is_11bit=0: +MS requests single block allocation +No PDCH available. +No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 2978d6d..f921dfc 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -68,3 +68,7 @@ === end test_tbf_li_decoding === === start test_tbf_epdan_out_of_rx_window === === end test_tbf_epdan_out_of_rx_window === +=== start test_immediate_assign_rej_multi_block === +=== end test_immediate_assign_rej_multi_block === +=== start test_immediate_assign_rej_single_block === +=== end test_immediate_assign_rej_single_block === diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 8b3cfd1..ee1c817 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -427,6 +427,42 @@ } } +void test_immediate_assign_rej() +{ + uint8_t plen; + bitvec *immediate_assignment_rej = bitvec_alloc(22); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_1); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x7f); + /* Extended RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[19] == 0xc0); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_0); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x70); + +} + int main(int argc, char **argv) { osmo_init_logging(&gprs_log_info); @@ -439,6 +475,7 @@ test_rlc_v_b(); test_rlc_v_n(); test_rlc_dl_ul_basic(); + test_immediate_assign_rej(); return EXIT_SUCCESS; } diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index cb40d39..fe5162c 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -6,3 +6,5 @@ rbb: 10 00 00 00 00 00 00 01 show_rbb: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR show_rbb: IIRRIIIR +assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b +assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 9 10:59:07 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 9 Nov 2016 10:59:07 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 11:00:53 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 11:00:53 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 3: Harald & Holger, Any updates on this patch? -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 11:26:04 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 11:26:04 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 12:03:29 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 12:03:29 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: Hi Holger, Our main intention with this patch was to test atleast 4 MSs having same resources allocated without re-compiling the PCU version. There may be a draw back with max MSs(more than 8) being served with this patch. Please let me know how we can proceed over this patch. Thanks, Aravind Sirsikar -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 12:22:00 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 9 Nov 2016 12:22:00 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 5: Any updates on this patch? -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 13:56:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 13:56:26 +0000 Subject: [PATCH] openbsc[master]: SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP Message-ID: Review at https://gerrit.osmocom.org/1217 SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP The GTP protocol specification requires us to include the MSISDN IE in all non-secondary PDP context activations. However, when no real HLR is used (e.g. via GSUP), we do not have the MSISDN information available and so far simply sent a zero-length MSISDN IE in GTP. The latter is a violation of the spec. So to resolve this, we now send a 15-digit all-zero dummy MSISDN IE, as described in TS 23.003. Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 14 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/1217/1 diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 29c9f06..072b9ba 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -59,6 +59,15 @@ #include #include +/* TS 23.003: The MSISDN shall take the dummy MSISDN value composed of + * 15 digits set to 0 (encoded as an E.164 international number) when + * the MSISDN is not available in messages in which the presence of the + * MSISDN parameter */ +static const uint8_t dummy_msisdn[] = + { 0x91, /* No extension, international, E.164 */ + 0, 0, 0, 0, 0, 0, 0, /* 14 digits of zeroes */ + 0xF0 /* 15th digit of zero + padding */ }; + const struct value_string gtp_cause_strs[] = { { GTPCAUSE_REQ_IMSI, "Request IMSI" }, { GTPCAUSE_REQ_IMEI, "Request IMEI" }, @@ -167,12 +176,16 @@ /* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */ /* Put the MSISDN in case we have it */ - if (mmctx->subscr) { + if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) { pdp->msisdn.l = mmctx->subscr->sgsn_data->msisdn_len; if (pdp->msisdn.l > sizeof(pdp->msisdn.v)) pdp->msisdn.l = sizeof(pdp->msisdn.v); memcpy(pdp->msisdn.v, mmctx->subscr->sgsn_data->msisdn, pdp->msisdn.l); + } else { + /* use the dummy 15-digits-zero MSISDN value */ + pdp->msisdn.l = sizeof(dummy_msisdn); + memcpy(pdp->msisdn.v, dummy_msisdn, pdp->msisdn.l); } /* End User Address from GMM requested PDP address */ -- To view, visit https://gerrit.osmocom.org/1217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 9 14:02:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 9 Nov 2016 14:02:53 +0000 Subject: osmo-bts[master]: Fix AGCH/PCH proportional allocation In-Reply-To: References: Message-ID: Patch Set 2: Was tested with BS_AG_BLKS_RES set to 1 and 5 on openbsc side. I have not tested the client-side view though. I can re-test using xgoldmon for example to check how it looks like for the phone. -- To view, visit https://gerrit.osmocom.org/1099 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 14:17:49 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 9 Nov 2016 14:17:49 +0000 Subject: [PATCH] openbsc[master]: abis_om2000: for TS conf of dyn TS, always send TCH/F as cha... Message-ID: Review at https://gerrit.osmocom.org/1218 abis_om2000: for TS conf of dyn TS, always send TCH/F as chan comb Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1218/1 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 9 14:45:59 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Nov 2016 14:45:59 +0000 Subject: [PATCH] osmo-bts[master]: fix 'osmo-bts-* --version' segfault Message-ID: Review at https://gerrit.osmocom.org/1219 fix 'osmo-bts-* --version' segfault Call vty_init() before handle_options() to make sure the host.app_info is populated before --version potentially tries to print it. Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 --- M src/common/main.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/19/1219/1 diff --git a/src/common/main.c b/src/common/main.c index 60839df..1b2549e 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -227,6 +227,7 @@ msgb_talloc_ctx_init(tall_bts_ctx, 100*1024); bts_log_init(NULL); + vty_init(&bts_vty_info); handle_options(argc, argv); @@ -242,7 +243,6 @@ exit(1); } } - vty_init(&bts_vty_info); e1inp_vty_init(); bts_vty_init(bts, &bts_log_info); -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:05:49 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Wed, 9 Nov 2016 15:05:49 +0000 Subject: openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1212/1/openbsc/src/gprs/gb_proxy.c File openbsc/src/gprs/gb_proxy.c: Line 478: return !is_ident_resp; Does this still make sense? just return 0? -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:36:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:36:26 +0000 Subject: [MERGED] openbsc[master]: OM2000: Fix state machien for CF/TRXC on START Result In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Fix state machien for CF/TRXC on START Result ...................................................................... OM2000: Fix state machien for CF/TRXC on START Result When receiving the 'Start Result' message, for CF and TRXC MO we directly transition to performing the Operational Info. In that case, we need to return after sending the Operational Info and skip the usual processing for the default case below. Change-Id: I99860d198b337ffe461b240bda20dc10e1b5b2cb --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 58d86c6..aeac876 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1518,7 +1518,7 @@ osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_OPINFO_ACCEPT, OM2K_TIMEOUT, 0); abis_om2k_tx_op_info(omfp->trx->bts, &omfp->mo->addr, 1); - break; + return; case OM2K_MO_CLS_DP: /* Transition directoy to WAIT_ENABLE_ACCEPT */ osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_ENABLE_ACCEPT, -- To view, visit https://gerrit.osmocom.org/1158 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I99860d198b337ffe461b240bda20dc10e1b5b2cb Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:36:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:36:28 +0000 Subject: [MERGED] openbsc[master]: WIP: OM2000: Full state machine implementation using osmo_fsm In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: WIP: OM2000: Full state machine implementation using osmo_fsm ...................................................................... WIP: OM2000: Full state machine implementation using osmo_fsm Our existing OM2000 code for initializing all Managed Objects of a BTS at startup was never complete. Rather than trying to fix the old-style code, introudce a hierarchy of osmo_fsm's reflecting the full protocol hand-shake and sequence of bringing up the individual MO's. If this works out well, it mihgt make sense to convert the TS 12.21 OML code for other BTS models, too. Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c --- M openbsc/include/openbsc/abis_om2000.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/bts_ericsson_rbs2000.c 4 files changed, 1,132 insertions(+), 286 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified Objections: lynxis lazus: I would prefer this is not merged as is diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index 2ff7270..5a7344f 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -41,13 +41,6 @@ OM2K_MO_S_DISABLED, }; -struct abis_om2k_mo { - uint8_t class; - uint8_t bts; - uint8_t assoc_so; - uint8_t inst; -} __attribute__ ((packed)); - /* on-wire format for IS conn group */ struct om2k_is_conn_grp { uint16_t icp1; @@ -90,6 +83,10 @@ int abis_om2k_tx_tx_conf_req(struct gsm_bts_trx *trx); int abis_om2k_tx_ts_conf_req(struct gsm_bts_trx_ts *ts); +struct osmo_fsm_inst *om2k_bts_fsm_start(struct gsm_bts *bts); +void abis_om2k_bts_init(struct gsm_bts *bts); +void abis_om2k_trx_init(struct gsm_bts_trx *trx); + int abis_om2k_vty_init(void); struct vty; diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 4472310..97fde83 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -104,6 +104,19 @@ struct gsm_bts *bts; }; +/* Ericsson OM2000 Managed Object */ +struct abis_om2k_mo { + uint8_t class; + uint8_t bts; + uint8_t assoc_so; + uint8_t inst; +} __attribute__ ((packed)); + +struct om2k_mo { + struct abis_om2k_mo addr; + struct osmo_fsm_inst *fsm; +}; + #define MAX_A5_KEY_LEN (128/8) #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 @@ -387,6 +400,12 @@ /* To which E1 subslot are we connected */ struct gsm_e1_subslot e1_link; + union { + struct { + struct om2k_mo om2k_mo; + } rbs2000; + }; + struct gsm_lchan lchan[TS_MAX_LCHAN]; }; @@ -441,6 +460,17 @@ uint8_t test_nr; struct rxlev_stats rxlev_stat; } ipaccess; + struct { + struct { + struct om2k_mo om2k_mo; + } trxc; + struct { + struct om2k_mo om2k_mo; + } rx; + struct { + struct om2k_mo om2k_mo; + } tx; + } rbs2000; }; struct gsm_bts_trx_ts ts[TRX_NR_TS]; }; @@ -679,17 +709,26 @@ } bs11; struct { struct { + struct om2k_mo om2k_mo; + struct gsm_abis_mo mo; + struct llist_head conn_groups; + } cf; + struct { + struct om2k_mo om2k_mo; struct gsm_abis_mo mo; struct llist_head conn_groups; } is; struct { + struct om2k_mo om2k_mo; struct gsm_abis_mo mo; struct llist_head conn_groups; } con; struct { + struct om2k_mo om2k_mo; struct gsm_abis_mo mo; } dp; struct { + struct om2k_mo om2k_mo; struct gsm_abis_mo mo; } tf; } rbs2000; diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1745a72..58d86c6 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1,7 +1,7 @@ /* Ericsson RBS 2xxx GSM O&M (OM2000) messages on the A-bis interface * implemented based on protocol trace analysis, no formal documentation */ -/* (C) 2010-2011 by Harald Welte +/* (C) 2010-2011,2016 by Harald Welte * * All Rights Reserved * @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -42,8 +43,38 @@ #include #include +/* FIXME: move to libosmocore */ +struct osmo_fsm_inst *osmo_fsm_inst_alloc_child_id(struct osmo_fsm *fsm, + struct osmo_fsm_inst *parent, + uint32_t parent_term_event, + const char *id) +{ + struct osmo_fsm_inst *fi; + + fi = osmo_fsm_inst_alloc(fsm, parent, NULL, parent->log_level, + id ? id : parent->id); + if (!fi) { + /* indicate immediate termination to caller */ + osmo_fsm_inst_dispatch(parent, parent_term_event, NULL); + return NULL; + } + + LOGPFSM(fi, "is child of %s\n", osmo_fsm_inst_name(parent)); + + fi->proc.parent = parent; + fi->proc.parent_term_event = parent_term_event; + llist_add(&fi->proc.child, &parent->proc.children); + + return fi; +} + + #define OM_ALLOC_SIZE 1024 #define OM_HEADROOM_SIZE 128 + +#define OM2K_TIMEOUT 10 +#define TRX_FSM_TIMEOUT 60 +#define BTS_FSM_TIMEOUT 60 /* use following functions from abis_nm.c: * om2k_msgb_alloc() @@ -625,6 +656,96 @@ { 0, NULL } }; +const struct value_string om2k_result_strings[] = { + { 0x02, "Wrong state or out of sequence" }, + { 0x03, "File error" }, + { 0x04, "Fault, unspecified" }, + { 0x05, "Tuning fault" }, + { 0x06, "Protocol error" }, + { 0x07, "MO not connected" }, + { 0x08, "Parameter error" }, + { 0x09, "Optional function not supported" }, + { 0x0a, "Local access state LOCALLY DISCONNECTED" }, + { 0, NULL } +}; + +const struct value_string om2k_accordance_strings[] = { + { 0x00, "Data according to request" }, + { 0x01, "Data not according to request" }, + { 0x02, "Inconsistent MO data" }, + { 0x03, "Capability constraint violation" }, + { 0, NULL } +}; + +const struct value_string om2k_mostate_vals[] = { + { 0x00, "RESET" }, + { 0x01, "STARTED" }, + { 0x02, "ENABLED" }, + { 0x03, "DISABLED" }, + { 0, NULL } +}; + +/* entire decoded OM2K message (header + parsed TLV) */ +struct om2k_decoded_msg { + struct abis_om2k_hdr o2h; + uint16_t msg_type; + struct tlv_parsed tp; +}; + +/* resolve the OM2000 Managed Object by BTS + MO Address */ +static struct om2k_mo * +get_om2k_mo(struct gsm_bts *bts, const struct abis_om2k_mo *abis_mo) +{ + struct om2k_mo *mo = NULL; + struct gsm_bts_trx *trx; + + switch (abis_mo->class) { + case OM2K_MO_CLS_CF: + mo = &bts->rbs2000.cf.om2k_mo; + break; + case OM2K_MO_CLS_CON: + mo = &bts->rbs2000.con.om2k_mo; + break; + case OM2K_MO_CLS_IS: + mo = &bts->rbs2000.is.om2k_mo; + break; + case OM2K_MO_CLS_TF: + mo = &bts->rbs2000.tf.om2k_mo; + break; + + case OM2K_MO_CLS_TRXC: + trx = gsm_bts_trx_num(bts, abis_mo->inst); + if (!trx) + return NULL; + mo = &trx->rbs2000.trxc.om2k_mo; + break; + case OM2K_MO_CLS_TX: + trx = gsm_bts_trx_num(bts, abis_mo->inst); + if (!trx) + return NULL; + mo = &trx->rbs2000.tx.om2k_mo; + break; + case OM2K_MO_CLS_RX: + trx = gsm_bts_trx_num(bts, abis_mo->inst); + if (!trx) + return NULL; + mo = &trx->rbs2000.rx.om2k_mo; + break; + case OM2K_MO_CLS_TS: + trx = gsm_bts_trx_num(bts, abis_mo->assoc_so); + if (!trx) + return NULL; + if (abis_mo->inst >= ARRAY_SIZE(trx->ts)) + return NULL; + mo = &trx->ts[abis_mo->inst].rbs2000.om2k_mo; + break; + default: + return NULL; + }; + + return mo; +} + static struct msgb *om2k_msgb_alloc(void) { return msgb_alloc_headroom(OM_ALLOC_SIZE, OM_HEADROOM_SIZE, @@ -639,6 +760,15 @@ static int abis_om2k_msg_tlv_parse(struct tlv_parsed *tp, struct abis_om2k_hdr *oh) { return abis_om2k_tlv_parse(tp, oh->data, oh->om.length - 6); +} + +/* decode/parse the message */ +static int om2k_decode_msg(struct om2k_decoded_msg *odm, struct msgb *msg) +{ + struct abis_om2k_hdr *o2h = msgb_l2(msg); + odm->msg_type = ntohs(o2h->msg_type); + odm->o2h = *o2h; + return abis_om2k_msg_tlv_parse(&odm->tp, o2h); } static char *om2k_mo_name(const struct abis_om2k_mo *mo) @@ -783,23 +913,6 @@ nm_state->operational = new_state.operational; } -static void signal_op_state(struct gsm_bts *bts, struct abis_om2k_mo *mo) -{ - struct gsm_nm_state *nm_state = mo2nm_state(bts, mo); - struct nm_statechg_signal_data nsd; - - if (!nm_state) - return; - - nsd.bts = bts; - nsd.obj = mo2obj(bts, mo); - nsd.old_state = nm_state; - nsd.new_state = nm_state; - nsd.om2k_mo = mo; - - osmo_signal_dispatch(SS_NM, S_NM_STATECHG_OPER, &nsd); -} - static int abis_om2k_sendmsg(struct gsm_bts *bts, struct msgb *msg) { struct abis_om2k_hdr *o2h; @@ -854,11 +967,6 @@ memcpy(&o2h->mo, mo, sizeof(o2h->mo)); } -const struct abis_om2k_mo om2k_mo_cf = { OM2K_MO_CLS_CF, 0, 0xFF, 0 }; -const struct abis_om2k_mo om2k_mo_is = { OM2K_MO_CLS_IS, 0, 0xFF, 0 }; -const struct abis_om2k_mo om2k_mo_con = { OM2K_MO_CLS_CON, 0, 0xFF, 0 }; -const struct abis_om2k_mo om2k_mo_tf = { OM2K_MO_CLS_TF, 0, 0xFF, 0 }; - static int abis_om2k_cal_time_resp(struct gsm_bts *bts) { struct msgb *msg = om2k_msgb_alloc(); @@ -867,7 +975,8 @@ struct tm *tm; o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); - fill_om2k_hdr(o2k, &om2k_mo_cf, OM2K_MSGT_CAL_TIME_RESP); + fill_om2k_hdr(o2k, &bts->rbs2000.cf.om2k_mo.addr, + OM2K_MSGT_CAL_TIME_RESP); tm_t = time(NULL); tm = localtime(&tm_t); @@ -989,7 +1098,8 @@ om2k_fill_is_conn_grp(&cg[i++], grp->icp1, grp->icp2, grp->ci); o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); - fill_om2k_hdr(o2k, &om2k_mo_is, OM2K_MSGT_IS_CONF_REQ); + fill_om2k_hdr(o2k, &bts->rbs2000.is.om2k_mo.addr, + OM2K_MSGT_IS_CONF_REQ); msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); @@ -999,7 +1109,8 @@ talloc_free(cg); - DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&om2k_mo_is), + DEBUGP(DNM, "Tx MO=%s %s\n", + om2k_mo_name(&bts->rbs2000.is.om2k_mo.addr), get_value_string(om2k_msgcode_vals, OM2K_MSGT_IS_CONF_REQ)); return abis_om2k_sendmsg(bts, msg); @@ -1012,14 +1123,16 @@ struct abis_om2k_hdr *o2k; o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); - fill_om2k_hdr(o2k, &om2k_mo_con, OM2K_MSGT_CON_CONF_REQ); + fill_om2k_hdr(o2k, &bts->rbs2000.con.om2k_mo.addr, + OM2K_MSGT_CON_CONF_REQ); msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); - DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&om2k_mo_con), + DEBUGP(DNM, "Tx MO=%s %s\n", + om2k_mo_name(&bts->rbs2000.con.om2k_mo.addr), get_value_string(om2k_msgcode_vals, OM2K_MSGT_CON_CONF_REQ)); return abis_om2k_sendmsg(bts, msg); @@ -1098,14 +1211,16 @@ struct abis_om2k_hdr *o2k; o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); - fill_om2k_hdr(o2k, &om2k_mo_tf, OM2K_MSGT_TF_CONF_REQ); + fill_om2k_hdr(o2k, &bts->rbs2000.tf.om2k_mo.addr, + OM2K_MSGT_TF_CONF_REQ); msgb_tv_put(msg, OM2K_DEI_TF_MODE, OM2K_TF_MODE_STANDALONE); msgb_tv_put(msg, OM2K_DEI_TF_SYNC_SRC, 0x00); msgb_tv_fixed_put(msg, OM2K_DEI_FS_OFFSET, sizeof(fs_offset_undef), fs_offset_undef); - DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&om2k_mo_tf), + DEBUGP(DNM, "Tx MO=%s %s\n", + om2k_mo_name(&bts->rbs2000.tf.om2k_mo.addr), get_value_string(om2k_msgcode_vals, OM2K_MSGT_TF_CONF_REQ)); return abis_om2k_sendmsg(bts, msg); @@ -1256,8 +1371,859 @@ break; } + DEBUGP(DNM, "Tx MO=%s %s\n", + om2k_mo_name(&mo), + get_value_string(om2k_msgcode_vals, OM2K_MSGT_TS_CONF_REQ)); + return abis_om2k_sendmsg(ts->trx->bts, msg); } + + +/*********************************************************************** + * OM2000 Managed Object (MO) FSM + ***********************************************************************/ + +#define S(x) (1 << (x)) + +enum om2k_event_name { + OM2K_MO_EVT_START, + OM2K_MO_EVT_RX_CONN_COMPL, + OM2K_MO_EVT_RX_RESET_COMPL, + OM2K_MO_EVT_RX_START_REQ_ACCEPT, + OM2K_MO_EVT_RX_START_RES, + OM2K_MO_EVT_RX_CFG_REQ_ACCEPT, + OM2K_MO_EVT_RX_CFG_RES, + OM2K_MO_EVT_RX_ENA_REQ_ACCEPT, + OM2K_MO_EVT_RX_ENA_RES, + OM2K_MO_EVT_RX_OPINFO_ACC, +}; + +static const struct value_string om2k_event_names[] = { + { OM2K_MO_EVT_START, "START" }, + { OM2K_MO_EVT_RX_CONN_COMPL, "RX-CONN-COMPL" }, + { OM2K_MO_EVT_RX_RESET_COMPL, "RX-RESET-COMPL" }, + { OM2K_MO_EVT_RX_START_REQ_ACCEPT, "RX-RESET-REQ-ACCEPT" }, + { OM2K_MO_EVT_RX_START_RES, "RX-START-RESULT" }, + { OM2K_MO_EVT_RX_CFG_REQ_ACCEPT, "RX-CFG-REQ-ACCEPT" }, + { OM2K_MO_EVT_RX_CFG_RES, "RX-CFG-RESULT" }, + { OM2K_MO_EVT_RX_ENA_REQ_ACCEPT, "RX-ENABLE-REQ-ACCEPT" }, + { OM2K_MO_EVT_RX_ENA_RES, "RX-ENABLE-RESULT" }, + { OM2K_MO_EVT_RX_OPINFO_ACC, "RX-OPINFO-ACCEPT" }, + { 0, NULL } +}; + +enum om2k_mo_fsm_state { + OM2K_ST_INIT, + OM2K_ST_WAIT_CONN_COMPL, + OM2K_ST_WAIT_RES_COMPL, + OM2K_ST_WAIT_START_ACCEPT, + OM2K_ST_WAIT_START_RES, + OM2K_ST_WAIT_CFG_ACCEPT, + OM2K_ST_WAIT_CFG_RES, + OM2K_ST_WAIT_ENABLE_ACCEPT, + OM2K_ST_WAIT_ENABLE_RES, + OM2K_ST_WAIT_OPINFO_ACCEPT, + OM2K_ST_DONE, + OM2K_ST_ERROR, +}; + +struct om2k_mo_fsm_priv { + struct gsm_bts_trx *trx; + struct om2k_mo *mo; + uint8_t ts_nr; +}; + +static void om2k_mo_st_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + + OSMO_ASSERT(event == OM2K_MO_EVT_START); + + switch (omfp->mo->addr.class) { + case OM2K_MO_CLS_CF: + /* no Connect required, is always connected */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_START_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_start_req(omfp->trx->bts, &omfp->mo->addr); + break; + case OM2K_MO_CLS_TRXC: + /* no Connect required, start with Reset */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_RES_COMPL, + OM2K_TIMEOUT, 0); + abis_om2k_tx_reset_cmd(omfp->trx->bts, &omfp->mo->addr); + break; + default: + /* start with Connect */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_CONN_COMPL, + OM2K_TIMEOUT, 0); + abis_om2k_tx_connect_cmd(omfp->trx->bts, &omfp->mo->addr); + break; + } +} + +static void om2k_mo_st_wait_conn_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + + switch (omfp->mo->addr.class) { +#if 0 + case OM2K_MO_CLS_TF: + /* skip the reset, hope that helps */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_START_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_start_req(omfp->trx->bts, &omfp->mo->addr); + break; +#endif + default: + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_RES_COMPL, + OM2K_TIMEOUT, 0); + abis_om2k_tx_reset_cmd(omfp->trx->bts, &omfp->mo->addr); + break; + } +} + +static void om2k_mo_st_wait_res_compl(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_START_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_start_req(omfp->trx->bts, &omfp->mo->addr); +} + +static void om2k_mo_st_wait_start_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_decoded_msg *omd = data; + + switch (omd->msg_type) { + case OM2K_MSGT_START_REQ_ACK: + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_START_RES, + OM2K_TIMEOUT, 0); + break; + case OM2K_MSGT_START_REQ_REJ: + osmo_fsm_inst_state_chg(fi, OM2K_ST_ERROR, 0, 0); + break; + } +} + +static void om2k_mo_st_wait_start_res(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + struct gsm_bts_trx_ts *ts; + + switch (omfp->mo->addr.class) { + case OM2K_MO_CLS_CF: + case OM2K_MO_CLS_TRXC: + /* Transition directly to Operational Info */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_OPINFO_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_op_info(omfp->trx->bts, &omfp->mo->addr, 1); + break; + case OM2K_MO_CLS_DP: + /* Transition directoy to WAIT_ENABLE_ACCEPT */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_ENABLE_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_enable_req(omfp->trx->bts, &omfp->mo->addr); + return; +#if 0 + case OM2K_MO_CLS_TF: + /* skip the config, hope that helps speeding things up */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_ENABLE_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_enable_req(omfp->trx->bts, &omfp->mo->addr); + return; +#endif + } + + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_CFG_ACCEPT, + OM2K_TIMEOUT, 0); + switch (omfp->mo->addr.class) { + case OM2K_MO_CLS_TF: + abis_om2k_tx_tf_conf_req(omfp->trx->bts); + break; + case OM2K_MO_CLS_IS: + abis_om2k_tx_is_conf_req(omfp->trx->bts); + break; + case OM2K_MO_CLS_CON: + /* TODO */ + //abis_om2k_tx_con_conf_req(omfp->trx->bts, data, len); + break; + case OM2K_MO_CLS_TX: + abis_om2k_tx_tx_conf_req(omfp->trx); + break; + case OM2K_MO_CLS_RX: + abis_om2k_tx_rx_conf_req(omfp->trx); + break; + case OM2K_MO_CLS_TS: + ts = mo2obj(omfp->trx->bts, &omfp->mo->addr); + abis_om2k_tx_ts_conf_req(ts); + break; + } +} + +static void om2k_mo_st_wait_cfg_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + uint32_t timeout = OM2K_TIMEOUT; + + if (omfp->mo->addr.class == OM2K_MO_CLS_TF) + timeout = 600; + + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_CFG_RES, timeout, 0); +} + +static void om2k_mo_st_wait_cfg_res(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + struct om2k_decoded_msg *omd = data; + uint8_t accordance; + + if (!TLVP_PRESENT(&omd->tp, OM2K_DEI_ACCORDANCE_IND)) { + osmo_fsm_inst_state_chg(fi, OM2K_ST_ERROR, 0, 0); + return; + } + accordance = *TLVP_VAL(&omd->tp, OM2K_DEI_ACCORDANCE_IND); + + if (accordance != 0) { + /* accordance not OK */ + osmo_fsm_inst_state_chg(fi, OM2K_ST_ERROR, 0, 0); + return; + } + + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_ENABLE_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_enable_req(omfp->trx->bts, &omfp->mo->addr); +} + +static void om2k_mo_st_wait_enable_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_decoded_msg *omd = data; + + switch (omd->msg_type) { + case OM2K_MSGT_ENABLE_REQ_REJ: + osmo_fsm_inst_state_chg(fi, OM2K_ST_ERROR, 0, 0); + break; + case OM2K_MSGT_ENABLE_REQ_ACK: + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_ENABLE_RES, + OM2K_TIMEOUT, 0); + } +} + +static void om2k_mo_st_wait_enable_res(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_mo_fsm_priv *omfp = fi->priv; + //struct om2k_decoded_msg *omd = data; + /* TODO: check if state is actually enabled now? */ + + osmo_fsm_inst_state_chg(fi, OM2K_ST_WAIT_OPINFO_ACCEPT, + OM2K_TIMEOUT, 0); + abis_om2k_tx_op_info(omfp->trx->bts, &omfp->mo->addr, 1); +} + +static void om2k_mo_st_wait_opinfo_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + osmo_fsm_inst_state_chg(fi, OM2K_ST_DONE, 0, 0); +} + +static void om2k_mo_s_done_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state om2k_is_states[] = { + [OM2K_ST_INIT] = { + .name = "INIT", + .in_event_mask = S(OM2K_MO_EVT_START), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_CONN_COMPL) | + S(OM2K_ST_WAIT_START_ACCEPT) | + S(OM2K_ST_WAIT_RES_COMPL), + .action = om2k_mo_st_init, + }, + [OM2K_ST_WAIT_CONN_COMPL] = { + .name = "WAIT-CONN-COMPL", + .in_event_mask = S(OM2K_MO_EVT_RX_CONN_COMPL), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_START_ACCEPT) | + S(OM2K_ST_WAIT_RES_COMPL), + .action = om2k_mo_st_wait_conn_compl, + }, + [OM2K_ST_WAIT_RES_COMPL] = { + .name = "WAIT-RES-COMPL", + .in_event_mask = S(OM2K_MO_EVT_RX_RESET_COMPL), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_START_ACCEPT), + .action = om2k_mo_st_wait_res_compl, + }, + [OM2K_ST_WAIT_START_ACCEPT] = { + .name = "WAIT-START-ACCEPT", + .in_event_mask = S(OM2K_MO_EVT_RX_START_REQ_ACCEPT), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_START_RES), + .action =om2k_mo_st_wait_start_accept, + }, + [OM2K_ST_WAIT_START_RES] = { + .name = "WAIT-START-RES", + .in_event_mask = S(OM2K_MO_EVT_RX_START_RES), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_CFG_ACCEPT) | + S(OM2K_ST_WAIT_OPINFO_ACCEPT), + .action = om2k_mo_st_wait_start_res, + }, + [OM2K_ST_WAIT_CFG_ACCEPT] = { + .name = "WAIT-CFG-ACCEPT", + .in_event_mask = S(OM2K_MO_EVT_RX_CFG_REQ_ACCEPT), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_CFG_RES), + .action = om2k_mo_st_wait_cfg_accept, + }, + [OM2K_ST_WAIT_CFG_RES] = { + .name = "WAIT-CFG-RES", + .in_event_mask = S(OM2K_MO_EVT_RX_CFG_RES), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_ENABLE_ACCEPT), + .action = om2k_mo_st_wait_cfg_res, + }, + [OM2K_ST_WAIT_ENABLE_ACCEPT] = { + .name = "WAIT-ENABLE-ACCEPT", + .in_event_mask = S(OM2K_MO_EVT_RX_ENA_REQ_ACCEPT), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_ENABLE_RES), + .action = om2k_mo_st_wait_enable_accept, + }, + [OM2K_ST_WAIT_ENABLE_RES] = { + .name = "WAIT-ENABLE-RES", + .in_event_mask = S(OM2K_MO_EVT_RX_ENA_RES), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR) | + S(OM2K_ST_WAIT_OPINFO_ACCEPT), + .action = om2k_mo_st_wait_enable_res, + }, + [OM2K_ST_WAIT_OPINFO_ACCEPT] = { + .name = "WAIT-OPINFO-ACCEPT", + .in_event_mask = S(OM2K_MO_EVT_RX_OPINFO_ACC), + .out_state_mask = S(OM2K_ST_DONE) | + S(OM2K_ST_ERROR), + .action = om2k_mo_st_wait_opinfo_accept, + }, + [OM2K_ST_DONE] = { + .name = "DONE", + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = om2k_mo_s_done_onenter, + }, + [OM2K_ST_ERROR] = { + .name = "ERROR", + .in_event_mask = 0, + .out_state_mask = 0, + .onenter = om2k_mo_s_done_onenter, + }, + +}; + +static int om2k_mo_timer_cb(struct osmo_fsm_inst *fi) +{ + osmo_fsm_inst_state_chg(fi, OM2K_ST_ERROR, 0, 0); + return 0; +} + +static struct osmo_fsm om2k_mo_fsm = { + .name = "OM2000-MO", + .states = om2k_is_states, + .num_states = ARRAY_SIZE(om2k_is_states), + .log_subsys = DNM, + .event_names = om2k_event_names, + .timer_cb = om2k_mo_timer_cb, +}; + +struct osmo_fsm_inst *om2k_mo_fsm_start(struct osmo_fsm_inst *parent, + uint32_t term_event, + struct gsm_bts_trx *trx, struct om2k_mo *mo) +{ + struct osmo_fsm_inst *fi; + struct om2k_mo_fsm_priv *omfp; + char idbuf[64]; + + snprintf(idbuf, sizeof(idbuf), "%s-%s", parent->id, + om2k_mo_name(&mo->addr)); + + fi = osmo_fsm_inst_alloc_child_id(&om2k_mo_fsm, parent, + term_event, idbuf); + if (!fi) + return NULL; + + mo->fsm = fi; + omfp = talloc_zero(fi, struct om2k_mo_fsm_priv); + omfp->mo = mo; + omfp->trx = trx; + fi->priv = omfp; + + osmo_fsm_inst_dispatch(fi, OM2K_MO_EVT_START, NULL); + + return fi; +} + +int om2k_mo_fsm_recvmsg(struct gsm_bts *bts, struct om2k_mo *mo, + struct om2k_decoded_msg *odm) +{ + switch (odm->msg_type) { + case OM2K_MSGT_CONNECT_COMPL: + case OM2K_MSGT_CONNECT_REJ: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_CONN_COMPL, odm); + break; + + case OM2K_MSGT_RESET_COMPL: + case OM2K_MSGT_RESET_REJ: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_RESET_COMPL, odm); + break; + + case OM2K_MSGT_START_REQ_ACK: + case OM2K_MSGT_START_REQ_REJ: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_START_REQ_ACCEPT, odm); + break; + + case OM2K_MSGT_START_RES: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_START_RES, odm); + break; + + case OM2K_MSGT_CON_CONF_REQ_ACK: + case OM2K_MSGT_IS_CONF_REQ_ACK: + case OM2K_MSGT_RX_CONF_REQ_ACK: + case OM2K_MSGT_TF_CONF_REQ_ACK: + case OM2K_MSGT_TS_CONF_REQ_ACK: + case OM2K_MSGT_TX_CONF_REQ_ACK: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_CFG_REQ_ACCEPT, odm); + break; + + case OM2K_MSGT_CON_CONF_RES: + case OM2K_MSGT_IS_CONF_RES: + case OM2K_MSGT_RX_CONF_RES: + case OM2K_MSGT_TF_CONF_RES: + case OM2K_MSGT_TS_CONF_RES: + case OM2K_MSGT_TX_CONF_RES: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_CFG_RES, odm); + break; + + case OM2K_MSGT_ENABLE_REQ_ACK: + case OM2K_MSGT_ENABLE_REQ_REJ: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_ENA_REQ_ACCEPT, odm); + break; + case OM2K_MSGT_ENABLE_RES: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_ENA_RES, odm); + break; + + case OM2K_MSGT_OP_INFO_ACK: + case OM2K_MSGT_OP_INFO_REJ: + osmo_fsm_inst_dispatch(mo->fsm, + OM2K_MO_EVT_RX_OPINFO_ACC, odm); + break; + default: + return -1; + } + + return 0; +} + +/*********************************************************************** + * OM2000 TRX Finite State Machine, initializes TRXC and all siblings + ***********************************************************************/ + +enum om2k_trx_event { + OM2K_TRX_EVT_START, + OM2K_TRX_EVT_TRXC_DONE, + OM2K_TRX_EVT_TX_DONE, + OM2K_TRX_EVT_RX_DONE, + OM2K_TRX_EVT_TS_DONE, + OM2K_TRX_EVT_STOP, +}; + +static struct value_string om2k_trx_events[] = { + { OM2K_TRX_EVT_START, "START" }, + { OM2K_TRX_EVT_TRXC_DONE, "TRXC-DONE" }, + { OM2K_TRX_EVT_TX_DONE, "TX-DONE" }, + { OM2K_TRX_EVT_RX_DONE, "RX-DONE" }, + { OM2K_TRX_EVT_TS_DONE, "TS-DONE" }, + { OM2K_TRX_EVT_STOP, "STOP" }, + { 0, NULL } +}; + +enum om2k_trx_state { + OM2K_TRX_S_INIT, + OM2K_TRX_S_WAIT_TRXC, + OM2K_TRX_S_WAIT_TX, + OM2K_TRX_S_WAIT_RX, + OM2K_TRX_S_WAIT_TS, + OM2K_TRX_S_DONE, + OM2K_TRX_S_ERROR +}; + +struct om2k_trx_fsm_priv { + struct gsm_bts_trx *trx; + uint8_t next_ts_nr; +}; + +static void om2k_trx_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + + /* First initialize TRXC */ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_WAIT_TRXC, + TRX_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TRXC_DONE, otfp->trx, + &otfp->trx->rbs2000.trxc.om2k_mo); +} + +static void om2k_trx_s_wait_trxc(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + + /* Initialize TX after TRXC */ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_WAIT_TX, + TRX_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TX_DONE, otfp->trx, + &otfp->trx->rbs2000.tx.om2k_mo); +} + +static void om2k_trx_s_wait_tx(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + + /* Initialize RX after TX */ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_WAIT_RX, + TRX_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_TRX_EVT_RX_DONE, otfp->trx, + &otfp->trx->rbs2000.rx.om2k_mo); +} + +static void om2k_trx_s_wait_rx(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + struct gsm_bts_trx_ts *ts; + + /* Initialize Timeslots after TX */ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_WAIT_TS, + TRX_FSM_TIMEOUT, 0); + otfp->next_ts_nr = 0; + ts = &otfp->trx->ts[otfp->next_ts_nr++]; + om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TS_DONE, otfp->trx, + &ts->rbs2000.om2k_mo); +} + +static void om2k_trx_s_wait_ts(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + struct gsm_bts_trx_ts *ts; + + if (otfp->next_ts_nr < 8) { + /* iterate to the next timeslot */ + ts = &otfp->trx->ts[otfp->next_ts_nr++]; + om2k_mo_fsm_start(fi, OM2K_TRX_EVT_TS_DONE, otfp->trx, + &ts->rbs2000.om2k_mo); + } else { + /* only after all 8 TS */ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_DONE, 0, 0); + } +} + +static void om2k_trx_s_done_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + struct om2k_trx_fsm_priv *otfp = fi->priv; + gsm_bts_trx_set_system_infos(otfp->trx); + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state om2k_trx_states[] = { + [OM2K_TRX_S_INIT] = { + .in_event_mask = S(OM2K_TRX_EVT_START), + .out_state_mask = S(OM2K_TRX_S_WAIT_TRXC), + .name = "INIT", + .action = om2k_trx_s_init, + }, + [OM2K_TRX_S_WAIT_TRXC] = { + .in_event_mask = S(OM2K_TRX_EVT_TRXC_DONE), + .out_state_mask = S(OM2K_TRX_S_ERROR) | + S(OM2K_TRX_S_WAIT_TX), + .name = "WAIT-TRXC", + .action = om2k_trx_s_wait_trxc, + }, + [OM2K_TRX_S_WAIT_TX] = { + .in_event_mask = S(OM2K_TRX_EVT_TX_DONE), + .out_state_mask = S(OM2K_TRX_S_ERROR) | + S(OM2K_TRX_S_WAIT_RX), + .name = "WAIT-TX", + .action = om2k_trx_s_wait_tx, + }, + [OM2K_TRX_S_WAIT_RX] = { + .in_event_mask = S(OM2K_TRX_EVT_RX_DONE), + .out_state_mask = S(OM2K_TRX_S_ERROR) | + S(OM2K_TRX_S_WAIT_TS), + .name = "WAIT-RX", + .action = om2k_trx_s_wait_rx, + }, + [OM2K_TRX_S_WAIT_TS] = { + .in_event_mask = S(OM2K_TRX_EVT_TS_DONE), + .out_state_mask = S(OM2K_TRX_S_ERROR) | + S(OM2K_TRX_S_DONE), + .name = "WAIT-TS", + .action = om2k_trx_s_wait_ts, + }, + [OM2K_TRX_S_DONE] = { + .name = "DONE", + .onenter = om2k_trx_s_done_onenter, + }, + [OM2K_TRX_S_ERROR] = { + .name = "ERROR", + }, +}; + +static int om2k_trx_timer_cb(struct osmo_fsm_inst *fi) +{ + osmo_fsm_inst_state_chg(fi, OM2K_TRX_S_ERROR, 0, 0); + return 0; +} + +static struct osmo_fsm om2k_trx_fsm = { + .name = "OM2000-TRX", + .states = om2k_trx_states, + .num_states = ARRAY_SIZE(om2k_trx_states), + .log_subsys = DNM, + .event_names = om2k_trx_events, + .timer_cb = om2k_trx_timer_cb, +}; + +struct osmo_fsm_inst *om2k_trx_fsm_start(struct osmo_fsm_inst *parent, + struct gsm_bts_trx *trx, + uint32_t term_event) +{ + struct osmo_fsm_inst *fi; + struct om2k_trx_fsm_priv *otfp; + char idbuf[32]; + + snprintf(idbuf, sizeof(idbuf), "%u/%u", trx->bts->nr, trx->nr); + + fi = osmo_fsm_inst_alloc_child_id(&om2k_trx_fsm, parent, term_event, + idbuf); + if (!fi) + return NULL; + + otfp = talloc_zero(fi, struct om2k_trx_fsm_priv); + otfp->trx = trx; + fi->priv = otfp; + + osmo_fsm_inst_dispatch(fi, OM2K_TRX_EVT_START, NULL); + + return fi; +} + + +/*********************************************************************** + * OM2000 BTS Finite State Machine, initializes CF and all siblings + ***********************************************************************/ + +enum om2k_bts_event { + OM2K_BTS_EVT_START, + OM2K_BTS_EVT_CF_DONE, + OM2K_BTS_EVT_IS_DONE, + OM2K_BTS_EVT_TF_DONE, + OM2K_BTS_EVT_TRX_DONE, + OM2K_BTS_EVT_STOP, +}; + +static const struct value_string om2k_bts_events[] = { + { OM2K_BTS_EVT_START, "START" }, + { OM2K_BTS_EVT_CF_DONE, "CF-DONE" }, + { OM2K_BTS_EVT_IS_DONE, "IS-DONE" }, + { OM2K_BTS_EVT_TF_DONE, "TF-DONE" }, + { OM2K_BTS_EVT_TRX_DONE, "TRX-DONE" }, + { OM2K_BTS_EVT_STOP, "STOP" }, + { 0, NULL } +}; + +enum om2k_bts_state { + OM2K_BTS_S_INIT, + OM2K_BTS_S_WAIT_CF, + OM2K_BTS_S_WAIT_IS, + OM2K_BTS_S_WAIT_TF, + OM2K_BTS_S_WAIT_TRX, + OM2K_BTS_S_DONE, + OM2K_BTS_S_ERROR, +}; + +struct om2k_bts_fsm_priv { + struct gsm_bts *bts; + uint8_t next_trx_nr; +}; + +static void om2k_bts_s_init(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_START); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_CF, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_CF_DONE, bts->c0, + &bts->rbs2000.cf.om2k_mo); +} + +static void om2k_bts_s_wait_cf(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_CF_DONE); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_IS, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_IS_DONE, bts->c0, + &bts->rbs2000.is.om2k_mo); +} + +static void om2k_bts_s_wait_is(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_IS_DONE); + /* TF can take a long time to initialize, wait for 10min */ + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TF, 600, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_TF_DONE, bts->c0, + &bts->rbs2000.tf.om2k_mo); +} + +static void om2k_bts_s_wait_tf(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts_trx *trx; + + OSMO_ASSERT(event == OM2K_BTS_EVT_TF_DONE); + + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TRX, + BTS_FSM_TIMEOUT, 0); + obfp->next_trx_nr = 0; + trx = gsm_bts_trx_num(obfp->bts, obfp->next_trx_nr++); + om2k_trx_fsm_start(fi, trx, OM2K_BTS_EVT_TRX_DONE); +} + +static void om2k_bts_s_wait_trx(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + + OSMO_ASSERT(event == OM2K_BTS_EVT_TRX_DONE); + + if (obfp->next_trx_nr < obfp->bts->num_trx) { + struct gsm_bts_trx *trx; + trx = gsm_bts_trx_num(obfp->bts, obfp->next_trx_nr++); + om2k_trx_fsm_start(fi, trx, OM2K_BTS_EVT_TRX_DONE); + } else { + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_DONE, 0, 0); + } +} + +static void om2k_bts_s_done_onenter(struct osmo_fsm_inst *fi, uint32_t prev_state) +{ + osmo_fsm_inst_term(fi, OSMO_FSM_TERM_REGULAR, NULL); +} + +static const struct osmo_fsm_state om2k_bts_states[] = { + [OM2K_BTS_S_INIT] = { + .in_event_mask = S(OM2K_BTS_EVT_START), + .out_state_mask = S(OM2K_BTS_S_WAIT_CF), + .name = "INIT", + .action = om2k_bts_s_init, + }, + [OM2K_BTS_S_WAIT_CF] = { + .in_event_mask = S(OM2K_BTS_EVT_CF_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_IS), + .name = "WAIT-CF", + .action = om2k_bts_s_wait_cf, + }, + [OM2K_BTS_S_WAIT_IS] = { + .in_event_mask = S(OM2K_BTS_EVT_IS_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TF), + .name = "WAIT-IS", + .action = om2k_bts_s_wait_is, + }, + [OM2K_BTS_S_WAIT_TF] = { + .in_event_mask = S(OM2K_BTS_EVT_TF_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TRX), + .name = "WAIT-TF", + .action = om2k_bts_s_wait_tf, + }, + [OM2K_BTS_S_WAIT_TRX] = { + .in_event_mask = S(OM2K_BTS_EVT_TRX_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_DONE), + .name = "WAIT-TRX", + .action = om2k_bts_s_wait_trx, + }, + [OM2K_BTS_S_DONE] = { + .name = "DONE", + .onenter = om2k_bts_s_done_onenter, + }, + [OM2K_BTS_S_ERROR] = { + .name = "ERROR", + }, +}; + +static int om2k_bts_timer_cb(struct osmo_fsm_inst *fi) +{ + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_ERROR, 0, 0); + return 0; +} + +static struct osmo_fsm om2k_bts_fsm = { + .name = "OM2000-BTS", + .states = om2k_bts_states, + .num_states = ARRAY_SIZE(om2k_bts_states), + .log_subsys = DNM, + .event_names = om2k_bts_events, + .timer_cb = om2k_bts_timer_cb, +}; + +struct osmo_fsm_inst * +om2k_bts_fsm_start(struct gsm_bts *bts) +{ + struct osmo_fsm_inst *fi; + struct om2k_bts_fsm_priv *obfp; + char idbuf[16]; + + snprintf(idbuf, sizeof(idbuf), "%u", bts->nr); + + fi = osmo_fsm_inst_alloc(&om2k_bts_fsm, bts, NULL, + LOGL_DEBUG, idbuf); + if (!fi) + return NULL; + fi->priv = obfp = talloc_zero(fi, struct om2k_bts_fsm_priv); + obfp->bts = bts; + + osmo_fsm_inst_dispatch(fi, OM2K_BTS_EVT_START, NULL); + + return fi; +} + + +/*********************************************************************** + * OM2000 Negotiation + ***********************************************************************/ static int abis_om2k_tx_negot_req_ack(struct gsm_bts *bts, const struct abis_om2k_mo *mo, uint8_t *data, unsigned int len) @@ -1345,60 +2311,10 @@ return abis_om2k_tx_negot_req_ack(sign_link->trx->bts, &o2h->mo, out_buf, out_cur - out_buf); } -static int om2k_rx_start_res(struct msgb *msg) -{ - struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)msg->dst; - struct abis_om2k_hdr *o2h = msgb_l2(msg); - int rc; - rc = abis_om2k_tx_simple(sign_link->trx->bts, &o2h->mo, OM2K_MSGT_START_RES_ACK); - rc = abis_om2k_tx_op_info(sign_link->trx->bts, &o2h->mo, 1); - - return rc; -} - -static int om2k_rx_op_info_ack(struct msgb *msg) -{ - struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)msg->dst; - struct abis_om2k_hdr *o2h = msgb_l2(msg); - - /* This Acknowledgement does not contain the actual operational state, - * so we signal whatever state we saved when we sent the Op Info - * request */ - - signal_op_state(sign_link->trx->bts, &o2h->mo); - - return 0; -} - -const struct value_string om2k_result_strings[] = { - { 0x02, "Wrong state or out of sequence" }, - { 0x03, "File error" }, - { 0x04, "Fault, unspecified" }, - { 0x05, "Tuning fault" }, - { 0x06, "Protocol error" }, - { 0x07, "MO not connected" }, - { 0x08, "Parameter error" }, - { 0x09, "Optional function not supported" }, - { 0x0a, "Local access state LOCALLY DISCONNECTED" }, - { 0, NULL } -}; - -const struct value_string om2k_accordance_strings[] = { - { 0x00, "Data according to request" }, - { 0x01, "Data not according to request" }, - { 0x02, "Inconsistent MO data" }, - { 0x03, "Capability constraint violation" }, - { 0, NULL } -}; - -const struct value_string om2k_mostate_vals[] = { - { 0x00, "RESET" }, - { 0x01, "STARTED" }, - { 0x02, "ENABLED" }, - { 0x03, "DISABLED" }, - { 0, NULL } -}; +/*********************************************************************** + * OM2000 Receive Message Handler + ***********************************************************************/ static int om2k_rx_nack(struct msgb *msg) { @@ -1423,68 +2339,20 @@ return 0; } -/* Process a Configuration Result message */ -static int process_conf_res(struct gsm_bts *bts, struct msgb *msg) +static int process_mo_state(struct gsm_bts *bts, struct om2k_decoded_msg *odm) { - struct abis_om2k_hdr *o2h = msgb_l2(msg); - uint16_t msg_type = ntohs(o2h->msg_type); - struct nm_om2k_signal_data nsd; - struct tlv_parsed tp; - uint8_t acc; - unsigned int log_level; - int ret; - - memset(&nsd, 0, sizeof(nsd)); - - abis_om2k_msg_tlv_parse(&tp, o2h); - if (!TLVP_PRESENT(&tp, OM2K_DEI_ACCORDANCE_IND)) - return -EIO; - - acc = *TLVP_VAL(&tp, OM2K_DEI_ACCORDANCE_IND); - - switch (acc) { - case 0: - log_level = LOGL_DEBUG; - ret = 0; - break; - default: - log_level = LOGL_ERROR; - ret = -EINVAL; - break; - } - - LOGP(DNM, log_level, "Rx MO=%s %s, Accordance: %s\n", - om2k_mo_name(&o2h->mo), - get_value_string(om2k_msgcode_vals, msg_type), - get_value_string(om2k_accordance_strings, acc)); - - nsd.bts = bts; - nsd.obj = mo2obj(bts, &o2h->mo); - nsd.om2k_mo = &o2h->mo; - nsd.accordance_ind = acc; - osmo_signal_dispatch(SS_NM, S_NM_OM2K_CONF_RES, &nsd); - - return ret; -} - -static int process_mo_state(struct gsm_bts *bts, struct msgb *msg) -{ - struct abis_om2k_hdr *o2h = msgb_l2(msg); - uint16_t msg_type = ntohs(o2h->msg_type); - struct tlv_parsed tp; uint8_t mo_state; - abis_om2k_msg_tlv_parse(&tp, o2h); - if (!TLVP_PRESENT(&tp, OM2K_DEI_MO_STATE)) + if (!TLVP_PRESENT(&odm->tp, OM2K_DEI_MO_STATE)) return -EIO; - mo_state = *TLVP_VAL(&tp, OM2K_DEI_MO_STATE); + mo_state = *TLVP_VAL(&odm->tp, OM2K_DEI_MO_STATE); LOGP(DNM, LOGL_DEBUG, "Rx MO=%s %s, MO State: %s\n", - om2k_mo_name(&o2h->mo), - get_value_string(om2k_msgcode_vals, msg_type), + om2k_mo_name(&odm->o2h.mo), + get_value_string(om2k_msgcode_vals, odm->msg_type), get_value_string(om2k_mostate_vals, mo_state)); - update_mo_state(bts, &o2h->mo, mo_state); + update_mo_state(bts, &odm->o2h.mo, mo_state); return 0; } @@ -1496,6 +2364,8 @@ struct abis_om2k_hdr *o2h = msgb_l2(msg); struct abis_om_hdr *oh = &o2h->om; uint16_t msg_type = ntohs(o2h->msg_type); + struct om2k_decoded_msg odm; + struct om2k_mo *mo; int rc = 0; /* Various consistency checks */ @@ -1523,80 +2393,53 @@ get_value_string(om2k_msgcode_vals, msg_type), osmo_hexdump(msg->l2h, msgb_l2len(msg))); + om2k_decode_msg(&odm, msg); + + process_mo_state(bts, &odm); + switch (msg_type) { case OM2K_MSGT_CAL_TIME_REQ: rc = abis_om2k_cal_time_resp(bts); break; case OM2K_MSGT_FAULT_REP: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_FAULT_REP_ACK); - process_mo_state(bts, msg); break; case OM2K_MSGT_NEGOT_REQ: rc = om2k_rx_negot_req(msg); break; case OM2K_MSGT_START_RES: - rc = om2k_rx_start_res(msg); - process_mo_state(bts, msg); - break; - case OM2K_MSGT_OP_INFO_ACK: - rc = om2k_rx_op_info_ack(msg); + /* common processing here */ + rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_START_RES_ACK); + /* below we dispatch into MO */ break; case OM2K_MSGT_IS_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_IS_CONF_RES_ACK); - process_conf_res(bts, msg); break; case OM2K_MSGT_CON_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_CON_CONF_RES_ACK); - process_conf_res(bts, msg); break; case OM2K_MSGT_TX_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TX_CONF_RES_ACK); - process_conf_res(bts, msg); break; case OM2K_MSGT_RX_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RX_CONF_RES_ACK); - process_conf_res(bts, msg); break; case OM2K_MSGT_TS_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TS_CONF_RES_ACK); - process_conf_res(bts, msg); break; case OM2K_MSGT_TF_CONF_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TF_CONF_RES_ACK); - process_conf_res(bts, msg); - break; - case OM2K_MSGT_CONNECT_COMPL: - rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_RESET_CMD); - break; - case OM2K_MSGT_RESET_COMPL: - rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_START_REQ); break; case OM2K_MSGT_ENABLE_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_ENABLE_RES_ACK); - process_mo_state(bts, msg); break; case OM2K_MSGT_DISABLE_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_DISABLE_RES_ACK); - process_mo_state(bts, msg); break; case OM2K_MSGT_TEST_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TEST_RES_ACK); - process_mo_state(bts, msg); break; - case OM2K_MSGT_STATUS_RESP: - process_mo_state(bts, msg); - break; - case OM2K_MSGT_START_REQ_ACK: - case OM2K_MSGT_CON_CONF_REQ_ACK: - case OM2K_MSGT_IS_CONF_REQ_ACK: - case OM2K_MSGT_TX_CONF_REQ_ACK: - case OM2K_MSGT_RX_CONF_REQ_ACK: - case OM2K_MSGT_TS_CONF_REQ_ACK: - case OM2K_MSGT_TF_CONF_REQ_ACK: - case OM2K_MSGT_ENABLE_REQ_ACK: - case OM2K_MSGT_ALARM_STATUS_REQ_ACK: - case OM2K_MSGT_DISABLE_REQ_ACK: - break; + /* ERrors */ case OM2K_MSGT_START_REQ_REJ: case OM2K_MSGT_CONNECT_REJ: case OM2K_MSGT_OP_INFO_REJ: @@ -1613,11 +2456,74 @@ case OM2K_MSGT_DISABLE_REQ_REJ: rc = om2k_rx_nack(msg); break; - default: - LOGP(DNM, LOGL_NOTICE, "Rx unhandled OM2000 msg %s\n", - get_value_string(om2k_msgcode_vals, msg_type)); } + + /* Resolve the MO for this message */ + mo = get_om2k_mo(bts, &o2h->mo); + if (!mo) { + LOGP(DNM, LOGL_ERROR, "Couldn't resolve MO for OM2K msg " + "%s: %s\n", get_value_string(om2k_msgcode_vals, msg_type), + msgb_hexdump(msg)); + return 0; + } + + /* Dispatch message to that MO */ + om2k_mo_fsm_recvmsg(bts, mo, &odm); msgb_free(msg); return rc; } + +static void om2k_mo_init(struct om2k_mo *mo, uint8_t class, + uint8_t bts_nr, uint8_t assoc_so, uint8_t inst) +{ + mo->addr.class = class; + mo->addr.bts = bts_nr; + mo->addr.assoc_so = assoc_so; + mo->addr.inst = inst; +} + +/* initialize the OM2K_MO members of gsm_bts_trx and its timeslots */ +void abis_om2k_trx_init(struct gsm_bts_trx *trx) +{ + struct gsm_bts *bts = trx->bts; + unsigned int i; + + OSMO_ASSERT(bts->type == GSM_BTS_TYPE_RBS2000); + + om2k_mo_init(&trx->rbs2000.trxc.om2k_mo, OM2K_MO_CLS_TRXC, + bts->nr, 255, trx->nr); + om2k_mo_init(&trx->rbs2000.tx.om2k_mo, OM2K_MO_CLS_TX, + bts->nr, 255, trx->nr); + om2k_mo_init(&trx->rbs2000.rx.om2k_mo, OM2K_MO_CLS_RX, + bts->nr, 255, trx->nr); + + for (i = 0; i < ARRAY_SIZE(trx->ts); i++) { + om2k_mo_init(&trx->ts[i].rbs2000.om2k_mo, OM2K_MO_CLS_TS, + bts->nr, trx->nr, i); + } +} + +/* initialize the OM2K_MO members of gsm_bts */ +void abis_om2k_bts_init(struct gsm_bts *bts) +{ + OSMO_ASSERT(bts->type == GSM_BTS_TYPE_RBS2000); + + om2k_mo_init(&bts->rbs2000.cf.om2k_mo, OM2K_MO_CLS_CF, + bts->nr, 0xFF, 0); + om2k_mo_init(&bts->rbs2000.is.om2k_mo, OM2K_MO_CLS_IS, + bts->nr, 0xFF, 0); + om2k_mo_init(&bts->rbs2000.con.om2k_mo, OM2K_MO_CLS_CON, + bts->nr, 0xFF, 0); + om2k_mo_init(&bts->rbs2000.dp.om2k_mo, OM2K_MO_CLS_DP, + bts->nr, 0xFF, 0); + om2k_mo_init(&bts->rbs2000.tf.om2k_mo, OM2K_MO_CLS_TF, + bts->nr, 0xFF, 0); +} + +static __attribute__((constructor)) void abis_om2k_init(void) +{ + osmo_fsm_register(&om2k_mo_fsm); + osmo_fsm_register(&om2k_bts_fsm); + osmo_fsm_register(&om2k_trx_fsm); +} diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index 7f056f1..a828937 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -34,18 +34,20 @@ static void bootstrap_om_bts(struct gsm_bts *bts) { LOGP(DNM, LOGL_NOTICE, "bootstrapping OML for BTS %u\n", bts->nr); - abis_om2k_tx_start_req(bts, &om2k_mo_cf); - /* FIXME */ + + /* FIXME: this is global init, not bootstrapping */ + abis_om2k_bts_init(bts); + abis_om2k_trx_init(bts->c0); + + /* TODO: Should we wait for a Failure report? */ + om2k_bts_fsm_start(bts); } static void bootstrap_om_trx(struct gsm_bts_trx *trx) { - struct abis_om2k_mo trx_mo = { OM2K_MO_CLS_TRXC, 0, 255, trx->nr }; - LOGP(DNM, LOGL_NOTICE, "bootstrapping OML for TRX %u/%u\n", trx->bts->nr, trx->nr); - - abis_om2k_tx_reset_cmd(trx->bts, &trx_mo); + /* FIXME */ } static int shutdown_om(struct gsm_bts *bts) @@ -137,103 +139,6 @@ return 0; } -static void nm_statechg_evt(unsigned int signal, - struct nm_statechg_signal_data *nsd) -{ - struct abis_om2k_mo mo; - - if (nsd->bts->type != GSM_BTS_TYPE_RBS2000) - return; - - switch (nsd->om2k_mo->class) { - case OM2K_MO_CLS_CF: - if (nsd->new_state->operational != NM_OPSTATE_ENABLED || - nsd->new_state->availability != OM2K_MO_S_STARTED) - break; - /* CF has started, we can trigger IS and TF start */ - abis_om2k_tx_connect_cmd(nsd->bts, &om2k_mo_is); - abis_om2k_tx_connect_cmd(nsd->bts, &om2k_mo_tf); - break; - case OM2K_MO_CLS_IS: - if (nsd->new_state->availability == OM2K_MO_S_ENABLED) { - /* IS is enabled, we can proceed with TRXC/RX/TX/TS */ - break; - } - if (nsd->new_state->operational != NM_OPSTATE_ENABLED) - break; - /* IS has started, we can configure + enable it */ - abis_om2k_tx_is_conf_req(nsd->bts); - break; - case OM2K_MO_CLS_TF: - if (nsd->new_state->operational != NM_OPSTATE_ENABLED || - nsd->new_state->availability == OM2K_MO_S_DISABLED) - break; - if (nsd->new_state->availability == OM2K_MO_S_STARTED) { - /* TF has started, configure + enable it */ - abis_om2k_tx_tf_conf_req(nsd->bts); - } - break; - case OM2K_MO_CLS_TRXC: - if (nsd->new_state->availability != OM2K_MO_S_STARTED) - break; - /* TRXC is started, connect the TX and RX objects */ - memcpy(&mo, nsd->om2k_mo, sizeof(mo)); - mo.class = OM2K_MO_CLS_TX; - abis_om2k_tx_connect_cmd(nsd->bts, &mo); - mo.class = OM2K_MO_CLS_RX; - abis_om2k_tx_connect_cmd(nsd->bts, &mo); - break; - case OM2K_MO_CLS_RX: - if (nsd->new_state->operational != NM_OPSTATE_ENABLED || - nsd->new_state->availability != OM2K_MO_S_STARTED) - break; - /* RX is started, configure + enable it */ - abis_om2k_tx_rx_conf_req(nsd->obj); - break; - case OM2K_MO_CLS_TX: - if (nsd->new_state->operational != NM_OPSTATE_ENABLED || - nsd->new_state->availability != OM2K_MO_S_STARTED) - break; - /* RX is started, configure + enable it */ - abis_om2k_tx_tx_conf_req(nsd->obj); - break; - } -} - -static void nm_conf_res(struct nm_om2k_signal_data *nsd) -{ - switch (nsd->om2k_mo->class) { - case OM2K_MO_CLS_IS: - case OM2K_MO_CLS_TF: - case OM2K_MO_CLS_RX: - case OM2K_MO_CLS_TX: - /* If configuration was a success, enable it */ - abis_om2k_tx_enable_req(nsd->bts, nsd->om2k_mo); - break; - } -} - -static int nm_sig_cb(unsigned int subsys, unsigned int signal, - void *handler_data, void *signal_data) -{ - if (subsys != SS_NM) - return 0; - - switch (signal) { - case S_NM_STATECHG_OPER: - case S_NM_STATECHG_ADM: - nm_statechg_evt(signal, signal_data); - break; - case S_NM_OM2K_CONF_RES: - nm_conf_res(signal_data); - break; - default: - break; - } - - return 0; -} - static void config_write_bts(struct vty *vty, struct gsm_bts *bts) { abis_om2k_config_write_bts(vty, bts); @@ -266,7 +171,6 @@ osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); osmo_signal_register_handler(SS_L_GLOBAL, gbl_sig_cb, NULL); - osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); return 0; } -- To view, visit https://gerrit.osmocom.org/1156 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3e11b28ba22b8c227e0401e6207fdda5381dda8c Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:38:11 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:38:11 +0000 Subject: openbsc[master]: SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:39:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:39:34 +0000 Subject: osmo-pcu[master]: BTS: accept also relative frame numbers with rach requst In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1205 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iaa182d8d29c6a0f5fa06064c2eb48b21b1ba2775 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:40:16 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:40:16 +0000 Subject: osmo-bts[master]: fix 'osmo-bts-* --version' segfault In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:40:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:40:39 +0000 Subject: osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:40:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:40:43 +0000 Subject: [MERGED] osmo-pcu[master]: Handle Immediate assignment reject In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Handle Immediate assignment reject ...................................................................... Handle Immediate assignment reject When RACH is received, PCU will generate the Immediate assignment reject message if no resources are present. The encoding is done based on section 9.1.20 of 44.018 version 11.7.0 Release 11. This patch also includes the test case to validate the generated Immediate assignment reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok M tests/types/TypesTest.cpp M tests/types/TypesTest.ok 8 files changed, 520 insertions(+), 68 deletions(-) Approvals: Max: Looks good to me, but someone else must approve arvind.sirsikar: Looks good to me, but someone else must approve; Verified Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index 4aa5c2c..4e6b5e9 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -475,32 +475,42 @@ uint8_t trx_no, ts_no = 0; uint8_t sb = 0; uint32_t sb_fn = 0; - int rc; + int rc = 0; int plen; uint8_t usf = 7; - uint8_t tsc, ta = qta2ta(qta); + uint8_t tsc = 0, ta = qta2ta(qta); uint16_t ms_class = 0; uint16_t priority = 0; + bool failure = false; rach_frame(); - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide " - "one:\n"); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, " + "so we provide one \n" + "ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); sb = is_single_block(ra, burst_type, is_11bit, &ms_class, &priority); if (sb) { rc = sba()->alloc(&trx_no, &ts_no, &sb_fn, ta); - if (rc < 0) - return rc; - LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH qbit-ta=%d " - "ra=0x%02x, Fn=%d (%d,%d,%d), SBFn=%d\n", - qta, ra, - Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, - sb_fn); - LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment Uplink " - "(AGCH)\n"); - tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + if (rc < 0) { + failure = true; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource for " + "single block allocation." + "sending Immediate " + "Assignment Uplink (AGCH) reject\n"); + } else { + tsc = m_bts.trx[trx_no].pdch[ts_no].tsc; + + LOGP(DRLCMAC, LOGL_DEBUG, "RX: [PCU <- BTS] RACH " + " qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)," + " SBFn=%d\n", + qta, ra, + Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26, + sb_fn); + LOGP(DRLCMAC, LOGL_INFO, "TX: Immediate Assignment " + "Uplink (AGCH)\n"); + } } else { // Create new TBF #warning "Copy and paste with other routines.." @@ -515,47 +525,60 @@ } if (!tbf) { - LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n"); - /* FIXME: send reject */ - return -EBUSY; + LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource sending " + "Immediate Assignment Uplink (AGCH) " + "reject\n"); + rc = -EBUSY; + failure = true; + } else { + tbf->set_ta(ta); + tbf->set_state(GPRS_RLCMAC_FLOW); + tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); + tbf_timer_start(tbf, 3169, m_bts.t3169, 0); + LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", + tbf_name(tbf)); + LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " + "qbit-ta=%d ra=0x%02x, Fn=%d " + " (%d,%d,%d)\n", + tbf_name(tbf), + qta, ra, Fn, (Fn / (26 * 51)) % 32, + Fn % 51, Fn % 26); + LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " + "Assignment Uplink (AGCH)\n", + tbf_name(tbf)); + trx_no = tbf->trx->trx_no; + ts_no = tbf->first_ts; + usf = tbf->m_usf[ts_no]; + tsc = tbf->tsc(); } - tbf->set_ta(ta); - tbf->set_state(GPRS_RLCMAC_FLOW); - tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH); - tbf_timer_start(tbf, 3169, m_bts.t3169, 0); - LOGP(DRLCMAC, LOGL_DEBUG, "%s [UPLINK] START\n", - tbf_name(tbf)); - LOGP(DRLCMAC, LOGL_DEBUG, "%s RX: [PCU <- BTS] RACH " - "qbit-ta=%d ra=0x%02x, Fn=%d (%d,%d,%d)\n", - tbf_name(tbf), - qta, ra, Fn, (Fn / (26 * 51)) % 32, Fn % 51, Fn % 26); - LOGP(DRLCMAC, LOGL_INFO, "%s TX: START Immediate " - "Assignment Uplink (AGCH)\n", tbf_name(tbf)); - trx_no = tbf->trx->trx_no; - ts_no = tbf->first_ts; - usf = tbf->m_usf[ts_no]; - tsc = tbf->tsc(); } bitvec *immediate_assignment = bitvec_alloc(22) /* without plen */; bitvec_unhex(immediate_assignment, "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); - LOGP(DRLCMAC, LOGL_DEBUG, - " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", - trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, - tbf ? tbf->tfi() : -1, usf); - plen = Encoding::write_immediate_assignment( - tbf, immediate_assignment, 0, ra, Fn, ta, - m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, - m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + if (failure) + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment, ra, Fn, + burst_type); + else { + LOGP(DRLCMAC, LOGL_DEBUG, + " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", + trx_no, m_bts.trx[trx_no].arfcn, ts_no, ta, tsc, + tbf ? tbf->tfi() : -1, usf); + + plen = Encoding::write_immediate_assignment( + tbf, immediate_assignment, 0, ra, Fn, ta, + m_bts.trx[trx_no].arfcn, ts_no, tsc, usf, 0, sb_fn, + m_bts.alpha, m_bts.gamma, -1, burst_type, sb); + } if (plen >= 0) pcu_l1if_tx_agch(immediate_assignment, plen); bitvec_free(immediate_assignment); - return 0; + return rc; } uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type, diff --git a/src/encoding.cpp b/src/encoding.cpp index fb80eeb..ca72b0f 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -242,6 +242,84 @@ } /* + * Immediate assignment reject, sent on the CCCH/AGCH + * see GSM 44.018, 9.1.20 + 10.5.2.30 + */ +int Encoding::write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type) +{ + unsigned wp = 0; + int plen; + int i; + + bitvec_write_field(dest, wp, 0x0, 4); // Skip Indicator + bitvec_write_field(dest, wp, 0x6, 4); // Protocol Discriminator + bitvec_write_field(dest, wp, 0x3A, 8); // Immediate Assign Message Type + + // feature indicator + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // spare + bitvec_write_field(dest, wp, 0x0, 1); // no cs + bitvec_write_field(dest, wp, 0x1, 1); // implicit detach for PS + + bitvec_write_field(dest, wp, 0x0, 4); // Page Mode + /* + * 9.1.20.2 of 44.018 version 11.7.0 Release 11 + * Filling of the message + * If necessary the request reference information element and the + * wait indication information element should be duplicated to + * fill the message. + * TODO: group rejection for multiple MS + */ + for (i = 0; i < 4; i++) { + //10.5.2.30 Request Reference + if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + bitvec_write_field(dest, wp, 0x7f, 8); /* RACH value */ + } else { + bitvec_write_field(dest, wp, ra, 8); /* RACH value */ + } + + bitvec_write_field(dest, wp, + (ref_fn / (26 * 51)) % 32, 5); // T1' + bitvec_write_field(dest, wp, ref_fn % 51, 6); // T3 + bitvec_write_field(dest, wp, ref_fn % 26, 5); // T2 + + /* TODO: Make it configurable */ + bitvec_write_field(dest, wp, 20, 8); //Wait Indication 1 + } + + plen = wp / 8; + + if ((wp % 8)) { + LOGP(DRLCMACUL, LOGL_ERROR, "Length of IMM.ASS.Rej without" + "rest octets is not multiple of 8 bits, PLEASE FIX!\n"); + return -1; + } + + // Extended RA + else if (((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) || + (burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) { + //9.1.20.2a of 44.018 version 11.7.0 Release 11 + uint8_t extended_ra = 0; + + extended_ra = (ra & 0x1F); + bitvec_write_field(dest, wp, 0x1, 1); + bitvec_write_field(dest, wp, extended_ra, 5); /* Extended RA */ + } else { + bitvec_write_field(dest, wp, 0x0, 1); + } + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + bitvec_write_field(dest, wp, 0x0, 1); + + return plen; +} + +/* * Immediate assignment, sent on the CCCH/AGCH * see GSM 04.08, 9.1.18 and GSM 44.018, 9.1.18 + 10.5.2.16 */ diff --git a/src/encoding.h b/src/encoding.h index 69f8cdc..79dc32d 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -52,6 +52,12 @@ GSM_L1_BURST_TYPE_ACCESS_0, uint8_t sb = 1); + static int write_immediate_assignment_reject( + bitvec *dest, uint16_t ra, + uint32_t ref_fn, + enum ph_burst_type burst_type + ); + static void write_packet_uplink_assignment( struct gprs_rlcmac_bts *bts, bitvec * dest, uint8_t old_tfi, diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index cc48392..339390b 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1372,6 +1372,88 @@ printf("=== end %s ===\n", __func__); } +/* + * Trigger rach for single block + */ +static void test_immediate_assign_rej_single_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + the_bts.bts_data()->trx[0].pdch[ts_no].disable(); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment + * Uplink reject on the AGCH + */ + rc = the_bts.rcv_rach(0x70, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EINVAL); + + printf("=== end %s ===\n", __func__); +} + +/* + * Trigger rach till resources(USF) exhaust + */ +static void test_immediate_assign_rej_multi_block() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + uint32_t rach_fn = fn - 51; + + int rc = 0; + + /* + * simulate RACH, sends an Immediate Assignment Uplink + * reject on the AGCH + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7f, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + OSMO_ASSERT(rc == -EBUSY); + + printf("=== end %s ===\n", __func__); +} + +static void test_immediate_assign_rej() +{ + test_immediate_assign_rej_multi_block(); + test_immediate_assign_rej_single_block(); +} + static void test_tbf_two_phase() { BTS the_bts; @@ -2791,6 +2873,7 @@ test_tbf_update_ws(); test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); + test_immediate_assign_rej(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index fc3a113..627cdc3 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -1510,7 +1510,8 @@ MSG = 07 01 04 4d 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 03 Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654167 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -1531,7 +1532,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654167 (17,25,9) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b 29 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -1584,9 +1585,10 @@ Sending data request: trx=0 ts=0 sapi=3 arfcn=0 fn=0 block=0 data=33 34 34 2d 06 3f 30 0f 00 00 7d 80 00 07 00 df 12 23 34 48 00 23 2b 2b 2b 2b TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1669,9 +1671,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1803,9 +1806,10 @@ - Copying data unit 0 (BSN 0) msg block (BSN 0, CS-4): 07 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=00 01 00 29 52 41 55 5f 41 43 43 45 50 54 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 00 -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654232 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654232 (17,39,22), SBFn=2654335 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8c f6 07 00 c0 0c 68 ab 2b 2b 2b 2b 2b 2b 2b @@ -1879,9 +1883,10 @@ Modifying MS object, TLLI: 0xf5667788 confirmed New MS: TLLI = 0xf5667788, TA = 7, IMSI = 0011223344, LLC = 1 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -1972,9 +1977,10 @@ Detaching TBF from MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW) ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654224 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654224 (17,31,14), SBFn=2654327 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b ee 07 00 c0 0c 60 6b 2b 2b 2b 2b 2b 2b 2b @@ -2056,9 +2062,10 @@ - No gaps in received block, last block: BSN=0 CV=15 New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -2150,7 +2157,8 @@ ********** TBF ends here ********** Searching for first unallocated TFI: TRX=0 Found TFI=0. -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x03 Fn=2654275 qta=31 is_11bit=0: ********** TBF starts here ********** Allocating UL TBF: MS_CLASS=0/0 Creating MS object, TLLI = 0x00000000 @@ -2171,7 +2179,7 @@ TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START -TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x03, Fn=2654275 (17,31,13) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 03 8b ed 07 00 c8 00 10 0b 2b 2b 2b 2b 2b 2b 2b @@ -2210,9 +2218,10 @@ - Scheduling Ack/Nack, because last block has CV==0. New MS: TLLI = 0xf1223344, TA = 7, IMSI = 0011223344, LLC = 2 Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3344,9 +3353,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -3436,9 +3446,10 @@ TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6198,9 +6209,10 @@ Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6370,9 +6382,10 @@ Destroying MS object, TLLI = 0x00000000 ********** TBF ends here ********** Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b -MS requests UL TBF on RACH, so we provide one: +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: MS requests single block allocation -RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 TX: Immediate Assignment Uplink (AGCH) - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b @@ -6627,3 +6640,209 @@ Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=RELEASING EGPRS) Destroying MS object, TLLI = 0xffeeddcc ********** TBF ends here ********** +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7f Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 7f 8b 29 14 0b 2b 2b +Destroying MS object, TLLI = 0x00000000 +MS requests UL TBF on RACH, so we provide one +ra=0x70 Fn=2654167 qta=31 is_11bit=0: +MS requests single block allocation +No PDCH available. +No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index 2978d6d..f921dfc 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -68,3 +68,7 @@ === end test_tbf_li_decoding === === start test_tbf_epdan_out_of_rx_window === === end test_tbf_epdan_out_of_rx_window === +=== start test_immediate_assign_rej_multi_block === +=== end test_immediate_assign_rej_multi_block === +=== start test_immediate_assign_rej_single_block === +=== end test_immediate_assign_rej_single_block === diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index 8b3cfd1..ee1c817 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -427,6 +427,42 @@ } } +void test_immediate_assign_rej() +{ + uint8_t plen; + bitvec *immediate_assignment_rej = bitvec_alloc(22); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_1); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x7f); + /* Extended RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[19] == 0xc0); + + bitvec_unhex(immediate_assignment_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + plen = Encoding::write_immediate_assignment_reject( + immediate_assignment_rej, 112, 100, + GSM_L1_BURST_TYPE_ACCESS_0); + + printf("assignment reject: %s\n", + osmo_hexdump(immediate_assignment_rej->data, 22)); + + OSMO_ASSERT(plen == 19); + /* RA value */ + OSMO_ASSERT(immediate_assignment_rej->data[3] == 0x70); + +} + int main(int argc, char **argv) { osmo_init_logging(&gprs_log_info); @@ -439,6 +475,7 @@ test_rlc_v_b(); test_rlc_v_n(); test_rlc_dl_ul_basic(); + test_immediate_assign_rej(); return EXIT_SUCCESS; } diff --git a/tests/types/TypesTest.ok b/tests/types/TypesTest.ok index cb40d39..fe5162c 100644 --- a/tests/types/TypesTest.ok +++ b/tests/types/TypesTest.ok @@ -6,3 +6,5 @@ rbb: 10 00 00 00 00 00 00 01 show_rbb: RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR show_rbb: IIRRIIIR +assignment reject: 06 3a 10 7f 06 36 14 7f 06 36 14 7f 06 36 14 7f 06 36 14 c0 2b 2b +assignment reject: 06 3a 10 70 06 36 14 70 06 36 14 70 06 36 14 70 06 36 14 0b 2b 2b -- To view, visit https://gerrit.osmocom.org/1204 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3d33e2b9746fa4f338fad0e6b63b1c5f07de6f9b Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:41:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:41:12 +0000 Subject: openbsc[master]: test/gbproxy: Test for possible memory corruption when link_... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:41:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:41:39 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:42:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:42:26 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1198/1/src/input/unixsocket.c File src/input/unixsocket.c: Line 177: ret = osmo_sock_unix_init(SOCK_SEQPACKET, 0, sock_path, OSMO_SOCK_F_CONNECT); > it already break the build on freebsd. can you please be more specific? what breaks the freebsd build? -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:42:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:42:41 +0000 Subject: openbsc[master]: SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/1217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:42:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:42:46 +0000 Subject: [MERGED] openbsc[master]: SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP ...................................................................... SGSN: Use dummy all-zero MSISDN value in PDP Context Act on GTP The GTP protocol specification requires us to include the MSISDN IE in all non-secondary PDP context activations. However, when no real HLR is used (e.g. via GSUP), we do not have the MSISDN information available and so far simply sent a zero-length MSISDN IE in GTP. The latter is a violation of the spec. So to resolve this, we now send a 15-digit all-zero dummy MSISDN IE, as described in TS 23.003. Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d --- M openbsc/src/gprs/sgsn_libgtp.c 1 file changed, 14 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c index 29c9f06..072b9ba 100644 --- a/openbsc/src/gprs/sgsn_libgtp.c +++ b/openbsc/src/gprs/sgsn_libgtp.c @@ -59,6 +59,15 @@ #include #include +/* TS 23.003: The MSISDN shall take the dummy MSISDN value composed of + * 15 digits set to 0 (encoded as an E.164 international number) when + * the MSISDN is not available in messages in which the presence of the + * MSISDN parameter */ +static const uint8_t dummy_msisdn[] = + { 0x91, /* No extension, international, E.164 */ + 0, 0, 0, 0, 0, 0, 0, /* 14 digits of zeroes */ + 0xF0 /* 15th digit of zero + padding */ }; + const struct value_string gtp_cause_strs[] = { { GTPCAUSE_REQ_IMSI, "Request IMSI" }, { GTPCAUSE_REQ_IMEI, "Request IMEI" }, @@ -167,12 +176,16 @@ /* IMSI, TEID/TEIC, FLLU/FLLC, TID, NSAPI set in pdp_newpdp */ /* Put the MSISDN in case we have it */ - if (mmctx->subscr) { + if (mmctx->subscr && mmctx->subscr->sgsn_data->msisdn_len) { pdp->msisdn.l = mmctx->subscr->sgsn_data->msisdn_len; if (pdp->msisdn.l > sizeof(pdp->msisdn.v)) pdp->msisdn.l = sizeof(pdp->msisdn.v); memcpy(pdp->msisdn.v, mmctx->subscr->sgsn_data->msisdn, pdp->msisdn.l); + } else { + /* use the dummy 15-digits-zero MSISDN value */ + pdp->msisdn.l = sizeof(dummy_msisdn); + memcpy(pdp->msisdn.v, dummy_msisdn, pdp->msisdn.l); } /* End User Address from GMM requested PDP address */ -- To view, visit https://gerrit.osmocom.org/1217 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8d0a5d52d6cd2a00b5dda060bd41d45056dfa84d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:11 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:11 +0000 Subject: openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:13 +0000 Subject: [MERGED] openbsc[master]: lchan: Release channel in case of late activation ack In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lchan: Release channel in case of late activation ack ...................................................................... lchan: Release channel in case of late activation ack In case of the sysmoBTS and receiving a channel activation ack on a channel that was marked as broken, release it again. Use a normal release without SACCH deactivation and release the rqd_ta data. Also add a local variable 'ts' to shorten some lines. The typical situation where this would occur is with high latency between BTS and BSC (or NITB). If a channel activation ack does not arrive in time, a channel is marked broken, and never recovers after that. This patch will release the channel again, which will remove the BROKEN_UNUSABLE state and makes lchan available again. Reported by Rhizomatica. However, in case of packet loss, i.e. when the channel activation ack never arrives at the BSC, this patch does not provide a resolution of the BROKEN_UNUSABLE state. On dynamic timeslots: clearing the dyn ts state could possibly happen in lchan_free() instead of in rsl_rx_chan_act_ack(). That's to be done in a separate patch, if at all. Tweaked-By: nhofmeyr Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 28 insertions(+), 3 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 3788644..36487c7 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -1172,6 +1172,7 @@ { struct abis_rsl_dchan_hdr *rslh = msgb_l2(msg); struct gsm_lchan *lchan = msg->lchan; + struct gsm_bts_trx_ts *ts = lchan->ts; /* BTS has confirmed channel activation, we now need * to assign the activated channel to the MS */ @@ -1181,8 +1182,32 @@ osmo_timer_del(&lchan->act_timer); if (lchan->state == LCHAN_S_BROKEN) { - LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK for broken channel.\n", - gsm_lchan_name(lchan)); + int do_release = is_sysmobts_v2(ts->trx->bts); + LOGP(DRSL, LOGL_NOTICE, "%s CHAN ACT ACK for broken channel. %s\n", + gsm_lchan_name(lchan), + do_release ? "Releasing it" : "Keeping it broken"); + if (do_release) { + talloc_free(lchan->rqd_ref); + lchan->rqd_ref = NULL; + lchan->rqd_ta = 0; + rsl_lchan_set_state(msg->lchan, LCHAN_S_ACTIVE); + if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) { + /* + * lchan_act_tmr_cb() already called + * lchan_free() and cleared the lchan->type, so + * calling dyn_ts_switchover_complete() here + * would not have the desired effect of + * mimicking an activated lchan that we can + * release. Instead hack the dyn ts state to + * make sure that rsl_rx_rf_chan_rel_ack() will + * switch back to PDCH, i.e. have pchan_is == + * pchan_want, both != GSM_PCHAN_PDCH: + */ + ts->dyn.pchan_is = GSM_PCHAN_NONE; + ts->dyn.pchan_want = GSM_PCHAN_NONE; + } + rsl_rf_chan_release(msg->lchan, 0, SACCH_NONE); + } return 0; } @@ -1192,7 +1217,7 @@ gsm_lchans_name(lchan->state)); rsl_lchan_set_state(lchan, LCHAN_S_ACTIVE); - if (lchan->ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) + if (ts->pchan == GSM_PCHAN_TCH_F_TCH_H_PDCH) dyn_ts_switchover_complete(lchan); if (lchan->rqd_ref) { -- To view, visit https://gerrit.osmocom.org/713 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I63dc0deaf15ba7c21e20b1e0c7b85f0437e183ed Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: keith From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:34 +0000 Subject: [MERGED] openbsc[master]: om2000: Add support for querying RBS capabilities In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: om2000: Add support for querying RBS capabilities ...................................................................... om2000: Add support for querying RBS capabilities Change-Id: Id1fbaf41286f3651ce8f210eb8da05fb51179c96 --- M openbsc/include/openbsc/abis_om2000.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/abis_om2000_vty.c 3 files changed, 28 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index 5a7344f..c745112 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -77,6 +77,7 @@ int abis_om2k_tx_test_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); int abis_om2k_tx_op_info(struct gsm_bts *bts, const struct abis_om2k_mo *mo, uint8_t operational); +int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo); int abis_om2k_tx_is_conf_req(struct gsm_bts *bts); int abis_om2k_tx_tf_conf_req(struct gsm_bts *bts); int abis_om2k_tx_rx_conf_req(struct gsm_bts_trx *trx); diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index aeac876..3337412 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -190,6 +190,13 @@ OM2K_MSGT_TX_CONF_RES_NACK = 0x00b5, OM2K_MSGT_TX_CONF_RES = 0x00b6, + OM2K_MSGT_CAPA_REQ = 0x00e8, + OM2K_MSGT_CAPA_REQ_ACK = 0x00ea, + OM2K_MSGT_CAPA_REQ_REJ = 0x00eb, + OM2K_MSGT_CAPA_RES = 0x00ee, + OM2K_MSGT_CAPA_RES_ACK = 0x00ec, + OM2K_MSGT_CAPA_RES_NACK = 0x00ed, + OM2K_MSGT_NEGOT_REQ_ACK = 0x0104, OM2K_MSGT_NEGOT_REQ_NACK = 0x0105, OM2K_MSGT_NEGOT_REQ = 0x0106, @@ -1065,6 +1072,11 @@ update_op_state(bts, mo, operational); return abis_om2k_sendmsg(bts, msg); +} + +int abis_om2k_tx_cap_req(struct gsm_bts *bts, const struct abis_om2k_mo *mo) +{ + return abis_om2k_tx_simple(bts, mo, OM2K_MSGT_CAPA_REQ); } static void om2k_fill_is_conn_grp(struct om2k_is_conn_grp *grp, uint16_t icp1, @@ -2439,6 +2451,9 @@ case OM2K_MSGT_TEST_RES: rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_TEST_RES_ACK); break; + case OM2K_MSGT_CAPA_RES: + rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_CAPA_RES_ACK); + break; /* ERrors */ case OM2K_MSGT_START_REQ_REJ: case OM2K_MSGT_CONNECT_REJ: diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 72422a1..d48ff95 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -236,6 +236,17 @@ return CMD_SUCCESS; } +DEFUN(om2k_cap_req, om2k_cap_req_cmd, + "capabilities-request", + "Request MO capabilities\n") +{ + struct oml_node_state *oms = vty->index; + + abis_om2k_tx_cap_req(oms->bts, &oms->mo); + return CMD_SUCCESS; +} + + struct con_conn_group { struct llist_head list; @@ -455,6 +466,7 @@ install_element(OM2K_NODE, &om2k_disable_cmd); install_element(OM2K_NODE, &om2k_op_info_cmd); install_element(OM2K_NODE, &om2k_test_cmd); + install_element(OM2K_NODE, &om2k_cap_req_cmd); install_element(OM2K_NODE, &om2k_conf_req_cmd); install_element(OM2K_NODE, &om2k_con_list_dec_cmd); install_element(OM2K_NODE, &om2k_con_list_tei_cmd); -- To view, visit https://gerrit.osmocom.org/1159 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id1fbaf41286f3651ce8f210eb8da05fb51179c96 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:35 +0000 Subject: [MERGED] openbsc[master]: om2000: added support for ericssons sabm negotiation In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: om2000: added support for ericssons sabm negotiation ...................................................................... om2000: added support for ericssons sabm negotiation This patch adds support for ericssons sambm negotiation. This patch depends on libosmo-abis commit: 2788c7eacab91cd39d68e316fc8ee87763bbfeb4 Change-Id: I56b1c1cef07a61143fc0e8058480805cddfeff96 --- M openbsc/src/libbsc/bts_ericsson_rbs2000.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index 1d122ec..1300b4a 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -71,6 +71,9 @@ continue; llist_for_each_entry(link, &ts->sign.sign_links, list) { + lapd_instance_set_profile(ts->lapd, + &lapd_profile_abis_ericsson); + if (start) lapd_sap_start(ts->lapd, link->tei, link->sapi); else -- To view, visit https://gerrit.osmocom.org/1162 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56b1c1cef07a61143fc0e8058480805cddfeff96 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:35 +0000 Subject: [MERGED] openbsc[master]: OM2000: Throw error when MO can not be enabled In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Throw error when MO can not be enabled ...................................................................... OM2000: Throw error when MO can not be enabled Throw warning message in case the MO state does not change to enabled after sendeing an Enable-Request message. Change-Id: Idfde8d6f71526e8acfea51835732515a4bee858e --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 10 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 357e2e5..1ab77b1 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -2368,6 +2368,16 @@ get_value_string(om2k_msgcode_vals, odm->msg_type), get_value_string(om2k_mostate_vals, mo_state)); + /* Throw error message in case we see an enable rsponse that does + * not yield an enabled mo-state */ + if (odm->msg_type == OM2K_MSGT_ENABLE_RES + && mo_state != OM2K_MO_S_ENABLED) { + LOGP(DNM, LOGL_ERROR, + "Rx MO=%s %s Failed to enable MO State!\n", + om2k_mo_name(&odm->o2h.mo), + get_value_string(om2k_msgcode_vals, odm->msg_type)); + } + update_mo_state(bts, &odm->o2h.mo, mo_state); return 0; -- To view, visit https://gerrit.osmocom.org/1163 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idfde8d6f71526e8acfea51835732515a4bee858e Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:35 +0000 Subject: [MERGED] openbsc[master]: OM2000: Add fault report parsing In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Add fault report parsing ...................................................................... OM2000: Add fault report parsing This patch adds parsing for OM2000 MO fault report map parsing, the bits in the fault maps are counted out and displayed. Change-Id: I6e2928f39b09bc08e9ab78bc10bc81e07f7eb55d --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 129 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 3337412..357e2e5 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -238,6 +238,7 @@ OM2K_DEI_POWER = 0x2f, OM2K_DEI_REASON_CODE = 0x32, OM2K_DEI_RX_DIVERSITY = 0x33, + OM2K_DEI_REPL_UNIT_MAP = 0x34, OM2K_DEI_RESULT_CODE = 0x35, OM2K_DEI_T3105 = 0x38, OM2K_DEI_TF_MODE = 0x3a, @@ -252,7 +253,7 @@ OM2K_DEI_RSL_FUNC_MAP_2 = 0x46, OM2K_DEI_EXT_RANGE = 0x47, OM2K_DEI_REQ_IND = 0x48, - OM2K_DEI_REPL_UNIT_MAP = 0x50, + OM2K_DEI_REPL_UNIT_MAP_EXT = 0x50, OM2K_DEI_ICM_BOUND_PARAMS = 0x74, OM2K_DEI_LSC = 0x79, OM2K_DEI_LSC_FILT_TIME = 0x7a, @@ -268,6 +269,7 @@ OM2K_DEI_INTERF_REJ_COMB = 0x94, OM2K_DEI_FS_OFFSET = 0x98, OM2K_DEI_EXT_COND_MAP_2_EXT = 0x9c, + OM2K_DEI_TSS_MO_STATE = 0x9d, }; const struct tlv_definition om2k_att_tlvdef = { @@ -322,6 +324,7 @@ [OM2K_DEI_EXT_RANGE] = { TLV_TYPE_TV }, [OM2K_DEI_REQ_IND] = { TLV_TYPE_TV }, [OM2K_DEI_REPL_UNIT_MAP] = { TLV_TYPE_FIXED, 6 }, + [OM2K_DEI_REPL_UNIT_MAP_EXT] = {TLV_TYPE_FIXED, 6}, [OM2K_DEI_ICM_BOUND_PARAMS] = { TLV_TYPE_FIXED, 5 }, [OM2K_DEI_LSC] = { TLV_TYPE_TV }, [OM2K_DEI_LSC_FILT_TIME] = { TLV_TYPE_TV }, @@ -337,6 +340,7 @@ [OM2K_DEI_INTERF_REJ_COMB] = { TLV_TYPE_TV }, [OM2K_DEI_FS_OFFSET] = { TLV_TYPE_FIXED, 5 }, [OM2K_DEI_EXT_COND_MAP_2_EXT] = { TLV_TYPE_FIXED, 4 }, + [OM2K_DEI_TSS_MO_STATE] = { TLV_TYPE_FIXED, 4 }, }, }; @@ -2369,6 +2373,129 @@ return 0; } +/* Display fault report bits (helper function of display_fault_maps()) */ +static bool display_fault_bits(const uint8_t *vect, unsigned int len, + uint8_t dei, const struct abis_om2k_mo *mo) +{ + int i; + int k; + bool faults_present = false; + int first = 1; + char string[255]; + + /* Check if errors are present at all */ + for (i = 0; i < len; i++) + if (vect[i]) + faults_present = true; + if (!faults_present) + return false; + + sprintf(string, "Fault Report: %s (", + get_value_string(om2k_attr_vals, dei)); + + for (i = 0; i < len; i++) { + for (k = 0; k < 8; k++) { + if ((vect[i] >> k) & 1) { + if (!first) + sprintf(string + strlen(string), ","); + sprintf(string + strlen(string), "%d", k + i*8); + first = 0; + } + } + } + + sprintf(string + strlen(string), ")\n"); + DEBUGP(DNM, "Rx MO=%s %s", om2k_mo_name(mo), string); + + return true; +} + +/* Display fault report maps */ +static void display_fault_maps(const uint8_t *src, unsigned int src_len, + const struct abis_om2k_mo *mo) +{ + uint8_t tag; + uint16_t tag_len; + const uint8_t *val; + int src_pos = 0; + int rc; + int tlv_count = 0; + uint16_t msg_code; + bool faults_present = false; + + /* Chop off header */ + src+=4; + src_len-=4; + + /* Check message type */ + msg_code = (*src & 0xff) << 8; + src++; + src_len--; + msg_code |= (*src & 0xff); + src++; + src_len--; + if (msg_code != OM2K_MSGT_FAULT_REP) { + LOGP(DNM, LOGL_ERROR, "Rx MO=%s Fault report: invalid message code!\n", + om2k_mo_name(mo)); + return; + } + + /* Chop off mo-interface */ + src += 4; + src_len -= 4; + + /* Iterate over each TLV element */ + while (1) { + + /* Bail if an the maximum number of TLV fields + * have been parsed */ + if (tlv_count >= 11) { + LOGP(DNM, LOGL_ERROR, + "Rx MO=%s Fault Report: too many tlv elements!\n", + om2k_mo_name(mo)); + return; + } + + /* Parse TLV field */ + rc = tlv_parse_one(&tag, &tag_len, &val, &om2k_att_tlvdef, + src + src_pos, src_len - src_pos); + if (rc > 0) + src_pos += rc; + else { + LOGP(DNM, LOGL_ERROR, + "Rx MO=%s Fault Report: invalid tlv element!\n", + om2k_mo_name(mo)); + return; + } + + switch (tag) { + case OM2K_DEI_INT_FAULT_MAP_1A: + case OM2K_DEI_INT_FAULT_MAP_1B: + case OM2K_DEI_INT_FAULT_MAP_2A: + case OM2K_DEI_EXT_COND_MAP_1: + case OM2K_DEI_EXT_COND_MAP_2: + case OM2K_DEI_REPL_UNIT_MAP: + case OM2K_DEI_INT_FAULT_MAP_2A_EXT: + case OM2K_DEI_EXT_COND_MAP_2_EXT: + case OM2K_DEI_REPL_UNIT_MAP_EXT: + faults_present |= display_fault_bits(val, tag_len, + tag, mo); + break; + } + + /* Stop when no further TLV elements can be expected */ + if (src_len - src_pos < 2) + break; + + tlv_count++; + } + + if (!faults_present) { + DEBUGP(DNM, "Rx MO=%s Fault Report: All faults ceased!\n", + om2k_mo_name(mo)); + } +} + int abis_om2k_rcvmsg(struct msgb *msg) { struct e1inp_sign_link *sign_link = (struct e1inp_sign_link *)msg->dst; @@ -2414,6 +2541,7 @@ rc = abis_om2k_cal_time_resp(bts); break; case OM2K_MSGT_FAULT_REP: + display_fault_maps(msg->l2h, msgb_l2len(msg), &o2h->mo); rc = abis_om2k_tx_simple(bts, &o2h->mo, OM2K_MSGT_FAULT_REP_ACK); break; case OM2K_MSGT_NEGOT_REQ: -- To view, visit https://gerrit.osmocom.org/1161 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6e2928f39b09bc08e9ab78bc10bc81e07f7eb55d Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:43:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:43:35 +0000 Subject: [MERGED] openbsc[master]: RBS2000: re-establish any lost signalling links In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RBS2000: re-establish any lost signalling links ...................................................................... RBS2000: re-establish any lost signalling links Contrary to standard A-bis, in the RBS2000 case the BSC connects the signalling data links (LAPD) to the BTS. In case one of them drop, we need to attempt to re-establish them. This requires libosmo-abis with Change-Id I07f0f79e0cda09766f357032ffb4e7ad643d448a Change-Id: I710b5af5d0acbdd3febd314849340f2adb7abd80 --- M openbsc/src/libbsc/bts_ericsson_rbs2000.c 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index a828937..1d122ec 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -104,6 +104,7 @@ void *handler_data, void *signal_data) { struct input_signal_data *isd = signal_data; + struct e1inp_ts *e1i_ts; if (subsys != SS_L_INPUT) return 0; @@ -121,6 +122,17 @@ break; } break; + case S_L_INP_TEI_DN: + if (isd->trx->bts->type != GSM_BTS_TYPE_RBS2000) + break; + LOGP(DNM, LOGL_NOTICE, "Line-%u TS-%u TEI-%u SAPI-%u: Link " + "Lost for Ericsson RBS2000. Re-starting DL Establishment\n", + isd->line->num, isd->ts_nr, isd->tei, isd->sapi); + /* Some datalink for a given TEI/SAPI went down, try to re-start it */ + e1i_ts = &isd->line->ts[isd->ts_nr-1]; + OSMO_ASSERT(e1i_ts->type == E1INP_TS_TYPE_SIGN); + lapd_sap_start(e1i_ts->lapd, isd->tei, isd->sapi); + break; case S_L_INP_LINE_INIT: case S_L_INP_LINE_NOALARM: if (strcasecmp(isd->line->driver->name, "DAHDI") -- To view, visit https://gerrit.osmocom.org/1160 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I710b5af5d0acbdd3febd314849340f2adb7abd80 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 9 15:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 9 Nov 2016 15:44:36 +0000 Subject: openbsc[master]: abis_om2000: for TS conf of dyn TS, always send TCH/F as cha... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 i can see what the patch changes in detail, but I don't see why. This information belongs into the commit log. -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 16:07:48 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Nov 2016 16:07:48 +0000 Subject: osmo-bts[master]: fix 'osmo-bts-* --version' segfault In-Reply-To: References: Message-ID: Patch Set 1: Verified+1 before: root at sysmobts-v2:~# osmo-bts-sysmo --version ((*)) | / \ OsmoBTS Segmentation fault After: root at sysmobts-v2:~/neels# ./bin/osmo-bts-sysmo --version ((*)) | / \ OsmoBTS OsmoBTS version 0.4.0.322-c433 Copyright (C) 2010, 2011 by Harald Welte, Andreas Eversberg and On-Waves License AGPLv3+: GNU AGPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 16:23:20 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 9 Nov 2016 16:23:20 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 9 17:33:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 9 Nov 2016 17:33:21 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: vty prompts: add space after '#' Message-ID: Review at https://gerrit.osmocom.org/1220 cosmetic: vty prompts: add space after '#' Typically, our VTY prompts have space after the '#', but some of the osmo-bts VTY prompts don't: OsmoBTS# configure terminal OsmoBTS(config)# bts 0 OsmoBTS(bts)#gsmtap-sapi ccch Add spaces after the '#' to yield e.g. OsmoBTS(bts)# gsmtap-sapi ccch Change-Id: If0591a359e77f01abb76c4113181af7a7733ddd4 --- M src/common/vty.c 1 file changed, 4 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/20/1220/1 diff --git a/src/common/vty.c b/src/common/vty.c index b4aa616..ca2bfc6 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -179,13 +179,13 @@ static struct cmd_node bts_node = { BTS_NODE, - "%s(bts)#", + "%s(bts)# ", 1, }; static struct cmd_node trx_node = { TRX_NODE, - "%s(trx)#", + "%s(trx)# ", 1, }; @@ -895,13 +895,13 @@ static struct cmd_node phy_node = { PHY_NODE, - "%s(phy)#", + "%s(phy)# ", 1, }; static struct cmd_node phy_inst_node = { PHY_INST_NODE, - "%s(phy-inst)#", + "%s(phy-inst)# ", 1, }; -- To view, visit https://gerrit.osmocom.org/1220 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If0591a359e77f01abb76c4113181af7a7733ddd4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 00:29:42 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 00:29:42 +0000 Subject: osmo-bts[master]: fix 'osmo-bts-* --version' segfault In-Reply-To: References: Message-ID: Patch Set 1: let's wait for https://osmocom.org/issues/1746 -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 00:58:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 00:58:16 +0000 Subject: [PATCH] openbsc[master]: abis_om2000: for TS conf of dyn TS, always send TCH/F as cha... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1218 to look at the new patch set (#2). abis_om2000: for TS conf of dyn TS, always send TCH/F as chan comb When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as TCH/F. Initially, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This a slight mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as TCH/F because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1218/2 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 01:00:40 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 01:00:40 +0000 Subject: [PATCH] openbsc[master]: abis_om2000: for TS conf of dyn TS, always send TCH/F as cha... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1218 to look at the new patch set (#3). abis_om2000: for TS conf of dyn TS, always send TCH/F as chan comb When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as pchan2comb(TCH/F). In the past, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This a slight mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as pchan2comb(TCH/F) because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1218/3 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 01:02:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 01:02:27 +0000 Subject: [PATCH] openbsc[master]: abis_om2000: for TS conf of dyn TS, always send TCH/F as cha... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1218 to look at the new patch set (#4). abis_om2000: for TS conf of dyn TS, always send TCH/F as chan comb When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as pchan2comb(TCH/F). In the past, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This is a mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as pchan2comb(TCH/F) because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1218/4 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 01:20:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 01:20:24 +0000 Subject: [PATCH] openbsc[master]: OM2000: for TS conf of dyn TS, always send TCH/F chan comb In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1218 to look at the new patch set (#5). OM2000: for TS conf of dyn TS, always send TCH/F chan comb When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as pchan2comb(TCH/F). In the past, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This is a mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as pchan2comb(TCH/F) because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1218/5 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 01:20:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 01:20:24 +0000 Subject: [PATCH] openbsc[master]: OM2000: disallow ip.access style TCH/F_PDCH pchan type Message-ID: Review at https://gerrit.osmocom.org/1221 OM2000: disallow ip.access style TCH/F_PDCH pchan type For TCH/F_PDCH, return an invalid chan comb (0) and print an error message that hints at the proper pchan type to use instead: TCH/F_TCH/H_PDCH Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 9 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/1221/1 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 0890a15..8c4bfb3 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,6 +1264,15 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: + LOGP(DNM, LOGL_ERROR, "%s pchan %s not intended for use" + " with OM2000, use %s instead\n", + gsm_ts_and_pchan_name(ts), + gsm_pchan_name(GSM_PCHAN_TCH_F_PDCH), + gsm_pchan_name(GSM_PCHAN_TCH_F_TCH_H_PDCH)); + /* If we allowed initialization of TCH/F_PDCH, it would fail + * when we try to send the ip.access specific RSL PDCH Act + * message for it. Rather fail completely right now: */ + return 0; case GSM_PCHAN_TCH_F_TCH_H_PDCH: return pchan2comb(GSM_PCHAN_TCH_F); default: -- To view, visit https://gerrit.osmocom.org/1221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 01:21:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 01:21:20 +0000 Subject: openbsc[master]: OM2000: for TS conf of dyn TS, always send TCH/F chan comb In-Reply-To: References: Message-ID: Patch Set 5: see also gerrit #1221 which suggests a way to disallow ip.access style TCH/F_PDCH pchans -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 02:21:01 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 10 Nov 2016 02:21:01 +0000 Subject: [PATCH] openbsc[master]: fix use after free in bsc_config_free Message-ID: Review at https://gerrit.osmocom.org/1222 fix use after free in bsc_config_free talloc_free the cfg only after asserting num_bsc count sanity. This caused a failure in the 'bsc-nat' test with -fsanitize build. Should fix the Osmocom_Sanitizer build on jenkins.osmocom.org https://jenkins.osmocom.org/jenkins/job/Osmocom_Sanitizer/ Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6 --- M openbsc/src/osmo-bsc_nat/bsc_nat_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/1222/1 diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 37b01e3..bb0f4c4 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -205,9 +205,9 @@ { llist_del(&cfg->entry); rate_ctr_group_free(cfg->stats.ctrg); - talloc_free(cfg); cfg->nat->num_bsc--; OSMO_ASSERT(cfg->nat->num_bsc >= 0) + talloc_free(cfg); } static void _add_lac(void *ctx, struct llist_head *list, int _lac) -- To view, visit https://gerrit.osmocom.org/1222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 06:07:31 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 06:07:31 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1216 to look at the new patch set (#2). Handle packet access reject during packet resource request When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 7 files changed, 338 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/16/1216/2 diff --git a/src/bts.cpp b/src/bts.cpp index 0668c2d..f0dcd61 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1285,8 +1285,13 @@ egprs_ms_class); ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, egprs_ms_class, tlli, ta, ms); - if (!ul_tbf) + + /* if no resource send packet resource request */ + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); return; + } /* set control ts to current MS's TS, until assignment complete */ LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a3723df..a8b716d 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -56,7 +56,9 @@ *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || ul_tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } @@ -136,8 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - - if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) + if (tbf == ul_ass_tbf && tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else if (tbf == ul_ass_tbf && tbf->direction == + GPRS_RLCMAC_DL_TBF) if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) msg = ul_ass_tbf->create_packet_access_reject(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 2d82727..7e98a72 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1032,6 +1032,9 @@ bitvec_free(packet_access_rej); ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + /* Start Tmr only if it is UL TBF */ + if (direction == GPRS_RLCMAC_UL_TBF) + tbf_timer_start(this, 0, Tassign_pacch); return msg; } @@ -1260,3 +1263,32 @@ { return ts == control_ts; } + +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts) +{ + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); + if (!ul_tbf) + return; + + talloc_set_destructor(ul_tbf, ul_tbf_dtor); + new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + if (!ms) + ms = bts->bts->ms_alloc(0, 0); + + ms->set_tlli(tlli); + + llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + ul_tbf->bts->tbf_ul_created(); + ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + + ul_tbf->set_ms(ms); + ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + ul_tbf->control_ts = ts; + ul_tbf->trx = trx; +} diff --git a/src/tbf.h b/src/tbf.h index e044053..518c2ce 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -264,6 +264,8 @@ uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 213bd12..6bfe9cc 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,80 @@ ARRAY_SIZE(default_categories), }; +static void test_packet_access_rej_prr() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + uint8_t trx_no = 0; + RlcMacUplink_t ulreq = {0}; + Packet_Resource_Request_t *presreq = NULL; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + uint32_t rach_fn = fn - 51; + uint32_t sba_fn = fn + 52; + uint32_t tlli = 0xffeeddcc; + MS_Radio_Access_capability_t *pmsradiocap = NULL; + Multislot_capability_t *pmultislotcap = NULL; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + int rc = 0; + + /* + * Trigger rach till resources(USF) exhaust + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + presreq = &ulreq.u.Packet_Resource_Request; + presreq->PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + presreq->ID.UnionType = 1; /* != 0 */ + presreq->ID.u.TLLI = tlli; + presreq->Exist_MS_Radio_Access_capability = 1; + pmsradiocap = &presreq->MS_Radio_Access_capability; + pmsradiocap->Count_MS_RA_capability_value = 1; + pmsradiocap->MS_RA_capability_value[0].u.Content. + Exist_Multislot_capability = 1; + pmultislotcap = &pmsradiocap->MS_RA_capability_value[0]. + u.Content.Multislot_capability; + + pmultislotcap->Exist_GPRS_multislot_class = 1; + pmultislotcap->GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + pmultislotcap->Exist_EGPRS_multislot_class = 1; + pmultislotcap->EGPRS_multislot_class = egprs_ms_class; + } + + send_ul_mac_block(&the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* trigger packet access reject */ + uint8_t bn = fn2bn(fn); + + rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), + trx_no, ts_no, fn, bn); + + OSMO_ASSERT(rc == 0); + + printf("=== end %s ===\n", __func__); +} void test_packet_access_rej_epdan() { BTS the_bts; @@ -2898,6 +2972,7 @@ test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); test_packet_access_rej_epdan(); + test_packet_access_rej_prr(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index a680812..1e863fe 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6870,3 +6870,216 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled! +MS supports EGPRS multislot class 11. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource +Creating MS object, TLLI = 0x00000000 +Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN +Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer 0. +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Destroying MS object, TLLI = 0x00000000 diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index dc07fc7..d62fedd 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -75,3 +75,5 @@ === start test_packet_access_rej_epdan === packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_packet_access_rej_epdan === +=== start test_packet_access_rej_prr === +=== end test_packet_access_rej_prr === -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 10 06:07:31 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 06:07:31 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1209 to look at the new patch set (#3). Handle packet access reject during EPDAN/PDAN with channel description When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 9 files changed, 134 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/1209/3 diff --git a/src/bts.cpp b/src/bts.cpp index 4e6b5e9..0668c2d 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1077,16 +1077,23 @@ } /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we pacekt access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ if (tbf->ms()) { @@ -1179,16 +1186,23 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we send packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ diff --git a/src/encoding.cpp b/src/encoding.cpp index ca72b0f..705f901 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -1391,3 +1391,27 @@ return AR_NEED_MORE_BLOCKS; } + +/* + * Refer 44.060 version 7.27.0 Release 7 + * section 7.1.3.2.1 On receipt of a PACKET RESOURCE REQUEST message + * 8.1.2.5 Establishment of uplink TBF + */ +void Encoding::write_packet_access_reject( + bitvec * dest, uint32_t tlli) +{ + unsigned wp = 0; + + bitvec_write_field(dest, wp, 0x1, 2); // Payload Type + bitvec_write_field(dest, wp, 0x0, 2); // Uplink block with TDMA FN + bitvec_write_field(dest, wp, 0, 1); // No Polling Bit + bitvec_write_field(dest, wp, 0x0, 3); // Uplink state flag + bitvec_write_field(dest, wp, 0x21, 6); // MESSAGE TYPE + bitvec_write_field(dest, wp, 0, 2); // fixed 00 + bitvec_write_field(dest, wp, 0x0, 1); // TLLI / G-RNTI : bit (32) + bitvec_write_field(dest, wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI + bitvec_write_field(dest, wp, 1, 1); // WAIT_INDICATION size in seconds + /* TODO: make it configurable */ + bitvec_write_field(dest, wp, 5, 8); // WAIT_INDICATION value + bitvec_write_field(dest, wp, 0, 1); // WAIT_INDICATION size in seconds +} diff --git a/src/encoding.h b/src/encoding.h index 79dc32d..6164b89 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -74,6 +74,9 @@ static void encode_rbb(const char *show_rbb, uint8_t *rbb); + static void write_packet_access_reject( + bitvec * dest, uint32_t tlli); + static void write_packet_uplink_ack( struct gprs_rlcmac_bts *bts, bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final, diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index f486075..a3723df 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -72,7 +72,8 @@ *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = dl_tbf; } @@ -137,7 +138,11 @@ */ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - msg = ul_ass_tbf->create_ul_ass(fn, ts); + if (tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else + msg = ul_ass_tbf->create_ul_ass(fn, ts); else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF) msg = dl_ass_tbf->create_dl_ass(fn, ts); else if (tbf == ul_ack_tbf) diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..2d82727 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1013,6 +1013,29 @@ return msg; } +struct msgb *gprs_rlcmac_tbf::create_packet_access_reject() +{ + struct msgb *msg; + + msg = msgb_alloc(23, "rlcmac_ul_ass_rej"); + + bitvec *packet_access_rej = bitvec_alloc(23); + + bitvec_unhex(packet_access_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + Encoding::write_packet_access_reject( + packet_access_rej, tlli()); + + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); + + bitvec_free(packet_access_rej); + ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + + return msg; + +} + struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) { struct msgb *msg; diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..e044053 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,7 @@ enum gprs_rlcmac_tbf_ul_ass_state { GPRS_RLCMAC_UL_ASS_NONE = 0, GPRS_RLCMAC_UL_ASS_SEND_ASS, /* send uplink assignment on next RTS */ + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ, /* send assignment reject next RTS */ GPRS_RLCMAC_UL_ASS_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; @@ -103,6 +104,7 @@ struct msgb *create_dl_ass(uint32_t fn, uint8_t ts); struct msgb *create_ul_ass(uint32_t fn, uint8_t ts); + struct msgb *create_packet_access_reject(); GprsMs *ms() const; void set_ms(GprsMs *ms); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 339390b..213bd12 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,29 @@ ARRAY_SIZE(default_categories), }; +void test_packet_access_rej_epdan() +{ + BTS the_bts; + uint32_t tlli = 0xffeeddcc; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, 4); + static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(&the_bts, 1); + + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + struct msgb *msg = dl_tbf->create_packet_access_reject(); + + printf("packet reject: %s\n", + osmo_hexdump(msg->data, 23)); + + OSMO_ASSERT(!strcmp(osmo_hexdump(msg->data, 23), + "40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ")); + printf("=== end %s ===\n", __func__); + +} + + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -2874,6 +2897,7 @@ test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); + test_packet_access_rej_epdan(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 627cdc3..a680812 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6846,3 +6846,27 @@ No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index f921dfc..dc07fc7 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -72,3 +72,6 @@ === end test_immediate_assign_rej_multi_block === === start test_immediate_assign_rej_single_block === === end test_immediate_assign_rej_single_block === +=== start test_packet_access_rej_epdan === +packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_packet_access_rej_epdan === -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Thu Nov 10 10:36:14 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 10 Nov 2016 10:36:14 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 10:36:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 10 Nov 2016 10:36:53 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 10:53:25 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Thu, 10 Nov 2016 10:53:25 +0000 Subject: [PATCH] libosmocore[master]: utils/conv_gen.py: separate code definitions Message-ID: Review at https://gerrit.osmocom.org/1223 utils/conv_gen.py: separate code definitions This change separates the convolutional code definitions from the code generator logic, allowing us to make further changes in more specific way. For example, adding some new codes, you change the conv_codes.py only because such change isn't related to the generator. Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa --- A utils/conv_codes.py M utils/conv_gen.py 2 files changed, 708 insertions(+), 702 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/1223/1 diff --git a/utils/conv_codes.py b/utils/conv_codes.py new file mode 100644 index 0000000..b4c04f5 --- /dev/null +++ b/utils/conv_codes.py @@ -0,0 +1,707 @@ +#!/usr/bin/python2 + +from conv_gen import ConvolutionalCode + +poly = lambda *args: sum([(1 << x) for x in args]) + +# Polynomials according to 3GPP TS 05.03 Annex B +G0 = poly(0, 3, 4) +G1 = poly(0, 1, 3, 4) +G2 = poly(0, 2, 4) +G3 = poly(0, 1, 2, 3, 4) +G4 = poly(0, 2, 3, 5, 6) +G5 = poly(0, 1, 4, 6) +G6 = poly(0, 1, 2, 3, 4, 6) +G7 = poly(0, 1, 2, 3, 6) + +# Shared polynomials +shared_polys = { + "xcch" : [ + ( G0, 1 ), + ( G1, 1 ), + ], + "mcs" : [ + ( G4, 1 ), + ( G7, 1 ), + ( G5, 1 ), + ], +} + +# Convolutional code definitions +conv_codes = [ + # xCCH definition + ConvolutionalCode( + 224, + shared_polys["xcch"], + name = "xcch", + description = [ + "xCCH convolutional code:", + "228 bits blocks, rate 1/2, k = 5", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # RACH definition + ConvolutionalCode( + 14, + shared_polys["xcch"], + name = "rach", + description = ["RACH convolutional code"] + ), + + # SCH definition + ConvolutionalCode( + 35, + shared_polys["xcch"], + name = "sch", + description = ["SCH convolutional code"] + ), + + # CS2 definition + ConvolutionalCode( + 290, + shared_polys["xcch"], + puncture = [ + 15, 19, 23, 27, 31, 35, 43, 47, 51, 55, 59, 63, 67, 71, + 75, 79, 83, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, + 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 187, 191, 195, + 199, 203, 207, 211, 215, 219, 223, 227, 235, 239, 243, 247, 251, 255, + 259, 263, 267, 271, 275, 283, 287, 291, 295, 299, 303, 307, 311, 315, + 319, 323, 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 371, 379, + 383, 387, 391, 395, 399, 403, 407, 411, 415, 419, 427, 431, 435, 439, + 443, 447, 451, 455, 459, 463, 467, 475, 479, 483, 487, 491, 495, 499, + 503, 507, 511, 515, 523, 527, 531, 535, 539, 543, 547, 551, 555, 559, + 563, 571, 575, 579, 583, 587, -1 + ], + name = "cs2", + description = [ + "CS2 convolutional code:", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # CS3 definition + ConvolutionalCode( + 334, + shared_polys["xcch"], + puncture = [ + 15, 17, 21, 23, 27, 29, 33, 35, 39, 41, 45, 47, 51, 53, + 57, 59, 63, 65, 69, 71, 75, 77, 81, 83, 87, 89, 93, 95, + 99, 101, 105, 107, 111, 113, 117, 119, 123, 125, 129, 131, 135, 137, + 141, 143, 147, 149, 153, 155, 159, 161, 165, 167, 171, 173, 177, 179, + 183, 185, 189, 191, 195, 197, 201, 203, 207, 209, 213, 215, 219, 221, + 225, 227, 231, 233, 237, 239, 243, 245, 249, 251, 255, 257, 261, 263, + 267, 269, 273, 275, 279, 281, 285, 287, 291, 293, 297, 299, 303, 305, + 309, 311, 315, 317, 321, 323, 327, 329, 333, 335, 339, 341, 345, 347, + 351, 353, 357, 359, 363, 365, 369, 371, 375, 377, 381, 383, 387, 389, + 393, 395, 399, 401, 405, 407, 411, 413, 417, 419, 423, 425, 429, 431, + 435, 437, 441, 443, 447, 449, 453, 455, 459, 461, 465, 467, 471, 473, + 477, 479, 483, 485, 489, 491, 495, 497, 501, 503, 507, 509, 513, 515, + 519, 521, 525, 527, 531, 533, 537, 539, 543, 545, 549, 551, 555, 557, + 561, 563, 567, 569, 573, 575, 579, 581, 585, 587, 591, 593, 597, 599, + 603, 605, 609, 611, 615, 617, 621, 623, 627, 629, 633, 635, 639, 641, + 645, 647, 651, 653, 657, 659, 663, 665, 669, 671, -1 + ], + name = "cs3", + description = [ + "CS3 convolutional code:", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # TCH_AFS_12_2 definition + ConvolutionalCode( + 250, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 363, + 365, 369, 373, 377, 379, 381, 385, 389, 393, 395, 397, 401, + 405, 409, 411, 413, 417, 421, 425, 427, 429, 433, 437, 441, + 443, 445, 449, 453, 457, 459, 461, 465, 469, 473, 475, 477, + 481, 485, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, + -1 + ], + name = 'tch_afs_12_2', + description = [ + "TCH/AFS 12.2 kbits convolutional code:", + "250 bits block, rate 1/2, punctured", + "G0/G0 = 1", + "G1/G0 = 1 + D + D3 + D4 / 1 + D3 + D4", + ] + ), + + # TCH_AFS_10_2 definition + ConvolutionalCode( + 210, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 1, 4, 7, 10, 16, 19, 22, 28, 31, 34, 40, 43, + 46, 52, 55, 58, 64, 67, 70, 76, 79, 82, 88, 91, + 94, 100, 103, 106, 112, 115, 118, 124, 127, 130, 136, 139, + 142, 148, 151, 154, 160, 163, 166, 172, 175, 178, 184, 187, + 190, 196, 199, 202, 208, 211, 214, 220, 223, 226, 232, 235, + 238, 244, 247, 250, 256, 259, 262, 268, 271, 274, 280, 283, + 286, 292, 295, 298, 304, 307, 310, 316, 319, 322, 325, 328, + 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, + 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, 400, + 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, + 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, + 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, 505, 508, + 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, + 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, + 583, 586, 589, 592, 595, 598, 601, 604, 607, 609, 610, 613, + 616, 619, 621, 622, 625, 627, 628, 631, 633, 634, 636, 637, + 639, 640, -1 + ], + name = 'tch_afs_10_2', + description = [ + "TCH/AFS 10.2 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_7_95 definition + ConvolutionalCode( + 165, + [ + ( 1, 1 ), + ( G5, G4 ), + ( G6, G4 ), + ], + puncture = [ + 1, 2, 4, 5, 8, 22, 70, 118, 166, 214, 262, 310, + 317, 319, 325, 332, 334, 341, 343, 349, 356, 358, 365, 367, + 373, 380, 382, 385, 389, 391, 397, 404, 406, 409, 413, 415, + 421, 428, 430, 433, 437, 439, 445, 452, 454, 457, 461, 463, + 469, 476, 478, 481, 485, 487, 490, 493, 500, 502, 503, 505, + 506, 508, 509, 511, 512, -1 + ], + name = 'tch_afs_7_95', + description = [ + "TCH/AFS 7.95 kbits convolutional code:", + "G4/G4 = 1", + "G5/G4 = 1 + D + D4 + D6 / 1 + D2 + D3 + D5 + D6", + "G6/G4 = 1 + D + D2 + D3 + D4 + D6 / 1 + D2 + D3 + D5 + D6", + ] + ), + + # TCH_AFS_7_4 definition + ConvolutionalCode( + 154, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 0, 355, 361, 367, 373, 379, 385, 391, 397, 403, 409, 415, + 421, 427, 433, 439, 445, 451, 457, 460, 463, 466, 468, 469, + 471, 472, -1 + ], + name = 'tch_afs_7_4', + description = [ + "TCH/AFS 7.4 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_6_7 definition + ConvolutionalCode( + 140, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 1, 3, 7, 11, 15, 27, 39, 55, 67, 79, 95, 107, + 119, 135, 147, 159, 175, 187, 199, 215, 227, 239, 255, 267, + 279, 287, 291, 295, 299, 303, 307, 311, 315, 319, 323, 327, + 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 369, 371, + 375, 377, 379, 383, 385, 387, 391, 393, 395, 399, 401, 403, + 407, 409, 411, 415, 417, 419, 423, 425, 427, 431, 433, 435, + 439, 441, 443, 447, 449, 451, 455, 457, 459, 463, 465, 467, + 471, 473, 475, 479, 481, 483, 487, 489, 491, 495, 497, 499, + 503, 505, 507, 511, 513, 515, 519, 521, 523, 527, 529, 531, + 535, 537, 539, 543, 545, 547, 549, 551, 553, 555, 557, 559, + 561, 563, 565, 567, 569, 571, 573, 575, -1 + ], + name = 'tch_afs_6_7', + description = [ + "TCH/AFS 6.7 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_5_9 definition + ConvolutionalCode( + 124, + [ + ( G4, G6 ), + ( G5, G6 ), + ( 1, 1), + ( 1, 1), + ], + puncture = [ + 0, 1, 3, 5, 7, 11, 15, 31, 47, 63, 79, 95, + 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, 271, 287, + 303, 319, 327, 331, 335, 343, 347, 351, 359, 363, 367, 375, + 379, 383, 391, 395, 399, 407, 411, 415, 423, 427, 431, 439, + 443, 447, 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, + 495, 499, 503, 507, 509, 511, 512, 513, 515, 516, 517, 519, + -1 + ], + name = 'tch_afs_5_9', + description = [ + "TCH/AFS 5.9 kbits convolutional code:", + "124 bits", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G6/G6 = 1", + "G6/G6 = 1", + ] + ), + + # TCH_AFS_5_15 definition + ConvolutionalCode( + 109, + [ + ( G1, G3 ), + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 0, 4, 5, 9, 10, 14, 15, 20, 25, 30, 35, 40, + 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, + 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, + 290, 300, 310, 315, 320, 325, 330, 334, 335, 340, 344, 345, + 350, 354, 355, 360, 364, 365, 370, 374, 375, 380, 384, 385, + 390, 394, 395, 400, 404, 405, 410, 414, 415, 420, 424, 425, + 430, 434, 435, 440, 444, 445, 450, 454, 455, 460, 464, 465, + 470, 474, 475, 480, 484, 485, 490, 494, 495, 500, 504, 505, + 510, 514, 515, 520, 524, 525, 529, 530, 534, 535, 539, 540, + 544, 545, 549, 550, 554, 555, 559, 560, 564, -1 + ], + name = 'tch_afs_5_15', + description = [ + "TCH/AFS 5.15 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_4_75 definition + ConvolutionalCode( + 101, + [ + ( G4, G6 ), + ( G4, G6 ), + ( G5, G6 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 0, 1, 2, 4, 5, 7, 9, 15, 25, 35, 45, 55, + 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165, 175, + 185, 195, 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, + 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 400, 405, + 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 459, 460, + 465, 470, 475, 479, 480, 485, 490, 495, 499, 500, 505, 509, + 510, 515, 517, 519, 520, 522, 524, 525, 526, 527, 529, 530, + 531, 532, 534, -1 + ], + name = 'tch_afs_4_75', + description = [ + "TCH/AFS 4.75 kbits convolutional code:", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G6/G6 = 1", + "G6/G6 = 1", + ] + ), + + # TCH_FR definition + ConvolutionalCode( + 185, + shared_polys["xcch"], + name = "tch_fr", + description = ["TCH/F convolutional code"] + ), + + # TCH_HR definition + ConvolutionalCode( + 98, + [ + ( G4, 1 ), + ( G5, 1 ), + ( G6, 1 ), + ], + puncture = [ + 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, + 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, + 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, + 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, + 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, + 181, 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 214, + 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, + 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 295, + 298, 301, 304, 307, 310, -1, + ], + name = "tch_hr", + description = ["TCH/H convolutional code"] + ), + + # TCH_AHS_7_95 definition + ConvolutionalCode( + 129, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 5, 7, 11, 15, 19, 23, 27, 31, 35, 43, + 47, 51, 55, 59, 63, 67, 71, 79, 83, 87, 91, 95, + 99, 103, 107, 115, 119, 123, 127, 131, 135, 139, 143, 151, + 155, 159, 163, 167, 171, 175, 177, 179, 183, 185, 187, 191, + 193, 195, 197, 199, 203, 205, 207, 211, 213, 215, 219, 221, + 223, 227, 229, 231, 233, 235, 239, 241, 243, 247, 249, 251, + 255, 257, 259, 261, 263, 265, -1, + ], + name = "tch_ahs_7_95", + description = ["TCH/AHS 7.95 kbits convolutional code"] + ), + + # TCH_AHS_7_4 definition + ConvolutionalCode( + 126, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 7, 11, 19, 23, 27, 35, 39, 43, 51, 55, + 59, 67, 71, 75, 83, 87, 91, 99, 103, 107, 115, 119, + 123, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, + 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, + 221, 223, 227, 229, 231, 235, 237, 239, 243, 245, 247, 251, + 253, 255, 257, 259, -1, + ], + name = "tch_ahs_7_4", + description = ["TCH/AHS 7.4 kbits convolutional code"] + ), + + # TCH_AHS_6_7 definition + ConvolutionalCode( + 116, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, + 109, 119, 129, 139, 149, 159, 167, 169, 177, 179, 187, 189, + 197, 199, 203, 207, 209, 213, 217, 219, 223, 227, 229, 231, + 233, 235, 237, 239, -1, + ], + name = "tch_ahs_6_7", + description = ["TCH/AHS 6.7 kbits convolutional code"] + ), + + # TCH_AHS_5_9 definition + ConvolutionalCode( + 108, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 15, 71, 127, 139, 151, 163, 175, 187, 195, 203, 211, + 215, 219, 221, 223, -1, + ], + name = "tch_ahs_5_9", + description = ["TCH/AHS 5.9 kbits convolutional code"] + ), + + # TCH_AHS_5_15 definition + ConvolutionalCode( + 97, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 0, 1, 3, 4, 6, 9, 12, 15, 18, 21, 27, 33, + 39, 45, 51, 54, 57, 63, 69, 75, 81, 87, 90, 93, + 99, 105, 111, 117, 123, 126, 129, 135, 141, 147, 153, 159, + 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192, 195, + 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, + 234, 237, 240, 243, 244, 246, 249, 252, 255, 256, 258, 261, + 264, 267, 268, 270, 273, 276, 279, 280, 282, 285, 288, 289, + 291, 294, 295, 297, 298, 300, 301, -1, + ], + name = "tch_ahs_5_15", + description = ["TCH/AHS 5.15 kbits convolutional code"] + ), + + # TCH_AHS_4_75 definition + ConvolutionalCode( + 89, + [ + ( 1, 1 ), + ( G5, G4 ), + ( G6, G4 ), + ], + puncture = [ + 1, 2, 4, 5, 7, 8, 10, 13, 16, 22, 28, 34, + 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, + 112, 118, 124, 130, 136, 142, 148, 151, 154, 160, 163, 166, + 172, 175, 178, 184, 187, 190, 196, 199, 202, 208, 211, 214, + 220, 223, 226, 232, 235, 238, 241, 244, 247, 250, 253, 256, + 259, 262, 265, 268, 271, 274, 275, 277, 278, 280, 281, 283, + 284, -1, + ], + name = "tch_ahs_4_75", + description = ["TCH/AHS 4.75 kbits convolutional code"] + ), + + # EDGE MCS1_DL_HDR definition + ConvolutionalCode( + 36, + shared_polys["mcs"], + name = "mcs1_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-1 DL header convolutional code:", + "42 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS1_UL_HDR definition + ConvolutionalCode( + 39, + shared_polys["mcs"], + name = "mcs1_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-1 UL header convolutional code:", + "45 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS1 definition + ConvolutionalCode( + 190, + shared_polys["mcs"], + name = "mcs1", + description = [ + "EDGE MCS-1 data convolutional code:", + "196 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS2 definition + ConvolutionalCode( + 238, + shared_polys["mcs"], + name = "mcs2", + description = [ + "EDGE MCS-2 data convolutional code:", + "244 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS3 definition + ConvolutionalCode( + 310, + shared_polys["mcs"], + name = "mcs3", + description = [ + "EDGE MCS-3 data convolutional code:", + "316 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS4 definition + ConvolutionalCode( + 366, + shared_polys["mcs"], + name = "mcs4", + description = [ + "EDGE MCS-4 data convolutional code:", + "372 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5_DL_HDR definition + ConvolutionalCode( + 33, + shared_polys["mcs"], + name = "mcs5_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-5 DL header convolutional code:", + "39 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5_UL_HDR definition + ConvolutionalCode( + 45, + shared_polys["mcs"], + name = "mcs5_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-5 UL header convolutional code:", + "51 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5 definition + ConvolutionalCode( + 462, + shared_polys["mcs"], + name = "mcs5", + description = [ + "EDGE MCS-5 data convolutional code:", + "468 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS6 definition + ConvolutionalCode( + 606, + shared_polys["mcs"], + name = "mcs6", + description = [ + "EDGE MCS-6 data convolutional code:", + "612 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7_DL_HDR definition + ConvolutionalCode( + 45, + shared_polys["mcs"], + name = "mcs7_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-7 DL header convolutional code:", + "51 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7_UL_HDR definition + ConvolutionalCode( + 54, + shared_polys["mcs"], + name = "mcs7_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-7 UL header convolutional code:", + "60 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7 definition + ConvolutionalCode( + 462, + shared_polys["mcs"], + name = "mcs7", + description = [ + "EDGE MCS-7 data convolutional code:", + "468 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS8 definition + ConvolutionalCode( + 558, + shared_polys["mcs"], + name = "mcs8", + description = [ + "EDGE MCS-8 data convolutional code:", + "564 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS9 definition + ConvolutionalCode( + 606, + shared_polys["mcs"], + name = "mcs9", + description = [ + "EDGE MCS-9 data convolutional code:", + "612 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), +] diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 1ecb550..9958d3a 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -25,6 +25,7 @@ import sys, os, math from functools import reduce +from conv_codes import * class ConvolutionalCode(object): @@ -225,8 +226,6 @@ fi.write("\t.puncture = %s_puncture,\n" % self.name) fi.write("};\n\n") -poly = lambda *args: sum([(1 << x) for x in args]) - def combine(src, sel, nb): x = src & sel fn_xor = lambda x, y: x ^ y @@ -252,706 +251,6 @@ # HACK code = ConvolutionalCode(0, polys, name = name) code.print_state_and_output(fi) - -# Polynomials according to 3GPP TS 05.03 Annex B -G0 = poly(0, 3, 4) -G1 = poly(0, 1, 3, 4) -G2 = poly(0, 2, 4) -G3 = poly(0, 1, 2, 3, 4) -G4 = poly(0, 2, 3, 5, 6) -G5 = poly(0, 1, 4, 6) -G6 = poly(0, 1, 2, 3, 4, 6) -G7 = poly(0, 1, 2, 3, 6) - -shared_polys = { - "xcch" : [ - ( G0, 1 ), - ( G1, 1 ), - ], - "mcs" : [ - ( G4, 1 ), - ( G7, 1 ), - ( G5, 1 ), - ], -} - -conv_codes = [ - # xCCH definition - ConvolutionalCode( - 224, - shared_polys["xcch"], - name = "xcch", - description = [ - "xCCH convolutional code:", - "228 bits blocks, rate 1/2, k = 5", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # RACH definition - ConvolutionalCode( - 14, - shared_polys["xcch"], - name = "rach", - description = ["RACH convolutional code"] - ), - - # SCH definition - ConvolutionalCode( - 35, - shared_polys["xcch"], - name = "sch", - description = ["SCH convolutional code"] - ), - - # CS2 definition - ConvolutionalCode( - 290, - shared_polys["xcch"], - puncture = [ - 15, 19, 23, 27, 31, 35, 43, 47, 51, 55, 59, 63, 67, 71, - 75, 79, 83, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, - 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 187, 191, 195, - 199, 203, 207, 211, 215, 219, 223, 227, 235, 239, 243, 247, 251, 255, - 259, 263, 267, 271, 275, 283, 287, 291, 295, 299, 303, 307, 311, 315, - 319, 323, 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 371, 379, - 383, 387, 391, 395, 399, 403, 407, 411, 415, 419, 427, 431, 435, 439, - 443, 447, 451, 455, 459, 463, 467, 475, 479, 483, 487, 491, 495, 499, - 503, 507, 511, 515, 523, 527, 531, 535, 539, 543, 547, 551, 555, 559, - 563, 571, 575, 579, 583, 587, -1 - ], - name = "cs2", - description = [ - "CS2 convolutional code:", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # CS3 definition - ConvolutionalCode( - 334, - shared_polys["xcch"], - puncture = [ - 15, 17, 21, 23, 27, 29, 33, 35, 39, 41, 45, 47, 51, 53, - 57, 59, 63, 65, 69, 71, 75, 77, 81, 83, 87, 89, 93, 95, - 99, 101, 105, 107, 111, 113, 117, 119, 123, 125, 129, 131, 135, 137, - 141, 143, 147, 149, 153, 155, 159, 161, 165, 167, 171, 173, 177, 179, - 183, 185, 189, 191, 195, 197, 201, 203, 207, 209, 213, 215, 219, 221, - 225, 227, 231, 233, 237, 239, 243, 245, 249, 251, 255, 257, 261, 263, - 267, 269, 273, 275, 279, 281, 285, 287, 291, 293, 297, 299, 303, 305, - 309, 311, 315, 317, 321, 323, 327, 329, 333, 335, 339, 341, 345, 347, - 351, 353, 357, 359, 363, 365, 369, 371, 375, 377, 381, 383, 387, 389, - 393, 395, 399, 401, 405, 407, 411, 413, 417, 419, 423, 425, 429, 431, - 435, 437, 441, 443, 447, 449, 453, 455, 459, 461, 465, 467, 471, 473, - 477, 479, 483, 485, 489, 491, 495, 497, 501, 503, 507, 509, 513, 515, - 519, 521, 525, 527, 531, 533, 537, 539, 543, 545, 549, 551, 555, 557, - 561, 563, 567, 569, 573, 575, 579, 581, 585, 587, 591, 593, 597, 599, - 603, 605, 609, 611, 615, 617, 621, 623, 627, 629, 633, 635, 639, 641, - 645, 647, 651, 653, 657, 659, 663, 665, 669, 671, -1 - ], - name = "cs3", - description = [ - "CS3 convolutional code:", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # TCH_AFS_12_2 definition - ConvolutionalCode( - 250, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 363, - 365, 369, 373, 377, 379, 381, 385, 389, 393, 395, 397, 401, - 405, 409, 411, 413, 417, 421, 425, 427, 429, 433, 437, 441, - 443, 445, 449, 453, 457, 459, 461, 465, 469, 473, 475, 477, - 481, 485, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, - -1 - ], - name = 'tch_afs_12_2', - description = [ - "TCH/AFS 12.2 kbits convolutional code:", - "250 bits block, rate 1/2, punctured", - "G0/G0 = 1", - "G1/G0 = 1 + D + D3 + D4 / 1 + D3 + D4", - ] - ), - - # TCH_AFS_10_2 definition - ConvolutionalCode( - 210, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 1, 4, 7, 10, 16, 19, 22, 28, 31, 34, 40, 43, - 46, 52, 55, 58, 64, 67, 70, 76, 79, 82, 88, 91, - 94, 100, 103, 106, 112, 115, 118, 124, 127, 130, 136, 139, - 142, 148, 151, 154, 160, 163, 166, 172, 175, 178, 184, 187, - 190, 196, 199, 202, 208, 211, 214, 220, 223, 226, 232, 235, - 238, 244, 247, 250, 256, 259, 262, 268, 271, 274, 280, 283, - 286, 292, 295, 298, 304, 307, 310, 316, 319, 322, 325, 328, - 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, - 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, 400, - 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, - 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, - 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, 505, 508, - 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, - 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, - 583, 586, 589, 592, 595, 598, 601, 604, 607, 609, 610, 613, - 616, 619, 621, 622, 625, 627, 628, 631, 633, 634, 636, 637, - 639, 640, -1 - ], - name = 'tch_afs_10_2', - description = [ - "TCH/AFS 10.2 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_7_95 definition - ConvolutionalCode( - 165, - [ - ( 1, 1 ), - ( G5, G4 ), - ( G6, G4 ), - ], - puncture = [ - 1, 2, 4, 5, 8, 22, 70, 118, 166, 214, 262, 310, - 317, 319, 325, 332, 334, 341, 343, 349, 356, 358, 365, 367, - 373, 380, 382, 385, 389, 391, 397, 404, 406, 409, 413, 415, - 421, 428, 430, 433, 437, 439, 445, 452, 454, 457, 461, 463, - 469, 476, 478, 481, 485, 487, 490, 493, 500, 502, 503, 505, - 506, 508, 509, 511, 512, -1 - ], - name = 'tch_afs_7_95', - description = [ - "TCH/AFS 7.95 kbits convolutional code:", - "G4/G4 = 1", - "G5/G4 = 1 + D + D4 + D6 / 1 + D2 + D3 + D5 + D6", - "G6/G4 = 1 + D + D2 + D3 + D4 + D6 / 1 + D2 + D3 + D5 + D6", - ] - ), - - # TCH_AFS_7_4 definition - ConvolutionalCode( - 154, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 0, 355, 361, 367, 373, 379, 385, 391, 397, 403, 409, 415, - 421, 427, 433, 439, 445, 451, 457, 460, 463, 466, 468, 469, - 471, 472, -1 - ], - name = 'tch_afs_7_4', - description = [ - "TCH/AFS 7.4 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_6_7 definition - ConvolutionalCode( - 140, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 1, 3, 7, 11, 15, 27, 39, 55, 67, 79, 95, 107, - 119, 135, 147, 159, 175, 187, 199, 215, 227, 239, 255, 267, - 279, 287, 291, 295, 299, 303, 307, 311, 315, 319, 323, 327, - 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 369, 371, - 375, 377, 379, 383, 385, 387, 391, 393, 395, 399, 401, 403, - 407, 409, 411, 415, 417, 419, 423, 425, 427, 431, 433, 435, - 439, 441, 443, 447, 449, 451, 455, 457, 459, 463, 465, 467, - 471, 473, 475, 479, 481, 483, 487, 489, 491, 495, 497, 499, - 503, 505, 507, 511, 513, 515, 519, 521, 523, 527, 529, 531, - 535, 537, 539, 543, 545, 547, 549, 551, 553, 555, 557, 559, - 561, 563, 565, 567, 569, 571, 573, 575, -1 - ], - name = 'tch_afs_6_7', - description = [ - "TCH/AFS 6.7 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_5_9 definition - ConvolutionalCode( - 124, - [ - ( G4, G6 ), - ( G5, G6 ), - ( 1, 1), - ( 1, 1), - ], - puncture = [ - 0, 1, 3, 5, 7, 11, 15, 31, 47, 63, 79, 95, - 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, 271, 287, - 303, 319, 327, 331, 335, 343, 347, 351, 359, 363, 367, 375, - 379, 383, 391, 395, 399, 407, 411, 415, 423, 427, 431, 439, - 443, 447, 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, - 495, 499, 503, 507, 509, 511, 512, 513, 515, 516, 517, 519, - -1 - ], - name = 'tch_afs_5_9', - description = [ - "TCH/AFS 5.9 kbits convolutional code:", - "124 bits", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G6/G6 = 1", - "G6/G6 = 1", - ] - ), - - # TCH_AFS_5_15 definition - ConvolutionalCode( - 109, - [ - ( G1, G3 ), - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 0, 4, 5, 9, 10, 14, 15, 20, 25, 30, 35, 40, - 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, - 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, - 290, 300, 310, 315, 320, 325, 330, 334, 335, 340, 344, 345, - 350, 354, 355, 360, 364, 365, 370, 374, 375, 380, 384, 385, - 390, 394, 395, 400, 404, 405, 410, 414, 415, 420, 424, 425, - 430, 434, 435, 440, 444, 445, 450, 454, 455, 460, 464, 465, - 470, 474, 475, 480, 484, 485, 490, 494, 495, 500, 504, 505, - 510, 514, 515, 520, 524, 525, 529, 530, 534, 535, 539, 540, - 544, 545, 549, 550, 554, 555, 559, 560, 564, -1 - ], - name = 'tch_afs_5_15', - description = [ - "TCH/AFS 5.15 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_4_75 definition - ConvolutionalCode( - 101, - [ - ( G4, G6 ), - ( G4, G6 ), - ( G5, G6 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 0, 1, 2, 4, 5, 7, 9, 15, 25, 35, 45, 55, - 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165, 175, - 185, 195, 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, - 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 400, 405, - 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 459, 460, - 465, 470, 475, 479, 480, 485, 490, 495, 499, 500, 505, 509, - 510, 515, 517, 519, 520, 522, 524, 525, 526, 527, 529, 530, - 531, 532, 534, -1 - ], - name = 'tch_afs_4_75', - description = [ - "TCH/AFS 4.75 kbits convolutional code:", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G6/G6 = 1", - "G6/G6 = 1", - ] - ), - - # TCH_FR definition - ConvolutionalCode( - 185, - shared_polys["xcch"], - name = "tch_fr", - description = ["TCH/F convolutional code"] - ), - - # TCH_HR definition - ConvolutionalCode( - 98, - [ - ( G4, 1 ), - ( G5, 1 ), - ( G6, 1 ), - ], - puncture = [ - 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, - 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, - 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, - 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, - 181, 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 214, - 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, - 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 295, - 298, 301, 304, 307, 310, -1, - ], - name = "tch_hr", - description = ["TCH/H convolutional code"] - ), - - # TCH_AHS_7_95 definition - ConvolutionalCode( - 129, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 5, 7, 11, 15, 19, 23, 27, 31, 35, 43, - 47, 51, 55, 59, 63, 67, 71, 79, 83, 87, 91, 95, - 99, 103, 107, 115, 119, 123, 127, 131, 135, 139, 143, 151, - 155, 159, 163, 167, 171, 175, 177, 179, 183, 185, 187, 191, - 193, 195, 197, 199, 203, 205, 207, 211, 213, 215, 219, 221, - 223, 227, 229, 231, 233, 235, 239, 241, 243, 247, 249, 251, - 255, 257, 259, 261, 263, 265, -1, - ], - name = "tch_ahs_7_95", - description = ["TCH/AHS 7.95 kbits convolutional code"] - ), - - # TCH_AHS_7_4 definition - ConvolutionalCode( - 126, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 7, 11, 19, 23, 27, 35, 39, 43, 51, 55, - 59, 67, 71, 75, 83, 87, 91, 99, 103, 107, 115, 119, - 123, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, - 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, - 221, 223, 227, 229, 231, 235, 237, 239, 243, 245, 247, 251, - 253, 255, 257, 259, -1, - ], - name = "tch_ahs_7_4", - description = ["TCH/AHS 7.4 kbits convolutional code"] - ), - - # TCH_AHS_6_7 definition - ConvolutionalCode( - 116, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, - 109, 119, 129, 139, 149, 159, 167, 169, 177, 179, 187, 189, - 197, 199, 203, 207, 209, 213, 217, 219, 223, 227, 229, 231, - 233, 235, 237, 239, -1, - ], - name = "tch_ahs_6_7", - description = ["TCH/AHS 6.7 kbits convolutional code"] - ), - - # TCH_AHS_5_9 definition - ConvolutionalCode( - 108, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 15, 71, 127, 139, 151, 163, 175, 187, 195, 203, 211, - 215, 219, 221, 223, -1, - ], - name = "tch_ahs_5_9", - description = ["TCH/AHS 5.9 kbits convolutional code"] - ), - - # TCH_AHS_5_15 definition - ConvolutionalCode( - 97, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 0, 1, 3, 4, 6, 9, 12, 15, 18, 21, 27, 33, - 39, 45, 51, 54, 57, 63, 69, 75, 81, 87, 90, 93, - 99, 105, 111, 117, 123, 126, 129, 135, 141, 147, 153, 159, - 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192, 195, - 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, - 234, 237, 240, 243, 244, 246, 249, 252, 255, 256, 258, 261, - 264, 267, 268, 270, 273, 276, 279, 280, 282, 285, 288, 289, - 291, 294, 295, 297, 298, 300, 301, -1, - ], - name = "tch_ahs_5_15", - description = ["TCH/AHS 5.15 kbits convolutional code"] - ), - - # TCH_AHS_4_75 definition - ConvolutionalCode( - 89, - [ - ( 1, 1 ), - ( G5, G4 ), - ( G6, G4 ), - ], - puncture = [ - 1, 2, 4, 5, 7, 8, 10, 13, 16, 22, 28, 34, - 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, - 112, 118, 124, 130, 136, 142, 148, 151, 154, 160, 163, 166, - 172, 175, 178, 184, 187, 190, 196, 199, 202, 208, 211, 214, - 220, 223, 226, 232, 235, 238, 241, 244, 247, 250, 253, 256, - 259, 262, 265, 268, 271, 274, 275, 277, 278, 280, 281, 283, - 284, -1, - ], - name = "tch_ahs_4_75", - description = ["TCH/AHS 4.75 kbits convolutional code"] - ), - - # EDGE MCS1_DL_HDR definition - ConvolutionalCode( - 36, - shared_polys["mcs"], - name = "mcs1_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-1 DL header convolutional code:", - "42 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS1_UL_HDR definition - ConvolutionalCode( - 39, - shared_polys["mcs"], - name = "mcs1_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-1 UL header convolutional code:", - "45 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS1 definition - ConvolutionalCode( - 190, - shared_polys["mcs"], - name = "mcs1", - description = [ - "EDGE MCS-1 data convolutional code:", - "196 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS2 definition - ConvolutionalCode( - 238, - shared_polys["mcs"], - name = "mcs2", - description = [ - "EDGE MCS-2 data convolutional code:", - "244 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS3 definition - ConvolutionalCode( - 310, - shared_polys["mcs"], - name = "mcs3", - description = [ - "EDGE MCS-3 data convolutional code:", - "316 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS4 definition - ConvolutionalCode( - 366, - shared_polys["mcs"], - name = "mcs4", - description = [ - "EDGE MCS-4 data convolutional code:", - "372 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5_DL_HDR definition - ConvolutionalCode( - 33, - shared_polys["mcs"], - name = "mcs5_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-5 DL header convolutional code:", - "39 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5_UL_HDR definition - ConvolutionalCode( - 45, - shared_polys["mcs"], - name = "mcs5_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-5 UL header convolutional code:", - "51 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5 definition - ConvolutionalCode( - 462, - shared_polys["mcs"], - name = "mcs5", - description = [ - "EDGE MCS-5 data convolutional code:", - "468 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS6 definition - ConvolutionalCode( - 606, - shared_polys["mcs"], - name = "mcs6", - description = [ - "EDGE MCS-6 data convolutional code:", - "612 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7_DL_HDR definition - ConvolutionalCode( - 45, - shared_polys["mcs"], - name = "mcs7_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-7 DL header convolutional code:", - "51 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7_UL_HDR definition - ConvolutionalCode( - 54, - shared_polys["mcs"], - name = "mcs7_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-7 UL header convolutional code:", - "60 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7 definition - ConvolutionalCode( - 462, - shared_polys["mcs"], - name = "mcs7", - description = [ - "EDGE MCS-7 data convolutional code:", - "468 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS8 definition - ConvolutionalCode( - 558, - shared_polys["mcs"], - name = "mcs8", - description = [ - "EDGE MCS-8 data convolutional code:", - "564 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS9 definition - ConvolutionalCode( - 606, - shared_polys["mcs"], - name = "mcs9", - description = [ - "EDGE MCS-9 data convolutional code:", - "612 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), -] if __name__ == '__main__': path = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() -- To view, visit https://gerrit.osmocom.org/1223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:33:59 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:33:59 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 3: Hi Harald, Any update on this patch? -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:34:14 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:34:14 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 2: Hi Harald, Any update on this patch? -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:35:44 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:35:44 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:36:02 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:36:02 +0000 Subject: osmo-pcu[master]: Refactoring write_packet_ack_nack_desc_egprs to prepare for ... In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/412 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie5c25b6ee30f2f1b613e923c234b03a6ffe12ae2 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:37:15 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:37:15 +0000 Subject: osmo-pcu[master]: Add test case for testing PUAN In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:38:24 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:38:24 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: Hi Holger, Any update on this patch? -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:39:34 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:39:34 +0000 Subject: osmo-pcu[master]: Add compression support in EGPRS PUAN In-Reply-To: References: Message-ID: Patch Set 2: Hi Holger, Any update on this patch? -- To view, visit https://gerrit.osmocom.org/413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:41:07 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 10 Nov 2016 11:41:07 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: > Hi Holger, > > Any update on this patch? Well, none of my comments/requests were addressed. What should the update look like? -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:41:24 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 11:41:24 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:47:04 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 11:47:04 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: > > Hi Holger, > > > > Any update on this patch? > > Well, none of my comments/requests were addressed. What should the > update look like? I have addressed the comments in my last patch set and for some of the comments I have replied with my explanation/queries. Thanks, -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:47:49 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 11:47:49 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: (5 comments) https://gerrit.osmocom.org/#/c/415/3/src/bitvec.c File src/bitvec.c: Line 581: * \param[in] b The boolean, sequence of 1's or 0's to be checked > max_bits is not documented Done Line 582: * \param[in] max_bits Total Number of Uncmopresed bits > This doesn't mention that cur_bit will go up. Done Line 590: int temp_res = 0; > Can't you re-order the code to first read up to a full byte.. and then do t Done Line 592: unsigned readIndex = bv->cur_bit; > select the mask once.. max_bits should not change during the call. Done Line 594: unsigned remaining_bytes = max_bits / 8; > select the bytemask once in the beginning Done -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:50:53 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 10 Nov 2016 11:50:53 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: I don't think having a "test" in another place is appropriate. * If code and test need to change you need to update two repositories, and synchronize the changes * The unit tests will only run a lot later (e.g. after review and during CI) * When reviewing code it is better to look at the test first and the implementation -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:54:53 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 10 Nov 2016 11:54:53 +0000 Subject: openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1212/1/openbsc/src/gprs/gb_proxy.c File openbsc/src/gprs/gb_proxy.c: Line 478: return !is_ident_resp; > Does this still make sense? just return 0? Maybe just don't forward it general as it got destroyed (referring to the comment below) -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 11:55:24 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 11:55:24 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 5: > I don't think having a "test" in another place is appropriate. > > * If code and test need to change you need to update two > repositories, and synchronize the changes > * The unit tests will only run a lot later (e.g. after review and > during CI) > * When reviewing code it is better to look at the test first and > the implementation I will update the "test" in my next patch set. Thanks -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 5 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:03:42 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 12:03:42 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:03:49 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 10 Nov 2016 12:03:49 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:45:04 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 12:45:04 +0000 Subject: [PATCH] osmo-pcu[master]: Add compression support in EGPRS PUAN In-Reply-To: References: Message-ID: Hello Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/413 to look at the new patch set (#3). Add compression support in EGPRS PUAN This adds compression of bitmap in PUAN. The compressed bitmap is used only if the number of bits in the bitmap does not fit in the message and there is a gain after compression. The algorithm is part of libosmocore and so there is dependency on the libosmocore for compilation. The algorithm is tested on integration setup by forcing compression. Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa --- M src/egprs_rlc_compression.cpp M src/egprs_rlc_compression.h M src/encoding.cpp M src/rlc.cpp M src/rlc.h M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.err 9 files changed, 539 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/13/413/3 diff --git a/src/egprs_rlc_compression.cpp b/src/egprs_rlc_compression.cpp index f4e6bde..82605ff 100644 --- a/src/egprs_rlc_compression.cpp +++ b/src/egprs_rlc_compression.cpp @@ -84,8 +84,203 @@ } } -/* The code words for one run length and zero run length are described in - * table 9.1.10.1 of 3gpp 44.060 +/* + * Terminating codes for uninterrupted sequences of 0 and 1 up to 64 bit length + * according to TS 44.060 9.1.10 + */ +static const unsigned t4_term[2][64] = { + { + 0b0000110111, + 0b10, + 0b11, + 0b010, + 0b011, + 0b0011, + 0b0010, + 0b00011, + 0b000101, + 0b000100, + 0b0000100, + 0b0000101, + 0b0000111, + 0b00000100, + 0b00000111, + 0b000011000, + 0b0000010111, + 0b0000011000, + 0b0000001000, + 0b00001100111, + 0b00001101000, + 0b00001101100, + 0b00000110111, + 0b00000101000, + 0b00000010111, + 0b00000011000, + 0b000011001010, + 0b000011001011, + 0b000011001100, + 0b000011001101, + 0b000001101000, + 0b000001101001, + 0b000001101010, + 0b000001101011, + 0b000011010010, + 0b000011010011, + 0b000011010100, + 0b000011010101, + 0b000011010110, + 0b000011010111, + 0b000001101100, + 0b000001101101, + 0b000011011010, + 0b000011011011, + 0b000001010100, + 0b000001010101, + 0b000001010110, + 0b000001010111, + 0b000001100100, + 0b000001100101, + 0b000001010010, + 0b000001010011, + 0b000000100100, + 0b000000110111, + 0b000000111000, + 0b000000100111, + 0b000000101000, + 0b000001011000, + 0b000001011001, + 0b000000101011, + 0b000000101100, + 0b000001011010, + 0b000001100110, + 0b000001100111 + + }, + { + 0b00110101, + 0b000111, + 0b0111, + 0b1000, + 0b1011, + 0b1100, + 0b1110, + 0b1111, + 0b10011, + 0b10100, + 0b00111, + 0b01000, + 0b001000, + 0b000011, + 0b110100, + 0b110101, + 0b101010, + 0b101011, + 0b0100111, + 0b0001100, + 0b0001000, + 0b0010111, + 0b0000011, + 0b0000100, + 0b0101000, + 0b0101011, + 0b0010011, + 0b0100100, + 0b0011000, + 0b00000010, + 0b00000011, + 0b00011010, + 0b00011011, + 0b00010010, + 0b00010011, + 0b00010100, + 0b00010101, + 0b00010110, + 0b00010111, + 0b00101000, + 0b00101001, + 0b00101010, + 0b00101011, + 0b00101100, + 0b00101101, + 0b00000100, + 0b00000101, + 0b00001010, + 0b00001011, + 0b01010010, + 0b01010011, + 0b01010100, + 0b01010101, + 0b00100100, + 0b00100101, + 0b01011000, + 0b01011001, + 0b01011010, + 0b01011011, + 0b01001010, + 0b01001011, + 0b00110010, + 0b00110011, + 0b00110100 + } +}; +static const unsigned t4_term_length[2][64] = { + {10, 2, 2, 3, 3, 4, 4, 5, 6, 6, 7, 7, 7, 8, 8, 9, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12}, + {8, 6, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8} +}; + +static const unsigned t4_min_term_length[] = {2, 4}; +static const unsigned t4_min_make_up_length[] = {10, 5}; + +static const unsigned t4_max_term_length[] = {12, 8}; +static const unsigned t4_max_make_up_length[] = {13, 9}; + +static const unsigned t4_make_up_length[2][15] = { + {10, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13}, + {5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9} +}; + +static const unsigned t4_make_up_ind[15] = {64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960}; + +static const unsigned t4_make_up[2][15] = { + { + 0b0000001111, + 0b000011001000, + 0b000011001001, + 0b000001011011, + 0b000000110011, + 0b000000110100, + 0b000000110101, + 0b0000001101100, + 0b0000001101101, + 0b0000001001010, + 0b0000001001011, + 0b0000001001100, + 0b0000001001101, + 0b0000001110010, + 0b0000001110011 + }, + { + 0b11011, + 0b10010, + 0b010111, + 0b0110111, + 0b00110110, + 0b00110111, + 0b01100100, + 0b01100101, + 0b01101000, + 0b01100111, + 0b011001100, + 0b011001101, + 0b011010010, + 0b011010011, + 0b011010100 + } +}; + +/* The code words for one run length and zero + * run length are described in table 9.1.10.1 + * of 3gpp 44.060 */ const char *one_run_len_code_list[EGPRS_CODEWORDS] = { "00110101", @@ -359,3 +554,138 @@ decode_tree_init(); } +/* Compress received block bitmap + * \param run_len_cnt[in] Count of number of 1's and 0's + * \param codewrd_bitmap[in] Code word for coresponding run length. + * \param crbb_vec[out] compressed bitvector. + */ +static void compress_bitmap( + uint16_t *run_len_cnt, /* cnt: run length count */ + uint16_t *codewrd_bitmap, /* code word */ + int16_t *codewrd_len, /* number of bits in the code word */ + bitvec *crbb_vec, /* bitmap buffer to put code word in */ + bool start) +{ + int i = 0; + unsigned writeIndex = crbb_vec->cur_bit; + *codewrd_bitmap = 0; + *codewrd_len = 0; + if (*run_len_cnt >= 64) { + for (i = 0; i < 15; i++) { + if (t4_make_up_ind[i] == *run_len_cnt) { + *codewrd_bitmap = t4_make_up[start][i]; + *codewrd_len = t4_make_up_length[start][i]; + } + } + } else { + *codewrd_bitmap = t4_term[start][*run_len_cnt]; + *codewrd_len = t4_term_length[start][*run_len_cnt]; + } + bitvec_write_field(crbb_vec, writeIndex, *codewrd_bitmap, *codewrd_len); +} + +/* Compress received block bitmap */ +int egprs_compress::osmo_t4_compress(struct bitvec *bv) +{ + uint8_t crbb_len = 0; + uint8_t uclen_crbb = 0; + uint8_t crbb_bitmap[127] = {'\0'}; + bool start = (bv->data[0] & 0x80)>>7; + struct bitvec crbb_vec; + + crbb_vec.data = crbb_bitmap; + crbb_vec.cur_bit = 0; + crbb_vec.data_len = 127; + bv->data_len = bv->cur_bit; + bv->cur_bit = 0; + if (egprs_compress::compress_rbb(bv, &crbb_vec, &uclen_crbb, 23*8)) { + memcpy(bv->data, crbb_bitmap, (crbb_len+7)/8); + bv->cur_bit = crbb_len; + bv->data_len = (crbb_len+7)/8; + return start; + } + else + printf("Encode failed\n"); + return -1; +} + +/*! \brief compression algorithm using T4 encoding + * the compressed bitmap's are copied in crbb_bitmap + * \param[in] rbb_vec bit vector to be encoded + * \return 1 if compression is success or 0 for failure + */ +int egprs_compress::compress_rbb( + struct bitvec *urbb_vec, + struct bitvec *crbb_vec, + uint8_t *uclen_crbb, /* Uncompressed bitmap len in CRBB */ + uint8_t max_bits) /* max remaining bits */ +{ + bool run_len_bit; + int buflen = urbb_vec->cur_bit; + int total_bits = urbb_vec->cur_bit; + uint16_t rlen; + uint16_t temprl = 0; + uint16_t cbmap = 0; /* Compressed code word */ + int16_t nbits; /* Length of code word */ + uint16_t uclen = 0; + int16_t clen = 0; + bool start; /* Starting color code see 9.1.10, 3GPP 44.060 */ + urbb_vec->cur_bit = 0; + run_len_bit = (urbb_vec->data[0] & 0x80)>>7; + while (buflen > 0) { + temprl = 0; + /* Find Run length */ + if (run_len_bit == 1) + rlen = bitvec_rl_curbit(urbb_vec, true, total_bits); + else + rlen = bitvec_rl_curbit(urbb_vec, false, total_bits); + buflen = buflen - rlen; + /* if rlen > 64 need Makeup code word */ + /*Compress the bits */ + if (run_len_bit == 0) { + start = 0; + if (rlen >= 64) { + temprl = (rlen/64)*64; + compress_bitmap(&temprl, &cbmap, &nbits, + crbb_vec, start); + clen = clen + nbits; + } + temprl = MOD64(rlen); + compress_bitmap(&temprl, &cbmap, &nbits, + crbb_vec, start); + /* next time the run length will be Ones */ + run_len_bit = 1; + } else { + start = 1; + if (rlen >= 64) { + temprl = (rlen/64)*64; + compress_bitmap(&temprl, &cbmap, &nbits, + crbb_vec, start); + clen = clen + nbits; + } + temprl = MOD64(rlen); + compress_bitmap(&temprl, &cbmap, &nbits, + crbb_vec, start); + + /* next time the run length will be Zeros */ + run_len_bit = 0; + } + uclen = uclen + rlen; + clen = clen + nbits; + /*compressed bitmap exceeds the buffer space */ + if (clen > max_bits) { + uclen = uclen - rlen; + clen = clen - nbits; + break; + } + } + crbb_vec->cur_bit = clen; + *uclen_crbb = uclen; + if (clen >= uclen) + /* No Gain is observed, So no need to compress */ + return 0; + else + LOGP(DRLCMACUL, LOGL_DEBUG, "CRBB bitmap = %s\n", osmo_hexdump(crbb_vec->data, (crbb_vec->cur_bit+7)/8)); + /* Add compressed bitmap to final buffer */ + return 1; +} diff --git a/src/egprs_rlc_compression.h b/src/egprs_rlc_compression.h index c5f0f1a..4d2501b 100644 --- a/src/egprs_rlc_compression.h +++ b/src/egprs_rlc_compression.h @@ -5,6 +5,7 @@ #pragma once struct egprs_compress_node; +#define MOD64(X) (((X) + 64) & 0x3F) /* Singleton to manage the EGPRS compression algorithm. */ class egprs_compress @@ -14,6 +15,9 @@ bool start, const uint8_t *orig_buf, bitvec *dest); egprs_compress(); + int osmo_t4_compress(struct bitvec *bv); + static int compress_rbb(struct bitvec *urbb_vec, struct bitvec *crbb_vec, + uint8_t *uclen_crbb, uint8_t max_bits); private: egprs_compress_node *ones_list; diff --git a/src/encoding.cpp b/src/encoding.cpp index 986ba91..527a165 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -24,6 +24,7 @@ #include #include #include +#include extern "C" { #include @@ -699,20 +700,44 @@ static void write_packet_ack_nack_desc_egprs( struct gprs_rlcmac_bts *bts, bitvec * dest, unsigned& wp, - gprs_rlc_ul_window *window, bool is_final) + gprs_rlc_ul_window *window, bool is_final, unsigned& rest_bits) { - int urbb_len = 0; - int len; + unsigned int urbb_len = 0; + uint8_t crbb_len = 0; + uint8_t len; bool bow = true; bool eow = true; int ssn = window->mod_sns(window->v_q() + 1); - int num_blocks = window->mod_sns(window->v_r() - window->v_q()); + unsigned int num_blocks = window->mod_sns(window->v_r() - window->v_q()); int esn_crbb = window->mod_sns(ssn - 1); - /* Bit 0 at the end is mandatory Table 11.2.28.1 in 44.060 */ - int rest_bits = dest->data_len * 8 - wp - 1; + static uint8_t rbb[RLC_EGPRS_MAX_WS] = {'\0'}; + uint8_t iter = 0; int is_compressed = 0; + bool try_compression = false; + uint8_t ucmp_bmplen; + uint8_t crbb_bitmap[23] = {'\0'}; + bitvec ucmp_vec; + bitvec crbb_vec; + uint8_t uclen_crbb = 0; bool len_coded = true; + uint8_t crbb_start_clr_code; uint8_t i; +#if 0 + /* static size of 16 bits*/ + ..0. .... = ACKNACK: (Union) + Desc + + ...0 .... = FINAL_ACK_INDICATION: False + + .... 1... = BEGINNING_OF_WINDOW: 1 + + .... .1.. = END_OF_WINDOW: 1 + + .... ..10 0101 0001 1... .... = STARTING_SEQUENCE_NUMBER: 1187 + + .0.. .... = CRBB Exist: 0 +#endif + rest_bits -= 16; if (num_blocks > 0) /* V(Q) is NACK and omitted -> SSN = V(Q) + 1 */ @@ -720,27 +745,67 @@ if (num_blocks > window->ws()) num_blocks = window->ws(); - /* TODO Compression support */ - if (is_compressed == 0) { - /* Union bit takes 1 bit */ - /* Other fields in descr for uncompresed bitmap takes 15 bits*/ + /* Try Compression as number of blocks does not fit */ + if (num_blocks > rest_bits) { + try_compression = true; + } + if (try_compression == true) { + ucmp_bmplen = window->update_egprs_rbb(rbb); + ucmp_vec.data = rbb; + ucmp_vec.cur_bit = ucmp_bmplen; + ucmp_vec.data_len = 127; + crbb_vec.data = crbb_bitmap; + crbb_vec.cur_bit = 0; + crbb_vec.data_len = 127; + LOGP(DRLCMACUL, LOGL_DEBUG, + "rest_bits=%d uncompressed len %d and uncompressed bitmap = %s\n", + rest_bits, ucmp_bmplen, + osmo_hexdump(ucmp_vec.data, (ucmp_bmplen+7)/8)); - if (num_blocks > rest_bits - 15 - 1) { + is_compressed = egprs_compress::compress_rbb(&ucmp_vec, /* Uncompressed bitmap*/ + &crbb_vec, /*Compressed bitmap vector */ + &uclen_crbb, + (rest_bits - 16));/* CRBBlength:7 colourcode:1 dissector length:8*/ + LOGP(DRLCMACUL, LOGL_DEBUG, + "the ucmp len=%d uclen_crbb=%d num_blocks=%d crbb length %d, " + "and the CRBB bitmap = %s\n", + ucmp_bmplen, uclen_crbb, num_blocks, crbb_vec.cur_bit, + osmo_hexdump(crbb_bitmap, (crbb_vec.cur_bit+7)/8)); + crbb_len = crbb_vec.cur_bit; + } + + if (is_compressed == 0) { + /* length field takes 8 bits*/ + if (num_blocks > rest_bits - 8) { eow = false; - urbb_len = rest_bits - 15 - 1; + urbb_len = rest_bits; len_coded = false; - } else if (num_blocks == rest_bits - 15 - 1) { - urbb_len = rest_bits - 15 - 1; + } else if (num_blocks == rest_bits) { + urbb_len = rest_bits; len_coded = false; - /* Union bit takes 1 bit length field takes 8 bits*/ - } else if (num_blocks > rest_bits - 15 - 9) { - eow = false; - urbb_len = rest_bits - 15 - 9; } else urbb_len = num_blocks; + len = urbb_len + 15; } else { - /* TODO Compressed bitmap */ + if (num_blocks > uclen_crbb) { + eow = false; + urbb_len = num_blocks - uclen_crbb; + } + /* Union bit takes 1 bit */ + /* Other fields in descr of compresed bitmap takes 23 bits + * -8 = CRBB_STARTING_COLOR_CODE + CRBB_LENGTH */ + if (urbb_len > (rest_bits - crbb_len - 8)) { + eow = false; + len_coded = false; + urbb_len = rest_bits - crbb_len - 8; + /* -16 = ACKNACK Dissector length + CRBB_STARTING_COLOR_CODE + CRBB_LENGTH */ + } else if (urbb_len > (rest_bits - crbb_len - 16)) { + eow = false; + len_coded = false; + urbb_len = rest_bits - crbb_len - 16; + } + len = urbb_len + crbb_len + 23; } /* EGPRS Ack/Nack Description IE */ @@ -756,14 +821,32 @@ bitvec_write_field(dest, wp, eow, 1); // END_OF_WINDOW bitvec_write_field(dest, wp, ssn, 11); // STARTING_SEQUENCE_NUMBER if (is_compressed) { - /* TODO Add CRBB support */ - } else + bitvec_write_field(dest, wp, 1, 1); // CRBB_Exist + bitvec_write_field(dest, wp, crbb_len, 7); // CRBB_LENGTH + crbb_start_clr_code = (0x80 & ucmp_vec.data[0])>>7; + bitvec_write_field(dest, wp, crbb_start_clr_code, 1); // CRBB_clr_code + LOGP(DRLCMACUL, LOGL_DEBUG, + "EGPRS CRBB, crbb_len = %d, crbb_start_clr_code = %d\n", + crbb_len, crbb_start_clr_code); + while (crbb_len != 0) { + if (crbb_len > 8) { + bitvec_write_field(dest, wp, crbb_bitmap[iter], 8); + crbb_len = crbb_len - 8; + iter++; + } else { + bitvec_write_field(dest, wp, crbb_bitmap[iter], crbb_len); + crbb_len = 0; + } + } + esn_crbb = window->mod_sns(esn_crbb + uclen_crbb); + } else { bitvec_write_field(dest, wp, 0, 1); // CRBB_Exist + } LOGP(DRLCMACUL, LOGL_DEBUG, "EGPRS URBB, urbb len = %d, SSN = %d, ESN_CRBB = %d, " "len present = %s,desc len = %d, " "SNS = %d, WS = %d, V(Q) = %d, V(R) = %d%s%s\n", - urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No", len, + urbb_len, ssn, esn_crbb, len_coded ? "yes" : "No" , len, window->sns(), window->ws(), window->v_q(), window->v_r(), bow ? ", BOW" : "", eow ? ", EOW" : ""); @@ -795,7 +878,9 @@ bitvec_write_field(dest, wp, 0, 1); // 0: don't have Power Control Parameters bitvec_write_field(dest, wp, 0, 1); // 0: don't have Extension Bits - write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final); + /* -2 for last bit 0 mandatory and REL5 not supported */ + unsigned bits_ack_nack = dest->data_len * 8 - wp - 2; + write_packet_ack_nack_desc_egprs(bts, dest, wp, &tbf->m_window, is_final, bits_ack_nack); bitvec_write_field(dest, wp, 0, 1); // fixed 0 bitvec_write_field(dest, wp, 0, 1); // 0: don't have REL 5 diff --git a/src/rlc.cpp b/src/rlc.cpp index 2bffccb..696aed5 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -83,6 +83,32 @@ return resend; } +/* Update the receive block bitmap */ +uint16_t gprs_rlc_ul_window::update_egprs_rbb(uint8_t *rbb) +{ + int i; + uint16_t bsn; + uint16_t bitmask = 0x80; + int8_t pos = 0; + int8_t bit_pos = 0; + for (i = 0, bsn = (v_q()+1); ((bsn < (v_r())) && (i < ws())); i++, + bsn = this->mod_sns(bsn + 1)) { + if (m_v_n.is_received(bsn)) { + rbb[pos] = rbb[pos] | bitmask; + } else { + rbb[pos] = rbb[pos] & (~bitmask); + } + bitmask = bitmask >> 1; + bit_pos++; + bit_pos = bit_pos % 8; + if (bit_pos == 0) { + pos++; + bitmask = 0x80; + } + } + return i; +} + int gprs_rlc_dl_window::count_unacked() { uint16_t unacked = 0; @@ -105,9 +131,8 @@ uint16_t first_bsn, uint16_t *lost, uint16_t *received) { - unsigned dist = distance(); - unsigned num_blocks = rbb->cur_bit > dist - ? dist : rbb->cur_bit; + unsigned num_blocks = rbb->cur_bit > (unsigned)distance() + ? distance() : rbb->cur_bit; unsigned bsn; /* first_bsn is in range V(A)..V(S) */ @@ -219,6 +244,8 @@ void gprs_rlc_window::set_ws(uint16_t ws) { + LOGP(DRLCMAC, LOGL_ERROR, "ws(%d)\n", + ws); OSMO_ASSERT(ws >= RLC_GPRS_SNS/2); OSMO_ASSERT(ws <= RLC_MAX_SNS/2); m_ws = ws; diff --git a/src/rlc.h b/src/rlc.h index b2fcd95..7db205d 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -347,6 +347,7 @@ bool is_received(uint16_t bsn) const; void update_rbb(char *rbb); + uint16_t update_egprs_rbb(uint8_t *rbb); void raise_v_r_to(int moves); void raise_v_r(const uint16_t bsn); uint16_t raise_v_q(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..041db4c 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -700,14 +700,16 @@ if (egprs_ms_class > 0 && bts->egprs_enabled) { tbf->enable_egprs(); tbf->m_window.set_sns(RLC_EGPRS_SNS); - /* TODO: Allow bigger UL windows when CRBB encoding is supported */ - tbf->m_window.set_ws(RLC_EGPRS_MIN_WS); setup_egprs_mode(bts, ms); LOGP(DRLCMAC, LOGL_INFO, "Enabled EGPRS for %s, mode %s\n", tbf->name(), GprsCodingScheme::modeName(ms->mode())); } rc = setup_tbf(tbf, ms, use_trx, ms_class, egprs_ms_class, single_slot); + + if (tbf->is_egprs_enabled()) + tbf->egprs_calc_ulwindow_size(); + /* if no resource */ if (rc < 0) { talloc_free(tbf); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..3f73297 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -465,6 +465,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void egprs_calc_ulwindow_size(); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..62f55c8 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -29,6 +29,8 @@ #include #include +#include "pcu_utils.h" + extern "C" { #include #include @@ -517,3 +519,22 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::egprs_calc_ulwindow_size() +{ + struct gprs_rlcmac_bts *bts_data = bts->bts_data(); + unsigned int num_pdch = pcu_bitcount(ul_slots()); + unsigned int ws = bts_data->ws_base + num_pdch * bts_data->ws_pdch; + ws = (ws / 32) * 32; + ws = OSMO_MAX(64, ws); + + if (num_pdch == 1) + ws = OSMO_MIN(192, ws); + else + ws = OSMO_MIN(128 * num_pdch, ws); + + LOGP(DRLCMAC, LOGL_ERROR, "%s: Setting EGPRS window size to %d, base(%d) slots(%d) ws_pdch(%d)\n", + name(), ws, bts_data->ws_base, num_pdch, bts_data->ws_pdch); + + m_window.set_ws(ws); +} diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 485da61..3ac9d0c 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -3342,6 +3342,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 3c TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384 +ws(384) DL TBF slots: 0x3c, N: 4, WS: 384 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) free @@ -3386,6 +3387,8 @@ - Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed @@ -3438,6 +3441,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' @@ -3479,6 +3483,8 @@ - Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed @@ -3694,6 +3700,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' @@ -3723,6 +3730,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -4057,6 +4065,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -4336,6 +4345,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -4574,6 +4584,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -4776,6 +4787,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -4956,6 +4968,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5117,6 +5130,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5274,6 +5288,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5418,6 +5433,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5563,6 +5579,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5614,6 +5631,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5665,6 +5683,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5716,6 +5735,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5786,6 +5806,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5856,6 +5877,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5926,6 +5948,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -5996,6 +6019,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -6053,6 +6077,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -6110,6 +6135,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -6167,6 +6193,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed @@ -6242,6 +6269,8 @@ - Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed @@ -6324,6 +6353,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' @@ -6355,6 +6385,7 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 192 +ws(192) DL TBF slots: 0x10, N: 1, WS: 192 ********** TBF update ********** PDCH(TS 4, TRX 0): Detaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 0 TBFs, USFs = 00, TFIs = 00000000. @@ -6371,6 +6402,7 @@ - Assigning DL TS 5 PDCH(TS 5, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 00, TFIs = 00000001. TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 384 +ws(384) DL TBF slots: 0x3c, N: 4, WS: 384 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to RELEASING TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=RELEASING EGPRS) free @@ -6415,6 +6447,8 @@ - Setting Control TS 7 Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 64, base(0) slots(1) ws_pdch(0) +ws(64) TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed @@ -6484,6 +6518,7 @@ Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI: 0xf1223344 confirmed TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' @@ -6513,9 +6548,11 @@ Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 10, dl_slots = 10 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 64 +ws(64) Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +ws(480) TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) downlink acknowledge - ack: (BSN=1176)"RRRRRRRRRRIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIRRRIRRRRRRRRRRRRRRRRRRRRRRRRRRI"(BSN=1287) R=ACK I=NACK TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW EGPRS) DL analysis, range=1176:1288, lost=73, recv=39, skipped=0, bsn=1944, info='RRRRRRRRRRRRRRRRRRRRRRRRRRLRRRLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLRRRRRRRRRR................................................................................................................................................................................................................................................................................................................................................................................' -- To view, visit https://gerrit.osmocom.org/413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:46:31 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 12:46:31 +0000 Subject: osmo-pcu[master]: Add compression support in EGPRS PUAN In-Reply-To: References: Message-ID: Patch Set 3: > Build Failed > > http://jenkins.osmocom.org/jenkins/job/osmo-pcu-gerrit/432/ : > FAILURE There is a dependency for this patch with libosmocore Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26. Due to this there is jenkins build failure for this patch -- To view, visit https://gerrit.osmocom.org/413 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I89683e82eda6c80b7328ddb4ec2c2f55d4a687aa Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:50:38 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Thu, 10 Nov 2016 12:50:38 +0000 Subject: [PATCH] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Hello arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1167 to look at the new patch set (#6). Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 294 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/67/1167/6 diff --git a/src/bts.cpp b/src/bts.cpp index 4e6b5e9..d34eafc 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -485,6 +525,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, " "so we provide one \n" "ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); @@ -573,8 +616,10 @@ m_bts.alpha, m_bts.gamma, -1, burst_type, sb); } - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -699,8 +744,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1349,6 +1397,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..19341af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1064,6 +1074,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..2e93efc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -377,6 +377,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -465,6 +466,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..185521d 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,56 @@ m_window.set_ws(ws); } + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..420fc1a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -175,7 +175,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +517,56 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal From gerrit-no-reply at lists.osmocom.org Thu Nov 10 12:54:51 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 12:54:51 +0000 Subject: [PATCH] osmo-pcu[master]: Add test case for testing PUAN In-Reply-To: References: Message-ID: Hello arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/414 to look at the new patch set (#5). Add test case for testing PUAN This test case is for testing generation of EGPRS PUAN. Corresponding log files .ok and .err are modified. Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 --- M src/rlc.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 4 files changed, 2,390 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/14/414/5 diff --git a/src/rlc.h b/src/rlc.h index 7db205d..ee86c2a 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -341,6 +341,9 @@ const uint16_t v_r() const; const uint16_t v_q() const; + const void set_v_r(int); + const void set_v_q(int); + const uint16_t ssn() const; bool is_in_window(uint16_t bsn) const; @@ -571,6 +574,16 @@ return is_in_window(bsn) && m_v_n.is_received(bsn) && offset_v_r < ws(); } +inline const void gprs_rlc_ul_window::set_v_r(int v_r) +{ + m_v_r = v_r; +} + +inline const void gprs_rlc_ul_window::set_v_q(int v_q) +{ + m_v_q = v_q; +} + inline const uint16_t gprs_rlc_ul_window::v_r() const { return m_v_r; diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 339390b..ca79f84 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -1215,6 +1215,348 @@ return ul_tbf; } +static gprs_rlcmac_ul_tbf *establish_ul_tbf(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class, uint8_t egprs_ms_class) +{ + GprsMs *ms; + uint32_t rach_fn = *fn - 51; + uint32_t sba_fn = *fn + 52; + uint8_t trx_no = 0; + int tfi = 0, i = 0; + gprs_rlcmac_ul_tbf *ul_tbf; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + struct pcu_l1_meas meas; + struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; + GprsCodingScheme cs; + + meas.set_rssi(31); + bts = the_bts->bts_data(); + + /* needed to set last_rts_fn in the PDCH object */ + request_dl_rlc_block(bts, trx_no, ts_no, fn); + + /* + * simulate RACH, this sends an Immediate + * Assignment Uplink on the AGCH + */ + the_bts->rcv_rach(0x73, rach_fn, qta, 0, GSM_L1_BURST_TYPE_ACCESS_0); + + /* get next free TFI */ + tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + ulreq.u.Packet_Resource_Request.PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + ulreq.u.Packet_Resource_Request.ID.UnionType = 1; /* != 0 */ + ulreq.u.Packet_Resource_Request.ID.u.TLLI = tlli; + ulreq.u.Packet_Resource_Request.Exist_MS_Radio_Access_capability = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + Count_MS_RA_capability_value = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content. + Exist_Multislot_capability = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + Exist_GPRS_multislot_class = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content.Multislot_capability. + GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content. + Multislot_capability.Exist_EGPRS_multislot_class = 1; + ulreq.u.Packet_Resource_Request.MS_Radio_Access_capability. + MS_RA_capability_value[0].u.Content. + Multislot_capability.EGPRS_multislot_class = ms_class; + } + send_ul_mac_block(the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* check the TBF */ + ul_tbf = the_bts->ul_tbf_by_tfi(tfi, trx_no, ts_no); + /* send packet uplink assignment */ + *fn = sba_fn; + request_dl_rlc_block(ul_tbf, fn); + + /* send real acknowledgement */ + send_control_ack(ul_tbf); + + check_tbf(ul_tbf); + + return ul_tbf; +} + +static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase_puan_URBB_no_length(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class, uint8_t egprs_ms_class, gprs_rlcmac_ul_tbf *ul_tbf) +{ + OSMO_ASSERT(ul_tbf); + OSMO_ASSERT(ul_tbf->ta() == qta / 4); + GprsMs *ms; + uint32_t rach_fn = *fn - 51; + uint32_t sba_fn = *fn + 52; + uint8_t trx_no = 0; + int tfi = 0, i = 0; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + struct pcu_l1_meas meas; + struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; + GprsCodingScheme cs; + + + /* send fake data with cv=0*/ + struct gprs_rlc_ul_header_egprs_3 *hdr3 = NULL; + uint8_t data[49] = {0}; + + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + + /*header_construction */ + memset(data, 0x2b, sizeof(data)); + /* Message with CRBB */ + for (int i = 0 ; i < 80; i++) { + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 10; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = ((i * 2)&0x1f); + hdr3->bsn1_lo = ((i * 2)/32); + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x0; + data[6] = 0x2b; + data[7] = 0x2b; + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + } + ul_tbf->create_ul_ack(*fn, ts_no); + memset(data, 0x2b, sizeof(data)); + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 0; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = 0; + hdr3->bsn1_lo = 2; + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x2b; + data[6] = 0x2b; + data[7] = 0x2b; + + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + + request_dl_rlc_block(ul_tbf, fn); + + check_tbf(ul_tbf); + OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + + ms = the_bts->ms_by_tlli(tlli); + OSMO_ASSERT(ms != NULL); + OSMO_ASSERT(ms->ta() == qta/4); + OSMO_ASSERT(ms->ul_tbf() == ul_tbf); + + return ul_tbf; +} + +static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase_puan_URBB_with_length(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class, uint8_t egprs_ms_class, gprs_rlcmac_ul_tbf *ul_tbf) +{ + OSMO_ASSERT(ul_tbf); + OSMO_ASSERT(ul_tbf->ta() == qta / 4); + GprsMs *ms; + uint32_t rach_fn = *fn - 51; + uint32_t sba_fn = *fn + 52; + uint8_t trx_no = 0; + int tfi = 0, i = 0; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + struct pcu_l1_meas meas; + struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; + GprsCodingScheme cs; + + check_tbf(ul_tbf); + /* send fake data with cv=0*/ + struct gprs_rlc_ul_header_egprs_3 *hdr3 = NULL; + uint8_t data[49] = {0}; + + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + + /*header_construction */ + memset(data, 0x2b, sizeof(data)); + + /* Message with URBB & URBB length */ + for (int i = 0 ; i < 20; i++) { + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 10; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = ((i * 2)&0x1f); + hdr3->bsn1_lo = ((i * 2)/32); + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x0; + data[6] = 0x2b; + data[7] = 0x2b; + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + } + ul_tbf->create_ul_ack(*fn, ts_no); + memset(data, 0x2b, sizeof(data)); + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 0; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = 0; + hdr3->bsn1_lo = 2; + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x2b; + data[6] = 0x2b; + data[7] = 0x2b; + + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + + request_dl_rlc_block(ul_tbf, fn); + + check_tbf(ul_tbf); + OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + + ms = the_bts->ms_by_tlli(tlli); + OSMO_ASSERT(ms != NULL); + OSMO_ASSERT(ms->ta() == qta/4); + OSMO_ASSERT(ms->ul_tbf() == ul_tbf); + + return ul_tbf; +} + +static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase_puan_CRBB(BTS *the_bts, + uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, + uint8_t ms_class, uint8_t egprs_ms_class) +{ + GprsMs *ms; + uint32_t rach_fn = *fn - 51; + uint32_t sba_fn = *fn + 52; + uint8_t trx_no = 0; + int tfi = 0, i = 0; + gprs_rlcmac_ul_tbf *ul_tbf; + struct gprs_rlcmac_pdch *pdch; + gprs_rlcmac_bts *bts; + RlcMacUplink_t ulreq = {0}; + struct pcu_l1_meas meas; + struct gprs_rlc_ul_header_egprs_3 *egprs3 = NULL; + GprsCodingScheme cs; + + + /* check the TBF */ + ul_tbf = the_bts->ul_tbf_by_tfi(tfi, trx_no, ts_no); + OSMO_ASSERT(ul_tbf); + OSMO_ASSERT(ul_tbf->ta() == qta / 4); + + /* send fake data with cv=0*/ + struct gprs_rlc_ul_header_egprs_3 *hdr3 = NULL; + uint8_t data[49] = {0}; + + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + + /*header_construction */ + memset(data, 0x2b, sizeof(data)); + + /* Message with CRBB */ + for (int i = 80 ; i < 160; i++) { + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 10; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = ((i)&0x1f); + hdr3->bsn1_lo = ((i)/32); + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x0; + data[6] = 0x2b; + data[7] = 0x2b; + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + } + ul_tbf->create_ul_ack(*fn, ts_no); + memset(data, 0x2b, sizeof(data)); + hdr3 = (struct gprs_rlc_ul_header_egprs_3 *)data; + hdr3->r = 0; + hdr3->si = 0; + hdr3->cv = 0; + hdr3->tfi_hi = (tfi >> 3) & 0x3; + hdr3->tfi_lo = tfi & 0x7; + hdr3->bsn1_hi = 0; + hdr3->bsn1_lo = 2; + hdr3->cps_hi = 0; + hdr3->cps_lo = 0; + hdr3->spb = 0; + hdr3->rsb = 0; + hdr3->pi = 0; + hdr3->spare = 0; + hdr3->dummy = 1; + data[4] = 0x0; + data[5] = 0x2b; + data[6] = 0x2b; + data[7] = 0x2b; + + pdch = &the_bts->bts_data()->trx[trx_no].pdch[ts_no]; + pdch->rcv_block(&data[0], sizeof(data), *fn, &meas); + + request_dl_rlc_block(ul_tbf, fn); + + check_tbf(ul_tbf); + OSMO_ASSERT(ul_tbf->ul_ack_state == GPRS_RLCMAC_UL_ACK_NONE); + + ms = the_bts->ms_by_tlli(tlli); + OSMO_ASSERT(ms != NULL); + OSMO_ASSERT(ms->ta() == qta/4); + OSMO_ASSERT(ms->ul_tbf() == ul_tbf); + + return ul_tbf; +} static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase(BTS *the_bts, uint8_t ts_no, uint32_t tlli, uint32_t *fn, uint16_t qta, uint8_t ms_class, uint8_t egprs_ms_class) @@ -1372,6 +1714,73 @@ printf("=== end %s ===\n", __func__); } +static void test_tbf_egprs_two_phase_puan(void) +{ + BTS the_bts; + int ts_no = 7; + uint32_t fn = 2654218; + uint16_t qta = 31; + uint32_t tlli = 0xf1223344; + const char *imsi = "0011223344"; + uint8_t ms_class = 1; + gprs_rlcmac_bts *bts; + uint8_t egprs_ms_class = 1; + gprs_rlcmac_ul_tbf *ul_tbf; + GprsMs *ms; + uint8_t test_data[256]; + + printf("=== start %s ===\n", __func__); + + memset(test_data, 1, sizeof(test_data)); + + setup_bts(&the_bts, ts_no, 4); + the_bts.bts_data()->initial_mcs_dl = 9; + the_bts.bts_data()->egprs_enabled = 1; + bts = the_bts.bts_data(); + bts->ws_base = 128; + bts->ws_pdch = 64; + + ul_tbf = establish_ul_tbf(&the_bts, ts_no, tlli, &fn, qta, ms_class, egprs_ms_class); + /* Function to generate URBB with no length */ + ul_tbf = establish_ul_tbf_two_phase_puan_URBB_no_length(&the_bts, ts_no, tlli, &fn, + qta, ms_class, egprs_ms_class, ul_tbf); + + ms = ul_tbf->ms(); + fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta()); + fprintf(stderr, + "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); + send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); + + ul_tbf->m_window.set_v_r(0); + ul_tbf->m_window.set_v_q(0); + /* Function to generate URBB with length */ + ul_tbf = establish_ul_tbf_two_phase_puan_URBB_with_length(&the_bts, ts_no, tlli, &fn, + qta, ms_class, egprs_ms_class, ul_tbf); + + ms = ul_tbf->ms(); + fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta()); + fprintf(stderr, + "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); + + send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); + + ul_tbf->m_window.set_v_r(0); + ul_tbf->m_window.set_v_q(0); + /* Function to generate CRBB */ + bts->ws_base = 128; + bts->ws_pdch = 64; + ul_tbf = establish_ul_tbf_two_phase_puan_CRBB(&the_bts, ts_no, tlli, &fn, + qta, ms_class, egprs_ms_class); + + ms = ul_tbf->ms(); + fprintf(stderr, "Got '%s', TA=%d\n", ul_tbf->name(), ul_tbf->ta()); + fprintf(stderr, + "Got MS: TLLI = 0x%08x, TA = %d\n", ms->tlli(), ms->ta()); + + send_dl_data(&the_bts, tlli, imsi, test_data, sizeof(test_data)); + + printf("=== end %s ===\n", __func__); +} /* * Trigger rach for single block */ @@ -2874,6 +3283,7 @@ test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); + test_tbf_egprs_two_phase_puan(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 3ac9d0c..14b0690 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6883,3 +6883,1968 @@ No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x73 Fn=2654167 qta=31 is_11bit=0: +MS requests single block allocation +RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x73, Fn=2654167 (17,25,9), SBFn=2654270 +TX: Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=-1 USF=7 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 73 8b 29 07 00 c0 0c 5a 43 2b 2b 2b 2b 2b 2b 2b +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS supports EGPRS multislot class 1. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=1/1 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 1 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 1 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 1 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 00 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS): Setting EGPRS window size to 192, base(128) slots(1) ws_pdch(64) +ws(192) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=ASSIGN EGPRS) starting timer 3169. +Modifying MS object, UL TLLI: 0x00000000 -> 0xf1223344, not yet confirmed +Modifying MS object, TLLI = 0xf1223344, TA 220 -> 7 +Change control TS to 7 until assinment is complete. +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS)s start Packet Uplink Assignment (PACCH) ++++++++++++++++++++++++++ TX : Packet Uplink Assignment +++++++++++++++++++++++++ +------------------------- TX : Packet Uplink Assignment ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS): Scheduling polling at FN 2654283 TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Scheduled UL Assignment polling on FN=2654283, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654270 block=8 data=4f 28 5e 24 46 68 90 f9 0a 39 00 00 88 00 08 2b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +RX: [PCU <- BTS] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) Packet Control Ack +TBF: [DOWNLINK] UPLINK ASSIGNED TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=ASSIGN EGPRS) changes state from ASSIGN to FLOW +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=0, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 0 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 1 +- Taking block 0 out, raising V(Q) to 1 +- Assembling frames: (len=44) +-- Frame 1 starts at offset 0, length=44, is_complete=0 +- No gaps in received block, last block: BSN=0 CV=10 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=1) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=2, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 2 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 3 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=3) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=4, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 4 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 5 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=5) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=6, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 6 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 7 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=7) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=8, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 8 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 9 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=9) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=10, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 10 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 11 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=11) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=12, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 12 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 13 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=13) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=14, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 14 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 15 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=15) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=16, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 16 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 17 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=17) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=18, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 18 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 19 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=19) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=20, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 20 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 21 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=21) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=22, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 22 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 23 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=23) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=24, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 24 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 25 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=25) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=26, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 26 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 27 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=27) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=28, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 28 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 29 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=29) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=30, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 30 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 31 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=31) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=32, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 32 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 33 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=33) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=34, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 34 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 35 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=35) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=36, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 36 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 37 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=37) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=38, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 38 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 39 +- Scheduling Ack/Nack, because 20 frames received. +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=39) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=40, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 40 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 41 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=41) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=42, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 42 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 43 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=43) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=44, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 44 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 45 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=45) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=46, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 46 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 47 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=47) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=48, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 48 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 49 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=49) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=50, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 50 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 51 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=51) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=52, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 52 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 53 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=53) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=54, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 54 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 55 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=55) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=56, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 56 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 57 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=57) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=58, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 58 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 59 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=59) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=60, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 60 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 61 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=61) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=62, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 62 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 63 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=63) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 64 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 65 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=65) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=66, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 66 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 67 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=67) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=68, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 68 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 69 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=69) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=70, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 70 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 71 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=71) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=72, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 72 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 73 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=73) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=74, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 74 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 75 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=75) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=76, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 76 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 77 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=77) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=78, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 78 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 79 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=79) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=80, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 80 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 81 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=81) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=82, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 82 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 83 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=83) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=84, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 84 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 85 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=85) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=86, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 86 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 87 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=87) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=88, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 88 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 89 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=89) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=90, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 90 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 91 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=91) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=92, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 92 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 93 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=93) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=94, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 94 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 95 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=95) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=96, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 96 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 97 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=97) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=98, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 98 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 99 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=99) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=100, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 100 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 101 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=101) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=102, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 102 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 103 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=103) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=104, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 104 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 105 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=105) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=106, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 106 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 107 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=107) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=108, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 108 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 109 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=109) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=110, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 110 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 111 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=111) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=112, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 112 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 113 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=113) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=114, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 114 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 115 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=115) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=116, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 116 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 117 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=117) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=118, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 118 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 119 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=119) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=120, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 120 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 121 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=121) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=122, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 122 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 123 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=123) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=124, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 124 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 125 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=125) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=126, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 126 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 127 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=127) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=128, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 128 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 129 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=129) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=130, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 130 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 131 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=131) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=132, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 132 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 133 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=133) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=134, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 134 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 135 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=135) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=136, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 136 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 137 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=137) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=138, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 138 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 139 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=139) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=140, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 140 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 141 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=141) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=142, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 142 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 143 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=143) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=144, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 144 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 145 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=145) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=146, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 146 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 147 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=147) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=148, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 148 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 149 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=149) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=150, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 150 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 151 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=151) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=152, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 152 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 153 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=153) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=154, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 154 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 155 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=155) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=156, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 156 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 157 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=157) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=158, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 158 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 159 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) +rest_bits=94 uncompressed len 157 and uncompressed bitmap = aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa aa a8 +the ucmp len=157 uclen_crbb=19 num_blocks=157 crbb length 78, and the CRBB bitmap = 1e 1e 1e 1e 1e 1e 1e 1e 1e 1e +EGPRS URBB, urbb len = 94, SSN = 2, ESN_CRBB = 1, len present = No,desc len = 109, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 159, BOW +Uplink Ack/Nack bit count 184, max 184, message = 40 24 01 3f 3e 24 46 68 90 20 04 55 55 55 55 55 55 55 55 55 55 55 54 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 00 00 02 80 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=159) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 64 already received +Received RTS for PDCH: TRX=0 TS=7 FN=2654275 block_nr=9 scheduling USF=0 for required uplink resource of UL TFI=0 +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654275 block=9 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 +Got MS: TLLI = 0xf1223344, TA = 7 +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=1/1 +Enabled EGPRS for TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), mode EGPRS +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign downlink TS=7 TFI=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL EGPRS), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0xf1223344, TBF = TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) +Allocated TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): trx = 0, ul_slots = 80, dl_slots = 80 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS): Setting EGPRS window size to 192 +ws(192) +Modifying MS object, TLLI: 0xf1223344 confirmed +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) [DOWNLINK] START +Modifying MS object, TLLI = 0xf1223344, IMSI '' -> '0011223344' +Send dowlink assignment on PACCH, because TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) exists +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=NULL EGPRS) changes state from NULL to ASSIGN +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) starting timer 0. +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=0, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 0 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 1 +- Taking block 0 out, raising V(Q) to 1 +- Assembling frames: (len=44) +-- Frame 1 starts at offset 0, length=44, is_complete=0 +- No gaps in received block, last block: BSN=0 CV=10 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=1) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=2, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 2 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 3 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=3) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=4, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 4 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 5 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=5) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=6, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 6 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 7 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=7) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=8, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 8 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 9 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=9) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=10, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 10 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 11 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=11) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=12, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 12 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 13 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=13) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=14, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 14 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 15 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=15) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=16, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 16 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 17 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=17) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=18, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 18 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 19 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=19) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=20, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 20 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 21 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=21) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=22, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 22 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 23 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=23) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=24, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 24 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 25 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=25) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=26, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 26 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 27 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=27) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=28, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 28 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 29 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 00 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=29) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=30, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 30 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 31 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=31) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=32, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 32 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 33 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=33) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=34, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 34 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 35 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=35) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=36, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 36 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 37 +- Scheduling Ack/Nack, because 20 frames received. +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 01 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=37) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=38, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 38 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 39 +Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) +EGPRS URBB, urbb len = 37, SSN = 2, ESN_CRBB = 1, len present = yes,desc len = 52, SNS = 2048, WS = 192, V(Q) = 1, V(R) = 39, BOW, EOW +Uplink Ack/Nack bit count 135, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a 30 04 aa aa aa aa a9 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 00 00 02 80 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=1 .. V(R)=39) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 64 storing in window (1..192) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 65 +Received RTS for PDCH: TRX=0 TS=7 FN=2654279 block_nr=10 scheduling USF=0 for required uplink resource of UL TFI=0 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) start Packet Downlink Assignment (PACCH) ++++++++++++++++++++++++++ TX : Packet Downlink Assignment +++++++++++++++++++++++++ +------------------------- TX : Packet Downlink Assignment ------------------------- +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Scheduling polling at FN 2654292 TS 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) Scheduled DL Assignment polling on FN=2654292, TS=7 +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654279 block=10 data=48 08 00 00 0c 72 00 02 08 00 80 c8 03 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 +Got MS: TLLI = 0xf1223344, TA = 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=0) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=80, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 80 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 81 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 88 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=81) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=81, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 81 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 82 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=82) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=82, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 82 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 83 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 98 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=83) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=83, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 83 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 84 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=84) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=84, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 84 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 85 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=85) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=85, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 85 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 86 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=86) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=86, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 86 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 87 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=87) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=87, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 87 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 88 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=88) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=88, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 88 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 89 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=89) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=89, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 89 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 90 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=90) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=90, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 90 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 91 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=91) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=91, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 91 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 92 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=92) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=92, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 92 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 93 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=93) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=93, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 93 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 94 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=94) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=94, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 94 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 95 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f8 02 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=95) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=95, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 95 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 96 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=96) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=96, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 96 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 97 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 08 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=97) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=97, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 97 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 98 +- Scheduling Ack/Nack, because 20 frames received. +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=98) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=98, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 98 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 99 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 18 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=99) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=99, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 99 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 100 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=100) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=100, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 100 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 101 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 28 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=101) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=101, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 101 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 102 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=102) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=102, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 102 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 103 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 38 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=103) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=103, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 103 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 104 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=104) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=104, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 104 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 105 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 48 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=105) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=105, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 105 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 106 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=106) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=106, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 106 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 107 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 58 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=107) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=107, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 107 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 108 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=108) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=108, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 108 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 109 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 68 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=109) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=109, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 109 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 110 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=110) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=110, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 110 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 111 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 78 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=111) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=111, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 111 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 112 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=112) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=112, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 112 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 113 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 88 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=113) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=113, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 113 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 114 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=114) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=114, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 114 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 115 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 98 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=115) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=115, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 115 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 116 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=116) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=116, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 116 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 117 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=117) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=117, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 117 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 118 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=118) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=118, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 118 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 119 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=119) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=119, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 119 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 120 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=120) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=120, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 120 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 121 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=121) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=121, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 121 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 122 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=122) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=122, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 122 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 123 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=123) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=123, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 123 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 124 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=124) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=124, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 124 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 125 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=125) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=125, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 125 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 126 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=126) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=126, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 126 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 127 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f8 03 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=127) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=127, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 127 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 128 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 00 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=128) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=128, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 128 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 129 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 08 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=129) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=129, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 129 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 130 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 10 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=130) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=130, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 130 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 131 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 18 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=131) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=131, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 131 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 132 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 20 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=132) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=132, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 132 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 133 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 28 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=133) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=133, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 133 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 134 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 30 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=134) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=134, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 134 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 135 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 38 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=135) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=135, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 135 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 136 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 40 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=136) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=136, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 136 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 137 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 48 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=137) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=137, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 137 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 138 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 50 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=138) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=138, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 138 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 139 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 58 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=139) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=139, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 139 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 140 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 60 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=140) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=140, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 140 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 141 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 68 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=141) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=141, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 141 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 142 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 70 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=142) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=142, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 142 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 143 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 78 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=143) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=143, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 143 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 144 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 80 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=144) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=144, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 144 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 145 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 88 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=145) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=145, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 145 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 146 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 90 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=146) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=146, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 146 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 147 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 98 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=147) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=147, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 147 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 148 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=148) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=148, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 148 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 149 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 a8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=149) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=149, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 149 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 150 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=150) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=150, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 150 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 151 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 b8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=151) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=151, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 151 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 152 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=152) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=152, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 152 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 153 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 c8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=153) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=153, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 153 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 154 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=154) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=154, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 154 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 155 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 d8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=155) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=155, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 155 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 156 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=156) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=156, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 156 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 157 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 e8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=157) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=157, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 157 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 158 +- Scheduling Ack/Nack, because 20 frames received. +- Sending Ack/Nack is already triggered, don't schedule! +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f0 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=158) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=158, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 158 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 159 +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 28 f8 04 80 00 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=159) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=10, BSN=159, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 159 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=00 80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +- Raising V(R) to 160 +Encoding Ack/Nack for TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) (final=0) +rest_bits=94 uncompressed len 159 and uncompressed bitmap = 00 00 00 00 00 00 00 00 00 01 ff ff ff ff ff ff ff ff ff fe +CRBB bitmap = 03 c3 1b a8 +the ucmp len=159 uclen_crbb=159 num_blocks=159 crbb length 30, and the CRBB bitmap = 03 c3 1b a8 +EGPRS CRBB, crbb_len = 30, crbb_start_clr_code = 0 +EGPRS URBB, urbb len = 0, SSN = 1, ESN_CRBB = 159, len present = yes,desc len = 53, SNS = 2048, WS = 192, V(Q) = 0, V(R) = 160, BOW, EOW +Uplink Ack/Nack bit count 136, max 184, message = 40 24 01 3f 3e 24 46 68 90 9a b0 03 3c 03 c3 1b a0 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: MCS-4, length: 49 (49)) + UL data: 00 00 02 80 00 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got MCS-4 RLC block: R=0, SI=0, TFI=0, CPS=0, RSB=0, rc=385 +UL DATA TFI=0 received (V(Q)=0 .. V(R)=160) +max_cs_ul cannot be derived (current UL CS: UNKNOWN) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) restarting timer 3169 while old timer 3169 pending +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): Got MCS-4 RLC data block: CV=0, BSN=64, SPB=0, PI=0, E=1, TI=0, bitoffs=33 +- BSN 64 storing in window (0..191) +TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS): data_length=44, data=80 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 95 +Received RTS for PDCH: TRX=0 TS=7 FN=2654283 block_nr=11 scheduling USF=0 for required uplink resource of UL TFI=0 +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654283 block=11 data=40 94 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Got 'TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS)', TA=7 +Got MS: TLLI = 0xf1223344, TA = 7 +TBF(TFI=0 TLLI=0xf1223344 DIR=DL STATE=ASSIGN EGPRS) append diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index f921dfc..a4cfaf0 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -72,3 +72,5 @@ === end test_immediate_assign_rej_multi_block === === start test_immediate_assign_rej_single_block === === end test_immediate_assign_rej_single_block === +=== start test_tbf_egprs_two_phase_puan === +=== end test_tbf_egprs_two_phase_puan === -- To view, visit https://gerrit.osmocom.org/414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 10 13:16:00 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 10 Nov 2016 13:16:00 +0000 Subject: osmo-pcu[master]: Add test case for testing PUAN In-Reply-To: References: Message-ID: Patch Set 5: > Build Failed > > http://jenkins.osmocom.org/jenkins/job/osmo-pcu-gerrit/434/ : > FAILURE There is a dependency for this patch with libosmocore Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26. Due to this there is jenkins build failure for this patch -- To view, visit https://gerrit.osmocom.org/414 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I18e6d4a9e90fd6453fe14187beab27dfeae8dbe9 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 16:58:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 16:58:18 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 2: > Hi Harald, > Any update on this patch? I am not qualified for review of PCU patches, as I am not familiar with its internals. In those rare cases where I feel competent enough, or where the issue is of a more general/formal nature, I will provide feedback. In general, I am not the right person for PCU related questions. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:00:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:00:41 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/1209/3/src/encoding.cpp File src/encoding.cpp: Line 1409: bitvec_write_field(dest, wp, 0x21, 6); // MESSAGE TYPE donb't we have something like enums or #defines for at least the message types? -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:03:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:03:13 +0000 Subject: libosmocore[master]: utils/conv_gen.py: separate code definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:03:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:03:18 +0000 Subject: libosmocore[master]: utils/conv_gen.py: separate code definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:03:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:03:41 +0000 Subject: openbsc[master]: fix use after free in bsc_config_free In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:03:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:03:42 +0000 Subject: [MERGED] openbsc[master]: fix use after free in bsc_config_free In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix use after free in bsc_config_free ...................................................................... fix use after free in bsc_config_free talloc_free the cfg only after asserting num_bsc count sanity. This caused a failure in the 'bsc-nat' test with -fsanitize build. Should fix the Osmocom_Sanitizer build on jenkins.osmocom.org https://jenkins.osmocom.org/jenkins/job/Osmocom_Sanitizer/ Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6 --- M openbsc/src/osmo-bsc_nat/bsc_nat_utils.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c index 37b01e3..bb0f4c4 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_utils.c @@ -205,9 +205,9 @@ { llist_del(&cfg->entry); rate_ctr_group_free(cfg->stats.ctrg); - talloc_free(cfg); cfg->nat->num_bsc--; OSMO_ASSERT(cfg->nat->num_bsc >= 0) + talloc_free(cfg); } static void _add_lac(void *ctx, struct llist_head *list, int _lac) -- To view, visit https://gerrit.osmocom.org/1222 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic20aacaccffcaa58ccec6d24c884727dc1bc50e6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:04:41 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:04:41 +0000 Subject: openbsc[master]: OM2000: for TS conf of dyn TS, always send TCH/F chan comb In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:05:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:05:01 +0000 Subject: openbsc[master]: OM2000: disallow ip.access style TCH/F_PDCH pchan type In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:05:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:05:02 +0000 Subject: [MERGED] openbsc[master]: OM2000: disallow ip.access style TCH/F_PDCH pchan type In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: disallow ip.access style TCH/F_PDCH pchan type ...................................................................... OM2000: disallow ip.access style TCH/F_PDCH pchan type For TCH/F_PDCH, return an invalid chan comb (0) and print an error message that hints at the proper pchan type to use instead: TCH/F_TCH/H_PDCH Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 9 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 0890a15..8c4bfb3 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,6 +1264,15 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: + LOGP(DNM, LOGL_ERROR, "%s pchan %s not intended for use" + " with OM2000, use %s instead\n", + gsm_ts_and_pchan_name(ts), + gsm_pchan_name(GSM_PCHAN_TCH_F_PDCH), + gsm_pchan_name(GSM_PCHAN_TCH_F_TCH_H_PDCH)); + /* If we allowed initialization of TCH/F_PDCH, it would fail + * when we try to send the ip.access specific RSL PDCH Act + * message for it. Rather fail completely right now: */ + return 0; case GSM_PCHAN_TCH_F_TCH_H_PDCH: return pchan2comb(GSM_PCHAN_TCH_F); default: -- To view, visit https://gerrit.osmocom.org/1221 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibe0f944573f0a6d1be4bf7cf4986c4b2b3bd6d0d Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:05:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:05:03 +0000 Subject: [MERGED] openbsc[master]: OM2000: for TS conf of dyn TS, always send TCH/F chan comb In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: for TS conf of dyn TS, always send TCH/F chan comb ...................................................................... OM2000: for TS conf of dyn TS, always send TCH/F chan comb When OM2K sets up the timeslots with the BTS, the dynamic channel state is not yet resolved to any particular pchan type. Instead of using the dyn state, always advertise dynamic timeslots as pchan2comb(TCH/F). In the past, the Ericsson dynamic timeslots were handled as pchan type TCH/F_PDCH. This is a mistake, as this pchan type is intended for the ip.access dynamic PDCH way of dynamic channels. In any case, in the initial state of this pchan type, the timeslot was initialized as pchan2comb(TCH/F) because the ts->flags do not reflect an active PDCH yet. In short, this patch does not change the behavior of TCH/F_PDCH timeslots, only clarifies it. It would in fact make sense to disallow use of TCH/F_PDCH for OM2K, but that should probably be a separate patch. The proper pchan to use for Ericsson dynamic timeslots is TCH/F_TCH/H_PDCH. These do not use ts->flags, but ts->dyn.* as state, which first reflects pchan_want == pchan_is == GSM_PCHAN_NONE. Hence the timeslot was initialized by OM2K as pchan type zero, which is unknown / invalid. So, instead of using pchan_is, which is not yet reflecting anything meaningful, always initialize as TCH/F chan comb, as Ericsson hardware apparently expects it. Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 1 insertion(+), 5 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 1ab77b1..0890a15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1264,12 +1264,8 @@ { switch (ts->pchan) { case GSM_PCHAN_TCH_F_PDCH: - if (ts->flags & TS_F_PDCH_ACTIVE) - return pchan2comb(GSM_PCHAN_PDCH); - else - return pchan2comb(GSM_PCHAN_TCH_F); case GSM_PCHAN_TCH_F_TCH_H_PDCH: - return pchan2comb(ts->dyn.pchan_is); + return pchan2comb(GSM_PCHAN_TCH_F); default: return pchan2comb(ts->pchan); } -- To view, visit https://gerrit.osmocom.org/1218 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If0693f7c5c85977b0e4acbc701ee5d635434d0d1 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:05:10 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:05:10 +0000 Subject: osmo-bts[master]: fix 'osmo-bts-* --version' segfault In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:05:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:05:12 +0000 Subject: [MERGED] osmo-bts[master]: fix 'osmo-bts-* --version' segfault In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix 'osmo-bts-* --version' segfault ...................................................................... fix 'osmo-bts-* --version' segfault Call vty_init() before handle_options() to make sure the host.app_info is populated before --version potentially tries to print it. Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 --- M src/common/main.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Neels Hofmeyr: Verified Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/main.c b/src/common/main.c index 60839df..1b2549e 100644 --- a/src/common/main.c +++ b/src/common/main.c @@ -227,6 +227,7 @@ msgb_talloc_ctx_init(tall_bts_ctx, 100*1024); bts_log_init(NULL); + vty_init(&bts_vty_info); handle_options(argc, argv); @@ -242,7 +243,6 @@ exit(1); } } - vty_init(&bts_vty_info); e1inp_vty_init(); bts_vty_init(bts, &bts_log_info); -- To view, visit https://gerrit.osmocom.org/1219 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:07:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:07:44 +0000 Subject: libosmocore[master]: bitcomp: Remove the t4 decoding from libosmocore In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I021424444625a097560d086c217c81eac4a5ee44 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:07:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:07:45 +0000 Subject: [MERGED] libosmocore[master]: bitcomp: Remove the t4 decoding from libosmocore In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bitcomp: Remove the t4 decoding from libosmocore ...................................................................... bitcomp: Remove the t4 decoding from libosmocore As outlined by mail on the 13th of July the tree based approach to decoding in the PCU is faster by order of magnitude. Instead of having a slow implementation in the library and a quick one in the PCU, let's only have a quick one in the PCU and at some point in the future move it to libosmocore. Execute the plan and remove t4_decode. Change-Id: I021424444625a097560d086c217c81eac4a5ee44 --- M include/osmocom/core/bitcomp.h M src/bitcomp.c M tests/bits/bitcomp_test.c M tests/bits/bitcomp_test.ok 4 files changed, 0 insertions(+), 151 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/bitcomp.h b/include/osmocom/core/bitcomp.h index 89eccbc..e87c0e1 100644 --- a/include/osmocom/core/bitcomp.h +++ b/include/osmocom/core/bitcomp.h @@ -37,6 +37,5 @@ int osmo_t4_encode(struct bitvec *bv); -int osmo_t4_decode(const struct bitvec *in, bool cc, struct bitvec *out); /*! @} */ diff --git a/src/bitcomp.c b/src/bitcomp.c index 8b3090e..9c01246 100644 --- a/src/bitcomp.c +++ b/src/bitcomp.c @@ -180,18 +180,10 @@ {8, 6, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8} }; -static const unsigned t4_min_term_length[] = {2, 4}; -static const unsigned t4_min_make_up_length[] = {10, 5}; - -static const unsigned t4_max_term_length[] = {12, 8}; -static const unsigned t4_max_make_up_length[] = {13, 9}; - static const unsigned t4_make_up_length[2][15] = { {10, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13}, {5, 5, 6, 7, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9} }; - -static const unsigned t4_make_up_ind[15] = {64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960}; static const unsigned t4_make_up[2][15] = { { @@ -229,30 +221,6 @@ 0b011010100 } }; - -/*! \brief Attempt to decode compressed bit vector - * - * \return length of RLE according to modified ITU-T T.4 from TS 44.060 - * Table 9.1.10.2 or -1 if no applicable RLE found N. B: we need - * explicit bit length to make decoding unambiguous -*/ -static inline int t4_rle_term(unsigned w, bool b, unsigned bits) -{ - unsigned i; - for (i = 0; i < 64; i++) - if (w == t4_term[b][i] && bits == t4_term_length[b][i]) - return i; - return -1; -} - -static inline int t4_rle_makeup(unsigned w, bool b, unsigned bits) -{ - unsigned i; - for (i = 0; i < 15; i++) - if (w == t4_make_up[b][i] && bits == t4_make_up_length[b][i]) - return t4_make_up_ind[i]; - return -1; -} /*! \brief Make-up codes for a given length * @@ -337,102 +305,6 @@ } return bitvec_set_uint(bv, t4_term[b][len], t4_term_length[b][len]); -} - -enum dec_state { - EXPECT_TERM, - TOO_LONG, - NEED_MORE_BITS, - CORRUPT, - OK -}; - -static inline enum dec_state _t4_step(struct bitvec *v, uint16_t w, bool b, unsigned bits, bool term_only) -{ - if (bits > t4_max_make_up_length[b]) - return TOO_LONG; - if (bits < t4_min_term_length[b]) - return NEED_MORE_BITS; - - if (term_only) { - if (bits > t4_max_term_length[b]) - return CORRUPT; - int t = t4_rle_term(w, b, bits); - if (-1 != t) { - bitvec_fill(v, t, b ? ONE : ZERO); - return OK; - } - return NEED_MORE_BITS; - } - - int m = t4_rle_makeup(w, b, bits); - if (-1 != m) { - bitvec_fill(v, m, b ? ONE : ZERO); - return EXPECT_TERM; - } - - m = t4_rle_term(w, b, bits); - if (-1 != m) { - bitvec_fill(v, m, b ? ONE : ZERO); - return OK; - } - - return NEED_MORE_BITS; -} - -/*! \brief decode T4-encoded bit vector - * Assumes MSB first encoding. - * \param[in] in bit vector with encoded data - * \param[in] cc color code (whether decoding should start with 1 or 0) - * \param[out] out the bit vector to store result into - * \return 0 on success, negative value otherwise - */ -int osmo_t4_decode(const struct bitvec *in, bool cc, struct bitvec *out) -{ - uint8_t orig[in->data_len]; - struct bitvec vec; - vec.data = orig; - vec.data_len = in->data_len; - bitvec_zero(&vec); - memcpy(vec.data, in->data, in->data_len); - vec.cur_bit = in->cur_bit; - - /* init decoder using known color code: */ - unsigned bits = t4_min_term_length[cc]; - enum dec_state d; - int16_t w = bitvec_get_int16_msb(&vec, bits); - bool b = cc; - bool term_only = false; - - while (vec.cur_bit > 0) { - d = _t4_step(out, w, b, bits, term_only); - - switch (d) { - case EXPECT_TERM: - bitvec_shiftl(&vec, bits); - bits = t4_min_term_length[b]; - w = bitvec_get_int16_msb(&vec, bits); - term_only = true; - break; - case OK: - bitvec_shiftl(&vec, bits); - bits = t4_min_term_length[!b]; - w = bitvec_get_int16_msb(&vec, bits); - b = !b; - term_only = false; - break; - case NEED_MORE_BITS: - bits++; - w = bitvec_get_int16_msb(&vec, bits); - break; - case TOO_LONG: - return -E2BIG; - case CORRUPT: - return -EINVAL; - } - } - - return 0; } /*! \brief encode bit vector in-place using T4 encoding diff --git a/tests/bits/bitcomp_test.c b/tests/bits/bitcomp_test.c index f6895cf..587dd72 100644 --- a/tests/bits/bitcomp_test.c +++ b/tests/bits/bitcomp_test.c @@ -41,11 +41,6 @@ bitvec_set_uint(&bv, 4, 3); bitvec_to_string_r(&bv, lol); printf(" %s [%d]\n", lol, bv.cur_bit); - int d = osmo_t4_decode(&bv, 0, &out); - printf("\nDecoded:\n%d", d); - bitvec_to_string_r(&out, lol); - printf("%s [%d]\n", lol, out.cur_bit); - printf("Expected:\n 00110111 01000111 10000001 1111 \n"); printf("\nTEST2:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); bitvec_zero(&bv); @@ -54,13 +49,6 @@ bitvec_set_uint(&bv, 0xFFFFFC00, 26); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf("\nEncoded:\n%d", osmo_t4_encode(&bv)); bitvec_to_string_r(&bv, lol); printf("%s", lol); printf(" [%d]\nExpected:\n1 11011101 01000001 00 [18]\n", bv.cur_bit); - - bitvec_zero(&out); - d = osmo_t4_decode(&bv, 1, &out); - printf("\nDecoded:\n%d", d); - bitvec_to_string_r(&out, lol); - printf("%s [%d]\n", lol, out.cur_bit); - printf("Expected:\n 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00\n"); return 0; } diff --git a/tests/bits/bitcomp_test.ok b/tests/bits/bitcomp_test.ok index 238f3c4..d2ac16a 100644 --- a/tests/bits/bitcomp_test.ok +++ b/tests/bits/bitcomp_test.ok @@ -10,11 +10,6 @@ 0 11011110 10001000 01110101 01100101 100 [35] 11011110 10001000 01110101 01100101 100 [35] -Decoded: -0 00110111 01000111 10000001 1111 [28] -Expected: - 00110111 01000111 10000001 1111 - TEST2: 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 @@ -22,8 +17,3 @@ 1 11011101 01000001 00 [18] Expected: 1 11011101 01000001 00 [18] - -Decoded: -0 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 [90] -Expected: - 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 11111111 00000000 00 -- To view, visit https://gerrit.osmocom.org/1176 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I021424444625a097560d086c217c81eac4a5ee44 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:14:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:14:59 +0000 Subject: osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 I am still confused by this patch. IT introduces some "common" functions, which in turn call back into the bts/l1if (without any related prefix), but then the common code is not used by all of the BTS models we use? There should be a clear/clean API between the common and the bts-specific parts. osmo-bts started without one but we are making more and more steps into that direction, whcih is good. If you look at the contents of osmo-bts/oml.h, you will see generic functions that can be used by all BTS models, and thoe functions have a clear namespace prefix of oml_. If you want to crate more shared code or change the interface, please change it for all BTS modesl, not just 3 out of 4. Or, if there is something common to those 3 but not the 4th, then it might be best to create some additional library of utility functions, which is then linked into the 3 backends, but not the 4th. In any case, the actual common part should be only code that is used by (or should be used by, or is shared) by all models. -- To view, visit https://gerrit.osmocom.org/1046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:15:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:15:56 +0000 Subject: openbsc[master]: ussd: Add band-aid for interrogationSS In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:17:16 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:17:16 +0000 Subject: openbsc[master]: Add empty libxsc In-Reply-To: References: Message-ID: Patch Set 1: > right now my favorite choice would be to rename libxsc to > libcommon-cs, showing that it is a library common to > circuit-switched entities, i.e. libbsc and libmsc libcommon-cs indeed sonds better. please go ahead. -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:19:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:19:18 +0000 Subject: openbsc[master]: move to libxsc: net init 2: move bsc_network_init decl to os... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/1126/1/openbsc/include/openbsc/osmo_bsc.h File openbsc/include/openbsc/osmo_bsc.h: Line 49: struct gsm_network *bsc_network_init(void *ctx, i support the move to a 'bsc specifc' header. but osmo_bsc.h is about the osmo-bsc program, and not about libbsc or libxsc?!? -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:20:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:20:00 +0000 Subject: openbsc[master]: move to libxsc: net init 3: actual move In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If06316b97002390dc9a434686750cb96193ea63b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:20:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:20:21 +0000 Subject: openbsc[master]: define mncc_recv_cb_t to avoid code dup In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:20:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:20:27 +0000 Subject: openbsc[master]: move to libxsc: net init 1: rename to bsc_network_init In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:22:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:22:15 +0000 Subject: openbsc[master]: move to libxsc: gsm48_create_mm_serv_rej(), gsm48_create_loc... In-Reply-To: References: Message-ID: Patch Set 2: what I don't undertand is why this is in libxsc (libcommon-cs). The Location Update Reject and the MM Service Reject are part of the MM layer. The BSC has nothing to do with MM. Rather, MM is a function of the MSC. So it should only be needed by osmo-nitb and osmo-cscn, but not by osmo-bsc. -- To view, visit https://gerrit.osmocom.org/1128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I212c2567b56191022b683674c1c4daf842839946 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:23:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:23:37 +0000 Subject: openbsc[master]: move to libxsc: factor out gen of USSD notify and release co... In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/1129/3//COMMIT_MSG Commit Message: Line 9: Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and why will libbsc (implementing only the BSC specific parts) need a USSD related function? USSD is to be dealt with the MSC, so it is shared between osmo-cscn and osmo-nitb, but not the BSC. -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:25:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:25:56 +0000 Subject: openbsc[master]: tests: drop unused libmsc, unneeded duplicate libbsc linking In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:26:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:26:49 +0000 Subject: openbsc[master]: split bsc_bootstrap_network() in alloc and config In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1140 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I480a09a31a79766ad07b627dd5238b7e37f3be7a Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:27:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:27:15 +0000 Subject: openbsc[master]: global gsm_network: move allocation further up In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1150 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie6a7037e703b5a2d08ceeb20d35f197aaddc9d1b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:27:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:27:49 +0000 Subject: openbsc[master]: move to libxsc: global vty gsm_network pointer In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:28:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:28:40 +0000 Subject: openbsc[master]: move to libxsc: network VTY that isn't BSC-specific In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:28:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:28:51 +0000 Subject: openbsc[master]: bsc vty: rename show_net_cmd to bsc_show_net_cmd In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1135 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifb86698cd57a09f03b935b6d3fcea87eff4cd397 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:29:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:29:28 +0000 Subject: openbsc[master]: reinvent connection_for_subscr() and move to libmsc In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1136 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5e0ba0ecf1726ebd540800f4e98fdfc937c904ff Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:29:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:29:58 +0000 Subject: openbsc[master]: move to libxsc: net timezone VTY config In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:30:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 10 Nov 2016 17:30:27 +0000 Subject: openbsc[master]: split subscr_con_allocate()/_free() in bsc_ and msc_ In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1139 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3cf7c7cafdf4672ec7b26058bba8a77159855257 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 10 17:31:36 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 10 Nov 2016 17:31:36 +0000 Subject: [PATCH] openbsc[master]: abisip-find: use protocol constant Message-ID: Review at https://gerrit.osmocom.org/1224 abisip-find: use protocol constant Use library define instead of directly using hardcoded value. Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413 --- M openbsc/src/ipaccess/abisip-find.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/1224/1 diff --git a/openbsc/src/ipaccess/abisip-find.c b/openbsc/src/ipaccess/abisip-find.c index 87c6e50..9fe7df6 100644 --- a/openbsc/src/ipaccess/abisip-find.c +++ b/openbsc/src/ipaccess/abisip-find.c @@ -138,8 +138,8 @@ if (len < 0) return len; - /* 2 bytes length, 1 byte protocol (0xfe) */ - if (buf[2] != 0xfe) + /* 2 bytes length, 1 byte protocol */ + if (buf[2] != IPAC_PROTO_IPACCESS) return 0; if (buf[4] != IPAC_MSGT_ID_RESP) -- To view, visit https://gerrit.osmocom.org/1224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 10 18:05:10 2016 From: gerrit-no-reply at lists.osmocom.org (tnt) Date: Thu, 10 Nov 2016 18:05:10 +0000 Subject: libosmocore[master]: utils/conv_gen.py: separate code definitions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) If they're going to be split, I'd rather give the file with the code a GSM specific name so that if we end up doing others in there, we can use a different file. It also opens the option for the future to have the .py with the code included in the subprojects rather than here. (obviously not with this change alone, but it's a step in the right direction) https://gerrit.osmocom.org/#/c/1223/1/utils/conv_codes.py File utils/conv_codes.py: Line 5: poly = lambda *args: sum([(1 << x) for x in args]) This should stay with the common code and be imported along with ConvolutionalCode Line 31: conv_codes = [ Use a gsm specific name -- To view, visit https://gerrit.osmocom.org/1223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 10 18:34:42 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 10 Nov 2016 18:34:42 +0000 Subject: [PATCH] osmo-bts[master]: DTX DL AMR: rewrite FSM recursion Message-ID: Review at https://gerrit.osmocom.org/1225 DTX DL AMR: rewrite FSM recursion Add explicit state for recursion (sending the different payload data in response to the RTS request for same FN) and corresponding transition. Remove ST_FACCH_V as with new explicit recursion handling it becomes unreacheable. This makes it easier to maintain preemption (interruption of current procedure due to FACCH or Inhibition). This also reduces the number of possible transitions out of each state thus reducing graph's cyclomatic complexity. Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14 --- M include/osmo-bts/dtx_dl_amr_fsm.h M include/osmo-bts/msg_utils.h M src/common/dtx_dl_amr_fsm.c M src/common/msg_utils.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-litecell15/tch.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-sysmo/tch.c 8 files changed, 270 insertions(+), 137 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/25/1225/1 diff --git a/include/osmo-bts/dtx_dl_amr_fsm.h b/include/osmo-bts/dtx_dl_amr_fsm.h index 8b19595..4fb2f25 100644 --- a/include/osmo-bts/dtx_dl_amr_fsm.h +++ b/include/osmo-bts/dtx_dl_amr_fsm.h @@ -14,10 +14,13 @@ ST_SID_F2, ST_F1_INH, ST_U_INH, + ST_F1_INH_REC, + ST_U_INH_REC, ST_SID_U, ST_ONSET_V, ST_ONSET_F, - ST_FACCH_V, + ST_ONSET_V_REC, + ST_ONSET_F_REC, ST_FACCH, }; diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 4f9868c..7321045 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -29,6 +29,8 @@ void lchan_set_marker(bool t, struct gsm_lchan *lchan); bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan); void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e); +bool dtx_recursion(const struct gsm_lchan *lchan); +void dtx_int_signal(struct gsm_lchan *lchan); void dtx_cache_payload(struct gsm_lchan *lchan, const uint8_t *l1_payload, size_t length, uint32_t fn, int update); int dtx_dl_amr_fsm_step(struct gsm_lchan *lchan, const uint8_t *rtp_pl, diff --git a/src/common/dtx_dl_amr_fsm.c b/src/common/dtx_dl_amr_fsm.c index 5075957..d903b0c 100644 --- a/src/common/dtx_dl_amr_fsm.c +++ b/src/common/dtx_dl_amr_fsm.c @@ -96,11 +96,8 @@ void dtx_fsm_f1_inh(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { - case E_VOICE: - osmo_fsm_inst_state_chg(fi, ST_ONSET_V, 0, 0); - break; - case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_ONSET_F, 0, 0); + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_F1_INH_REC, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -112,11 +109,34 @@ void dtx_fsm_u_inh(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { - case E_VOICE: + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_U_INH_REC, 0, 0); + break; + default: + LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); + OSMO_ASSERT(0); + break; + } +} + +void dtx_fsm_f1_inh_rec(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case E_COMPL: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; - case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + default: + LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); + OSMO_ASSERT(0); + break; + } +} + +void dtx_fsm_u_inh_rec(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -155,13 +175,8 @@ void dtx_fsm_onset_v(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { - case E_SID_F: - case E_SID_U: - case E_VOICE: - osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); - break; - case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH_V, 0, 0); + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_ONSET_V_REC, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -173,14 +188,8 @@ void dtx_fsm_onset_f(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { - case E_SID_F: - case E_SID_U: - break; - case E_VOICE: - osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); - break; - case E_FACCH: - osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_ONSET_F_REC, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -189,17 +198,24 @@ } } -void dtx_fsm_facch_v(struct osmo_fsm_inst *fi, uint32_t event, void *data) +void dtx_fsm_onset_v_rec(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { - case E_FACCH: - break; - case E_VOICE: + case E_COMPL: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; - case E_SID_U: + default: + LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); + OSMO_ASSERT(0); break; - case E_SID_F: + } +} + +void dtx_fsm_onset_f_rec(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + switch (event) { + case E_COMPL: + osmo_fsm_inst_state_chg(fi, ST_FACCH, 0, 0); break; default: LOGP(DL1P, LOGL_ERROR, "Unexpected event %d\n", event); @@ -211,13 +227,14 @@ void dtx_fsm_facch(struct osmo_fsm_inst *fi, uint32_t event, void *data) { switch (event) { + case E_SID_U: + case E_SID_F: case E_FACCH: break; case E_VOICE: osmo_fsm_inst_state_chg(fi, ST_VOICE, 0, 0); break; - case E_SID_U: - case E_SID_F: + case E_COMPL: osmo_fsm_inst_state_chg(fi, ST_SID_F1, 0, 0); break; default: @@ -244,28 +261,42 @@ .action = dtx_fsm_sid_f1, }, /* SID-FIRST P2 (only for AMR HR): - actual start of silence period in case of AMR HR*/ + actual start of silence period in case of AMR HR */ [ST_SID_F2]= { .in_event_mask = X(E_SID_U) | X(E_VOICE) | X(E_FACCH) | X(E_ONSET), .out_state_mask = X(ST_SID_U) | X(ST_VOICE) | X(ST_ONSET_F) | X(ST_ONSET_V), .name = "SID-FIRST (P2)", .action = dtx_fsm_sid_f2, }, - /* SID-FIRST Inhibited: - incoming SPEECH or FACCH (only for AMR HR) */ + /* SID-FIRST Inhibited: incoming SPEECH (only for AMR HR) */ [ST_F1_INH]= { - .in_event_mask = X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_F1_INH_REC), .name = "SID-FIRST (Inh)", .action = dtx_fsm_f1_inh, }, - /* SID-UPDATE Inhibited: - incoming SPEECH or FACCH (only for AMR HR) */ + /* SID-UPDATE Inhibited: incoming SPEECH (only for AMR HR) */ [ST_U_INH]= { - .in_event_mask = X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH), + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_U_INH_REC), .name = "SID-UPDATE (Inh)", .action = dtx_fsm_u_inh, + }, + /* SID-FIRST Inhibition recursion in progress: + Inhibit itself was already sent, now have to send the voice that caused it */ + [ST_F1_INH_REC]= { + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_VOICE), + .name = "SID-FIRST (Inh, Rec)", + .action = dtx_fsm_f1_inh_rec, + }, + /* SID-UPDATE Inhibition recursion in progress: + Inhibit itself was already sent, now have to send the voice that caused it */ + [ST_U_INH_REC]= { + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_VOICE), + .name = "SID-UPDATE (Inh, Rec)", + .action = dtx_fsm_u_inh_rec, }, /* Silence period with periodic comfort noise data updates */ [ST_SID_U]= { @@ -276,31 +307,39 @@ }, /* ONSET - end of silent period due to incoming SPEECH frame */ [ST_ONSET_V]= { - .in_event_mask = X(E_SID_F) | X(E_SID_U) | X(E_VOICE) | X(E_FACCH), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH_V), + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_ONSET_V_REC), .name = "ONSET (SPEECH)", .action = dtx_fsm_onset_v, }, /* ONSET - end of silent period due to incoming FACCH frame */ [ST_ONSET_F]= { - .in_event_mask = X(E_VOICE) | X(E_FACCH) | X(E_SID_U) | X(E_SID_F), - .out_state_mask = X(ST_VOICE) | X(ST_FACCH), + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_ONSET_F_REC), .name = "ONSET (FACCH)", .action = dtx_fsm_onset_f, }, - /* FACCH sending state: SPEECH was observed before so once we're done - FSM should get back to VOICE state */ - [ST_FACCH_V]= { - .in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_SID_U) | X(E_SID_F), - .out_state_mask = X(ST_FACCH_V) | X(ST_VOICE) | X(ST_SID_F1), - .name = "FACCH (SPEECH)", - .action = dtx_fsm_facch_v, + /* ONSET recursion in progress: + ONSET itself was already sent, now have to send the voice that caused it */ + [ST_ONSET_V_REC]= { + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_VOICE), + .name = "ONSET (SPEECH, Rec)", + .action = dtx_fsm_onset_v_rec, + }, + /* ONSET recursion in progress: + ONSET itself was already sent, now have to send the data that caused it */ + [ST_ONSET_F_REC]= { + .in_event_mask = X(E_COMPL), + .out_state_mask = X(ST_FACCH), + .name = "ONSET (FACCH, Rec)", + .action = dtx_fsm_onset_f_rec, }, /* FACCH sending state: no SPEECH was observed before so once we're done FSM should get back to silent period via SID-FIRST */ [ST_FACCH]= { - .in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_SID_U) | X(E_SID_F), - .out_state_mask = X(ST_FACCH_V) | X(ST_VOICE) | X(ST_SID_F1), + .in_event_mask = X(E_FACCH) | X(E_VOICE) | X(E_COMPL) | X(E_SID_U) | X(E_SID_F), + .out_state_mask = X(ST_VOICE) | X(ST_SID_F1), .name = "FACCH", .action = dtx_fsm_facch, }, @@ -310,7 +349,7 @@ { E_VOICE, "Voice" }, { E_ONSET, "ONSET" }, { E_FACCH, "FACCH" }, - { E_COMPL, "Complete P1 -> P2" }, + { E_COMPL, "Complete" }, { E_INHIB, "Inhibit" }, { E_SID_F, "SID-FIRST" }, { E_SID_U, "SID-UPDATE" }, diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c index b876443..c5081b4 100644 --- a/src/common/msg_utils.c +++ b/src/common/msg_utils.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -120,8 +121,15 @@ lchan->tch.dtx.len = copy_len + amr; /* SID FIRST is special because it's both sent and cached: */ if (update == 0) { - lchan->tch.dtx.fn = fn; lchan->tch.dtx.is_update = false; /* Mark SID FIRST explicitly */ + /* for non-AMR case - always update FN for incoming SID FIRST */ + if (!amr || + (dtx_dl_amr_enabled(lchan) && + lchan->tch.dtx.dl_amr_fsm->state != ST_SID_U)) + lchan->tch.dtx.fn = fn; + /* for AMR case - do not update FN if SID FIRST arrives in a + middle of silence: this should not be happening according to + the spec */ } memcpy(lchan->tch.dtx.cache + amr, l1_payload, copy_len); @@ -148,12 +156,16 @@ int8_t sti, cmi; int rc; - if (rtp_pl == NULL) { /* SID-FIRST P1 -> P2 */ + if (lchan->type == GSM_LCHAN_TCH_H && /* SID-FIRST P1 -> P2 completion */ + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F2 && !rtp_pl) { *len = 3; memcpy(l1_payload, lchan->tch.dtx.cache, 2); - dtx_dispatch(lchan, E_COMPL); + dtx_dispatch(lchan, E_SID_U); return 0; } + + if (!rtp_pl_len) + return -EBADMSG; rc = osmo_amr_rtp_dec(rtp_pl, rtp_pl_len, &cmr, &cmi, &ft, &bfi, &sti); if (rc < 0) { @@ -199,10 +211,15 @@ } if (ft == AMR_SID) { - dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, sti); - if (lchan->tch.dtx.dl_amr_fsm->state == ST_VOICE) + if (lchan->tch.dtx.dl_amr_fsm->state == ST_VOICE) { + /* SID FIRST/UPDATE scheduling logic relies on SID FIRST + being sent first hence we have to force caching of SID + as FIRST regardless of actually decoded type */ + dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, false); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_SID_F, (void *)lchan); + } else + dtx_cache_payload(lchan, rtp_pl, rtp_pl_len, fn, sti); return osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, sti ? E_SID_U : E_SID_F, (void *)lchan); @@ -220,11 +237,14 @@ return 0; } +/* STI is located in payload byte 6, cache contains 2 byte prefix (CMR/CMI) + * STI set = SID UPDATE, STI unset = SID FIRST + */ static inline void dtx_sti_set(struct gsm_lchan *lchan) { lchan->tch.dtx.cache[6 + 2] |= STI_BIT_MASK; } -/* STI is located in payload byte 6, cache contains 2 byte prefix (CMR/CMI) */ + static inline void dtx_sti_unset(struct gsm_lchan *lchan) { lchan->tch.dtx.cache[6 + 2] &= ~STI_BIT_MASK; @@ -241,17 +261,27 @@ uint32_t dx26 = 120 * (fn - lchan->tch.dtx.fn); /* We're resuming after FACCH interruption */ - if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH || - lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F) { + if (lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { /* force STI bit to 0 so cache is treated as SID FIRST */ dtx_sti_unset(lchan); lchan->tch.dtx.is_update = false; - osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, E_SID_F, - (void *)lchan); - /* this FN was already used for ONSET message so we just prepare - things for next one */ + /* check that this FN has not been used for FACCH message + already: we rely here on the order of RTS arrival from L1 - we + expect that PH-DATA.req ALWAYS comes before PH-TCH.req for the + same FN */ + if (lchan->tch.dtx.fn != LCHAN_FN_DUMMY) { + /* FACCH interruption is over */ + dtx_dispatch(lchan, E_COMPL); + return false; + } else + lchan->tch.dtx.fn = fn; + /* this FN was already used for FACCH or ONSET message so we just + prepare things for next one */ return true; } + + if (lchan->tch.dtx.dl_amr_fsm->state == ST_VOICE) + return true; /* according to 3GPP TS 26.093 A.5.1.1: (*26) to avoid float math, add 1 FN tolerance (-120) */ @@ -297,6 +327,11 @@ return false; } +/*! \brief Check if DTX DL AMR is enabled for a given lchan (it have proper type, + * FSM is allocated etc.) + * \param[in] lchan Logical channel on which we check scheduling + * \returns true if DTX DL AMR is enabled, false otherwise + */ bool dtx_dl_amr_enabled(const struct gsm_lchan *lchan) { if (lchan->ts->trx->bts->dtxd && @@ -306,6 +341,31 @@ return false; } +/*! \brief Check if DTX DL AMR FSM state is recursive: requires secondary + * response to a single RTS request from L1. + * \param[in] lchan Logical channel on which we check scheduling + * \returns true if DTX DL AMR FSM state is recursive, false otherwise + */ +bool dtx_recursion(const struct gsm_lchan *lchan) +{ + if (!dtx_dl_amr_enabled(lchan)) + return false; + + if (lchan->tch.dtx.dl_amr_fsm->state == ST_U_INH || + lchan->tch.dtx.dl_amr_fsm->state == ST_F1_INH || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_V || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_F_REC || + lchan->tch.dtx.dl_amr_fsm->state == ST_ONSET_V_REC) + return true; + + return false; +} + +/*! \brief Send signal to FSM: with proper check if DIX is enabled for this lchan + * \param[in] lchan Logical channel on which we check scheduling + * \param[in] e DTX DL AMR FSM Event + */ void dtx_dispatch(struct gsm_lchan *lchan, enum dtx_dl_amr_fsm_events e) { if (dtx_dl_amr_enabled(lchan)) @@ -313,7 +373,23 @@ (void *)lchan); } -/* repeat last SID if possible, returns SID length + 1 or 0 */ +/*! \brief Send internal signal to FSM: check that DTX is enabled for this chan, + * check that current FSM and lchan states are permitting such signal. + * Note: this should be the only way to dispatch E_COMPL to FSM from + * BTS code. + * \param[in] lchan Logical channel on which we check scheduling + */ +void dtx_int_signal(struct gsm_lchan *lchan) +{ + if (!dtx_dl_amr_enabled(lchan)) + return; + + if ((lchan->type == GSM_LCHAN_TCH_H && + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1) || + dtx_recursion(lchan)) + dtx_dispatch(lchan, E_COMPL); +} + /*! \brief Repeat last SID if possible in case of DTX * \param[in] lchan Logical channel on which we check scheduling * \param[in] dst Buffer to copy last SID into @@ -334,13 +410,26 @@ return 0; if (lchan->tch.dtx.len) { + if (dtx_dl_amr_enabled(lchan)) { + if ((lchan->type == GSM_LCHAN_TCH_H && + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F2) || + (lchan->type == GSM_LCHAN_TCH_F && + lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1)) { + /* advance FSM in case we've just sent SID FIRST + to restore silence after FACCH interruption */ + osmo_fsm_inst_dispatch(lchan->tch.dtx.dl_amr_fsm, + E_SID_U, (void *)lchan); + dtx_sti_unset(lchan); + } else if (lchan->tch.dtx.dl_amr_fsm->state == + ST_SID_U) { + /* enforce SID UPDATE for next repetition: it + might have been altered by FACCH handling */ + dtx_sti_set(lchan); + lchan->tch.dtx.is_update = true; + } + } memcpy(dst, lchan->tch.dtx.cache, lchan->tch.dtx.len); lchan->tch.dtx.fn = fn; - /* enforce SID UPDATE for next repetition - it might have - been altered by FACCH handling */ - dtx_sti_set(lchan); - if (lchan->tch.dtx.dl_amr_fsm->state == ST_SID_U) - lchan->tch.dtx.is_update = true; return lchan->tch.dtx.len + 1; } diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 9d57c2f..ccf8aa2 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -53,6 +53,7 @@ #include #include #include +#include #include #include @@ -339,7 +340,6 @@ uint32_t u32Fn; uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi = 0; uint8_t chan_nr, link_id; - bool rec = false; int len; if (!msg) { @@ -355,6 +355,7 @@ u32Fn = l1sap->u.data.fn; u8Tn = L1SAP_CHAN2TS(chan_nr); subCh = 0x1f; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; if (!L1SAP_IS_CHAN_TCHF(chan_nr)) @@ -404,8 +405,7 @@ if (len) { /* data request */ GsmL1_Prim_t *l1p = msgb_l1prim(l1msg); - lchan = get_lchan_by_chan_nr(trx, chan_nr); - + data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, len); if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); @@ -423,20 +423,25 @@ memcpy(lchan->tch.dtx.facch, msg->l2h, msgb_l2len(msg)); /* prepare ONSET message */ - len = 3; l1p->u.phDataReq.msgUnitParam.u8Buffer[0] = GsmL1_TchPlType_Amr_Onset; /* ignored CMR/CMI pair */ l1p->u.phDataReq.msgUnitParam.u8Buffer[1] = 0; l1p->u.phDataReq.msgUnitParam.u8Buffer[2] = 0; - /* ONSET is ready, recursive call is necessary */ - rec = true; + /* update length */ + data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, + subCh, u8BlockNbr, 3); + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } + } else if (dtx_dl_amr_enabled(lchan) && + lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } - - data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, len); - - if (!rec && !use_cache) { + else { OSMO_ASSERT(msgb_l2len(msg) <= sizeof(l1p->u.phDataReq.msgUnitParam.u8Buffer)); memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h, msgb_l2len(msg)); @@ -455,9 +460,10 @@ if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], l1msg) != 0) { LOGP(DL1P, LOGL_ERROR, "MQ_L1_WRITE queue full. Dropping msg.\n"); msgb_free(l1msg); - } + } else + dtx_int_signal(lchan); - if (rec) + if (dtx_recursion(lchan)) ph_data_req(trx, msg, l1sap, true); return 0; } @@ -536,8 +542,9 @@ } /* send message to DSP's queue */ osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg); + dtx_int_signal(lchan); - if (rc > 0 && trx->bts->dtxd) /* DTX: send voice after ONSET was sent */ + if (dtx_recursion(lchan)) /* DTX: send voice after ONSET was sent */ return ph_tch_req(trx, l1sap->oph.msg, l1sap, true, false); return 0; diff --git a/src/osmo-bts-litecell15/tch.c b/src/osmo-bts-litecell15/tch.c index 7495073..de3c7e3 100644 --- a/src/osmo-bts-litecell15/tch.c +++ b/src/osmo-bts-litecell15/tch.c @@ -305,9 +305,6 @@ *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); - /* force STI bit to 0 to make sure resume after FACCH - works properly */ - l1_payload[6 + 2] &= ~16; return 0; case ST_SID_F2: *payload_type = GsmL1_TchPlType_Amr; @@ -326,7 +323,6 @@ return 1; case ST_SID_U: return -EAGAIN; - case ST_FACCH_V: case ST_FACCH: return -EBADMSG; default: @@ -496,19 +492,17 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && - lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && dtx_dl_amr_enabled(lchan)) { + /* we have to explicitly handle sending SID FIRST P2 for + AMR HR in here */ *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), NULL); - if (rc < 0) { - msgb_free(msg); - return NULL; - } - return msg; - } else - *payload_type = GsmL1_TchPlType_Amr; + if (rc == 0) + return msg; + } + *payload_type = GsmL1_TchPlType_Amr; break; case GSM48_CMODE_SPEECH_V1: if (lchan->type == GSM_LCHAN_TCH_F) @@ -524,13 +518,12 @@ return NULL; } - if (dtx_dl_amr_enabled(lchan)) { - rc = repeat_last_sid(lchan, l1_payload, fn); - if (!rc) { - msgb_free(msg); - return NULL; - } - msu_param->u8Size = rc; + rc = repeat_last_sid(lchan, l1_payload, fn); + if (!rc) { + msgb_free(msg); + return NULL; } + msu_param->u8Size = rc; + return msg; } diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d14eac4..5b9df80 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -334,7 +335,6 @@ uint32_t u32Fn; uint8_t u8Tn, subCh, u8BlockNbr = 0, sapi = 0; uint8_t chan_nr, link_id; - bool rec = false; int len; if (!msg) { @@ -350,6 +350,7 @@ u32Fn = l1sap->u.data.fn; u8Tn = L1SAP_CHAN2TS(chan_nr); subCh = 0x1f; + lchan = get_lchan_by_chan_nr(trx, chan_nr); if (L1SAP_IS_LINK_SACCH(link_id)) { sapi = GsmL1_Sapi_Sacch; if (!L1SAP_IS_CHAN_TCHF(chan_nr)) @@ -399,8 +400,7 @@ if (len) { /* data request */ GsmL1_Prim_t *l1p = msgb_l1prim(l1msg); - lchan = get_lchan_by_chan_nr(trx, chan_nr); - + data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, len); if (use_cache) memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, lchan->tch.dtx.facch, msgb_l2len(msg)); @@ -418,20 +418,25 @@ memcpy(lchan->tch.dtx.facch, msg->l2h, msgb_l2len(msg)); /* prepare ONSET message */ - len = 3; l1p->u.phDataReq.msgUnitParam.u8Buffer[0] = GsmL1_TchPlType_Amr_Onset; /* ignored CMR/CMI pair */ l1p->u.phDataReq.msgUnitParam.u8Buffer[1] = 0; l1p->u.phDataReq.msgUnitParam.u8Buffer[2] = 0; - /* ONSET is ready, recursive call is necessary */ - rec = true; + /* update length */ + data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, + subCh, u8BlockNbr, 3); + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } + } else if (dtx_dl_amr_enabled(lchan) && + lchan->tch.dtx.dl_amr_fsm->state == ST_FACCH) { + /* update FN so it can be checked by TCH silence + resume handler */ + lchan->tch.dtx.fn = LCHAN_FN_DUMMY; } - - data_req_from_l1sap(l1p, fl1, u8Tn, u32Fn, sapi, subCh, u8BlockNbr, len); - - if (!rec && !use_cache) { + else { OSMO_ASSERT(msgb_l2len(msg) <= sizeof(l1p->u.phDataReq.msgUnitParam.u8Buffer)); memcpy(l1p->u.phDataReq.msgUnitParam.u8Buffer, msg->l2h, msgb_l2len(msg)); @@ -450,9 +455,10 @@ if (osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], l1msg) != 0) { LOGP(DL1P, LOGL_ERROR, "MQ_L1_WRITE queue full. Dropping msg.\n"); msgb_free(l1msg); - } + } else + dtx_int_signal(lchan); - if (rec) + if (dtx_recursion(lchan)) ph_data_req(trx, msg, l1sap, true); return 0; } @@ -531,8 +537,9 @@ } /* send message to DSP's queue */ osmo_wqueue_enqueue(&fl1->write_q[MQ_L1_WRITE], nmsg); + dtx_int_signal(lchan); - if (rc > 0 && trx->bts->dtxd) /* DTX: send voice after ONSET was sent */ + if (dtx_recursion(lchan)) /* DTX: send voice after ONSET was sent */ return ph_tch_req(trx, l1sap->oph.msg, l1sap, true, false); return 0; diff --git a/src/osmo-bts-sysmo/tch.c b/src/osmo-bts-sysmo/tch.c index addb2ff..16c2cf3 100644 --- a/src/osmo-bts-sysmo/tch.c +++ b/src/osmo-bts-sysmo/tch.c @@ -403,9 +403,6 @@ *payload_type = GsmL1_TchPlType_Amr; rtppayload_to_l1_amr(l1_payload + 2, rtp_pl, rtp_pl_len, ft); - /* force STI bit to 0 to make sure resume after FACCH - works properly */ - l1_payload[6 + 2] &= ~16; return 0; case ST_SID_F2: *payload_type = GsmL1_TchPlType_Amr; @@ -424,7 +421,6 @@ return 1; case ST_SID_U: return -EAGAIN; - case ST_FACCH_V: case ST_FACCH: return -EBADMSG; default: @@ -598,19 +594,17 @@ switch (lchan->tch_mode) { case GSM48_CMODE_SPEECH_AMR: if (lchan->type == GSM_LCHAN_TCH_H && - lchan->tch.dtx.dl_amr_fsm->state == ST_SID_F1 && dtx_dl_amr_enabled(lchan)) { + /* we have to explicitly handle sending SID FIRST P2 for + AMR HR in here */ *payload_type = GsmL1_TchPlType_Amr_SidFirstP2; rc = dtx_dl_amr_fsm_step(lchan, NULL, 0, fn, l1_payload, false, &(msu_param->u8Size), NULL); - if (rc < 0) { - msgb_free(msg); - return NULL; - } - return msg; - } else - *payload_type = GsmL1_TchPlType_Amr; + if (rc == 0) + return msg; + } + *payload_type = GsmL1_TchPlType_Amr; break; case GSM48_CMODE_SPEECH_V1: if (lchan->type == GSM_LCHAN_TCH_F) @@ -626,13 +620,12 @@ return NULL; } - if (dtx_dl_amr_enabled(lchan)) { - rc = repeat_last_sid(lchan, l1_payload, fn); - if (!rc) { - msgb_free(msg); - return NULL; - } - msu_param->u8Size = rc; + rc = repeat_last_sid(lchan, l1_payload, fn); + if (!rc) { + msgb_free(msg); + return NULL; } + msu_param->u8Size = rc; + return msg; } -- To view, visit https://gerrit.osmocom.org/1225 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 11 10:50:37 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Fri, 11 Nov 2016 10:50:37 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#6). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c M tests/bitvec/bitvec_test.ok 4 files changed, 64 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/6 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..ba19e1f 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/* \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index a98a91c..11656ad 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -150,6 +150,14 @@ } } +static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits, + int result ) +{ + int num = 0; + num = bitvec_rl_curbit(bv, b, max_bits); + OSMO_ASSERT (num == result); +} + static void test_array() { struct bitvec b; @@ -245,6 +253,14 @@ test_array(); + printf ("bitvec_runlength....\n"); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xff, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + test_bitvec_rl_curbit(&bv,0 , 64, 56); + printf("\nbitvec ok.\n"); return 0; diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index e256108..c6faf13 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -165,5 +165,6 @@ 11.1..1. 11111111 ..11.111 .11.111. ..1.111. 1...11.. 11.11.11 11.1.... 1111111. ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ -........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ +........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ bitvec_runlength.... + bitvec ok. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Fri Nov 11 10:53:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Nov 2016 10:53:02 +0000 Subject: openbsc[master]: move to libxsc: gsm48_create_mm_serv_rej(), gsm48_create_loc... In-Reply-To: References: Message-ID: Patch Set 2: * osmo-bsc: there is an initial msg filter which, on failure, sends a LU reject msg on its own accord. * osmo-bsc_nat: on conn release, sends a LU reject msg; on conn refuse, sends either a LU reject or an MM Service Reject message So these are used in our bsc* binaries to thwart subscribers without bothering the MSC. Notably, they are not used by libbsc, but directly by src/osmo-bsc/ and src/osmo-bsc_nat. I guess this should be mentioned in the commit log... -- To view, visit https://gerrit.osmocom.org/1128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I212c2567b56191022b683674c1c4daf842839946 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:50:27 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 11 Nov 2016 11:50:27 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1209 to look at the new patch set (#4). Handle packet access reject during EPDAN/PDAN with channel description When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 9 files changed, 135 insertions(+), 12 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/09/1209/4 diff --git a/src/bts.cpp b/src/bts.cpp index 4e6b5e9..0668c2d 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1077,16 +1077,23 @@ } /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we pacekt access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ if (tbf->ms()) { @@ -1179,16 +1186,23 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we send packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ diff --git a/src/encoding.cpp b/src/encoding.cpp index ca72b0f..e5a8605 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -1391,3 +1391,28 @@ return AR_NEED_MORE_BLOCKS; } + +/* + * Refer 44.060 version 7.27.0 Release 7 + * section 7.1.3.2.1 On receipt of a PACKET RESOURCE REQUEST message + * 8.1.2.5 Establishment of uplink TBF + */ +void Encoding::write_packet_access_reject( + bitvec * dest, uint32_t tlli) +{ + unsigned wp = 0; + + bitvec_write_field(dest, wp, 0x1, 2); // Payload Type + bitvec_write_field(dest, wp, 0x0, 2); // Uplink block with TDMA FN + bitvec_write_field(dest, wp, 0, 1); // No Polling Bit + bitvec_write_field(dest, wp, 0x0, 3); // Uplink state flag + bitvec_write_field(dest, wp, + MT_PACKET_ACCESS_REJECT, 6); // MESSAGE TYPE + bitvec_write_field(dest, wp, 0, 2); // fixed 00 + bitvec_write_field(dest, wp, 0x0, 1); // TLLI / G-RNTI : bit (32) + bitvec_write_field(dest, wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI + bitvec_write_field(dest, wp, 1, 1); // WAIT_INDICATION size in seconds + /* TODO: make it configurable */ + bitvec_write_field(dest, wp, 5, 8); // WAIT_INDICATION value + bitvec_write_field(dest, wp, 0, 1); // WAIT_INDICATION size in seconds +} diff --git a/src/encoding.h b/src/encoding.h index 79dc32d..6164b89 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -74,6 +74,9 @@ static void encode_rbb(const char *show_rbb, uint8_t *rbb); + static void write_packet_access_reject( + bitvec * dest, uint32_t tlli); + static void write_packet_uplink_ack( struct gprs_rlcmac_bts *bts, bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final, diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index f486075..a3723df 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -72,7 +72,8 @@ *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = dl_tbf; } @@ -137,7 +138,11 @@ */ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - msg = ul_ass_tbf->create_ul_ass(fn, ts); + if (tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else + msg = ul_ass_tbf->create_ul_ass(fn, ts); else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF) msg = dl_ass_tbf->create_dl_ass(fn, ts); else if (tbf == ul_ack_tbf) diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..2d82727 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1013,6 +1013,29 @@ return msg; } +struct msgb *gprs_rlcmac_tbf::create_packet_access_reject() +{ + struct msgb *msg; + + msg = msgb_alloc(23, "rlcmac_ul_ass_rej"); + + bitvec *packet_access_rej = bitvec_alloc(23); + + bitvec_unhex(packet_access_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + Encoding::write_packet_access_reject( + packet_access_rej, tlli()); + + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); + + bitvec_free(packet_access_rej); + ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + + return msg; + +} + struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) { struct msgb *msg; diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..e044053 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,7 @@ enum gprs_rlcmac_tbf_ul_ass_state { GPRS_RLCMAC_UL_ASS_NONE = 0, GPRS_RLCMAC_UL_ASS_SEND_ASS, /* send uplink assignment on next RTS */ + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ, /* send assignment reject next RTS */ GPRS_RLCMAC_UL_ASS_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; @@ -103,6 +104,7 @@ struct msgb *create_dl_ass(uint32_t fn, uint8_t ts); struct msgb *create_ul_ass(uint32_t fn, uint8_t ts); + struct msgb *create_packet_access_reject(); GprsMs *ms() const; void set_ms(GprsMs *ms); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 339390b..213bd12 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,29 @@ ARRAY_SIZE(default_categories), }; +void test_packet_access_rej_epdan() +{ + BTS the_bts; + uint32_t tlli = 0xffeeddcc; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, 4); + static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(&the_bts, 1); + + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + struct msgb *msg = dl_tbf->create_packet_access_reject(); + + printf("packet reject: %s\n", + osmo_hexdump(msg->data, 23)); + + OSMO_ASSERT(!strcmp(osmo_hexdump(msg->data, 23), + "40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ")); + printf("=== end %s ===\n", __func__); + +} + + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -2874,6 +2897,7 @@ test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); + test_packet_access_rej_epdan(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 627cdc3..a680812 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6846,3 +6846,27 @@ No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index f921dfc..dc07fc7 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -72,3 +72,6 @@ === end test_immediate_assign_rej_multi_block === === start test_immediate_assign_rej_single_block === === end test_immediate_assign_rej_single_block === +=== start test_packet_access_rej_epdan === +packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_packet_access_rej_epdan === -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:50:59 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 11 Nov 2016 11:50:59 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/1209/3/src/encoding.cpp File src/encoding.cpp: Line 1409: bitvec_write_field(dest, wp, 0x21, 6); // MESSAGE TYPE > donb't we have something like enums or #defines for at least the message ty Done -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:51:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Nov 2016 11:51:36 +0000 Subject: openbsc[master]: move to libxsc: net init 2: move bsc_network_init decl to os... In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1126/1/openbsc/include/openbsc/osmo_bsc.h File openbsc/include/openbsc/osmo_bsc.h: Line 49: struct gsm_network *bsc_network_init(void *ctx, > i support the move to a 'bsc specifc' header. but osmo_bsc.h is about the hmm ... it should be a header common to osmo-nitb, osmo-bsc and osmo-bsc_nat, as well as bs11config and ipaccess-config. So far I haven't spotted an .h that matches well. It seems to me a good choice would indeed be a new .h just for bsc_network_init(), it would later also contain the BSC specific version of the gsm_network struct. -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:54:44 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 11 Nov 2016 11:54:44 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:54:54 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 11 Nov 2016 11:54:54 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 11:57:26 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 11 Nov 2016 11:57:26 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 4: (1 comment) https://gerrit.osmocom.org/#/c/1209/3/src/encoding.cpp File src/encoding.cpp: Line 1409: bitvec_write_field(dest, wp, > Done It is present. hard coding for message type was done to align with the way current file is written. Introducing the macro for message type. -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 11 12:11:54 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Nov 2016 12:11:54 +0000 Subject: openbsc[master]: move to libxsc: factor out gen of USSD notify and release co... In-Reply-To: References: Message-ID: Patch Set 3: the two USSD functions Notify() and releaseComplete() are used by the osmo-bsc binary: * osmo_bsc_ctrl.c in set_net_ussd_notify() however set_net_ussd_notify() seems unused and should be removed (-> new patch) * osmo_bsc_sccp.c: when the MSC connection is lost, osmo-bsc sends out a conn->sccp_con->msc->ussd_msc_lost_txt to each osmo_bsc_sccp_con that is closed. * osmo_bsc_api.c sends various USSD texts in cases where subscription with the MSC failed; like ussd_msc_lost_txt, ussd_grace_txt, ussd_no_msc_txt * osmo_bsc_filter.c sends a ussd_welcome_txt * osmo_bsc_grace.c sends a mid_call_txt I'm not really familiar with it, just looked up the code -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:25:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:25:06 +0000 Subject: [PATCH] libosmocore[master]: statsd: Fix compiler warning (int32_t vs. int64_t) Message-ID: Review at https://gerrit.osmocom.org/1226 statsd: Fix compiler warning (int32_t vs. int64_t) Fixes the following compiler warning: stats_statsd.c: In function ?osmo_stats_reporter_create_statsd?: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] srep->send_item = osmo_stats_reporter_statsd_send_item; Change-Id: Id36914906e0982f6ac092a311210727de66b343a --- M include/osmocom/core/stats.h M src/stats.c M src/stats_statsd.c 3 files changed, 4 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/26/1226/1 diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 96f687e..f754e41 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -78,7 +78,7 @@ int (*send_item)(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, - int32_t value); + int64_t value); }; struct osmo_stats_config { diff --git a/src/stats.c b/src/stats.c index 5f1d028..1efc8cd 100644 --- a/src/stats.c +++ b/src/stats.c @@ -62,7 +62,7 @@ int64_t value, int64_t delta); static int osmo_stats_reporter_log_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, - const struct osmo_stat_item_desc *desc, int value); + const struct osmo_stat_item_desc *desc, int64_t value); static int update_srep_config(struct osmo_stats_reporter *srep) { @@ -429,7 +429,7 @@ static int osmo_stats_reporter_log_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, - const struct osmo_stat_item_desc *desc, int value) + const struct osmo_stat_item_desc *desc, int64_t value) { return osmo_stats_reporter_log_send(srep, "i", statg->desc->group_name_prefix, statg->idx, diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 3cecec3..8b53881 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -32,6 +32,7 @@ #include #include #include +#include static int osmo_stats_reporter_statsd_send_counter(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, -- To view, visit https://gerrit.osmocom.org/1226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id36914906e0982f6ac092a311210727de66b343a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:25:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:25:07 +0000 Subject: [PATCH] libosmocore[master]: bssgp_vty: Remove dead code and compiler warning Message-ID: Review at https://gerrit.osmocom.org/1227 bssgp_vty: Remove dead code and compiler warning gprs_bssgp_vty.c:48:34: warning: ?gprs_bssgp_timer_strs? defined but not used [-Wunused-const-variable=] static const struct value_string gprs_bssgp_timer_strs[] = { ^~~~~~~~~~~~~~~~~~~~~ Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48 --- M src/gb/gprs_bssgp_vty.c 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/1227/1 diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f23d75f..90e5001 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -43,12 +43,6 @@ #include "common_vty.h" -/* FIXME: this should go to some common file as it is copied - * in vty_interface.c of the BSC */ -static const struct value_string gprs_bssgp_timer_strs[] = { - { 0, NULL } -}; - static void log_set_bvc_filter(struct log_target *target, struct bssgp_bvc_ctx *bctx) { @@ -219,7 +213,6 @@ install_default(L_BSSGP_NODE); install_element(L_BSSGP_NODE, &libgb_exit_cmd); install_element(L_BSSGP_NODE, &libgb_end_cmd); - //install_element(L_BSSGP_NODE, &cfg_bssgp_timer_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/1227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:25:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:25:07 +0000 Subject: [PATCH] libosmocore[master]: bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message Message-ID: Review at https://gerrit.osmocom.org/1228 bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message This was actually discovered by the following compiler warning in gcc-6.2.0: CC gprs_bssgp_bss.lo gprs_bssgp_bss.c: In function ?bssgp_rx_paging?: gprs_bssgp_bss.c:544:2: warning: this ?if? clause does not guard... [-Wmisleading-indentation] if (TLVP_PRESENT(&tp, BSSGP_IE_TMSI) && ^~ gprs_bssgp_bss.c:548:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ?if? *(pinfo->ptmsi) = ntohl(*(uint32_t *) ^ This is an actual bug. If we recevied a BSSGP Paging Request without P-TMSI, we might crash or report some random memory as P-TMSI to the caller in the output data structure. Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d --- M src/gb/gprs_bssgp_bss.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/28/1228/1 diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 61ed0c4..73c1350 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -542,11 +542,12 @@ /* Optional (P-)TMSI */ if (TLVP_PRESENT(&tp, BSSGP_IE_TMSI) && - TLVP_LEN(&tp, BSSGP_IE_TMSI) >= 4) + TLVP_LEN(&tp, BSSGP_IE_TMSI) >= 4) { if (!pinfo->ptmsi) pinfo->ptmsi = talloc_zero_size(pinfo, sizeof(uint32_t)); *(pinfo->ptmsi) = ntohl(*(uint32_t *) TLVP_VAL(&tp, BSSGP_IE_TMSI)); + } return 0; -- To view, visit https://gerrit.osmocom.org/1228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:25:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:25:07 +0000 Subject: [PATCH] libosmocore[master]: gan: Mark gan_pdisc_vals[] as public / non-static symbol Message-ID: Review at https://gerrit.osmocom.org/1229 gan: Mark gan_pdisc_vals[] as public / non-static symbol It is actually listed in libosmogsm.map, but still used to be a static symbol. That couldn't have worked. Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 --- M src/gsm/gan.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/29/1229/1 diff --git a/src/gsm/gan.c b/src/gsm/gan.c index c71c513..0bcaa17 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -68,7 +68,7 @@ { 0, NULL } }; -static const struct value_string gan_pdisc_vals[] = { +const struct value_string gan_pdisc_vals[] = { { GA_PDISC_RC, "RC" }, { GA_PDISC_CSR, "CSR" }, { GA_PDISC_PSR, "PSR" }, -- To view, visit https://gerrit.osmocom.org/1229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:33:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:33:53 +0000 Subject: [PATCH] libosmo-netif[master]: examples/lapd-over-datagram-network: Fix compiler warning Message-ID: Review at https://gerrit.osmocom.org/1230 examples/lapd-over-datagram-network: Fix compiler warning lapd-over-datagram-network.c:38:12: warning: ?sapi? defined but not used [-Wunused-variable] static int sapi = 63, tei = 0; ^~~~ Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0 --- M examples/lapd-over-datagram-network.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/30/1230/1 diff --git a/examples/lapd-over-datagram-network.c b/examples/lapd-over-datagram-network.c index 8d3fbde..9b41808 100644 --- a/examples/lapd-over-datagram-network.c +++ b/examples/lapd-over-datagram-network.c @@ -35,7 +35,7 @@ static struct osmo_dgram *conn; static struct lapd_instance *lapd; -static int sapi = 63, tei = 0; +static int tei = 0; void sighandler(int foo) { -- To view, visit https://gerrit.osmocom.org/1230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:40:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:40:21 +0000 Subject: [PATCH] libosmo-sccp[master]: sua: Remove unused 'cur' variables Message-ID: Review at https://gerrit.osmocom.org/1231 sua: Remove unused 'cur' variables There are some compiler warnings about other unused variables which we rather keep as a reminder that the SUA code is partially incomplete and should be finished at some day. Change-Id: I42b76351f1bbdfb7fe339d5fad98c5a065822a45 --- M src/sua.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/31/1231/1 diff --git a/src/sua.c b/src/sua.c index 898a257..799d270 100644 --- a/src/sua.c +++ b/src/sua.c @@ -793,7 +793,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; struct sua_connection *conn; - uint8_t *cur; /* fill conn */ conn = conn_create(link); @@ -1051,7 +1050,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; uint32_t conn_id = xua_msg_get_u32(xua, SUA_IEI_DEST_REF); - uint8_t *cur; /* resolve conn */ conn = conn_find_by_id(link, conn_id); -- To view, visit https://gerrit.osmocom.org/1231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I42b76351f1bbdfb7fe339d5fad98c5a065822a45 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:40:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:40:21 +0000 Subject: [PATCH] libosmo-sccp[master]: mtp_parse_test: Comment out unused but defined packets Message-ID: Review at https://gerrit.osmocom.org/1232 mtp_parse_test: Comment out unused but defined packets Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589 --- M tests/mtp/mtp_parse_test.c 1 file changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/32/1232/1 diff --git a/tests/mtp/mtp_parse_test.c b/tests/mtp/mtp_parse_test.c index 80f1e4b..75650a3 100644 --- a/tests/mtp/mtp_parse_test.c +++ b/tests/mtp/mtp_parse_test.c @@ -26,13 +26,17 @@ 0x61, 0x72, 0x62, 0x61, 0x6e, 0x6f, 0x62, 0x61, 0x72, 0x6e, 0x61, 0x62, 0x6f }; -static const unsigned char pkt2[] = { -0x81, 0x5b, 0x00, 0x22, 0x00, 0x11, 0xe0, 0x41, +static const unsigned char pkt3[] = { +0x81, 0x88, 0xc0, 0x16, 0x00, 0x21, 0xe0, 0x41, 0x6d, 0x69, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x64, 0x72, 0x61, 0x00, 0x00 }; -static const unsigned char pkt3[] = { -0x81, 0x88, 0xc0, 0x16, 0x00, 0x21, 0xe0, 0x41, +static const unsigned char pkt7[] = { +0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x56, 0x00 }; + +#if 0 +static const unsigned char pkt2[] = { +0x81, 0x5b, 0x00, 0x22, 0x00, 0x11, 0xe0, 0x41, 0x6d, 0x69, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x64, 0x72, 0x61, 0x00, 0x00 }; @@ -48,9 +52,6 @@ static const unsigned char pkt6[] = { 0x80, 0x5b, 0x00, 0x22, 0x00, 0x17 }; - -static const unsigned char pkt7[] = { -0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x56, 0x00 }; static const unsigned char pkt8[] = { 0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x00, 0x00 }; @@ -463,6 +464,7 @@ 0x83, 0x88, 0xc0, 0x16, 0x60, 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x88, 0x00, 0xfe, 0x04, 0x43, 0x5b, 0x00, 0xfe, 0x03, 0x00, 0x01, 0x31 }; +#endif static struct mtp_test tests[] = { { -- To view, visit https://gerrit.osmocom.org/1232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:47:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:47:38 +0000 Subject: libosmo-sccp[master]: mtp_parse_test: Comment out unused but defined packets In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:47:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:47:40 +0000 Subject: libosmo-sccp[master]: sua: Remove unused 'cur' variables In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I42b76351f1bbdfb7fe339d5fad98c5a065822a45 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:47:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:47:42 +0000 Subject: [MERGED] libosmo-sccp[master]: sua: Remove unused 'cur' variables In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sua: Remove unused 'cur' variables ...................................................................... sua: Remove unused 'cur' variables There are some compiler warnings about other unused variables which we rather keep as a reminder that the SUA code is partially incomplete and should be finished at some day. Change-Id: I42b76351f1bbdfb7fe339d5fad98c5a065822a45 --- M src/sua.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/sua.c b/src/sua.c index 898a257..799d270 100644 --- a/src/sua.c +++ b/src/sua.c @@ -793,7 +793,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; struct sua_connection *conn; - uint8_t *cur; /* fill conn */ conn = conn_create(link); @@ -1051,7 +1050,6 @@ struct xua_msg_part *data_ie = xua_msg_find_tag(xua, SUA_IEI_DATA); struct msgb *upmsg; uint32_t conn_id = xua_msg_get_u32(xua, SUA_IEI_DEST_REF); - uint8_t *cur; /* resolve conn */ conn = conn_find_by_id(link, conn_id); -- To view, visit https://gerrit.osmocom.org/1231 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I42b76351f1bbdfb7fe339d5fad98c5a065822a45 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:47:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:47:59 +0000 Subject: libosmocore[master]: statsd: Fix compiler warning (int32_t vs. int64_t) In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id36914906e0982f6ac092a311210727de66b343a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:48:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:48:05 +0000 Subject: libosmocore[master]: bssgp_vty: Remove dead code and compiler warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:48:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:48:07 +0000 Subject: [MERGED] libosmocore[master]: statsd: Fix compiler warning (int32_t vs. int64_t) In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: statsd: Fix compiler warning (int32_t vs. int64_t) ...................................................................... statsd: Fix compiler warning (int32_t vs. int64_t) Fixes the following compiler warning: stats_statsd.c: In function ?osmo_stats_reporter_create_statsd?: stats_statsd.c:54:18: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] srep->send_item = osmo_stats_reporter_statsd_send_item; Change-Id: Id36914906e0982f6ac092a311210727de66b343a --- M include/osmocom/core/stats.h M src/stats.c M src/stats_statsd.c 3 files changed, 4 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/stats.h b/include/osmocom/core/stats.h index 96f687e..f754e41 100644 --- a/include/osmocom/core/stats.h +++ b/include/osmocom/core/stats.h @@ -78,7 +78,7 @@ int (*send_item)(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, const struct osmo_stat_item_desc *desc, - int32_t value); + int64_t value); }; struct osmo_stats_config { diff --git a/src/stats.c b/src/stats.c index 5f1d028..1efc8cd 100644 --- a/src/stats.c +++ b/src/stats.c @@ -62,7 +62,7 @@ int64_t value, int64_t delta); static int osmo_stats_reporter_log_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, - const struct osmo_stat_item_desc *desc, int value); + const struct osmo_stat_item_desc *desc, int64_t value); static int update_srep_config(struct osmo_stats_reporter *srep) { @@ -429,7 +429,7 @@ static int osmo_stats_reporter_log_send_item(struct osmo_stats_reporter *srep, const struct osmo_stat_item_group *statg, - const struct osmo_stat_item_desc *desc, int value) + const struct osmo_stat_item_desc *desc, int64_t value) { return osmo_stats_reporter_log_send(srep, "i", statg->desc->group_name_prefix, statg->idx, diff --git a/src/stats_statsd.c b/src/stats_statsd.c index 3cecec3..8b53881 100644 --- a/src/stats_statsd.c +++ b/src/stats_statsd.c @@ -32,6 +32,7 @@ #include #include #include +#include static int osmo_stats_reporter_statsd_send_counter(struct osmo_stats_reporter *srep, const struct rate_ctr_group *ctrg, -- To view, visit https://gerrit.osmocom.org/1226 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id36914906e0982f6ac092a311210727de66b343a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:03 +0000 Subject: [MERGED] libosmocore[master]: bssgp_vty: Remove dead code and compiler warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bssgp_vty: Remove dead code and compiler warning ...................................................................... bssgp_vty: Remove dead code and compiler warning gprs_bssgp_vty.c:48:34: warning: ?gprs_bssgp_timer_strs? defined but not used [-Wunused-const-variable=] static const struct value_string gprs_bssgp_timer_strs[] = { ^~~~~~~~~~~~~~~~~~~~~ Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48 --- M src/gb/gprs_bssgp_vty.c 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_bssgp_vty.c b/src/gb/gprs_bssgp_vty.c index f23d75f..90e5001 100644 --- a/src/gb/gprs_bssgp_vty.c +++ b/src/gb/gprs_bssgp_vty.c @@ -43,12 +43,6 @@ #include "common_vty.h" -/* FIXME: this should go to some common file as it is copied - * in vty_interface.c of the BSC */ -static const struct value_string gprs_bssgp_timer_strs[] = { - { 0, NULL } -}; - static void log_set_bvc_filter(struct log_target *target, struct bssgp_bvc_ctx *bctx) { @@ -219,7 +213,6 @@ install_default(L_BSSGP_NODE); install_element(L_BSSGP_NODE, &libgb_exit_cmd); install_element(L_BSSGP_NODE, &libgb_end_cmd); - //install_element(L_BSSGP_NODE, &cfg_bssgp_timer_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/1227 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia41ccb7b227c41996cdef51dc6779bfc5b5a8d48 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:06 +0000 Subject: libosmocore[master]: gan: Mark gan_pdisc_vals[] as public / non-static symbol In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:18 +0000 Subject: libosmocore[master]: gan: Mark gan_pdisc_vals[] as public / non-static symbol In-Reply-To: References: Message-ID: Patch Set 2: Verified+1 -- To view, visit https://gerrit.osmocom.org/1229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:20 +0000 Subject: [MERGED] libosmocore[master]: gan: Mark gan_pdisc_vals[] as public / non-static symbol In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gan: Mark gan_pdisc_vals[] as public / non-static symbol ...................................................................... gan: Mark gan_pdisc_vals[] as public / non-static symbol It is actually listed in libosmogsm.map, but still used to be a static symbol. That couldn't have worked. Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 --- M src/gsm/gan.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/src/gsm/gan.c b/src/gsm/gan.c index c71c513..0bcaa17 100644 --- a/src/gsm/gan.c +++ b/src/gsm/gan.c @@ -68,7 +68,7 @@ { 0, NULL } }; -static const struct value_string gan_pdisc_vals[] = { +const struct value_string gan_pdisc_vals[] = { { GA_PDISC_RC, "RC" }, { GA_PDISC_CSR, "CSR" }, { GA_PDISC_PSR, "PSR" }, -- To view, visit https://gerrit.osmocom.org/1229 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I6f3f04b683d906674ee7da9bab5762bb00cea916 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:38 +0000 Subject: libosmo-netif[master]: examples/lapd-over-datagram-network: Fix compiler warning In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:49:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:49:39 +0000 Subject: [MERGED] libosmo-netif[master]: examples/lapd-over-datagram-network: Fix compiler warning In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: examples/lapd-over-datagram-network: Fix compiler warning ...................................................................... examples/lapd-over-datagram-network: Fix compiler warning lapd-over-datagram-network.c:38:12: warning: ?sapi? defined but not used [-Wunused-variable] static int sapi = 63, tei = 0; ^~~~ Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0 --- M examples/lapd-over-datagram-network.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/examples/lapd-over-datagram-network.c b/examples/lapd-over-datagram-network.c index 8d3fbde..9b41808 100644 --- a/examples/lapd-over-datagram-network.c +++ b/examples/lapd-over-datagram-network.c @@ -35,7 +35,7 @@ static struct osmo_dgram *conn; static struct lapd_instance *lapd; -static int sapi = 63, tei = 0; +static int tei = 0; void sighandler(int foo) { -- To view, visit https://gerrit.osmocom.org/1230 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If367deb0e0d7d5e031db2bd905179263d18703f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:56:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:56:32 +0000 Subject: libosmocore[master]: bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:56:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:56:50 +0000 Subject: [MERGED] libosmocore[master]: bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message ...................................................................... bssgp_rx_paging(): Fix parsing of P-TMSI IE in Paging message This was actually discovered by the following compiler warning in gcc-6.2.0: CC gprs_bssgp_bss.lo gprs_bssgp_bss.c: In function ?bssgp_rx_paging?: gprs_bssgp_bss.c:544:2: warning: this ?if? clause does not guard... [-Wmisleading-indentation] if (TLVP_PRESENT(&tp, BSSGP_IE_TMSI) && ^~ gprs_bssgp_bss.c:548:3: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ?if? *(pinfo->ptmsi) = ntohl(*(uint32_t *) ^ This is an actual bug. If we recevied a BSSGP Paging Request without P-TMSI, we might crash or report some random memory as P-TMSI to the caller in the output data structure. Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d --- M src/gb/gprs_bssgp_bss.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c index 61ed0c4..73c1350 100644 --- a/src/gb/gprs_bssgp_bss.c +++ b/src/gb/gprs_bssgp_bss.c @@ -542,11 +542,12 @@ /* Optional (P-)TMSI */ if (TLVP_PRESENT(&tp, BSSGP_IE_TMSI) && - TLVP_LEN(&tp, BSSGP_IE_TMSI) >= 4) + TLVP_LEN(&tp, BSSGP_IE_TMSI) >= 4) { if (!pinfo->ptmsi) pinfo->ptmsi = talloc_zero_size(pinfo, sizeof(uint32_t)); *(pinfo->ptmsi) = ntohl(*(uint32_t *) TLVP_VAL(&tp, BSSGP_IE_TMSI)); + } return 0; -- To view, visit https://gerrit.osmocom.org/1228 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib4f307827cd7cccc91c1415a6fb5428d7cf8416d Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:57:06 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:57:06 +0000 Subject: [PATCH] openbsc[master]: talloc_cxt: Fix compiler warning / missing #include Message-ID: Review at https://gerrit.osmocom.org/1233 talloc_cxt: Fix compiler warning / missing #include talloc_ctx.c: In function ?talloc_ctx_init?: talloc_ctx.c:40:2: warning: implicit declaration of function ?msgb_talloc_ctx_init? [-Wimplicit-function-declaration] msgb_talloc_ctx_init(ctx_root, 0); ^~~~~~~~~~~~~~~~~~~~ Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896 --- M openbsc/src/libcommon/talloc_ctx.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/33/1233/1 diff --git a/openbsc/src/libcommon/talloc_ctx.c b/openbsc/src/libcommon/talloc_ctx.c index 7a8bfd3..5e3d9ae 100644 --- a/openbsc/src/libcommon/talloc_ctx.c +++ b/openbsc/src/libcommon/talloc_ctx.c @@ -18,6 +18,7 @@ */ #include +#include extern void *tall_bsc_ctx; extern void *tall_fle_ctx; -- To view, visit https://gerrit.osmocom.org/1233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:57:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:57:07 +0000 Subject: [PATCH] openbsc[master]: bs11_config: remove compiler waring about unused variable Message-ID: Review at https://gerrit.osmocom.org/1234 bs11_config: remove compiler waring about unused variable bs11_config.c:78:22: warning: ?too_fast? defined but not used [-Wunused-const-variable=] static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; ^~~~~~~~ Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b --- M openbsc/src/utils/bs11_config.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/1234/1 diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 7356b82..20b9ed3 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -75,8 +75,6 @@ static const char *trx1_password = "1111111111"; #define TEI_OML 25 -static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; - /* dummy function to keep gsm_data.c happy */ struct osmo_counter *osmo_counter_alloc(const char *name) { @@ -653,6 +651,8 @@ int rc = -1; #if 0 + const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; + if (rx_msg->len < LAPD_HDR_LEN + sizeof(struct abis_om_fom_hdr) + sizeof(struct abis_om_hdr)) { -- To view, visit https://gerrit.osmocom.org/1234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:57:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:57:44 +0000 Subject: openbsc[master]: talloc_cxt: Fix compiler warning / missing #include In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 14:57:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 14:57:49 +0000 Subject: openbsc[master]: bs11_config: remove compiler waring about unused variable In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 15:33:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 15:33:42 +0000 Subject: [MERGED] openbsc[master]: talloc_cxt: Fix compiler warning / missing #include In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: talloc_cxt: Fix compiler warning / missing #include ...................................................................... talloc_cxt: Fix compiler warning / missing #include talloc_ctx.c: In function ?talloc_ctx_init?: talloc_ctx.c:40:2: warning: implicit declaration of function ?msgb_talloc_ctx_init? [-Wimplicit-function-declaration] msgb_talloc_ctx_init(ctx_root, 0); ^~~~~~~~~~~~~~~~~~~~ Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896 --- M openbsc/src/libcommon/talloc_ctx.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libcommon/talloc_ctx.c b/openbsc/src/libcommon/talloc_ctx.c index 7a8bfd3..5e3d9ae 100644 --- a/openbsc/src/libcommon/talloc_ctx.c +++ b/openbsc/src/libcommon/talloc_ctx.c @@ -18,6 +18,7 @@ */ #include +#include extern void *tall_bsc_ctx; extern void *tall_fle_ctx; -- To view, visit https://gerrit.osmocom.org/1233 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib8ebc02d5cf0d2b4019473d3750ae7c6f8a32896 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 16:01:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 16:01:53 +0000 Subject: [MERGED] openbsc[master]: bs11_config: remove compiler waring about unused variable In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bs11_config: remove compiler waring about unused variable ...................................................................... bs11_config: remove compiler waring about unused variable bs11_config.c:78:22: warning: ?too_fast? defined but not used [-Wunused-const-variable=] static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; ^~~~~~~~ Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b --- M openbsc/src/utils/bs11_config.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 7356b82..20b9ed3 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -75,8 +75,6 @@ static const char *trx1_password = "1111111111"; #define TEI_OML 25 -static const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; - /* dummy function to keep gsm_data.c happy */ struct osmo_counter *osmo_counter_alloc(const char *name) { @@ -653,6 +651,8 @@ int rc = -1; #if 0 + const uint8_t too_fast[] = { 0x12, 0x80, 0x00, 0x00, 0x02, 0x02 }; + if (rx_msg->len < LAPD_HDR_LEN + sizeof(struct abis_om_fom_hdr) + sizeof(struct abis_om_hdr)) { -- To view, visit https://gerrit.osmocom.org/1234 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1fdb9645128c2dfeb489bf75e89ab0adea919d2b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 16:53:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 11 Nov 2016 16:53:39 +0000 Subject: [PATCH] osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1046 to look at the new patch set (#7). Remove duplicated code Remove lchan deactivation related code duplication to facilitate future use for dynamic CCCH re-activation. Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9 --- M include/osmo-bts/bts_model.h M include/osmo-bts/rsl.h M src/common/rsl.c M src/osmo-bts-litecell15/lc15bts_vty.c M src/osmo-bts-litecell15/oml.c M src/osmo-bts-octphy/l1_oml.c M src/osmo-bts-sysmo/oml.c M src/osmo-bts-sysmo/sysmobts_vty.c M src/osmo-bts-trx/l1_if.c M tests/handover/handover_test.c M tests/stubs.c 11 files changed, 45 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/1046/7 diff --git a/include/osmo-bts/bts_model.h b/include/osmo-bts/bts_model.h index 7e2d088..7a87d78 100644 --- a/include/osmo-bts/bts_model.h +++ b/include/osmo-bts/bts_model.h @@ -45,6 +45,9 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap); +int bts_model_lchan_deactivate(struct gsm_lchan *lchan); +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan); + void bts_model_abis_close(struct gsm_bts *bts); int bts_model_ctrl_cmds_install(struct gsm_bts *bts); diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h index 4311ffd..d542ff6 100644 --- a/include/osmo-bts/rsl.h +++ b/include/osmo-bts/rsl.h @@ -26,6 +26,8 @@ int rsl_tx_rf_rel_ack(struct gsm_lchan *lchan); int rsl_tx_hando_det(struct gsm_lchan *lchan, uint8_t *ho_delay); +int lchan_deactivate(struct gsm_lchan *lchan); + /* call-back for LAPDm code, called when it wants to send msgs UP */ int lapdm_rll_tx_cb(struct msgb *msg, struct lapdm_entity *le, void *ctx); diff --git a/src/common/rsl.c b/src/common/rsl.c index 6c8f5cc..880136c 100644 --- a/src/common/rsl.c +++ b/src/common/rsl.c @@ -2448,6 +2448,12 @@ return ret; } +int lchan_deactivate(struct gsm_lchan *lchan) +{ + lchan->ciph_state = 0; + return bts_model_lchan_deactivate(lchan); +} + int down_rsl(struct gsm_bts_trx *trx, struct msgb *msg) { struct abis_rsl_common_hdr *rslh = msgb_l2(msg); diff --git a/src/osmo-bts-litecell15/lc15bts_vty.c b/src/osmo-bts-litecell15/lc15bts_vty.c index c5d404c..0ffe663 100644 --- a/src/osmo-bts-litecell15/lc15bts_vty.c +++ b/src/osmo-bts-litecell15/lc15bts_vty.c @@ -46,15 +46,14 @@ #include #include #include +#include #include #include "lc15bts.h" #include "l1_if.h" #include "utils.h" - extern int lchan_activate(struct gsm_lchan *lchan); -extern int lchan_deactivate(struct gsm_lchan *lchan); #define TRX_STR "Transceiver related commands\n" "TRX number\n" diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c index 689ba70..8afa2a2 100644 --- a/src/osmo-bts-litecell15/oml.c +++ b/src/osmo-bts-litecell15/oml.c @@ -1656,10 +1656,9 @@ queue_sapi_command(lchan, cmd); } -int lchan_deactivate(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { lchan_set_state(lchan, LCHAN_S_REL_REQ); - lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ enqueue_rel_marker(lchan); return 0; } @@ -1674,7 +1673,7 @@ queue_sapi_command(lchan, cmd); } -static int lchan_deactivate_sacch(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { enqueue_sacch_rel_marker(lchan); return 0; @@ -1858,7 +1857,7 @@ /* Only de-activate the SACCH if the lchan is active */ if (lchan->state != LCHAN_S_ACTIVE) return 0; - return lchan_deactivate_sacch(lchan); + return bts_model_lchan_deactivate_sacch(lchan); } int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) diff --git a/src/osmo-bts-octphy/l1_oml.c b/src/osmo-bts-octphy/l1_oml.c index db416ba..5865625 100644 --- a/src/osmo-bts-octphy/l1_oml.c +++ b/src/osmo-bts-octphy/l1_oml.c @@ -884,7 +884,7 @@ queue_sapi_command(lchan, cmd); } -static int lchan_deactivate_sacch(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { enqueue_sacch_rel_marker(lchan); return 0; @@ -895,7 +895,7 @@ /* Only de-activate the SACCH if the lchan is active */ if (lchan->state != LCHAN_S_ACTIVE) return 0; - return lchan_deactivate_sacch(lchan); + return bts_model_lchan_deactivate_sacch(lchan); } @@ -913,10 +913,9 @@ queue_sapi_command(lchan, cmd); } -static int lchan_deactivate(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { lchan_set_state(lchan, LCHAN_S_REL_REQ); - lchan->ciph_state = 0; /* FIXME: do this in common *.c */ enqueue_rel_marker(lchan); return 0; } diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c index ed02c74..b23d992 100644 --- a/src/osmo-bts-sysmo/oml.c +++ b/src/osmo-bts-sysmo/oml.c @@ -1676,10 +1676,9 @@ queue_sapi_command(lchan, cmd); } -int lchan_deactivate(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { lchan_set_state(lchan, LCHAN_S_REL_REQ); - lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ enqueue_rel_marker(lchan); return 0; } @@ -1694,7 +1693,7 @@ queue_sapi_command(lchan, cmd); } -static int lchan_deactivate_sacch(struct gsm_lchan *lchan) +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { enqueue_sacch_rel_marker(lchan); return 0; @@ -1878,7 +1877,7 @@ /* Only de-activate the SACCH if the lchan is active */ if (lchan->state != LCHAN_S_ACTIVE) return 0; - return lchan_deactivate_sacch(lchan); + return bts_model_lchan_deactivate_sacch(lchan); } int bts_model_trx_deact_rf(struct gsm_bts_trx *trx) diff --git a/src/osmo-bts-sysmo/sysmobts_vty.c b/src/osmo-bts-sysmo/sysmobts_vty.c index c829c49..e67d8be 100644 --- a/src/osmo-bts-sysmo/sysmobts_vty.c +++ b/src/osmo-bts-sysmo/sysmobts_vty.c @@ -42,15 +42,14 @@ #include #include #include +#include #include #include "femtobts.h" #include "l1_if.h" #include "utils.h" - extern int lchan_activate(struct gsm_lchan *lchan); -extern int lchan_deactivate(struct gsm_lchan *lchan); #define TRX_STR "Transceiver related commands\n" "TRX number\n" diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ea2088b..1176413 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -144,6 +144,23 @@ return 0; } +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) +{ + struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + /* set lchan inactive */ + lchan_set_state(lchan, LCHAN_S_NONE); + + return trx_sched_set_lchan(&l1h->l1s, lchan->nr, LID_DEDIC, 0); +} + +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) +{ + struct phy_instance *pinst = trx_phy_instance(lchan->ts->trx); + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + return trx_sched_set_lchan(&l1h->l1s, lchan->nr, LID_SACCH, 0); +} /* * transceiver provisioning @@ -641,16 +658,13 @@ break; } /* deactivate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 0); + bts_model_lchan_deactivate_sacch(lchan); if (!l1sap->u.info.u.act_req.sacch_only) { - /* set lchan inactive */ - lchan_set_state(lchan, LCHAN_S_NONE); /* deactivate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 0); + lchan_deactivate(lchan); /* confirm only on dedicated channel */ mph_info_chan_confirm(l1h, chan_nr, PRIM_INFO_DEACTIVATE, 0); - lchan->ciph_state = 0; /* FIXME: do this in common/\*.c */ } break; default: diff --git a/tests/handover/handover_test.c b/tests/handover/handover_test.c index d1dc34a..a7a66d0 100644 --- a/tests/handover/handover_test.c +++ b/tests/handover/handover_test.c @@ -275,3 +275,5 @@ int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; } int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts) { return 0; } int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan) { return 0; } +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { return 0; } +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { return 0; } diff --git a/tests/stubs.c b/tests/stubs.c index c680db0..f969cb3 100644 --- a/tests/stubs.c +++ b/tests/stubs.c @@ -40,6 +40,8 @@ int l1if_set_txpower(struct femtol1_hdl *fl1h, float tx_power) { return 0; } +int bts_model_lchan_deactivate(struct gsm_lchan *lchan) { return 0; } +int bts_model_lchan_deactivate_sacch(struct gsm_lchan *lchan) { return 0; } int bts_model_adjst_ms_pwr(struct gsm_lchan *lchan) { return 0; } -- To view, visit https://gerrit.osmocom.org/1046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 11 16:53:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 11 Nov 2016 16:53:39 +0000 Subject: [PATCH] osmo-bts[master]: Remove duplicated code Message-ID: Review at https://gerrit.osmocom.org/1235 Remove duplicated code Having duplicated code to fill in fn & tn values makes it harder to read and modify static gsmtap_p* functions. Fix this by removing the duplication and moving the common code one level up. Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383 --- M src/common/l1sap.c 1 file changed, 11 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/35/1235/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 71c4b0b..f4bc5ce 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -205,15 +205,13 @@ /* send primitive as gsmtap */ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *tn, uint8_t *ss, uint32_t *fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len) { struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr, link_id; *data = msg->data + sizeof(struct osmo_phsap_prim); *len = msg->len - sizeof(struct osmo_phsap_prim); - *fn = l1sap->u.data.fn; - *tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); chan_nr = l1sap->u.data.chan_nr; link_id = l1sap->u.data.link_id; @@ -234,7 +232,7 @@ #warning Set BS_AG_BLKS_RES /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ - if (L1SAP_FN2CCCHBLOCK(*fn) >= 1) + if (L1SAP_FN2CCCHBLOCK(fn) >= 1) *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; @@ -246,18 +244,16 @@ } static int gsmtap_pdch(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *tn, uint8_t *ss, uint32_t *fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len) { struct msgb *msg = l1sap->oph.msg; *data = msg->data + sizeof(struct osmo_phsap_prim); *len = msg->len - sizeof(struct osmo_phsap_prim); - *fn = l1sap->u.data.fn; - *tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); - if (L1SAP_IS_PTCCH(*fn)) { + if (L1SAP_IS_PTCCH(fn)) { *chan_type = GSMTAP_CHANNEL_PTCCH; - *ss = L1SAP_FN2PTCCHBLOCK(*fn); + *ss = L1SAP_FN2PTCCHBLOCK(fn); if (l1sap->oph.primitive == PRIM_OP_INDICATION) { if ((*data[0]) == 7) @@ -309,12 +305,14 @@ uplink = 0; /* fall through */ case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_INDICATION): + fn = l1sap->u.data.fn; + tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); if (ts_is_pdch(&trx->ts[tn])) - rc = gsmtap_pdch(l1sap, &chan_type, &tn, &ss, &fn, &data, - &len); + rc = gsmtap_pdch(l1sap, &chan_type, &ss, fn, &data, + &len); else - rc = gsmtap_ph_data(l1sap, &chan_type, &tn, &ss, &fn, - &data, &len); + rc = gsmtap_ph_data(l1sap, &chan_type, &ss, fn, &data, + &len); break; case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION): rc = gsmtap_ph_rach(l1sap, &chan_type, &tn, &ss, &fn, &data, -- To view, visit https://gerrit.osmocom.org/1235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 11 16:53:40 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 11 Nov 2016 16:53:40 +0000 Subject: [PATCH] osmo-bts[master]: Replace link_id constant with define Message-ID: Review at https://gerrit.osmocom.org/1236 Replace link_id constant with define Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8 --- M include/osmo-bts/l1sap.h M src/common/scheduler.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-trx/l1_if.c 6 files changed, 57 insertions(+), 53 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/36/1236/1 diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 97a2f04..dcebc1d 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -3,6 +3,10 @@ #include +/* lchan link ID */ +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + /* timeslot and subslot from chan_nr */ #define L1SAP_CHAN2TS(chan_nr) (chan_nr & 7) #define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1) @@ -10,7 +14,7 @@ #define L1SAP_CHAN2SS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7) /* logical channel from chan_nr + link_id */ -#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == 0x40) +#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH) #define L1SAP_IS_CHAN_TCHF(chan_nr) ((chan_nr & 0xf8) == 0x08) #define L1SAP_IS_CHAN_TCHH(chan_nr) ((chan_nr & 0xf0) == 0x10) #define L1SAP_IS_CHAN_SDCCH4(chan_nr) ((chan_nr & 0xe0) == 0x20) diff --git a/src/common/scheduler.c b/src/common/scheduler.c index ec66cfc..db1f977 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -116,44 +116,44 @@ */ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = { - { 0, TRXC_IDLE, 0, 0, "IDLE", NULL, tx_idle_fn, NULL, 1 }, - { 0, TRXC_FCCH, 0, 0, "FCCH", NULL, tx_fcch_fn, NULL, 1 }, - { 0, TRXC_SCH, 0, 0, "SCH", NULL, tx_sch_fn, NULL, 1 }, - { 0, TRXC_BCCH, 0x80, 0x00, "BCCH", rts_data_fn, tx_data_fn, NULL, 1 }, - { 0, TRXC_RACH, 0x88, 0x00, "RACH", NULL, NULL, rx_rach_fn, 1 }, - { 0, TRXC_CCCH, 0x90, 0x00, "CCCH", rts_data_fn, tx_data_fn, NULL, 1 }, - { 0, TRXC_TCHF, 0x08, 0x00, "TCH/F", rts_tchf_fn, tx_tchf_fn, rx_tchf_fn, 0 }, - { 0, TRXC_TCHH_0, 0x10, 0x00, "TCH/H(0)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, - { 0, TRXC_TCHH_1, 0x18, 0x00, "TCH/H(1)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, - { 0, TRXC_SDCCH4_0, 0x20, 0x00, "SDCCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_1, 0x28, 0x00, "SDCCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_2, 0x30, 0x00, "SDCCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_3, 0x38, 0x00, "SDCCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_0, 0x40, 0x00, "SDCCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_1, 0x48, 0x00, "SDCCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_2, 0x50, 0x00, "SDCCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_3, 0x58, 0x00, "SDCCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_4, 0x60, 0x00, "SDCCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_5, 0x68, 0x00, "SDCCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_6, 0x70, 0x00, "SDCCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_7, 0x78, 0x00, "SDCCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTF, 0x08, 0x40, "SACCH/TF", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTH_0, 0x10, 0x40, "SACCH/TH(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTH_1, 0x18, 0x40, "SACCH/TH(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_0, 0x20, 0x40, "SACCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_1, 0x28, 0x40, "SACCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_2, 0x30, 0x40, "SACCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_3, 0x38, 0x40, "SACCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_0, 0x40, 0x40, "SACCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_1, 0x48, 0x40, "SACCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_2, 0x50, 0x40, "SACCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_3, 0x58, 0x40, "SACCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_4, 0x60, 0x40, "SACCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_5, 0x68, 0x40, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_6, 0x70, 0x40, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_7, 0x78, 0x40, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 1, TRXC_PDTCH, 0x08, 0x00, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, - { 1, TRXC_PTCCH, 0x08, 0x00, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_IDLE, 0, LID_DEDIC, "IDLE", NULL, tx_idle_fn, NULL, 1 }, + { 0, TRXC_FCCH, 0, LID_DEDIC, "FCCH", NULL, tx_fcch_fn, NULL, 1 }, + { 0, TRXC_SCH, 0, LID_DEDIC, "SCH", NULL, tx_sch_fn, NULL, 1 }, + { 0, TRXC_BCCH, 0x80, LID_DEDIC, "BCCH", rts_data_fn, tx_data_fn, NULL, 1 }, + { 0, TRXC_RACH, 0x88, LID_DEDIC, "RACH", NULL, NULL, rx_rach_fn, 1 }, + { 0, TRXC_CCCH, 0x90, LID_DEDIC, "CCCH", rts_data_fn, tx_data_fn, NULL, 1 }, + { 0, TRXC_TCHF, 0x08, LID_DEDIC, "TCH/F", rts_tchf_fn, tx_tchf_fn, rx_tchf_fn, 0 }, + { 0, TRXC_TCHH_0, 0x10, LID_DEDIC, "TCH/H(0)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, + { 0, TRXC_TCHH_1, 0x18, LID_DEDIC, "TCH/H(1)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, + { 0, TRXC_SDCCH4_0, 0x20, LID_DEDIC, "SDCCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_1, 0x28, LID_DEDIC, "SDCCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_2, 0x30, LID_DEDIC, "SDCCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_3, 0x38, LID_DEDIC, "SDCCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_0, 0x40, LID_DEDIC, "SDCCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_1, 0x48, LID_DEDIC, "SDCCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_2, 0x50, LID_DEDIC, "SDCCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_3, 0x58, LID_DEDIC, "SDCCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_4, 0x60, LID_DEDIC, "SDCCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_5, 0x68, LID_DEDIC, "SDCCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_6, 0x70, LID_DEDIC, "SDCCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_7, 0x78, LID_DEDIC, "SDCCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTF, 0x08, LID_SACCH, "SACCH/TF", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTH_0, 0x10, LID_SACCH, "SACCH/TH(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTH_1, 0x18, LID_SACCH, "SACCH/TH(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_0, 0x20, LID_SACCH, "SACCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_1, 0x28, LID_SACCH, "SACCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_2, 0x30, LID_SACCH, "SACCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_3, 0x38, LID_SACCH, "SACCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_0, 0x40, LID_SACCH, "SACCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_1, 0x48, LID_SACCH, "SACCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_2, 0x50, LID_SACCH, "SACCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_3, 0x58, LID_SACCH, "SACCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_4, 0x60, LID_SACCH, "SACCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_5, 0x68, LID_SACCH, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_6, 0x70, LID_SACCH, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_7, 0x78, LID_SACCH, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 1, TRXC_PDTCH, 0x08, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, + { 1, TRXC_PTCCH, 0x08, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, }; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 9d57c2f..4a6c739 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -788,9 +788,9 @@ if (chan_nr) { fn = rts_ind->u32Fn; if (rts_ind->sapi == GsmL1_Sapi_Sacch) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; /* recycle the msgb and use it for the L1 primitive, * which means that we (or our caller) must not free it */ rc = msgb_trim(l1p_msg, sizeof(*l1sap)); @@ -917,7 +917,7 @@ return ENOTSUP; } fn = data_ind->u32Fn; - link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? 0x40 : 0x00; + link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index c4105ac..0fc51fc 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -862,9 +862,9 @@ chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); if (chan_nr) { if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; rc = msgb_trim(l1p_msg, sizeof(*l1sap)); if (rc < 0) @@ -985,9 +985,9 @@ } if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; memset(&l1sap, 0, sizeof(l1sap)); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d14eac4..61ffe39 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -783,9 +783,9 @@ if (chan_nr) { fn = rts_ind->u32Fn; if (rts_ind->sapi == GsmL1_Sapi_Sacch) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; /* recycle the msgb and use it for the L1 primitive, * which means that we (or our caller) must not free it */ rc = msgb_trim(l1p_msg, sizeof(*l1sap)); @@ -911,7 +911,7 @@ return ENOTSUP; } fn = data_ind->u32Fn; - link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? 0x40 : 0x00; + link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 4465f3b..ea2088b 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -591,9 +591,9 @@ break; } /* activate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x00, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 1); /* activate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x40, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 1); /* set mode */ trx_sched_set_mode(&l1h->l1s, chan_nr, lchan->rsl_cmode, lchan->tch_mode, @@ -641,12 +641,12 @@ break; } /* deactivate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x40, 0); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 0); if (!l1sap->u.info.u.act_req.sacch_only) { /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); /* deactivate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x00, 0); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 0); /* confirm only on dedicated channel */ mph_info_chan_confirm(l1h, chan_nr, PRIM_INFO_DEACTIVATE, 0); -- To view, visit https://gerrit.osmocom.org/1236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Fri Nov 11 18:28:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 18:28:35 +0000 Subject: [PATCH] libosmocore[master]: msgb: add msgb_push_u{8, 16, 32}() functions Message-ID: Review at https://gerrit.osmocom.org/1237 msgb: add msgb_push_u{8,16,32}() functions Those work analoguous to msgb_put_*() but pre-pend the given value into the msg headroom, rather than appending it to the end. Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2 --- M include/osmocom/core/msgb.h 1 file changed, 30 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/1237/1 diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 7c85771..9cb1c24 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -290,6 +290,36 @@ return msgb->data; } +/*! \brief prepend a uint8 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 8bit byte to be prepended + */ +static inline void msgb_push_u8(struct msgb *msg, uint8_t word) +{ + uint8_t *space = msgb_push(msg, 1); + space[0] = word; +} + +/*! \brief prepend a uint16 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 16bit byte to be prepended + */ +static inline void msgb_push_u16(struct msgb *msg, uint16_t word) +{ + uint16_t *space = (uint16_t *) msgb_push(msg, 2); + osmo_store16be(word, space); +} + +/*! \brief prepend a uint32 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 32bit byte to be prepended + */ +static inline void msgb_push_u32(struct msgb *msg, uint32_t word) +{ + uint32_t *space = (uint32_t *) msgb_push(msg, 4); + osmo_store32be(word, space); +} + /*! \brief remove (pull) a header from the front of the message buffer * \param[in] msgb message buffer * \param[in] len number of octets to be pulled -- To view, visit https://gerrit.osmocom.org/1237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 18:31:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 18:31:21 +0000 Subject: libosmocore[master]: msgb: add msgb_push_u{8,16,32}() functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 11 18:31:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 18:31:23 +0000 Subject: [MERGED] libosmocore[master]: msgb: add msgb_push_u{8, 16, 32}() functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: msgb: add msgb_push_u{8,16,32}() functions ...................................................................... msgb: add msgb_push_u{8,16,32}() functions Those work analoguous to msgb_put_*() but pre-pend the given value into the msg headroom, rather than appending it to the end. Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2 --- M include/osmocom/core/msgb.h 1 file changed, 30 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h index 7c85771..9cb1c24 100644 --- a/include/osmocom/core/msgb.h +++ b/include/osmocom/core/msgb.h @@ -290,6 +290,36 @@ return msgb->data; } +/*! \brief prepend a uint8 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 8bit byte to be prepended + */ +static inline void msgb_push_u8(struct msgb *msg, uint8_t word) +{ + uint8_t *space = msgb_push(msg, 1); + space[0] = word; +} + +/*! \brief prepend a uint16 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 16bit byte to be prepended + */ +static inline void msgb_push_u16(struct msgb *msg, uint16_t word) +{ + uint16_t *space = (uint16_t *) msgb_push(msg, 2); + osmo_store16be(word, space); +} + +/*! \brief prepend a uint32 value to the head of the message + * \param[in] msgb message buffer + * \param[in] word unsigned 32bit byte to be prepended + */ +static inline void msgb_push_u32(struct msgb *msg, uint32_t word) +{ + uint32_t *space = (uint32_t *) msgb_push(msg, 4); + osmo_store32be(word, space); +} + /*! \brief remove (pull) a header from the front of the message buffer * \param[in] msgb message buffer * \param[in] len number of octets to be pulled -- To view, visit https://gerrit.osmocom.org/1237 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7de63e9d04c2d2b678f1f20eef37f9be2c4f5ec2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 18:31:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 18:31:33 +0000 Subject: [MERGED] libosmo-sccp[master]: mtp_parse_test: Comment out unused but defined packets In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: mtp_parse_test: Comment out unused but defined packets ...................................................................... mtp_parse_test: Comment out unused but defined packets Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589 --- M tests/mtp/mtp_parse_test.c 1 file changed, 9 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/tests/mtp/mtp_parse_test.c b/tests/mtp/mtp_parse_test.c index 80f1e4b..75650a3 100644 --- a/tests/mtp/mtp_parse_test.c +++ b/tests/mtp/mtp_parse_test.c @@ -26,13 +26,17 @@ 0x61, 0x72, 0x62, 0x61, 0x6e, 0x6f, 0x62, 0x61, 0x72, 0x6e, 0x61, 0x62, 0x6f }; -static const unsigned char pkt2[] = { -0x81, 0x5b, 0x00, 0x22, 0x00, 0x11, 0xe0, 0x41, +static const unsigned char pkt3[] = { +0x81, 0x88, 0xc0, 0x16, 0x00, 0x21, 0xe0, 0x41, 0x6d, 0x69, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x64, 0x72, 0x61, 0x00, 0x00 }; -static const unsigned char pkt3[] = { -0x81, 0x88, 0xc0, 0x16, 0x00, 0x21, 0xe0, 0x41, +static const unsigned char pkt7[] = { +0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x56, 0x00 }; + +#if 0 +static const unsigned char pkt2[] = { +0x81, 0x5b, 0x00, 0x22, 0x00, 0x11, 0xe0, 0x41, 0x6d, 0x69, 0x74, 0x20, 0x43, 0x68, 0x61, 0x6e, 0x64, 0x72, 0x61, 0x00, 0x00 }; @@ -48,9 +52,6 @@ static const unsigned char pkt6[] = { 0x80, 0x5b, 0x00, 0x22, 0x00, 0x17 }; - -static const unsigned char pkt7[] = { -0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x56, 0x00 }; static const unsigned char pkt8[] = { 0x80, 0x88, 0xc0, 0x16, 0x00, 0x14, 0x00, 0x00 }; @@ -463,6 +464,7 @@ 0x83, 0x88, 0xc0, 0x16, 0x60, 0x09, 0x00, 0x03, 0x07, 0x0b, 0x04, 0x43, 0x88, 0x00, 0xfe, 0x04, 0x43, 0x5b, 0x00, 0xfe, 0x03, 0x00, 0x01, 0x31 }; +#endif static struct mtp_test tests[] = { { -- To view, visit https://gerrit.osmocom.org/1232 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I837eee6cc6e2bdea65988b19d9e15601eda44589 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 20:21:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 20:21:22 +0000 Subject: [PATCH] openbsc[master]: RBS2000: Avoid segfault if ts->lapd instance doesn't exist Message-ID: Review at https://gerrit.osmocom.org/1238 RBS2000: Avoid segfault if ts->lapd instance doesn't exist This happens e.g. with DAHDI driver, when the DAHDI device cannot be opened. Let's not prematurely seg-fault early in the RBS2000 signal handler, but take the proper error handlign for this. Change-Id: I9223fb1568d3db7e278f07240c4be334c6602a13 --- M openbsc/src/libbsc/bts_ericsson_rbs2000.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/1238/1 diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index 1300b4a..faf6f05 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -71,6 +71,8 @@ continue; llist_for_each_entry(link, &ts->sign.sign_links, list) { + if (!ts->lapd) + continue; lapd_instance_set_profile(ts->lapd, &lapd_profile_abis_ericsson); -- To view, visit https://gerrit.osmocom.org/1238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9223fb1568d3db7e278f07240c4be334c6602a13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 20:21:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 20:21:22 +0000 Subject: [PATCH] openbsc[master]: RBS2000: Ensure the is-connection-list command is only used ... Message-ID: Review at https://gerrit.osmocom.org/1239 RBS2000: Ensure the is-connection-list command is only used on RBS2000 ... and not on other BTS models. Change-Id: I8882ca9a9ab974b0bbdcbd5c3bab0eadf4bc0927 --- M openbsc/src/libbsc/abis_om2000_vty.c 1 file changed, 6 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/39/1239/1 diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index d48ff95..64d205c 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -348,6 +348,12 @@ uint8_t ci = atoi(argv[3]); struct is_conn_group *grp, *grp2; + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% IS MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!strcmp(argv[0], "add")) { grp = talloc_zero(bts, struct is_conn_group); grp->icp1 = icp1; -- To view, visit https://gerrit.osmocom.org/1239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8882ca9a9ab974b0bbdcbd5c3bab0eadf4bc0927 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 20:21:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 20:21:22 +0000 Subject: [PATCH] openbsc[master]: WIP: Support configuration of CON MO Groups/Paths from VTY Message-ID: Review at https://gerrit.osmocom.org/1240 WIP: Support configuration of CON MO Groups/Paths from VTY Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 --- M openbsc/include/openbsc/abis_om2000.h M openbsc/include/openbsc/vty.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/abis_om2000_vty.c M openbsc/src/libcommon/common_vty.c 5 files changed, 236 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/1240/1 diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index c745112..b093a03 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -56,6 +56,39 @@ uint8_t ci; }; +/* on-wire format for CON Path */ +struct om2k_con_path { + uint16_t ccp; + uint8_t ci; + uint8_t tag; + uint8_t tei; +} __attribute__ ((packed)); + +/* internal data format for CON group */ +struct con_group { + /* links list of CON groups in BTS */ + struct llist_head list; + struct gsm_bts *bts; + /* CON Group ID */ + uint8_t cg; + /* list of CON paths in this group */ + struct llist_head paths; +}; + +/* internal data format for CON path */ +struct con_path { + /* links with con_group.paths */ + struct llist_head list; + /* CON Connection Point */ + uint16_t ccp; + /* Contiguity Index */ + uint8_t ci; + /* Tag */ + uint8_t tag; + /* TEI */ + uint8_t tei; +}; + extern const struct abis_om2k_mo om2k_mo_cf; extern const struct abis_om2k_mo om2k_mo_is; extern const struct abis_om2k_mo om2k_mo_con; diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index 315db0d..ad2cd2a 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -29,6 +29,7 @@ NAT_BSC_NODE, MSC_NODE, OM2K_NODE, + OM2K_CON_GROUP_NODE, TRUNK_NODE, PGROUP_NODE, MNCC_INT_NODE, diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 8c4bfb3..2733a90 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1132,20 +1132,48 @@ return abis_om2k_sendmsg(bts, msg); } -int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, - unsigned int len) +int abis_om2k_tx_con_conf_req(struct gsm_bts *bts) { struct msgb *msg = om2k_msgb_alloc(); struct abis_om2k_hdr *o2k; + struct con_group *grp; + unsigned int num_grps = 0; - o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); + /* count number of groups in linked list */ + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) + num_grps++; + + if (!num_grps) + return -EINVAL; + + /* first build the value part of the OM2K_DEI_CON_CONN_LIST DEI */ + msgb_put_u8(msg, num_grps); + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) { + struct con_path *cp; + unsigned int num_paths = 0; + llist_for_each_entry(cp, &grp->paths, list) + num_paths++; + msgb_put_u8(msg, num_paths); + llist_for_each_entry(cp, &grp->paths, list) { + struct om2k_con_path *om2k_cp; + om2k_cp = (struct om2k_con_path *) msgb_put(msg, sizeof(*om2k_cp)); + om2k_cp->ccp = htons(cp->ccp); + om2k_cp->ci = cp->ci; + om2k_cp->tag = cp->tag; + om2k_cp->tei = cp->tei; + } + } + msgb_push_u8(msg, msgb_length(msg)); + msgb_push_u8(msg, OM2K_DEI_CON_CONN_LIST); + + /* pre-pend the list number DEIs */ + msgb_tv_push(msg, OM2K_DEI_END_LIST_NR, 1); + msgb_tv_push(msg, OM2K_DEI_LIST_NR, 1); + + /* pre-pend the OM2K header */ + o2k = (struct abis_om2k_hdr *) msgb_push(msg, sizeof(*o2k)); fill_om2k_hdr(o2k, &bts->rbs2000.con.om2k_mo.addr, OM2K_MSGT_CON_CONF_REQ); - - msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); - msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); - - msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&bts->rbs2000.con.om2k_mo.addr), @@ -1566,8 +1594,7 @@ abis_om2k_tx_is_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_CON: - /* TODO */ - //abis_om2k_tx_con_conf_req(omfp->trx->bts, data, len); + abis_om2k_tx_con_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_TX: abis_om2k_tx_tx_conf_req(omfp->trx); @@ -2061,6 +2088,7 @@ OM2K_BTS_EVT_START, OM2K_BTS_EVT_CF_DONE, OM2K_BTS_EVT_IS_DONE, + OM2K_BTS_EVT_CON_DONE, OM2K_BTS_EVT_TF_DONE, OM2K_BTS_EVT_TRX_DONE, OM2K_BTS_EVT_STOP, @@ -2070,6 +2098,7 @@ { OM2K_BTS_EVT_START, "START" }, { OM2K_BTS_EVT_CF_DONE, "CF-DONE" }, { OM2K_BTS_EVT_IS_DONE, "IS-DONE" }, + { OM2K_BTS_EVT_CON_DONE, "CON-DONE" }, { OM2K_BTS_EVT_TF_DONE, "TF-DONE" }, { OM2K_BTS_EVT_TRX_DONE, "TRX-DONE" }, { OM2K_BTS_EVT_STOP, "STOP" }, @@ -2080,6 +2109,7 @@ OM2K_BTS_S_INIT, OM2K_BTS_S_WAIT_CF, OM2K_BTS_S_WAIT_IS, + OM2K_BTS_S_WAIT_CON, OM2K_BTS_S_WAIT_TF, OM2K_BTS_S_WAIT_TRX, OM2K_BTS_S_DONE, @@ -2121,6 +2151,18 @@ struct gsm_bts *bts = obfp->bts; OSMO_ASSERT(event == OM2K_BTS_EVT_IS_DONE); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_CON, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_CON_DONE, bts->c0, + &bts->rbs2000.con.om2k_mo); +} + +static void om2k_bts_s_wait_con(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_CON_DONE); /* TF can take a long time to initialize, wait for 10min */ osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TF, 600, 0); om2k_mo_fsm_start(fi, OM2K_BTS_EVT_TF_DONE, bts->c0, @@ -2178,10 +2220,17 @@ [OM2K_BTS_S_WAIT_IS] = { .in_event_mask = S(OM2K_BTS_EVT_IS_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | - S(OM2K_BTS_S_WAIT_TF), + S(OM2K_BTS_S_WAIT_CON), .name = "WAIT-IS", .action = om2k_bts_s_wait_is, }, + [OM2K_BTS_S_WAIT_CON] = { + .in_event_mask = S(OM2K_BTS_EVT_CON_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TF), + .name = "WAIT-CON", + .action = om2k_bts_s_wait_con, + }, [OM2K_BTS_S_WAIT_TF] = { .in_event_mask = S(OM2K_BTS_EVT_TF_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 64d205c..b68a8ea 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -48,9 +48,18 @@ 1, }; +static struct cmd_node om2k_con_group_node = { + OM2K_CON_GROUP_NODE, + "%s(om2k-con-group)# ", + 1, +}; + +struct con_group; + struct oml_node_state { struct gsm_bts *bts; struct abis_om2k_mo mo; + struct con_group *cg; }; static int dummy_config_write(struct vty *v) @@ -246,65 +255,112 @@ return CMD_SUCCESS; } - -struct con_conn_group { - struct llist_head list; - - uint8_t cg; - uint16_t ccp; - uint8_t tag; - uint8_t tei; -}; - -static void add_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static struct con_group *con_group_find_or_create(struct gsm_bts *bts, uint8_t cg) { - struct con_conn_group *ent = talloc_zero(bts, struct con_conn_group); + struct con_group *ent; + llist_for_each_entry(ent, &bts->rbs2000.con.conn_groups, list) { + if (ent->cg == cg) + return ent; + } + + ent = talloc_zero(bts, struct con_group); + ent->bts = bts; ent->cg = cg; - ent->ccp = ccp; - ent->tag = tag; - ent->tei = tei; - + INIT_LLIST_HEAD(&ent->paths); llist_add_tail(&ent->list, &bts->rbs2000.con.conn_groups); + + return ent; } -static int del_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static int con_group_del(struct gsm_bts *bts, uint8_t cg_id) { - struct con_conn_group *grp, *grp2; + struct con_group *cg, *cg2; - llist_for_each_entry_safe(grp, grp2, &bts->rbs2000.con.conn_groups, list) { - if (grp->cg == cg && grp->ccp == ccp && grp->tag == tag - && grp->tei == tei) { - llist_del(&grp->list); - talloc_free(grp); + llist_for_each_entry_safe(cg, cg2, &bts->rbs2000.con.conn_groups, list) { + if (cg->cg == cg_id) { + llist_del(&cg->list); + talloc_free(cg); + return 0; + }; + } + return -ENOENT; +} + +static void con_group_add_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp = talloc_zero(cg, struct con_path); + + cp->ccp = ccp; + cp->ci = ci; + cp->tag = tag; + cp->tei = tei; + llist_add(&cp->list, &cg->paths); +} + +static int con_group_del_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp, *cp2; + llist_for_each_entry_safe(cp, cp2, &cg->paths, list) { + if (cp->ccp == ccp && cp->ci == ci && cp->tag == tag && + cp->tei == tei) { + llist_del(&cp->list); + talloc_free(cp); return 0; } } return -ENOENT; } -#define CON_LIST_HELP "CON connetiton list\n" \ - "Add entry to CON list\n" \ - "Delete entry from CON list\n" \ - "Connection Group Number\n" \ - "CON Connection Point\n" \ - -DEFUN(om2k_con_list_dec, om2k_con_list_dec_cmd, - "con-connection-list (add|del) <1-255> <0-1023> deconcentrated", - CON_LIST_HELP "De-concentrated in/outlet\n") +DEFUN(cfg_om2k_con_group, cfg_om2k_con_group_cmd, + "con-connection-group <1-31>", + "Configure a CON (Concentrator) Connection Group\n" + "CON Connection Group Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); + struct gsm_bts *bts = vty->index; + struct con_group *cg; + uint8_t cgid = atoi(argv[0]); + + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% CON MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + cg = con_group_find_or_create(bts, cgid); + if (!cg) { + vty_out(vty, "%% Cannot create CON Group%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + vty->node = OM2K_CON_GROUP_NODE; + vty->index = cg; + + return CMD_SUCCESS; +} + +#define CON_PATH_HELP "CON Path (In/Out)\n" \ + "Add CON Path to Concentration Group\n" \ + "Delete CON Path from Concentration Group\n" \ + "Contiguity Index\n" \ + +DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, + "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") +{ + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tei = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, 0, 0xff); + con_group_add_path(cg, ccp, ci, 0, tei); else { - if (del_con_list(bts, cg, ccp, 0, 0xff) < 0) { - vty_out(vty, "%% No matching CON list entry%s", + if (con_group_del_path(cg, ccp, ci, 0, tei) < 0) { + vty_out(vty, "%% No matching CON Path%s", VTY_NEWLINE); return CMD_WARNING; } @@ -313,20 +369,19 @@ return CMD_SUCCESS; } -DEFUN(om2k_con_list_tei, om2k_con_list_tei_cmd, - "con-connection-list (add|del) <1-255> <0-1023> tei <0-63>", - CON_LIST_HELP "Concentrated in/outlet with TEI\n" "TEI Number\n") +DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, + "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); - uint8_t tei = atoi(argv[3]); + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tag = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, cg, tei); + con_group_add_path(cg, ccp, ci, tag, 0xff); else { - if (del_con_list(bts, cg, ccp, cg, tei) < 0) { + if (con_group_del_path(cg, ccp, ci, tag, 0xff) < 0) { vty_out(vty, "%% No matching CON list entry%s", VTY_NEWLINE); return CMD_WARNING; @@ -437,22 +492,35 @@ return CMD_SUCCESS; } +static void dump_con_group(struct vty *vty, struct con_group *cg) +{ + struct con_path *cp; + + llist_for_each_entry(cp, &cg->paths, list) { + vty_out(vty, " con-path add %u %u ", cp->ccp, cp->ci); + if (cp->tei == 0xff) { + vty_out(vty, "concentrated %u%s", cp->tag, + VTY_NEWLINE); + } else { + vty_out(vty, "deconcentrated %u%s", cp->tei, + VTY_NEWLINE); + } + } +} + void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts) { struct is_conn_group *igrp; - struct con_conn_group *cgrp; + struct con_group *cgrp; llist_for_each_entry(igrp, &bts->rbs2000.is.conn_groups, list) vty_out(vty, " is-connection-list add %u %u %u%s", igrp->icp1, igrp->icp2, igrp->ci, VTY_NEWLINE); llist_for_each_entry(cgrp, &bts->rbs2000.con.conn_groups, list) { - vty_out(vty, " con-connection-list add %u %u ", - cgrp->cg, cgrp->ccp); - if (cgrp->tei == 0xff) - vty_out(vty, "deconcentrated%s", VTY_NEWLINE); - else - vty_out(vty, "tei %u%s", cgrp->tei, VTY_NEWLINE); + vty_out(vty, " con-connection-group %u%s", cgrp->cg, + VTY_NEWLINE); + dump_con_group(vty, cgrp); } } @@ -474,10 +542,14 @@ install_element(OM2K_NODE, &om2k_test_cmd); install_element(OM2K_NODE, &om2k_cap_req_cmd); install_element(OM2K_NODE, &om2k_conf_req_cmd); - install_element(OM2K_NODE, &om2k_con_list_dec_cmd); - install_element(OM2K_NODE, &om2k_con_list_tei_cmd); + + install_node(&om2k_con_group_node, dummy_config_write); + vty_install_default(OM2K_CON_GROUP_NODE); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_dec_cmd); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_conc_cmd); install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd); + install_element(BTS_NODE, &cfg_om2k_con_group_cmd); return 0; } diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0..834da51 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,15 @@ talloc_free(vty->index); vty->index = NULL; break; + case OM2K_CON_GROUP_NODE: + vty->node = BTS_NODE; + { + struct con_group *cg = vty->index; + struct gsm_bts *bts = cg->bts; + vty->index = bts; + vty->index_sub = &bts->description; + } + break; case NAT_BSC_NODE: vty->node = NAT_NODE; { -- To view, visit https://gerrit.osmocom.org/1240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 11 20:22:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 11 Nov 2016 20:22:43 +0000 Subject: [PATCH] openbsc[master]: Support configuration of CON MO Groups/Paths from VTY In-Reply-To: References: Message-ID: Support configuration of CON MO Groups/Paths from VTY The code for supporting the configuration of the OM2000 CON (LAPD Concentrator) MO was so far incomplete and not used from the OM2000 FSM initialization. This patch adds * VTY commands for configuration of CON Groups and Paths * The FSM integration to actually configure the CON MO Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 --- M openbsc/include/openbsc/abis_om2000.h M openbsc/include/openbsc/vty.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/abis_om2000_vty.c M openbsc/src/libcommon/common_vty.c 5 files changed, 236 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/1240/2 diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index c745112..b093a03 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -56,6 +56,39 @@ uint8_t ci; }; +/* on-wire format for CON Path */ +struct om2k_con_path { + uint16_t ccp; + uint8_t ci; + uint8_t tag; + uint8_t tei; +} __attribute__ ((packed)); + +/* internal data format for CON group */ +struct con_group { + /* links list of CON groups in BTS */ + struct llist_head list; + struct gsm_bts *bts; + /* CON Group ID */ + uint8_t cg; + /* list of CON paths in this group */ + struct llist_head paths; +}; + +/* internal data format for CON path */ +struct con_path { + /* links with con_group.paths */ + struct llist_head list; + /* CON Connection Point */ + uint16_t ccp; + /* Contiguity Index */ + uint8_t ci; + /* Tag */ + uint8_t tag; + /* TEI */ + uint8_t tei; +}; + extern const struct abis_om2k_mo om2k_mo_cf; extern const struct abis_om2k_mo om2k_mo_is; extern const struct abis_om2k_mo om2k_mo_con; diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index 315db0d..ad2cd2a 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -29,6 +29,7 @@ NAT_BSC_NODE, MSC_NODE, OM2K_NODE, + OM2K_CON_GROUP_NODE, TRUNK_NODE, PGROUP_NODE, MNCC_INT_NODE, diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 8c4bfb3..2733a90 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1132,20 +1132,48 @@ return abis_om2k_sendmsg(bts, msg); } -int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, - unsigned int len) +int abis_om2k_tx_con_conf_req(struct gsm_bts *bts) { struct msgb *msg = om2k_msgb_alloc(); struct abis_om2k_hdr *o2k; + struct con_group *grp; + unsigned int num_grps = 0; - o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); + /* count number of groups in linked list */ + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) + num_grps++; + + if (!num_grps) + return -EINVAL; + + /* first build the value part of the OM2K_DEI_CON_CONN_LIST DEI */ + msgb_put_u8(msg, num_grps); + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) { + struct con_path *cp; + unsigned int num_paths = 0; + llist_for_each_entry(cp, &grp->paths, list) + num_paths++; + msgb_put_u8(msg, num_paths); + llist_for_each_entry(cp, &grp->paths, list) { + struct om2k_con_path *om2k_cp; + om2k_cp = (struct om2k_con_path *) msgb_put(msg, sizeof(*om2k_cp)); + om2k_cp->ccp = htons(cp->ccp); + om2k_cp->ci = cp->ci; + om2k_cp->tag = cp->tag; + om2k_cp->tei = cp->tei; + } + } + msgb_push_u8(msg, msgb_length(msg)); + msgb_push_u8(msg, OM2K_DEI_CON_CONN_LIST); + + /* pre-pend the list number DEIs */ + msgb_tv_push(msg, OM2K_DEI_END_LIST_NR, 1); + msgb_tv_push(msg, OM2K_DEI_LIST_NR, 1); + + /* pre-pend the OM2K header */ + o2k = (struct abis_om2k_hdr *) msgb_push(msg, sizeof(*o2k)); fill_om2k_hdr(o2k, &bts->rbs2000.con.om2k_mo.addr, OM2K_MSGT_CON_CONF_REQ); - - msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); - msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); - - msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&bts->rbs2000.con.om2k_mo.addr), @@ -1566,8 +1594,7 @@ abis_om2k_tx_is_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_CON: - /* TODO */ - //abis_om2k_tx_con_conf_req(omfp->trx->bts, data, len); + abis_om2k_tx_con_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_TX: abis_om2k_tx_tx_conf_req(omfp->trx); @@ -2061,6 +2088,7 @@ OM2K_BTS_EVT_START, OM2K_BTS_EVT_CF_DONE, OM2K_BTS_EVT_IS_DONE, + OM2K_BTS_EVT_CON_DONE, OM2K_BTS_EVT_TF_DONE, OM2K_BTS_EVT_TRX_DONE, OM2K_BTS_EVT_STOP, @@ -2070,6 +2098,7 @@ { OM2K_BTS_EVT_START, "START" }, { OM2K_BTS_EVT_CF_DONE, "CF-DONE" }, { OM2K_BTS_EVT_IS_DONE, "IS-DONE" }, + { OM2K_BTS_EVT_CON_DONE, "CON-DONE" }, { OM2K_BTS_EVT_TF_DONE, "TF-DONE" }, { OM2K_BTS_EVT_TRX_DONE, "TRX-DONE" }, { OM2K_BTS_EVT_STOP, "STOP" }, @@ -2080,6 +2109,7 @@ OM2K_BTS_S_INIT, OM2K_BTS_S_WAIT_CF, OM2K_BTS_S_WAIT_IS, + OM2K_BTS_S_WAIT_CON, OM2K_BTS_S_WAIT_TF, OM2K_BTS_S_WAIT_TRX, OM2K_BTS_S_DONE, @@ -2121,6 +2151,18 @@ struct gsm_bts *bts = obfp->bts; OSMO_ASSERT(event == OM2K_BTS_EVT_IS_DONE); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_CON, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_CON_DONE, bts->c0, + &bts->rbs2000.con.om2k_mo); +} + +static void om2k_bts_s_wait_con(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_CON_DONE); /* TF can take a long time to initialize, wait for 10min */ osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TF, 600, 0); om2k_mo_fsm_start(fi, OM2K_BTS_EVT_TF_DONE, bts->c0, @@ -2178,10 +2220,17 @@ [OM2K_BTS_S_WAIT_IS] = { .in_event_mask = S(OM2K_BTS_EVT_IS_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | - S(OM2K_BTS_S_WAIT_TF), + S(OM2K_BTS_S_WAIT_CON), .name = "WAIT-IS", .action = om2k_bts_s_wait_is, }, + [OM2K_BTS_S_WAIT_CON] = { + .in_event_mask = S(OM2K_BTS_EVT_CON_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TF), + .name = "WAIT-CON", + .action = om2k_bts_s_wait_con, + }, [OM2K_BTS_S_WAIT_TF] = { .in_event_mask = S(OM2K_BTS_EVT_TF_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 64d205c..b68a8ea 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -48,9 +48,18 @@ 1, }; +static struct cmd_node om2k_con_group_node = { + OM2K_CON_GROUP_NODE, + "%s(om2k-con-group)# ", + 1, +}; + +struct con_group; + struct oml_node_state { struct gsm_bts *bts; struct abis_om2k_mo mo; + struct con_group *cg; }; static int dummy_config_write(struct vty *v) @@ -246,65 +255,112 @@ return CMD_SUCCESS; } - -struct con_conn_group { - struct llist_head list; - - uint8_t cg; - uint16_t ccp; - uint8_t tag; - uint8_t tei; -}; - -static void add_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static struct con_group *con_group_find_or_create(struct gsm_bts *bts, uint8_t cg) { - struct con_conn_group *ent = talloc_zero(bts, struct con_conn_group); + struct con_group *ent; + llist_for_each_entry(ent, &bts->rbs2000.con.conn_groups, list) { + if (ent->cg == cg) + return ent; + } + + ent = talloc_zero(bts, struct con_group); + ent->bts = bts; ent->cg = cg; - ent->ccp = ccp; - ent->tag = tag; - ent->tei = tei; - + INIT_LLIST_HEAD(&ent->paths); llist_add_tail(&ent->list, &bts->rbs2000.con.conn_groups); + + return ent; } -static int del_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static int con_group_del(struct gsm_bts *bts, uint8_t cg_id) { - struct con_conn_group *grp, *grp2; + struct con_group *cg, *cg2; - llist_for_each_entry_safe(grp, grp2, &bts->rbs2000.con.conn_groups, list) { - if (grp->cg == cg && grp->ccp == ccp && grp->tag == tag - && grp->tei == tei) { - llist_del(&grp->list); - talloc_free(grp); + llist_for_each_entry_safe(cg, cg2, &bts->rbs2000.con.conn_groups, list) { + if (cg->cg == cg_id) { + llist_del(&cg->list); + talloc_free(cg); + return 0; + }; + } + return -ENOENT; +} + +static void con_group_add_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp = talloc_zero(cg, struct con_path); + + cp->ccp = ccp; + cp->ci = ci; + cp->tag = tag; + cp->tei = tei; + llist_add(&cp->list, &cg->paths); +} + +static int con_group_del_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp, *cp2; + llist_for_each_entry_safe(cp, cp2, &cg->paths, list) { + if (cp->ccp == ccp && cp->ci == ci && cp->tag == tag && + cp->tei == tei) { + llist_del(&cp->list); + talloc_free(cp); return 0; } } return -ENOENT; } -#define CON_LIST_HELP "CON connetiton list\n" \ - "Add entry to CON list\n" \ - "Delete entry from CON list\n" \ - "Connection Group Number\n" \ - "CON Connection Point\n" \ - -DEFUN(om2k_con_list_dec, om2k_con_list_dec_cmd, - "con-connection-list (add|del) <1-255> <0-1023> deconcentrated", - CON_LIST_HELP "De-concentrated in/outlet\n") +DEFUN(cfg_om2k_con_group, cfg_om2k_con_group_cmd, + "con-connection-group <1-31>", + "Configure a CON (Concentrator) Connection Group\n" + "CON Connection Group Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); + struct gsm_bts *bts = vty->index; + struct con_group *cg; + uint8_t cgid = atoi(argv[0]); + + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% CON MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + cg = con_group_find_or_create(bts, cgid); + if (!cg) { + vty_out(vty, "%% Cannot create CON Group%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + vty->node = OM2K_CON_GROUP_NODE; + vty->index = cg; + + return CMD_SUCCESS; +} + +#define CON_PATH_HELP "CON Path (In/Out)\n" \ + "Add CON Path to Concentration Group\n" \ + "Delete CON Path from Concentration Group\n" \ + "Contiguity Index\n" \ + +DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, + "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") +{ + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tei = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, 0, 0xff); + con_group_add_path(cg, ccp, ci, 0, tei); else { - if (del_con_list(bts, cg, ccp, 0, 0xff) < 0) { - vty_out(vty, "%% No matching CON list entry%s", + if (con_group_del_path(cg, ccp, ci, 0, tei) < 0) { + vty_out(vty, "%% No matching CON Path%s", VTY_NEWLINE); return CMD_WARNING; } @@ -313,20 +369,19 @@ return CMD_SUCCESS; } -DEFUN(om2k_con_list_tei, om2k_con_list_tei_cmd, - "con-connection-list (add|del) <1-255> <0-1023> tei <0-63>", - CON_LIST_HELP "Concentrated in/outlet with TEI\n" "TEI Number\n") +DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, + "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); - uint8_t tei = atoi(argv[3]); + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tag = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, cg, tei); + con_group_add_path(cg, ccp, ci, tag, 0xff); else { - if (del_con_list(bts, cg, ccp, cg, tei) < 0) { + if (con_group_del_path(cg, ccp, ci, tag, 0xff) < 0) { vty_out(vty, "%% No matching CON list entry%s", VTY_NEWLINE); return CMD_WARNING; @@ -437,22 +492,35 @@ return CMD_SUCCESS; } +static void dump_con_group(struct vty *vty, struct con_group *cg) +{ + struct con_path *cp; + + llist_for_each_entry(cp, &cg->paths, list) { + vty_out(vty, " con-path add %u %u ", cp->ccp, cp->ci); + if (cp->tei == 0xff) { + vty_out(vty, "concentrated %u%s", cp->tag, + VTY_NEWLINE); + } else { + vty_out(vty, "deconcentrated %u%s", cp->tei, + VTY_NEWLINE); + } + } +} + void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts) { struct is_conn_group *igrp; - struct con_conn_group *cgrp; + struct con_group *cgrp; llist_for_each_entry(igrp, &bts->rbs2000.is.conn_groups, list) vty_out(vty, " is-connection-list add %u %u %u%s", igrp->icp1, igrp->icp2, igrp->ci, VTY_NEWLINE); llist_for_each_entry(cgrp, &bts->rbs2000.con.conn_groups, list) { - vty_out(vty, " con-connection-list add %u %u ", - cgrp->cg, cgrp->ccp); - if (cgrp->tei == 0xff) - vty_out(vty, "deconcentrated%s", VTY_NEWLINE); - else - vty_out(vty, "tei %u%s", cgrp->tei, VTY_NEWLINE); + vty_out(vty, " con-connection-group %u%s", cgrp->cg, + VTY_NEWLINE); + dump_con_group(vty, cgrp); } } @@ -474,10 +542,14 @@ install_element(OM2K_NODE, &om2k_test_cmd); install_element(OM2K_NODE, &om2k_cap_req_cmd); install_element(OM2K_NODE, &om2k_conf_req_cmd); - install_element(OM2K_NODE, &om2k_con_list_dec_cmd); - install_element(OM2K_NODE, &om2k_con_list_tei_cmd); + + install_node(&om2k_con_group_node, dummy_config_write); + vty_install_default(OM2K_CON_GROUP_NODE); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_dec_cmd); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_conc_cmd); install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd); + install_element(BTS_NODE, &cfg_om2k_con_group_cmd); return 0; } diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0..834da51 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,15 @@ talloc_free(vty->index); vty->index = NULL; break; + case OM2K_CON_GROUP_NODE: + vty->node = BTS_NODE; + { + struct con_group *cg = vty->index; + struct gsm_bts *bts = cg->bts; + vty->index = bts; + vty->index_sub = &bts->description; + } + break; case NAT_BSC_NODE: vty->node = NAT_NODE; { -- To view, visit https://gerrit.osmocom.org/1240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 11 21:19:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 11 Nov 2016 21:19:24 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: tweak README Message-ID: Review at https://gerrit.osmocom.org/1241 cosmetic: tweak README I noticed that the README is prominently shown on github, so it makes sense to get rid of the worst typos and misinformation there. Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb --- M README 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/1241/1 diff --git a/README b/README index 967b080..897dae8 100644 --- a/README +++ b/README @@ -1,26 +1,29 @@ -Repository forw the Osmocom BTS implementation. += Repository for the Osmocom BTS implementation. = -This code implementes the Layer 2 and higher of a more or less -conventional GSM BTS (Base Transceiver Station) - however, using an -Abis/IP interface, rather than the old-fashioned E1/T1. +For most complete and accurate information, please refer to +https://osmocom.org/projects/osmobts/wiki + +To submit patches, please refer to +https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit +(Note: github pull requests are rejected by a bot) + +== Summary == + +This code implements Layer 2 and higher of a more or less conventional GSM BTS +(Base Transceiver Station) - however, using an Abis/IP interface, rather than +the old-fashioned E1/T1. Specifically, this includes - * BTS-Side implementation of TS 08.58 (RSL) and TS 12.21 (OML) - * BTS-Side implementation of LAPDm (using libosmocore/libosmogsm) - * A somewhat separated interface between those higher layer parts - and the Layer1 interface. + * BTS-side implementation of TS 08.58 (RSL) and TS 12.21 (OML) + * BTS-side implementation of LAPDm (using libosmocore/libosmogsm) + * A somewhat separated interface between those higher layer parts and the + Layer1 interface. -Right now, only one hardware and Layer1 are supported: The sysmocom -sysmoBTS. - -There is some experimental and way incomplete code to use a couple of -OsmocomBB phones and run them in the BTS. However, the required code -for the Calypso DSP code have not been written yet. This would still -require a lot of work. - -Some additional work is being done in using some parts of the OpenBTS -L1FEC and glue it against omso-bts. This code is called osmo-trx and -requires the jolly/trx branch of this repository. +Several kinds of BTS hardware are supported: + * sysmocom sysmoBTS + * Octasic octphy + * Nutaq litecell 1.5 + * software-defined radio based osmo-bts-trx (e.g. BS210) == Known Limitations == @@ -52,5 +55,3 @@ * Doesn't yet include MAC address in Abis/IP Identity message * MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power and ciphering. The dispatch should take a look at the hLayer3. - - -- To view, visit https://gerrit.osmocom.org/1241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: Add empty libcommon-cs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1123 to look at the new patch set (#2). Add empty libcommon-cs This will gradually soak up code shared by libbsc and libmsc. Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/common_cs.h M openbsc/src/Makefile.am A openbsc/src/libcommon-cs/Makefile.am A openbsc/src/libcommon-cs/common_cs.c A openbsc/src/libcommon-cs/common_cs_vty.c 7 files changed, 62 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/1123/2 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index b18ecc1..093d42f 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -214,6 +214,7 @@ src/libcommon/Makefile src/libfilter/Makefile src/libiu/Makefile + src/libcommon-cs/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 5737a4b..759df7e 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -82,6 +82,7 @@ vty.h \ v42bis.h \ v42bis_private.h \ + common_cs.h \ $(NULL) openbsc_HEADERS = \ diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/openbsc/include/openbsc/common_cs.h @@ -0,0 +1 @@ +#pragma once diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 272292a..cfad7df 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -27,6 +27,7 @@ libmsc \ libtrau \ libfilter \ + libcommon-cs \ $(NULL) # Conditional Libraries diff --git a/openbsc/src/libcommon-cs/Makefile.am b/openbsc/src/libcommon-cs/Makefile.am new file mode 100644 index 0000000..f3921ba --- /dev/null +++ b/openbsc/src/libcommon-cs/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +noinst_LIBRARIES = libcommon-cs.a + +libcommon_cs_a_SOURCES = \ + common_cs.c \ + common_cs_vty.c diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: define mncc_recv_cb_t to avoid code dup In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1124 to look at the new patch set (#2). define mncc_recv_cb_t to avoid code dup Put mncc_recv_cb_t in common_cs.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include common_cs.h (future knowledge). Since I will need to use mncc_recv_cb_t in common_cs.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in common_cs.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c --- M openbsc/include/openbsc/bss.h M openbsc/include/openbsc/common_cs.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/net_init.c 5 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/1124/2 diff --git a/openbsc/include/openbsc/bss.h b/openbsc/include/openbsc/bss.h index 49df547..d73776f 100644 --- a/openbsc/include/openbsc/bss.h +++ b/openbsc/include/openbsc/bss.h @@ -1,11 +1,12 @@ #ifndef _BSS_H_ #define _BSS_H_ -struct gsm_network; +#include + struct msgb; /* start and stop network */ -extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file); +extern int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *cfg_file); extern int bsc_shutdown_net(struct gsm_network *net); /* register all supported BTS */ diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 6f70f09..612d754 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -1 +1,6 @@ #pragma once + +struct msgb; +struct gsm_network; + +typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 70c08c3..fe3fa29 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -14,6 +14,7 @@ #include #include +#include /** annotations for msgb ownership */ #define __uses @@ -308,7 +309,7 @@ /* layer 4 */ struct mncc_sock_state *mncc_state; - int (*mncc_recv) (struct gsm_network *net, struct msgb *msg); + mncc_recv_cb_t mncc_recv; struct llist_head upqueue; struct llist_head trans_list; struct bsc_api *bsc_api; @@ -417,7 +418,7 @@ struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, - int (*mncc_recv)(struct gsm_network *, struct msgb *)); + mncc_recv_cb_t mncc_recv); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index bf6e056..a1becf8 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -475,8 +475,7 @@ return 0; } -int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), - const char *config_file) +int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *config_file) { struct gsm_bts *bts; int rc; diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 57e3599..da13a52 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -26,7 +26,7 @@ struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, - int (*mncc_recv)(struct gsm_network *, struct msgb *)) + mncc_recv_cb_t mncc_recv) { struct gsm_network *net; const char *default_regexp = ".*"; -- To view, visit https://gerrit.osmocom.org/1124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: net init 1: rename to bsc_network_init In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1125 to look at the new patch set (#2). move to libcommon-cs: net init 1: rename to bsc_network_init The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/ipaccess/ipaccess-config.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/net_init.c M openbsc/src/utils/bs11_config.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 7 files changed, 10 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/25/1125/2 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index fe3fa29..ea450be 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -415,7 +415,7 @@ extern void talloc_ctx_init(void *ctx_root); -struct gsm_network *gsm_network_init(void *ctx, +struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, uint16_t network_code, mncc_recv_cb_t mncc_recv); diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 3c2d6cc..06589f7 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -986,7 +986,7 @@ } libosmo_abis_init(tall_ctx_config); - bsc_gsmnet = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!bsc_gsmnet) exit(1); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index a1becf8..214926b 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -36,6 +36,7 @@ #include #include #include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; @@ -481,7 +482,7 @@ int rc; /* initialize our data structures */ - bsc_gsmnet = gsm_network_init(tall_bsc_ctx, 1, 1, mncc_recv); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1, mncc_recv); if (!bsc_gsmnet) return -ENOMEM; diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index da13a52..07a4423 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -17,13 +17,14 @@ * */ +#include #include #include #include #include -struct gsm_network *gsm_network_init(void *ctx, +struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, uint16_t network_code, mncc_recv_cb_t mncc_recv) diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 20b9ed3..ee43a40 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -897,7 +897,7 @@ handle_options(argc, argv); bts_model_bs11_init(); - gsmnet = gsm_network_init(tall_bs11cfg_ctx, 1, 1, NULL); + gsmnet = bsc_network_init(tall_bs11cfg_ctx, 1, 1, NULL); if (!gsmnet) { fprintf(stderr, "Unable to allocate gsm network\n"); exit(1); diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index b4a5fb1..0c730a2 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -66,7 +66,7 @@ printf("Testing the gsm_subscriber chan logic\n"); /* Create a dummy network */ - network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); bts = gsm_bts_alloc(network); diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index e81394f..15248f2 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -122,7 +122,7 @@ static inline void test_si2q_u(void) { struct gsm_bts *bts; - struct gsm_network *network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater UARFCN generation:\n"); if (!network) @@ -149,7 +149,7 @@ static inline void test_si2q_e(void) { struct gsm_bts *bts; - struct gsm_network *network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater EARFCN generation:\n"); if (!network) -- To view, visit https://gerrit.osmocom.org/1125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: net init 2: move bsc_network_init decl... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1126 to look at the new patch set (#2). move to libcommon-cs: net init 2: move bsc_network_init decl to osmo_bsc.h bsc_network_init() is more fit to live in a BSC specific header. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b --- M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/osmo_bsc.h M openbsc/src/ipaccess/ipaccess-config.c M openbsc/src/utils/bs11_config.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 6 files changed, 9 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/1126/2 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index ea450be..d4a4d6d 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -415,11 +415,6 @@ extern void talloc_ctx_init(void *ctx_root); -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); - int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/openbsc/include/openbsc/osmo_bsc.h b/openbsc/include/openbsc/osmo_bsc.h index fd5303d..ada89ea 100644 --- a/openbsc/include/openbsc/osmo_bsc.h +++ b/openbsc/include/openbsc/osmo_bsc.h @@ -46,6 +46,11 @@ struct bsc_filter_state filter_state; }; +struct gsm_network *bsc_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv); + struct bsc_api *osmo_bsc_api(); int bsc_queue_for_msc(struct osmo_bsc_sccp_con *conn, struct msgb *msg); diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 06589f7..83e42f7 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index ee43a40..0d1f0f3 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -32,7 +32,7 @@ #include -#include +#include #include #include #include diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 0c730a2..f0e4732 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 15248f2..b63205b 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: net init 3: actual move In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1127 to look at the new patch set (#3). move to libcommon-cs: net init 3: actual move Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b --- M openbsc/include/openbsc/common_cs.h M openbsc/src/ipaccess/Makefile.am M openbsc/src/libbsc/net_init.c M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc_nat/Makefile.am M openbsc/src/osmo-nitb/Makefile.am M openbsc/src/utils/Makefile.am M openbsc/tests/bsc-nat/Makefile.am M openbsc/tests/bsc/Makefile.am M openbsc/tests/channel/Makefile.am M openbsc/tests/db/Makefile.am M openbsc/tests/gsm0408/Makefile.am M openbsc/tests/subscr/Makefile.am M openbsc/tests/trau/Makefile.am 15 files changed, 84 insertions(+), 35 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/1127/3 diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 612d754..8549a83 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -1,6 +1,13 @@ #pragma once +#include + struct msgb; struct gsm_network; typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); + +struct gsm_network *gsm_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv); diff --git a/openbsc/src/ipaccess/Makefile.am b/openbsc/src/ipaccess/Makefile.am index 784a578..6c4d95c 100644 --- a/openbsc/src/ipaccess/Makefile.am +++ b/openbsc/src/ipaccess/Makefile.am @@ -48,6 +48,7 @@ # FIXME: resolve the bogus dependencies patched around here: ipaccess_config_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBCRYPT) \ diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 07a4423..f728d3f 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -17,12 +17,9 @@ * */ +#include #include -#include #include -#include - -#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -30,11 +27,8 @@ mncc_recv_cb_t mncc_recv) { struct gsm_network *net; - const char *default_regexp = ".*"; - net = talloc_zero(ctx, struct gsm_network); - if (!net) - return NULL; + net = gsm_network_init(ctx, country_code, network_code, mncc_recv); net->bsc_data = talloc_zero(net, struct osmo_bsc_data); if (!net->bsc_data) { @@ -42,27 +36,11 @@ return NULL; } - net->subscr_group = talloc_zero(net, struct gsm_subscriber_group); - if (!net->subscr_group) { - talloc_free(net); - return NULL; - } - - if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, - &default_regexp) != 0) - return NULL; - /* Init back pointer */ net->bsc_data->auto_off_timeout = -1; net->bsc_data->network = net; INIT_LLIST_HEAD(&net->bsc_data->mscs); - net->subscr_group->net = net; - net->auto_create_subscr = true; - net->auto_assign_exten = true; - - net->country_code = country_code; - net->network_code = network_code; net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; @@ -79,22 +57,12 @@ net->handover.pwr_hysteresis = 3; net->handover.max_distance = 9999; - INIT_LLIST_HEAD(&net->trans_list); - INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->bts_list); - INIT_LLIST_HEAD(&net->subscr_conns); /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); - net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); - net->active_calls = osmo_counter_alloc("msc.active_calls"); - net->mncc_recv = mncc_recv; - net->ext_min = GSM_MIN_EXTEN; - net->ext_max = GSM_MAX_EXTEN; gsm_net_update_ctype(net); - - net->dyn_ts_allow_tch_f = true; return net; } diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 99aa0cf..0efec23 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -1,6 +1,8 @@ /* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). * * (C) 2016 by sysmocom s.m.f.c. + * (C) 2008-2010 by Harald Welte + * (C) 2014 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -17,3 +19,64 @@ * along with this program. If not, see . * */ + +#include + +#include + +#include +#include +#include + +/* Warning: if bsc_network_init() is not called, some of the members of + * gsm_network are not initialized properly and must not be used! (In + * particular the llist heads and stats counters.) + * The long term aim should be to have entirely separate structs for libbsc and + * libmsc with some common general items. + */ +struct gsm_network *gsm_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv) +{ + struct gsm_network *net; + + const char *default_regexp = ".*"; + + net = talloc_zero(ctx, struct gsm_network); + if (!net) + return NULL; + + net->subscr_group = talloc_zero(net, struct gsm_subscriber_group); + if (!net->subscr_group) { + talloc_free(net); + return NULL; + } + + if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, + &default_regexp) != 0) + return NULL; + + net->subscr_group->net = net; + net->auto_create_subscr = true; + net->auto_assign_exten = true; + + net->country_code = country_code; + net->network_code = network_code; + + INIT_LLIST_HEAD(&net->trans_list); + INIT_LLIST_HEAD(&net->upqueue); + INIT_LLIST_HEAD(&net->subscr_conns); + + /* init statistics */ + net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + net->active_calls = osmo_counter_alloc("msc.active_calls"); + + net->mncc_recv = mncc_recv; + net->ext_min = GSM_MIN_EXTEN; + net->ext_max = GSM_MAX_EXTEN; + + net->dyn_ts_allow_tch_f = true; + + return net; +} diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index 2dbfeb8..6f836b0 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -41,6 +41,7 @@ osmo_bsc_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/openbsc/src/osmo-bsc_nat/Makefile.am index 6027f27..141b892 100644 --- a/openbsc/src/osmo-bsc_nat/Makefile.am +++ b/openbsc/src/osmo-bsc_nat/Makefile.am @@ -42,6 +42,7 @@ osmo_bsc_nat_LDADD = \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libfilter/libfilter.a \ diff --git a/openbsc/src/osmo-nitb/Makefile.am b/openbsc/src/osmo-nitb/Makefile.am index 60514c0..2a6d2fc 100644 --- a/openbsc/src/osmo-nitb/Makefile.am +++ b/openbsc/src/osmo-nitb/Makefile.am @@ -29,6 +29,7 @@ osmo_nitb_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/src/utils/Makefile.am b/openbsc/src/utils/Makefile.am index 7fcc4e3..6fe840c 100644 --- a/openbsc/src/utils/Makefile.am +++ b/openbsc/src/utils/Makefile.am @@ -50,6 +50,7 @@ bs11_config_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/bsc-nat/Makefile.am b/openbsc/tests/bsc-nat/Makefile.am index fa55d27..40be3a3 100644 --- a/openbsc/tests/bsc-nat/Makefile.am +++ b/openbsc/tests/bsc-nat/Makefile.am @@ -44,6 +44,7 @@ bsc_nat_test_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/bsc/Makefile.am b/openbsc/tests/bsc/Makefile.am index ddfa437..9de4145 100644 --- a/openbsc/tests/bsc/Makefile.am +++ b/openbsc/tests/bsc/Makefile.am @@ -33,6 +33,7 @@ bsc_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am index 5654572..5e9583f 100644 --- a/openbsc/tests/channel/Makefile.am +++ b/openbsc/tests/channel/Makefile.am @@ -26,6 +26,7 @@ channel_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ diff --git a/openbsc/tests/db/Makefile.am b/openbsc/tests/db/Makefile.am index c4da31c..0eed5cd 100644 --- a/openbsc/tests/db/Makefile.am +++ b/openbsc/tests/db/Makefile.am @@ -35,6 +35,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ @@ -45,4 +46,3 @@ $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) - diff --git a/openbsc/tests/gsm0408/Makefile.am b/openbsc/tests/gsm0408/Makefile.am index 11fa6b9..9739ee9 100644 --- a/openbsc/tests/gsm0408/Makefile.am +++ b/openbsc/tests/gsm0408/Makefile.am @@ -25,6 +25,7 @@ gsm0408_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/subscr/Makefile.am b/openbsc/tests/subscr/Makefile.am index fb863d8..52e7947 100644 --- a/openbsc/tests/subscr/Makefile.am +++ b/openbsc/tests/subscr/Makefile.am @@ -33,6 +33,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/trau/Makefile.am b/openbsc/tests/trau/Makefile.am index 93ce88e..a446f79 100644 --- a/openbsc/tests/trau/Makefile.am +++ b/openbsc/tests/trau/Makefile.am @@ -33,6 +33,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ -- To view, visit https://gerrit.osmocom.org/1127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If06316b97002390dc9a434686750cb96193ea63b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_crea... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1128 to look at the new patch set (#3). move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej() Used by libbsc, libmsc as well as osmo-bsc and osmo-bsc_nat. Moving gsm48_create* to libcommon-cs affects linking of osmo-bsc_nat, resulting in undefined references to gsm48_extract_mi() and gsm48_paging_extract_mi(); fix that by placing libfilter.a left of libbsc.a upon linker invocation. Change-Id: I212c2567b56191022b683674c1c4daf842839946 --- M openbsc/src/libbsc/gsm_04_08_utils.c M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/osmo-bsc_nat/Makefile.am 3 files changed, 34 insertions(+), 34 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/1128/3 diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c index 46df108..98f0790 100644 --- a/openbsc/src/libbsc/gsm_04_08_utils.c +++ b/openbsc/src/libbsc/gsm_04_08_utils.c @@ -634,39 +634,6 @@ return 0; } -struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) -{ - struct msgb *msg; - struct gsm48_hdr *gh; - - msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ"); - if (!msg) - return NULL; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_MM; - gh->msg_type = GSM48_MT_MM_CM_SERV_REJ; - gh->data[0] = value; - - return msg; -} - -struct msgb *gsm48_create_loc_upd_rej(uint8_t cause) -{ - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ"); - if (!msg) - return NULL; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_MM; - gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT; - gh->data[0] = cause; - return msg; -} - /* 9.2.5 CM service accept */ int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) { diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 0efec23..8d09b7e 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -80,3 +80,36 @@ return net; } + +struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) +{ + struct msgb *msg; + struct gsm48_hdr *gh; + + msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ"); + if (!msg) + return NULL; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_REJ; + gh->data[0] = value; + + return msg; +} + +struct msgb *gsm48_create_loc_upd_rej(uint8_t cause) +{ + struct gsm48_hdr *gh; + struct msgb *msg; + + msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ"); + if (!msg) + return NULL; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT; + gh->data[0] = cause; + return msg; +} diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/openbsc/src/osmo-bsc_nat/Makefile.am index 141b892..be33d28 100644 --- a/openbsc/src/osmo-bsc_nat/Makefile.am +++ b/openbsc/src/osmo-bsc_nat/Makefile.am @@ -41,11 +41,11 @@ osmo_bsc_nat_LDADD = \ $(top_builddir)/src/libmgcp/libmgcp.a \ + $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(top_builddir)/src/libfilter/libfilter.a \ $(LIBOSMOSCCP_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/1128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I212c2567b56191022b683674c1c4daf842839946 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: factor out gen of USSD notify and rele... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1129 to look at the new patch set (#4). move to libcommon-cs: factor out gen of USSD notify and release complete Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() functions, since there will be distinct subscriber connection structs. The current functions live in libmsc, so add the same in libbsc in new file gsm_04_80_utils.c. To avoid too much code dup, move the message generation part of gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() to new functions gsm0480_gen_ussdNotify() and gsm0480_gen_releaseComplete(), placed in libcommon-cs. Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 --- M openbsc/include/openbsc/gsm_04_80.h M openbsc/src/libbsc/Makefile.am A openbsc/src/libbsc/gsm_04_80_utils.c M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/libmsc/gsm_04_80.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/src/osmo-bsc/osmo_bsc_api.c M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c M openbsc/src/osmo-bsc/osmo_bsc_filter.c M openbsc/src/osmo-bsc/osmo_bsc_grace.c M openbsc/src/osmo-bsc/osmo_bsc_sccp.c 11 files changed, 105 insertions(+), 39 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/1129/4 diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index 0a60652..7f46895 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -14,7 +14,15 @@ const struct msgb *msg, const struct ussd_request *request); -int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text); -int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn); +struct msgb *gsm0480_gen_ussdNotify(int level, const char *text); +struct msgb *gsm0480_gen_releaseComplete(void); + +int msc_gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, + int level, const char *text); +int msc_gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn); + +int bsc_gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, + int level, const char *text); +int bsc_gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn); #endif diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am index 8c53817..18828f9 100644 --- a/openbsc/src/libbsc/Makefile.am +++ b/openbsc/src/libbsc/Makefile.am @@ -41,6 +41,7 @@ bsc_api.c \ bsc_msc.c bsc_vty.c \ gsm_04_08_utils.c \ + gsm_04_80_utils.c \ bsc_init.c \ bts_init.c \ bsc_rf_ctrl.c \ @@ -51,4 +52,3 @@ bsc_dyn_ts.c \ bts_ipaccess_nanobts_omlattr.c \ $(NULL) - diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/openbsc/src/libbsc/gsm_04_80_utils.c new file mode 100644 index 0000000..c96259d --- /dev/null +++ b/openbsc/src/libbsc/gsm_04_80_utils.c @@ -0,0 +1,40 @@ +/* OpenBSC utility functions for 3GPP TS 04.80 */ + +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +int bsc_gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int + level, const char *text) +{ + struct msgb *msg = gsm0480_gen_ussdNotify(level, text); + if (!msg) + return -1; + return gsm0808_submit_dtap(conn, msg, 0, 0); +} + +int bsc_gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm0480_gen_releaseComplete(); + if (!msg) + return -1; + return gsm0808_submit_dtap(conn, msg, 0, 0); +} diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 8d09b7e..42d0823 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -113,3 +113,39 @@ gh->data[0] = cause; return msg; } + +struct msgb *gsm0480_gen_ussdNotify(int level, const char *text) +{ + struct gsm48_hdr *gh; + struct msgb *msg; + + msg = gsm0480_create_unstructuredSS_Notify(level, text); + if (!msg) + return NULL; + + gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0); + gsm0480_wrap_facility(msg); + + /* And finally pre-pend the L3 header */ + gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); + gh->proto_discr = GSM48_PDISC_NC_SS; + gh->msg_type = GSM0480_MTYPE_REGISTER; + + return msg; +} + +struct msgb *gsm0480_gen_releaseComplete(void) +{ + struct gsm48_hdr *gh; + struct msgb *msg; + + msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REL COMPL"); + if (!msg) + return NULL; + + gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); + gh->proto_discr = GSM48_PDISC_NC_SS; + gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE; + + return msg; +} diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c index f1d75f2..b8d950f 100644 --- a/openbsc/src/libmsc/gsm_04_80.c +++ b/openbsc/src/libmsc/gsm_04_80.c @@ -138,38 +138,18 @@ return gsm0808_submit_dtap(conn, msg, 0, 0); } -int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text) +int msc_gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text) { - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm0480_create_unstructuredSS_Notify(level, text); + struct msgb *msg = gsm0480_gen_ussdNotify(level, text); if (!msg) return -1; - - gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0); - gsm0480_wrap_facility(msg); - - /* And finally pre-pend the L3 header */ - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - gh->proto_discr = GSM48_PDISC_NC_SS; - gh->msg_type = GSM0480_MTYPE_REGISTER; - return gsm0808_submit_dtap(conn, msg, 0, 0); } -int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn) +int msc_gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn) { - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REL COMPL"); + struct msgb *msg = gsm0480_gen_releaseComplete(); if (!msg) return -1; - - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - gh->proto_discr = GSM48_PDISC_NC_SS; - gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE; - return gsm0808_submit_dtap(conn, msg, 0, 0); } diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 6f0006c..956302e 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -473,8 +473,8 @@ return CMD_WARNING; } - gsm0480_send_ussdNotify(conn, level, text); - gsm0480_send_releaseComplete(conn); + msc_gsm0480_send_ussdNotify(conn, level, text); + msc_gsm0480_send_releaseComplete(conn); subscr_put(subscr); talloc_free(text); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c index d31e6c1..e759805 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_api.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c @@ -205,8 +205,8 @@ gsm48_tx_mm_serv_ack(conn); LOGP(DMSC, LOGL_INFO, "Sending USSD message: '%s'\n", text); - gsm0480_send_ussdNotify(conn, 1, text); - gsm0480_send_releaseComplete(conn); + bsc_gsm0480_send_ussdNotify(conn, 1, text); + bsc_gsm0480_send_releaseComplete(conn); } /* diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 3010b55..84b7b92 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -598,8 +598,8 @@ * the release complete when we get a returnResultLast * for this invoke id. */ - gsm0480_send_releaseComplete(conn); - gsm0480_send_ussdNotify(conn, alert, text_str); + bsc_gsm0480_send_releaseComplete(conn); + bsc_gsm0480_send_ussdNotify(conn, alert, text_str); cmd->reply = "Found a connection"; break; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c index 14e0b71..8fc899e 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c @@ -246,8 +246,9 @@ int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn) { - gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt); - gsm0480_send_releaseComplete(conn); + bsc_gsm0480_send_ussdNotify(conn, 1, + conn->sccp_con->msc->ussd_welcome_txt); + bsc_gsm0480_send_releaseComplete(conn); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c index e6194ab..c1d7c6a 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c @@ -112,8 +112,8 @@ if (lchan->state != LCHAN_S_ACTIVE) return -1; - gsm0480_send_ussdNotify(conn, 0, text); - gsm0480_send_releaseComplete(conn); + bsc_gsm0480_send_ussdNotify(conn, 0, text); + bsc_gsm0480_send_releaseComplete(conn); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 86b27be..fa060da 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -285,8 +285,9 @@ return; /* send USSD notification */ - gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt); - gsm0480_send_releaseComplete(conn); + bsc_gsm0480_send_ussdNotify(conn, 1, + conn->sccp_con->msc->ussd_msc_lost_txt); + bsc_gsm0480_send_releaseComplete(conn); } static void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con) -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: factor out & introduce struct gsm_encr, in common_cs.h In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1130 to look at the new patch set (#4). factor out & introduce struct gsm_encr, in common_cs.h Factor out encryption info from struct gsm_lchan as struct gsm_encr, placed in common_cs.h. Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Future: this will be used by libmsc's subscriber connection, for osmo-cscn. --- M openbsc/include/openbsc/common_cs.h M openbsc/include/openbsc/gsm_data_shared.h 2 files changed, 11 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/30/1130/4 diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 8549a83..172d6e6 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -7,6 +7,14 @@ typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); +#define MAX_A5_KEY_LEN (128/8) + +struct gsm_encr { + uint8_t alg_id; + uint8_t key_len; + uint8_t key[MAX_A5_KEY_LEN]; +}; + struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index 97fde83..af79485 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -24,6 +24,8 @@ #include #endif +#include + struct osmo_bsc_data; struct osmo_bsc_sccp_con; @@ -117,7 +119,6 @@ struct osmo_fsm_inst *fsm; }; -#define MAX_A5_KEY_LEN (128/8) #define A38_XOR_MIN_KEY_LEN 12 #define A38_XOR_MAX_KEY_LEN 16 #define A38_COMP128_KEY_LEN 16 @@ -219,11 +220,7 @@ uint8_t bs_power; uint8_t ms_power; /* Encryption information */ - struct { - uint8_t alg_id; - uint8_t key_len; - uint8_t key[MAX_A5_KEY_LEN]; - } encr; + struct gsm_encr encr; /* AMR bits */ uint8_t mr_ms_lv[7]; -- To view, visit https://gerrit.osmocom.org/1130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: sms_next_rp_msg_ref(): use direct pointer to next_rp_ref cou... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1131 to look at the new patch set (#4). sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counter libbsc and libmsc will have separate subscriber connection structs. Hence don't rely on gsm_subscriber_connection, but work on a direct pointer to the counter for the next RP reference. The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop the entire file. Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 --- M openbsc/include/openbsc/gsm_04_11.h M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/gsm_04_11.c D openbsc/src/libmsc/gsm_04_11_helper.c M openbsc/tests/gsm0408/gsm0408_test.c 6 files changed, 20 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/31/1131/4 diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h index 00c3a19..149de90 100644 --- a/openbsc/include/openbsc/gsm_04_11.h +++ b/openbsc/include/openbsc/gsm_04_11.h @@ -38,5 +38,5 @@ struct gsm_sms *sms); void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn); -uint8_t sms_next_rp_msg_ref(struct gsm_subscriber_connection *conn); +uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref); #endif diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 42d0823..1acd4e4 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In @@ -149,3 +151,16 @@ return msg; } + +uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) +{ + const uint8_t rp_msg_ref = *next_rp_ref; + /* + * This should wrap as the valid range is 0 to 255. We only + * transfer one SMS at a time so we don't need to check if + * the id has been already assigned. + */ + *next_rp_ref += 1; + + return rp_msg_ref; +} diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index d236d3a..9d966db 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -27,7 +27,6 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ - gsm_04_11_helper.c \ gsm_04_80.c \ gsm_subscriber.c \ mncc.c \ diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 3a2effe..48a87e0 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -873,7 +873,7 @@ struct msgb *msg = gsm411_msgb_alloc(); struct gsm_trans *trans; uint8_t *data, *rp_ud_len; - uint8_t msg_ref = sms_next_rp_msg_ref(conn); + uint8_t msg_ref = sms_next_rp_msg_ref(&conn->next_rp_ref); int transaction_id; int rc; diff --git a/openbsc/src/libmsc/gsm_04_11_helper.c b/openbsc/src/libmsc/gsm_04_11_helper.c deleted file mode 100644 index f48c6de..0000000 --- a/openbsc/src/libmsc/gsm_04_11_helper.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Helpers for SMS/GSM 04.11 */ -/* - * (C) 2014 by Holger Hans Peter Freyther - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -uint8_t sms_next_rp_msg_ref(struct gsm_subscriber_connection *conn) -{ - const uint8_t rp_msg_ref = conn->next_rp_ref; - /* - * This should wrap as the valid range is 0 to 255. We only - * transfer one SMS at a time so we don't need to check if - * the id has been already assigned. - */ - conn->next_rp_ref += 1; - - return rp_msg_ref; -} - diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index b63205b..a44c04a 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -563,15 +563,15 @@ memset(&conn, 0, sizeof(conn)); conn.next_rp_ref = 255; - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 255); - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 0); - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 1); } -- To view, visit https://gerrit.osmocom.org/1131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: tests: drop unused libmsc, unneeded duplicate libbsc linking In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1132 to look at the new patch set (#4). tests: drop unused libmsc, unneeded duplicate libbsc linking Because of libcommon-cs, tests/gsm0408,subscr,trau no longer need libmsc. Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18 --- M openbsc/tests/gsm0408/Makefile.am M openbsc/tests/subscr/Makefile.am M openbsc/tests/trau/Makefile.am 3 files changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/32/1132/4 diff --git a/openbsc/tests/gsm0408/Makefile.am b/openbsc/tests/gsm0408/Makefile.am index 9739ee9..ae81c2c 100644 --- a/openbsc/tests/gsm0408/Makefile.am +++ b/openbsc/tests/gsm0408/Makefile.am @@ -24,7 +24,6 @@ gsm0408_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/subscr/Makefile.am b/openbsc/tests/subscr/Makefile.am index 52e7947..ad8b20c 100644 --- a/openbsc/tests/subscr/Makefile.am +++ b/openbsc/tests/subscr/Makefile.am @@ -31,8 +31,6 @@ subscr_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/trau/Makefile.am b/openbsc/tests/trau/Makefile.am index a446f79..1d014ba 100644 --- a/openbsc/tests/trau/Makefile.am +++ b/openbsc/tests/trau/Makefile.am @@ -31,8 +31,6 @@ trau_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ - $(top_builddir)/src/libmsc/libmsc.a \ - $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ -- To view, visit https://gerrit.osmocom.org/1132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: global vty gsm_network pointer In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1133 to look at the new patch set (#4). move to libcommon-cs: global vty gsm_network pointer Move gsmnet_from_vty() and the bsc_gsmnet global to common_cs_vty.c. Rename bsc_gsmnet to vty_global_gsm_network and make it static to common_cs_vty.c, to clearly mark the global variable for VTY use only. Introduce common_cs_vty_init() to set vty_global_gsm_network. Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6 --- M openbsc/include/openbsc/common_cs.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon-cs/common_cs_vty.c 3 files changed, 32 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/33/1133/4 diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 172d6e6..caecfeb 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -7,6 +7,8 @@ typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); +struct vty; + #define MAX_A5_KEY_LEN (128/8) struct gsm_encr { @@ -19,3 +21,6 @@ uint16_t country_code, uint16_t network_code, mncc_recv_cb_t mncc_recv); + +int common_cs_vty_init(struct gsm_network *network); +struct gsm_network *gsmnet_from_vty(struct vty *v); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 9ed19aa..c8aa43c 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -131,21 +131,6 @@ 1, }; -extern struct gsm_network *bsc_gsmnet; - -struct gsm_network *gsmnet_from_vty(struct vty *v) -{ - /* In case we read from the config file, the vty->priv cannot - * point to a struct telnet_connection, and thus conn->priv - * will not point to the gsm_network structure */ -#if 0 - struct telnet_connection *conn = v->priv; - return (struct gsm_network *) conn->priv; -#else - return bsc_gsmnet; -#endif -} - static int dummy_config_write(struct vty *v) { return CMD_SUCCESS; @@ -3989,7 +3974,7 @@ uint8_t buf[88]; int rc; - bts = gsm_bts_num(bsc_gsmnet, bts_nr); + bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); if (!bts) { vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); return CMD_WARNING; @@ -4040,7 +4025,7 @@ int ts_nr = atoi(argv[2]); int activate; - bts = gsm_bts_num(bsc_gsmnet, bts_nr); + bts = gsm_bts_num(gsmnet_from_vty(vty), bts_nr); if (!bts) { vty_out(vty, "%% No such BTS (%d)%s", bts_nr, VTY_NEWLINE); return CMD_WARNING; @@ -4102,6 +4087,7 @@ "BTS Vendor/Type\n", "\n", "", 0); + common_cs_vty_init(network); install_element_ve(&show_net_cmd); install_element_ve(&show_bts_cmd); diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c index 99aa0cf..11ed50f 100644 --- a/openbsc/src/libcommon-cs/common_cs_vty.c +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -1,6 +1,7 @@ /* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). * * (C) 2016 by sysmocom s.m.f.c. + * (C) 2008-2010 by Harald Welte * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -17,3 +18,26 @@ * along with this program. If not, see . * */ + +#include + +static struct gsm_network *vty_global_gsm_network = NULL; + +/* initialize VTY elements used in both BSC and MSC */ +int common_cs_vty_init(struct gsm_network *network) +{ + OSMO_ASSERT(vty_global_gsm_network == NULL); + vty_global_gsm_network = network; +} + +struct gsm_network *gsmnet_from_vty(struct vty *v) +{ + /* It can't hurt to force callers to continue to pass the vty instance + * to this function, in case we'd like to retrieve the global + * gsm_network instance from the vty at some point in the future. But + * until then, just return the global pointer, which should have been + * initialized by common_cs_vty_init(). + */ + OSMO_ASSERT(vty_global_gsm_network); + return vty_global_gsm_network; +} -- To view, visit https://gerrit.osmocom.org/1133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: network VTY that isn't BSC-specific In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1134 to look at the new patch set (#4). move to libcommon-cs: network VTY that isn't BSC-specific Keep only BSC specific bits of the 'network' VTY node in bsc_vty.c, move more general VTY commands to common_cs_vty.c. Add arg to common_cs_vty_init() to pass a config_write_net() function. Pass a libbsc specific config_write_net() function. Future: upcoming omso-cscn will re-use the VTY bits moved to libcommon-cs and pass a different config_write_net() function. Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71 --- M openbsc/include/openbsc/common_cs.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon-cs/common_cs_vty.c 3 files changed, 211 insertions(+), 194 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/34/1134/4 diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index caecfeb..6dc956f 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -22,5 +22,6 @@ uint16_t network_code, mncc_recv_cb_t mncc_recv); -int common_cs_vty_init(struct gsm_network *network); +int common_cs_vty_init(struct gsm_network *network, + int (* config_write_net )(struct vty *)); struct gsm_network *gsmnet_from_vty(struct vty *v); diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index c8aa43c..d7d62bb 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -54,15 +54,13 @@ #include #include +#include + #include #include "../../bscconfig.h" -#define NETWORK_STR "Configure the GSM network\n" -#define CODE_CMD_STR "Code commands\n" -#define NAME_CMD_STR "Name Commands\n" -#define NAME_STR "Name to use\n" #define LCHAN_NR_STR "Logical Channel Number\n" @@ -105,12 +103,6 @@ { BTS_LOC_FIX_2D, "fix2d" }, { BTS_LOC_FIX_3D, "fix3d" }, { 0, NULL } -}; - -struct cmd_node net_node = { - GSMNET_NODE, - "%s(config-net)# ", - 1, }; struct cmd_node bts_node = { @@ -1386,133 +1378,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_net, - cfg_net_cmd, - "network", NETWORK_STR) -{ - vty->index = gsmnet_from_vty(vty); - vty->node = GSMNET_NODE; - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_ncc, - cfg_net_ncc_cmd, - "network country code <1-999>", - "Set the GSM network country code\n" - "Country commands\n" - CODE_CMD_STR - "Network Country Code to use\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->country_code = atoi(argv[0]); - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_mnc, - cfg_net_mnc_cmd, - "mobile network code <0-999>", - "Set the GSM mobile network code\n" - "Network Commands\n" - CODE_CMD_STR - "Mobile Network Code to use\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->network_code = atoi(argv[0]); - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_name_short, - cfg_net_name_short_cmd, - "short name NAME", - "Set the short GSM network name\n" NAME_CMD_STR NAME_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - bsc_replace_string(gsmnet, &gsmnet->name_short, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_name_long, - cfg_net_name_long_cmd, - "long name NAME", - "Set the long GSM network name\n" NAME_CMD_STR NAME_STR) -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - bsc_replace_string(gsmnet, &gsmnet->name_long, argv[0]); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_auth_policy, - cfg_net_auth_policy_cmd, - "auth policy (closed|accept-all|regexp|token)", - "Authentication (not cryptographic)\n" - "Set the GSM network authentication policy\n" - "Require the MS to be activated in HLR\n" - "Accept all MS, whether in HLR or not\n" - "Use regular expression for IMSI authorization decision\n" - "Use SMS-token based authentication\n") -{ - enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->auth_policy = policy; - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd, - "authorized-regexp REGEXP", - "Set regexp for IMSI which will be used for authorization decision\n" - "Regular expression, IMSIs matching it are allowed to use the network\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp, - &gsmnet->authorized_reg_str, argc, argv) != 0) { - vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s", - argv[0], VTY_NEWLINE); - return CMD_WARNING; - } - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_reject_cause, - cfg_net_reject_cause_cmd, - "location updating reject cause <2-111>", - "Set the reject cause of location updating reject\n" - "Set the reject cause of location updating reject\n" - "Set the reject cause of location updating reject\n" - "Set the reject cause of location updating reject\n" - "Cause Value as Per GSM TS 04.08\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->reject_cause = atoi(argv[0]); - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_encryption, - cfg_net_encryption_cmd, - "encryption a5 (0|1|2|3)", - "Encryption options\n" - "A5 encryption\n" "A5/0: No encryption\n" - "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n" - "A5/3: 'New' Secure Encryption\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->a5_encryption= atoi(argv[0]); - - return CMD_SUCCESS; -} - DEFUN(cfg_net_neci, cfg_net_neci_cmd, "neci (0|1)", @@ -1523,35 +1388,6 @@ gsmnet->neci = atoi(argv[0]); gsm_net_update_ctype(gsmnet); - return CMD_SUCCESS; -} - -DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd, - "rrlp mode (none|ms-based|ms-preferred|ass-preferred)", - "Radio Resource Location Protocol\n" - "Set the Radio Resource Location Protocol Mode\n" - "Don't send RRLP request\n" - "Request MS-based location\n" - "Request any location, prefer MS-based\n" - "Request any location, prefer MS-assisted\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]); - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd, - "mm info (0|1)", - "Mobility Management\n" - "Send MM INFO after LOC UPD ACCEPT\n" - "Disable\n" "Enable\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - - gsmnet->send_mm_info = atoi(argv[0]); - return CMD_SUCCESS; } @@ -1704,17 +1540,6 @@ vty_out(vty, "%% 'dtx-used' is now deprecated: use dtx * " "configuration options of BTS instead%s", VTY_NEWLINE); return CMD_SUCCESS; -} - -DEFUN(cfg_net_subscr_keep, - cfg_net_subscr_keep_cmd, - "subscriber-keep-in-ram (0|1)", - "Keep unused subscribers in RAM.\n" - "Delete unused subscribers\n" "Keep unused subscribers\n") -{ - struct gsm_network *gsmnet = gsmnet_from_vty(vty); - gsmnet->subscr_group->keep_subscr = atoi(argv[0]); - return CMD_SUCCESS; } /* per-BTS configuration */ @@ -4087,7 +3912,7 @@ "BTS Vendor/Type\n", "\n", "", 0); - common_cs_vty_init(network); + common_cs_vty_init(network, config_write_net); install_element_ve(&show_net_cmd); install_element_ve(&show_bts_cmd); @@ -4102,20 +3927,7 @@ logging_vty_add_cmds(cat); osmo_stats_vty_add_cmds(); - install_element(CONFIG_NODE, &cfg_net_cmd); - install_node(&net_node, config_write_net); - vty_install_default(GSMNET_NODE); - install_element(GSMNET_NODE, &cfg_net_ncc_cmd); - install_element(GSMNET_NODE, &cfg_net_mnc_cmd); - install_element(GSMNET_NODE, &cfg_net_name_short_cmd); - install_element(GSMNET_NODE, &cfg_net_name_long_cmd); - install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); - install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd); - install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); - install_element(GSMNET_NODE, &cfg_net_encryption_cmd); install_element(GSMNET_NODE, &cfg_net_neci_cmd); - install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); - install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); install_element(GSMNET_NODE, &cfg_net_handover_cmd); install_element(GSMNET_NODE, &cfg_net_ho_win_rxlev_avg_cmd); install_element(GSMNET_NODE, &cfg_net_ho_win_rxqual_avg_cmd); @@ -4136,7 +3948,6 @@ install_element(GSMNET_NODE, &cfg_net_T3122_cmd); install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); - install_element(GSMNET_NODE, &cfg_net_subscr_keep_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); install_element(GSMNET_NODE, &cfg_bts_cmd); diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c index 11ed50f..bab3712 100644 --- a/openbsc/src/libcommon-cs/common_cs_vty.c +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -19,15 +19,220 @@ * */ +#include + +#include +#include +#include + +#include + #include +#include + +struct cmd_node net_node = { + GSMNET_NODE, + "%s(config-net)# ", + 1, +}; + +#define NETWORK_STR "Configure the GSM network\n" +#define CODE_CMD_STR "Code commands\n" +#define NAME_CMD_STR "Name Commands\n" +#define NAME_STR "Name to use\n" + +DEFUN(cfg_net, + cfg_net_cmd, + "network", NETWORK_STR) +{ + vty->index = gsmnet_from_vty(vty); + vty->node = GSMNET_NODE; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_ncc, + cfg_net_ncc_cmd, + "network country code <1-999>", + "Set the GSM network country code\n" + "Country commands\n" + CODE_CMD_STR + "Network Country Code to use\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->country_code = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_mnc, + cfg_net_mnc_cmd, + "mobile network code <0-999>", + "Set the GSM mobile network code\n" + "Network Commands\n" + CODE_CMD_STR + "Mobile Network Code to use\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->network_code = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_name_short, + cfg_net_name_short_cmd, + "short name NAME", + "Set the short GSM network name\n" NAME_CMD_STR NAME_STR) +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + bsc_replace_string(gsmnet, &gsmnet->name_short, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_net_name_long, + cfg_net_name_long_cmd, + "long name NAME", + "Set the long GSM network name\n" NAME_CMD_STR NAME_STR) +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + bsc_replace_string(gsmnet, &gsmnet->name_long, argv[0]); + return CMD_SUCCESS; +} + +DEFUN(cfg_net_auth_policy, + cfg_net_auth_policy_cmd, + "auth policy (closed|accept-all|regexp|token)", + "Authentication (not cryptographic)\n" + "Set the GSM network authentication policy\n" + "Require the MS to be activated in HLR\n" + "Accept all MS, whether in HLR or not\n" + "Use regular expression for IMSI authorization decision\n" + "Use SMS-token based authentication\n") +{ + enum gsm_auth_policy policy = gsm_auth_policy_parse(argv[0]); + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->auth_policy = policy; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_authorize_regexp, cfg_net_authorize_regexp_cmd, + "authorized-regexp REGEXP", + "Set regexp for IMSI which will be used for authorization decision\n" + "Regular expression, IMSIs matching it are allowed to use the network\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + if (gsm_parse_reg(gsmnet, &gsmnet->authorized_regexp, + &gsmnet->authorized_reg_str, argc, argv) != 0) { + vty_out(vty, "%%Failed to parse the authorized-regexp: '%s'%s", + argv[0], VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_reject_cause, + cfg_net_reject_cause_cmd, + "location updating reject cause <2-111>", + "Set the reject cause of location updating reject\n" + "Set the reject cause of location updating reject\n" + "Set the reject cause of location updating reject\n" + "Set the reject cause of location updating reject\n" + "Cause Value as Per GSM TS 04.08\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->reject_cause = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_encryption, + cfg_net_encryption_cmd, + "encryption a5 (0|1|2|3)", + "Encryption options\n" + "A5 encryption\n" "A5/0: No encryption\n" + "A5/1: Encryption\n" "A5/2: Export-grade Encryption\n" + "A5/3: 'New' Secure Encryption\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->a5_encryption= atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_rrlp_mode, cfg_net_rrlp_mode_cmd, + "rrlp mode (none|ms-based|ms-preferred|ass-preferred)", + "Radio Resource Location Protocol\n" + "Set the Radio Resource Location Protocol Mode\n" + "Don't send RRLP request\n" + "Request MS-based location\n" + "Request any location, prefer MS-based\n" + "Request any location, prefer MS-assisted\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->rrlp.mode = rrlp_mode_parse(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_mm_info, cfg_net_mm_info_cmd, + "mm info (0|1)", + "Mobility Management\n" + "Send MM INFO after LOC UPD ACCEPT\n" + "Disable\n" "Enable\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + + gsmnet->send_mm_info = atoi(argv[0]); + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_subscr_keep, + cfg_net_subscr_keep_cmd, + "subscriber-keep-in-ram (0|1)", + "Keep unused subscribers in RAM.\n" + "Delete unused subscribers\n" "Keep unused subscribers\n") +{ + struct gsm_network *gsmnet = gsmnet_from_vty(vty); + gsmnet->subscr_group->keep_subscr = atoi(argv[0]); + return CMD_SUCCESS; +} static struct gsm_network *vty_global_gsm_network = NULL; /* initialize VTY elements used in both BSC and MSC */ -int common_cs_vty_init(struct gsm_network *network) +int common_cs_vty_init(struct gsm_network *network, + int (* config_write_net )(struct vty *)) { OSMO_ASSERT(vty_global_gsm_network == NULL); vty_global_gsm_network = network; + + install_element(CONFIG_NODE, &cfg_net_cmd); + install_node(&net_node, config_write_net); + vty_install_default(GSMNET_NODE); + install_element(GSMNET_NODE, &cfg_net_ncc_cmd); + install_element(GSMNET_NODE, &cfg_net_mnc_cmd); + install_element(GSMNET_NODE, &cfg_net_name_short_cmd); + install_element(GSMNET_NODE, &cfg_net_name_long_cmd); + install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd); + install_element(GSMNET_NODE, &cfg_net_authorize_regexp_cmd); + install_element(GSMNET_NODE, &cfg_net_reject_cause_cmd); + install_element(GSMNET_NODE, &cfg_net_encryption_cmd); + install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); + install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); + install_element(GSMNET_NODE, &cfg_net_subscr_keep_cmd); + + return CMD_SUCCESS; } struct gsm_network *gsmnet_from_vty(struct vty *v) -- To view, visit https://gerrit.osmocom.org/1134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: Move timezone settings up to network level In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1137 to look at the new patch set (#5). Move timezone settings up to network level Time zone used to be configurable per-BTS. In the upcoming MSC-split, no BTS structures will be available on the MSC level. To simplify, drop the ability to manage several time zones in a core network and place the time zone config on the network VTY level, i.e. in gsm_network. If we are going to re-add fine grained time zone settings, it should probably be tied to the LAC. Adjust time zone VTY config code (to be moved to libcommon-cs in subsequent commit). Adjust time zone Ctrl Interface code. Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8 --- M openbsc/include/openbsc/gsm_data.h M openbsc/include/openbsc/gsm_data_shared.h M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libmsc/gsm_04_08.c M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c M openbsc/src/osmo-bsc/osmo_bsc_filter.c M openbsc/tests/bsc/bsc_test.c M openbsc/tests/ctrl_test_runner.py M openbsc/tests/vty_test_runner.py 9 files changed, 98 insertions(+), 99 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/37/1137/5 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index d4a4d6d..f820ba3 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -273,6 +273,13 @@ #define GSM_T3113_DEFAULT 60 #define GSM_T3122_DEFAULT 10 +struct gsm_tz { + int override; /* if 0, use system's time zone instead. */ + int hr; /* hour */ + int mn; /* minute */ + int dst; /* daylight savings */ +}; + struct gsm_network { /* global parameters */ uint16_t country_code; @@ -367,6 +374,13 @@ /* all active subscriber connections. */ struct llist_head subscr_conns; + + /* if override is nonzero, this timezone data is used for all MM + * contexts. */ + /* TODO: in OsmoNITB, tz-override used to be BTS-specific. To enable + * BTS|RNC specific timezone overrides for multi-tz networks in + * OsmoCSCN, this should be tied to the location area code (LAC). */ + struct gsm_tz tz; }; struct osmo_esme; diff --git a/openbsc/include/openbsc/gsm_data_shared.h b/openbsc/include/openbsc/gsm_data_shared.h index af79485..4ec4f69 100644 --- a/openbsc/include/openbsc/gsm_data_shared.h +++ b/openbsc/include/openbsc/gsm_data_shared.h @@ -679,14 +679,6 @@ /* buffers where we put the pre-computed SI */ sysinfo_buf_t si_buf[_MAX_SYSINFO_TYPE]; - /* TimeZone hours, mins, and bts specific */ - struct { - int hr; - int mn; - int override; - int dst; - } tz; - /* ip.accesss Unit ID's have Site/BTS/TRX layout */ union { struct { diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index e3f0464..7afa8e1 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -554,14 +554,6 @@ if (bts->dtxd) vty_out(vty, " dtx downlink%s", VTY_NEWLINE); vty_out(vty, " base_station_id_code %u%s", bts->bsic, VTY_NEWLINE); - if (bts->tz.override != 0) { - if (bts->tz.dst) - vty_out(vty, " timezone %d %d %d%s", - bts->tz.hr, bts->tz.mn, bts->tz.dst, VTY_NEWLINE); - else - vty_out(vty, " timezone %d %d%s", - bts->tz.hr, bts->tz.mn, VTY_NEWLINE); - } vty_out(vty, " ms max power %u%s", bts->ms_max_power, VTY_NEWLINE); vty_out(vty, " cell reselection hysteresis %u%s", bts->si_common.cell_sel_par.cell_resel_hyst*2, VTY_NEWLINE); @@ -817,6 +809,15 @@ vty_out(vty, " timer t3141 %u%s", gsmnet->T3141, VTY_NEWLINE); vty_out(vty, " subscriber-keep-in-ram %d%s", gsmnet->subscr_group->keep_subscr, VTY_NEWLINE); + if (gsmnet->tz.override != 0) { + if (gsmnet->tz.dst) + vty_out(vty, " timezone %d %d %d%s", + gsmnet->tz.hr, gsmnet->tz.mn, gsmnet->tz.dst, + VTY_NEWLINE); + else + vty_out(vty, " timezone %d %d%s", + gsmnet->tz.hr, gsmnet->tz.mn, VTY_NEWLINE); + } return CMD_SUCCESS; } @@ -1735,10 +1736,10 @@ return CMD_SUCCESS; } -DEFUN(cfg_bts_timezone, - cfg_bts_timezone_cmd, +DEFUN(cfg_net_timezone, + cfg_net_timezone_cmd, "timezone <-19-19> (0|15|30|45)", - "Set the Timezone Offset of this BTS\n" + "Set the Timezone Offset of the network\n" "Timezone offset (hours)\n" "Timezone offset (00 minutes)\n" "Timezone offset (15 minutes)\n" @@ -1746,22 +1747,22 @@ "Timezone offset (45 minutes)\n" ) { - struct gsm_bts *bts = vty->index; + struct gsm_network *net = vty->index; int tzhr = atoi(argv[0]); int tzmn = atoi(argv[1]); - bts->tz.hr = tzhr; - bts->tz.mn = tzmn; - bts->tz.dst = 0; - bts->tz.override = 1; + net->tz.hr = tzhr; + net->tz.mn = tzmn; + net->tz.dst = 0; + net->tz.override = 1; return CMD_SUCCESS; } -DEFUN(cfg_bts_timezone_dst, - cfg_bts_timezone_dst_cmd, +DEFUN(cfg_net_timezone_dst, + cfg_net_timezone_dst_cmd, "timezone <-19-19> (0|15|30|45) <0-2>", - "Set the Timezone Offset of this BTS\n" + "Set the Timezone Offset of the network\n" "Timezone offset (hours)\n" "Timezone offset (00 minutes)\n" "Timezone offset (15 minutes)\n" @@ -1770,28 +1771,28 @@ "DST offset (hours)\n" ) { - struct gsm_bts *bts = vty->index; + struct gsm_network *net = vty->index; int tzhr = atoi(argv[0]); int tzmn = atoi(argv[1]); int tzdst = atoi(argv[2]); - bts->tz.hr = tzhr; - bts->tz.mn = tzmn; - bts->tz.dst = tzdst; - bts->tz.override = 1; + net->tz.hr = tzhr; + net->tz.mn = tzmn; + net->tz.dst = tzdst; + net->tz.override = 1; return CMD_SUCCESS; } -DEFUN(cfg_bts_no_timezone, - cfg_bts_no_timezone_cmd, +DEFUN(cfg_net_no_timezone, + cfg_net_no_timezone_cmd, "no timezone", NO_STR - "Disable BTS specific timezone\n") + "Disable network timezone override, use system tz\n") { - struct gsm_bts *bts = vty->index; + struct gsm_network *net = vty->index; - bts->tz.override = 0; + net->tz.override = 0; return CMD_SUCCESS; } @@ -3949,6 +3950,9 @@ install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); + install_element(GSMNET_NODE, &cfg_net_timezone_cmd); + install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd); + install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd); install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); @@ -3967,9 +3971,6 @@ install_element(BTS_NODE, &cfg_bts_bsic_cmd); install_element(BTS_NODE, &cfg_bts_unit_id_cmd); install_element(BTS_NODE, &cfg_bts_rsl_ip_cmd); - install_element(BTS_NODE, &cfg_bts_timezone_cmd); - install_element(BTS_NODE, &cfg_bts_timezone_dst_cmd); - install_element(BTS_NODE, &cfg_bts_no_timezone_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_skip_reset_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_no_loc_rel_cnf_cmd); install_element(BTS_NODE, &cfg_bts_nokia_site_bts_reset_timer_cnf_cmd); diff --git a/openbsc/src/libmsc/gsm_04_08.c b/openbsc/src/libmsc/gsm_04_08.c index 3e362fa..d10f8cf 100644 --- a/openbsc/src/libmsc/gsm_04_08.c +++ b/openbsc/src/libmsc/gsm_04_08.c @@ -733,7 +733,6 @@ struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 MM INF"); struct gsm48_hdr *gh; struct gsm_network *net = conn->network; - struct gsm_bts *bts = conn->bts; uint8_t *ptr8; int name_len, name_pad; @@ -821,23 +820,23 @@ ptr8[5] = bcdify(gmt_time->tm_min); ptr8[6] = bcdify(gmt_time->tm_sec); - if (bts->tz.override) { + if (net->tz.override) { /* Convert tz.hr and tz.mn to units */ - if (bts->tz.hr < 0) { - tzunits = ((bts->tz.hr/-1)*4); - tzunits = tzunits + (bts->tz.mn/15); + if (net->tz.hr < 0) { + tzunits = ((net->tz.hr/-1)*4); + tzunits = tzunits + (net->tz.mn/15); ptr8[7] = bcdify(tzunits); /* Set negative time */ ptr8[7] |= 0x08; } else { - tzunits = bts->tz.hr*4; - tzunits = tzunits + (bts->tz.mn/15); + tzunits = net->tz.hr*4; + tzunits = tzunits + (net->tz.mn/15); ptr8[7] = bcdify(tzunits); } /* Convert DST value */ - if (bts->tz.dst >= 0 && bts->tz.dst <= 2) - dst = bts->tz.dst; + if (net->tz.dst >= 0 && net->tz.dst <= 2) + dst = net->tz.dst; } else { /* Need to get GSM offset and convert into 15 min units */ diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 84b7b92..556d362 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -362,18 +362,15 @@ return 1; } -CTRL_CMD_DEFINE(bts_timezone, "timezone"); -static int get_bts_timezone(struct ctrl_cmd *cmd, void *data) +CTRL_CMD_DEFINE(net_timezone, "timezone"); +static int get_net_timezone(struct ctrl_cmd *cmd, void *data) { - struct gsm_bts *bts = (struct gsm_bts *) cmd->node; - if (!bts) { - cmd->reply = "bts not found."; - return CTRL_CMD_ERROR; - } + struct gsm_network *net = (struct gsm_network*)cmd->node; - if (bts->tz.override) + struct gsm_tz *tz = &net->tz; + if (tz->override) cmd->reply = talloc_asprintf(cmd, "%d,%d,%d", - bts->tz.hr, bts->tz.mn, bts->tz.dst); + tz->hr, tz->mn, tz->dst); else cmd->reply = talloc_asprintf(cmd, "off"); @@ -385,16 +382,11 @@ return CTRL_CMD_REPLY; } -static int set_bts_timezone(struct ctrl_cmd *cmd, void *data) +static int set_net_timezone(struct ctrl_cmd *cmd, void *data) { char *saveptr, *hourstr, *minstr, *dststr, *tmp = 0; int override; - struct gsm_bts *bts = (struct gsm_bts *) cmd->node; - - if (!bts) { - cmd->reply = "bts not found."; - return CTRL_CMD_ERROR; - } + struct gsm_network *net = (struct gsm_network*)cmd->node; tmp = talloc_strdup(cmd, cmd->value); if (!tmp) @@ -409,25 +401,26 @@ if (hourstr != NULL) override = strcasecmp(hourstr, "off") != 0; - bts->tz.override = override; + struct gsm_tz *tz = &net->tz; + tz->override = override; if (override) { - bts->tz.hr = hourstr ? atol(hourstr) : 0; - bts->tz.mn = minstr ? atol(minstr) : 0; - bts->tz.dst = dststr ? atol(dststr) : 0; + tz->hr = hourstr ? atol(hourstr) : 0; + tz->mn = minstr ? atol(minstr) : 0; + tz->dst = dststr ? atol(dststr) : 0; } talloc_free(tmp); tmp = NULL; - return get_bts_timezone(cmd, data); + return get_net_timezone(cmd, data); oom: cmd->reply = "OOM"; return CTRL_CMD_ERROR; } -static int verify_bts_timezone(struct ctrl_cmd *cmd, const char *value, void *data) +static int verify_net_timezone(struct ctrl_cmd *cmd, const char *value, void *data) { char *saveptr, *hourstr, *minstr, *dststr, *tmp; int override, tz_hours, tz_mins, tz_dst; @@ -655,7 +648,7 @@ rc = ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_loc); if (rc) goto end; - rc = ctrl_cmd_install(CTRL_NODE_BTS, &cmd_bts_timezone); + rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_net_timezone); if (rc) goto end; rc = ctrl_cmd_install(CTRL_NODE_ROOT, &cmd_msc_connection_status); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c index 8fc899e..3b5f57e 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c @@ -271,23 +271,24 @@ return 0; /* Is TZ patching enabled? */ - if (!bts->tz.override) + struct gsm_tz *tz = &bts->network->tz; + if (!tz->override) return 0; /* Convert tz.hr and tz.mn to units */ - if (bts->tz.hr < 0) { - tzunits = -bts->tz.hr*4; + if (tz->hr < 0) { + tzunits = -tz->hr*4; tzbsd |= 0x08; } else - tzunits = bts->tz.hr*4; + tzunits = tz->hr*4; - tzunits = tzunits + (bts->tz.mn/15); + tzunits = tzunits + (tz->mn/15); tzbsd |= (tzunits % 10)*0x10 + (tzunits / 10); /* Convert DST value */ - if (bts->tz.dst >= 0 && bts->tz.dst <= 2) - dst = bts->tz.dst; + if (tz->dst >= 0 && tz->dst <= 2) + dst = tz->dst; if (TLVP_PRESENT(&tp, GSM48_IE_UTC)) { LOGP(DMSC, LOGL_DEBUG, diff --git a/openbsc/tests/bsc/bsc_test.c b/openbsc/tests/bsc/bsc_test.c index 6d41941..7174828 100644 --- a/openbsc/tests/bsc/bsc_test.c +++ b/openbsc/tests/bsc/bsc_test.c @@ -147,10 +147,10 @@ struct msgb *msg = msgb_alloc(4096, "test-message"); int is_set = 0; - bts->tz.hr = get_int(test_def->params, test_def->n_params, "tz_hr", 0, &is_set); - bts->tz.mn = get_int(test_def->params, test_def->n_params, "tz_mn", 0, &is_set); - bts->tz.dst = get_int(test_def->params, test_def->n_params, "tz_dst", 0, &is_set); - bts->tz.override = 1; + net->tz.hr = get_int(test_def->params, test_def->n_params, "tz_hr", 0, &is_set); + net->tz.mn = get_int(test_def->params, test_def->n_params, "tz_mn", 0, &is_set); + net->tz.dst = get_int(test_def->params, test_def->n_params, "tz_dst", 0, &is_set); + net->tz.override = 1; printf("Going to test item: %d\n", i); msg->l3h = msgb_put(msg, test_def->length); diff --git a/openbsc/tests/ctrl_test_runner.py b/openbsc/tests/ctrl_test_runner.py index bed685a..4fd831f 100644 --- a/openbsc/tests/ctrl_test_runner.py +++ b/openbsc/tests/ctrl_test_runner.py @@ -331,41 +331,41 @@ self.assertEquals(r['value'], 'state=off,policy=on') def testTimezone(self): - r = self.do_get('bts.0.timezone') + r = self.do_get('timezone') self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], 'off') - r = self.do_set('bts.0.timezone', '-2,15,2') + r = self.do_set('timezone', '-2,15,2') self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], '-2,15,2') - r = self.do_get('bts.0.timezone') + r = self.do_get('timezone') self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], '-2,15,2') # Test invalid input - r = self.do_set('bts.0.timezone', '-2,15,2,5,6,7') + r = self.do_set('timezone', '-2,15,2,5,6,7') self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], '-2,15,2') - r = self.do_set('bts.0.timezone', '-2,15') + r = self.do_set('timezone', '-2,15') self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('bts.0.timezone', '-2') + r = self.do_set('timezone', '-2') self.assertEquals(r['mtype'], 'ERROR') - r = self.do_set('bts.0.timezone', '1') + r = self.do_set('timezone', '1') - r = self.do_set('bts.0.timezone', 'off') + r = self.do_set('timezone', 'off') self.assertEquals(r['mtype'], 'SET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], 'off') - r = self.do_get('bts.0.timezone') + r = self.do_get('timezone') self.assertEquals(r['mtype'], 'GET_REPLY') - self.assertEquals(r['var'], 'bts.0.timezone') + self.assertEquals(r['var'], 'timezone') self.assertEquals(r['value'], 'off') def testMcc(self): diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index a73dadd..cf2cf18 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -651,7 +651,6 @@ self.vty.enable() self.vty.verify("configure terminal", ['']) self.vty.verify("network", ['']) - self.vty.verify("bts 0", ['']) # Test invalid input self.vty.verify("timezone", ['% Command incomplete.']) -- To view, visit https://gerrit.osmocom.org/1137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sun Nov 13 00:05:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sun, 13 Nov 2016 00:05:16 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: net timezone VTY config In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1138 to look at the new patch set (#5). move to libcommon-cs: net timezone VTY config Leave the timezone VTY output in libbsc's config_write_net(), until the BSC/MSC separation of struct gsm_network is completed. Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20 --- M openbsc/src/libbsc/bsc_vty.c M openbsc/src/libcommon-cs/common_cs_vty.c 2 files changed, 64 insertions(+), 64 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/38/1138/5 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 7afa8e1..b9519b4 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -1736,67 +1736,6 @@ return CMD_SUCCESS; } -DEFUN(cfg_net_timezone, - cfg_net_timezone_cmd, - "timezone <-19-19> (0|15|30|45)", - "Set the Timezone Offset of the network\n" - "Timezone offset (hours)\n" - "Timezone offset (00 minutes)\n" - "Timezone offset (15 minutes)\n" - "Timezone offset (30 minutes)\n" - "Timezone offset (45 minutes)\n" - ) -{ - struct gsm_network *net = vty->index; - int tzhr = atoi(argv[0]); - int tzmn = atoi(argv[1]); - - net->tz.hr = tzhr; - net->tz.mn = tzmn; - net->tz.dst = 0; - net->tz.override = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_timezone_dst, - cfg_net_timezone_dst_cmd, - "timezone <-19-19> (0|15|30|45) <0-2>", - "Set the Timezone Offset of the network\n" - "Timezone offset (hours)\n" - "Timezone offset (00 minutes)\n" - "Timezone offset (15 minutes)\n" - "Timezone offset (30 minutes)\n" - "Timezone offset (45 minutes)\n" - "DST offset (hours)\n" - ) -{ - struct gsm_network *net = vty->index; - int tzhr = atoi(argv[0]); - int tzmn = atoi(argv[1]); - int tzdst = atoi(argv[2]); - - net->tz.hr = tzhr; - net->tz.mn = tzmn; - net->tz.dst = tzdst; - net->tz.override = 1; - - return CMD_SUCCESS; -} - -DEFUN(cfg_net_no_timezone, - cfg_net_no_timezone_cmd, - "no timezone", - NO_STR - "Disable network timezone override, use system tz\n") -{ - struct gsm_network *net = vty->index; - - net->tz.override = 0; - - return CMD_SUCCESS; -} - DEFUN(cfg_bts_unit_id, cfg_bts_unit_id_cmd, "ip.access unit_id <0-65534> <0-255>", @@ -3950,9 +3889,6 @@ install_element(GSMNET_NODE, &cfg_net_T3141_cmd); install_element(GSMNET_NODE, &cfg_net_dtx_cmd); install_element(GSMNET_NODE, &cfg_net_pag_any_tch_cmd); - install_element(GSMNET_NODE, &cfg_net_timezone_cmd); - install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd); - install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd); install_element(GSMNET_NODE, &cfg_bts_cmd); install_node(&bts_node, config_write_bts); diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c index bab3712..7f8b495 100644 --- a/openbsc/src/libcommon-cs/common_cs_vty.c +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -208,6 +208,67 @@ return CMD_SUCCESS; } +DEFUN(cfg_net_timezone, + cfg_net_timezone_cmd, + "timezone <-19-19> (0|15|30|45)", + "Set the Timezone Offset of the network\n" + "Timezone offset (hours)\n" + "Timezone offset (00 minutes)\n" + "Timezone offset (15 minutes)\n" + "Timezone offset (30 minutes)\n" + "Timezone offset (45 minutes)\n" + ) +{ + struct gsm_network *net = vty->index; + int tzhr = atoi(argv[0]); + int tzmn = atoi(argv[1]); + + net->tz.hr = tzhr; + net->tz.mn = tzmn; + net->tz.dst = 0; + net->tz.override = 1; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_timezone_dst, + cfg_net_timezone_dst_cmd, + "timezone <-19-19> (0|15|30|45) <0-2>", + "Set the Timezone Offset of the network\n" + "Timezone offset (hours)\n" + "Timezone offset (00 minutes)\n" + "Timezone offset (15 minutes)\n" + "Timezone offset (30 minutes)\n" + "Timezone offset (45 minutes)\n" + "DST offset (hours)\n" + ) +{ + struct gsm_network *net = vty->index; + int tzhr = atoi(argv[0]); + int tzmn = atoi(argv[1]); + int tzdst = atoi(argv[2]); + + net->tz.hr = tzhr; + net->tz.mn = tzmn; + net->tz.dst = tzdst; + net->tz.override = 1; + + return CMD_SUCCESS; +} + +DEFUN(cfg_net_no_timezone, + cfg_net_no_timezone_cmd, + "no timezone", + NO_STR + "Disable network timezone override, use system tz\n") +{ + struct gsm_network *net = vty->index; + + net->tz.override = 0; + + return CMD_SUCCESS; +} + static struct gsm_network *vty_global_gsm_network = NULL; /* initialize VTY elements used in both BSC and MSC */ @@ -231,6 +292,9 @@ install_element(GSMNET_NODE, &cfg_net_rrlp_mode_cmd); install_element(GSMNET_NODE, &cfg_net_mm_info_cmd); install_element(GSMNET_NODE, &cfg_net_subscr_keep_cmd); + install_element(GSMNET_NODE, &cfg_net_timezone_cmd); + install_element(GSMNET_NODE, &cfg_net_timezone_dst_cmd); + install_element(GSMNET_NODE, &cfg_net_no_timezone_cmd); return CMD_SUCCESS; } -- To view, visit https://gerrit.osmocom.org/1138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 19:54:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 19:54:57 +0000 Subject: [PATCH] openbsc[master]: OM2000: CON MO: Allow larger range for CCP and CI values Message-ID: Review at https://gerrit.osmocom.org/1242 OM2000: CON MO: Allow larger range for CCP and CI values it seesm more recent RBS2000 models have much larger CCP and CI value ranges than those of older models. Change-Id: Ib116c1fac901b293929fce34223d1fd0af15d2bc --- M openbsc/src/libbsc/abis_om2000_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/42/1242/1 diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index b68a8ea..b864691 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -348,7 +348,7 @@ "Contiguity Index\n" \ DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, - "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + "con-path (add|del) <0-2047> <0-255> deconcentrated <0-63>", CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") { struct con_group *cg = vty->index; @@ -370,7 +370,7 @@ } DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, - "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + "con-path (add|del) <0-2047> <0-255> concentrated <1-16>", CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { struct con_group *cg = vty->index; -- To view, visit https://gerrit.osmocom.org/1242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib116c1fac901b293929fce34223d1fd0af15d2bc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sun Nov 13 19:56:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 19:56:46 +0000 Subject: openbsc[master]: RBS2000: Avoid segfault if ts->lapd instance doesn't exist In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9223fb1568d3db7e278f07240c4be334c6602a13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 19:56:49 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 19:56:49 +0000 Subject: openbsc[master]: RBS2000: Ensure the is-connection-list command is only used ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8882ca9a9ab974b0bbdcbd5c3bab0eadf4bc0927 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 19:57:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 19:57:48 +0000 Subject: [MERGED] openbsc[master]: RBS2000: Ensure the is-connection-list command is only used ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RBS2000: Ensure the is-connection-list command is only used on RBS2000 ...................................................................... RBS2000: Ensure the is-connection-list command is only used on RBS2000 ... and not on other BTS models. Change-Id: I8882ca9a9ab974b0bbdcbd5c3bab0eadf4bc0927 --- M openbsc/src/libbsc/abis_om2000_vty.c 1 file changed, 6 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index d48ff95..64d205c 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -348,6 +348,12 @@ uint8_t ci = atoi(argv[3]); struct is_conn_group *grp, *grp2; + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% IS MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + if (!strcmp(argv[0], "add")) { grp = talloc_zero(bts, struct is_conn_group); grp->icp1 = icp1; -- To view, visit https://gerrit.osmocom.org/1239 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8882ca9a9ab974b0bbdcbd5c3bab0eadf4bc0927 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 19:57:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 19:57:52 +0000 Subject: [MERGED] openbsc[master]: RBS2000: Avoid segfault if ts->lapd instance doesn't exist In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RBS2000: Avoid segfault if ts->lapd instance doesn't exist ...................................................................... RBS2000: Avoid segfault if ts->lapd instance doesn't exist This happens e.g. with DAHDI driver, when the DAHDI device cannot be opened. Let's not prematurely seg-fault early in the RBS2000 signal handler, but take the proper error handlign for this. Change-Id: I9223fb1568d3db7e278f07240c4be334c6602a13 --- M openbsc/src/libbsc/bts_ericsson_rbs2000.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index 1300b4a..faf6f05 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -71,6 +71,8 @@ continue; llist_for_each_entry(link, &ts->sign.sign_links, list) { + if (!ts->lapd) + continue; lapd_instance_set_profile(ts->lapd, &lapd_profile_abis_ericsson); -- To view, visit https://gerrit.osmocom.org/1238 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9223fb1568d3db7e278f07240c4be334c6602a13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:22:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:22:44 +0000 Subject: [PATCH] openbsc[master]: Support configuration of CON MO Groups/Paths from VTY In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1240 to look at the new patch set (#4). Support configuration of CON MO Groups/Paths from VTY The code for supporting the configuration of the OM2000 CON (LAPD Concentrator) MO was so far incomplete and not used from the OM2000 FSM initialization. This patch adds * VTY commands for configuration of CON Groups and Paths * The FSM integration to actually configure the CON MO Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 --- M openbsc/include/openbsc/abis_om2000.h M openbsc/include/openbsc/vty.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/abis_om2000_vty.c M openbsc/src/libcommon/common_vty.c 5 files changed, 237 insertions(+), 71 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/40/1240/4 diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index c745112..b093a03 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -56,6 +56,39 @@ uint8_t ci; }; +/* on-wire format for CON Path */ +struct om2k_con_path { + uint16_t ccp; + uint8_t ci; + uint8_t tag; + uint8_t tei; +} __attribute__ ((packed)); + +/* internal data format for CON group */ +struct con_group { + /* links list of CON groups in BTS */ + struct llist_head list; + struct gsm_bts *bts; + /* CON Group ID */ + uint8_t cg; + /* list of CON paths in this group */ + struct llist_head paths; +}; + +/* internal data format for CON path */ +struct con_path { + /* links with con_group.paths */ + struct llist_head list; + /* CON Connection Point */ + uint16_t ccp; + /* Contiguity Index */ + uint8_t ci; + /* Tag */ + uint8_t tag; + /* TEI */ + uint8_t tei; +}; + extern const struct abis_om2k_mo om2k_mo_cf; extern const struct abis_om2k_mo om2k_mo_is; extern const struct abis_om2k_mo om2k_mo_con; diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index 315db0d..ad2cd2a 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -29,6 +29,7 @@ NAT_BSC_NODE, MSC_NODE, OM2K_NODE, + OM2K_CON_GROUP_NODE, TRUNK_NODE, PGROUP_NODE, MNCC_INT_NODE, diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 8c4bfb3..2733a90 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1132,20 +1132,48 @@ return abis_om2k_sendmsg(bts, msg); } -int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, - unsigned int len) +int abis_om2k_tx_con_conf_req(struct gsm_bts *bts) { struct msgb *msg = om2k_msgb_alloc(); struct abis_om2k_hdr *o2k; + struct con_group *grp; + unsigned int num_grps = 0; - o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); + /* count number of groups in linked list */ + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) + num_grps++; + + if (!num_grps) + return -EINVAL; + + /* first build the value part of the OM2K_DEI_CON_CONN_LIST DEI */ + msgb_put_u8(msg, num_grps); + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) { + struct con_path *cp; + unsigned int num_paths = 0; + llist_for_each_entry(cp, &grp->paths, list) + num_paths++; + msgb_put_u8(msg, num_paths); + llist_for_each_entry(cp, &grp->paths, list) { + struct om2k_con_path *om2k_cp; + om2k_cp = (struct om2k_con_path *) msgb_put(msg, sizeof(*om2k_cp)); + om2k_cp->ccp = htons(cp->ccp); + om2k_cp->ci = cp->ci; + om2k_cp->tag = cp->tag; + om2k_cp->tei = cp->tei; + } + } + msgb_push_u8(msg, msgb_length(msg)); + msgb_push_u8(msg, OM2K_DEI_CON_CONN_LIST); + + /* pre-pend the list number DEIs */ + msgb_tv_push(msg, OM2K_DEI_END_LIST_NR, 1); + msgb_tv_push(msg, OM2K_DEI_LIST_NR, 1); + + /* pre-pend the OM2K header */ + o2k = (struct abis_om2k_hdr *) msgb_push(msg, sizeof(*o2k)); fill_om2k_hdr(o2k, &bts->rbs2000.con.om2k_mo.addr, OM2K_MSGT_CON_CONF_REQ); - - msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); - msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); - - msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&bts->rbs2000.con.om2k_mo.addr), @@ -1566,8 +1594,7 @@ abis_om2k_tx_is_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_CON: - /* TODO */ - //abis_om2k_tx_con_conf_req(omfp->trx->bts, data, len); + abis_om2k_tx_con_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_TX: abis_om2k_tx_tx_conf_req(omfp->trx); @@ -2061,6 +2088,7 @@ OM2K_BTS_EVT_START, OM2K_BTS_EVT_CF_DONE, OM2K_BTS_EVT_IS_DONE, + OM2K_BTS_EVT_CON_DONE, OM2K_BTS_EVT_TF_DONE, OM2K_BTS_EVT_TRX_DONE, OM2K_BTS_EVT_STOP, @@ -2070,6 +2098,7 @@ { OM2K_BTS_EVT_START, "START" }, { OM2K_BTS_EVT_CF_DONE, "CF-DONE" }, { OM2K_BTS_EVT_IS_DONE, "IS-DONE" }, + { OM2K_BTS_EVT_CON_DONE, "CON-DONE" }, { OM2K_BTS_EVT_TF_DONE, "TF-DONE" }, { OM2K_BTS_EVT_TRX_DONE, "TRX-DONE" }, { OM2K_BTS_EVT_STOP, "STOP" }, @@ -2080,6 +2109,7 @@ OM2K_BTS_S_INIT, OM2K_BTS_S_WAIT_CF, OM2K_BTS_S_WAIT_IS, + OM2K_BTS_S_WAIT_CON, OM2K_BTS_S_WAIT_TF, OM2K_BTS_S_WAIT_TRX, OM2K_BTS_S_DONE, @@ -2121,6 +2151,18 @@ struct gsm_bts *bts = obfp->bts; OSMO_ASSERT(event == OM2K_BTS_EVT_IS_DONE); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_CON, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_CON_DONE, bts->c0, + &bts->rbs2000.con.om2k_mo); +} + +static void om2k_bts_s_wait_con(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_CON_DONE); /* TF can take a long time to initialize, wait for 10min */ osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TF, 600, 0); om2k_mo_fsm_start(fi, OM2K_BTS_EVT_TF_DONE, bts->c0, @@ -2178,10 +2220,17 @@ [OM2K_BTS_S_WAIT_IS] = { .in_event_mask = S(OM2K_BTS_EVT_IS_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | - S(OM2K_BTS_S_WAIT_TF), + S(OM2K_BTS_S_WAIT_CON), .name = "WAIT-IS", .action = om2k_bts_s_wait_is, }, + [OM2K_BTS_S_WAIT_CON] = { + .in_event_mask = S(OM2K_BTS_EVT_CON_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TF), + .name = "WAIT-CON", + .action = om2k_bts_s_wait_con, + }, [OM2K_BTS_S_WAIT_TF] = { .in_event_mask = S(OM2K_BTS_EVT_TF_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 64d205c..2a89d49 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -48,9 +48,18 @@ 1, }; +static struct cmd_node om2k_con_group_node = { + OM2K_CON_GROUP_NODE, + "%s(om2k-con-group)# ", + 1, +}; + +struct con_group; + struct oml_node_state { struct gsm_bts *bts; struct abis_om2k_mo mo; + struct con_group *cg; }; static int dummy_config_write(struct vty *v) @@ -246,65 +255,113 @@ return CMD_SUCCESS; } - -struct con_conn_group { - struct llist_head list; - - uint8_t cg; - uint16_t ccp; - uint8_t tag; - uint8_t tei; -}; - -static void add_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static struct con_group *con_group_find_or_create(struct gsm_bts *bts, uint8_t cg) { - struct con_conn_group *ent = talloc_zero(bts, struct con_conn_group); + struct con_group *ent; + llist_for_each_entry(ent, &bts->rbs2000.con.conn_groups, list) { + if (ent->cg == cg) + return ent; + } + + ent = talloc_zero(bts, struct con_group); + ent->bts = bts; ent->cg = cg; - ent->ccp = ccp; - ent->tag = tag; - ent->tei = tei; - + INIT_LLIST_HEAD(&ent->paths); llist_add_tail(&ent->list, &bts->rbs2000.con.conn_groups); + + return ent; } -static int del_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static int con_group_del(struct gsm_bts *bts, uint8_t cg_id) { - struct con_conn_group *grp, *grp2; + struct con_group *cg, *cg2; - llist_for_each_entry_safe(grp, grp2, &bts->rbs2000.con.conn_groups, list) { - if (grp->cg == cg && grp->ccp == ccp && grp->tag == tag - && grp->tei == tei) { - llist_del(&grp->list); - talloc_free(grp); + llist_for_each_entry_safe(cg, cg2, &bts->rbs2000.con.conn_groups, list) { + if (cg->cg == cg_id) { + llist_del(&cg->list); + talloc_free(cg); + return 0; + }; + } + return -ENOENT; +} + +static void con_group_add_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp = talloc_zero(cg, struct con_path); + + cp->ccp = ccp; + cp->ci = ci; + cp->tag = tag; + cp->tei = tei; + llist_add(&cp->list, &cg->paths); +} + +static int con_group_del_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp, *cp2; + llist_for_each_entry_safe(cp, cp2, &cg->paths, list) { + if (cp->ccp == ccp && cp->ci == ci && cp->tag == tag && + cp->tei == tei) { + llist_del(&cp->list); + talloc_free(cp); return 0; } } return -ENOENT; } -#define CON_LIST_HELP "CON connetiton list\n" \ - "Add entry to CON list\n" \ - "Delete entry from CON list\n" \ - "Connection Group Number\n" \ - "CON Connection Point\n" \ - -DEFUN(om2k_con_list_dec, om2k_con_list_dec_cmd, - "con-connection-list (add|del) <1-255> <0-1023> deconcentrated", - CON_LIST_HELP "De-concentrated in/outlet\n") +DEFUN(cfg_om2k_con_group, cfg_om2k_con_group_cmd, + "con-connection-group <1-31>", + "Configure a CON (Concentrator) Connection Group\n" + "CON Connection Group Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); + struct gsm_bts *bts = vty->index; + struct con_group *cg; + uint8_t cgid = atoi(argv[0]); + + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% CON MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + cg = con_group_find_or_create(bts, cgid); + if (!cg) { + vty_out(vty, "%% Cannot create CON Group%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + vty->node = OM2K_CON_GROUP_NODE; + vty->index = cg; + + return CMD_SUCCESS; +} + +#define CON_PATH_HELP "CON Path (In/Out)\n" \ + "Add CON Path to Concentration Group\n" \ + "Delete CON Path from Concentration Group\n" \ + "CON Conection Point\n" \ + "Contiguity Index\n" \ + +DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, + "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") +{ + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tei = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, 0, 0xff); + con_group_add_path(cg, ccp, ci, 0, tei); else { - if (del_con_list(bts, cg, ccp, 0, 0xff) < 0) { - vty_out(vty, "%% No matching CON list entry%s", + if (con_group_del_path(cg, ccp, ci, 0, tei) < 0) { + vty_out(vty, "%% No matching CON Path%s", VTY_NEWLINE); return CMD_WARNING; } @@ -313,20 +370,19 @@ return CMD_SUCCESS; } -DEFUN(om2k_con_list_tei, om2k_con_list_tei_cmd, - "con-connection-list (add|del) <1-255> <0-1023> tei <0-63>", - CON_LIST_HELP "Concentrated in/outlet with TEI\n" "TEI Number\n") +DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, + "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); - uint8_t tei = atoi(argv[3]); + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tag = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, cg, tei); + con_group_add_path(cg, ccp, ci, tag, 0xff); else { - if (del_con_list(bts, cg, ccp, cg, tei) < 0) { + if (con_group_del_path(cg, ccp, ci, tag, 0xff) < 0) { vty_out(vty, "%% No matching CON list entry%s", VTY_NEWLINE); return CMD_WARNING; @@ -437,22 +493,35 @@ return CMD_SUCCESS; } +static void dump_con_group(struct vty *vty, struct con_group *cg) +{ + struct con_path *cp; + + llist_for_each_entry(cp, &cg->paths, list) { + vty_out(vty, " con-path add %u %u ", cp->ccp, cp->ci); + if (cp->tei == 0xff) { + vty_out(vty, "concentrated %u%s", cp->tag, + VTY_NEWLINE); + } else { + vty_out(vty, "deconcentrated %u%s", cp->tei, + VTY_NEWLINE); + } + } +} + void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts) { struct is_conn_group *igrp; - struct con_conn_group *cgrp; + struct con_group *cgrp; llist_for_each_entry(igrp, &bts->rbs2000.is.conn_groups, list) vty_out(vty, " is-connection-list add %u %u %u%s", igrp->icp1, igrp->icp2, igrp->ci, VTY_NEWLINE); llist_for_each_entry(cgrp, &bts->rbs2000.con.conn_groups, list) { - vty_out(vty, " con-connection-list add %u %u ", - cgrp->cg, cgrp->ccp); - if (cgrp->tei == 0xff) - vty_out(vty, "deconcentrated%s", VTY_NEWLINE); - else - vty_out(vty, "tei %u%s", cgrp->tei, VTY_NEWLINE); + vty_out(vty, " con-connection-group %u%s", cgrp->cg, + VTY_NEWLINE); + dump_con_group(vty, cgrp); } } @@ -474,10 +543,14 @@ install_element(OM2K_NODE, &om2k_test_cmd); install_element(OM2K_NODE, &om2k_cap_req_cmd); install_element(OM2K_NODE, &om2k_conf_req_cmd); - install_element(OM2K_NODE, &om2k_con_list_dec_cmd); - install_element(OM2K_NODE, &om2k_con_list_tei_cmd); + + install_node(&om2k_con_group_node, dummy_config_write); + vty_install_default(OM2K_CON_GROUP_NODE); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_dec_cmd); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_conc_cmd); install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd); + install_element(BTS_NODE, &cfg_om2k_con_group_cmd); return 0; } diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0..834da51 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,15 @@ talloc_free(vty->index); vty->index = NULL; break; + case OM2K_CON_GROUP_NODE: + vty->node = BTS_NODE; + { + struct con_group *cg = vty->index; + struct gsm_bts *bts = cg->bts; + vty->index = bts; + vty->index_sub = &bts->description; + } + break; case NAT_BSC_NODE: vty->node = NAT_NODE; { -- To view, visit https://gerrit.osmocom.org/1240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:41:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:41:25 +0000 Subject: openbsc[master]: Support configuration of CON MO Groups/Paths from VTY In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:41:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:41:45 +0000 Subject: openbsc[master]: OM2000: CON MO: Allow larger range for CCP and CI values In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib116c1fac901b293929fce34223d1fd0af15d2bc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:41:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:41:50 +0000 Subject: [MERGED] openbsc[master]: OM2000: CON MO: Allow larger range for CCP and CI values In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: CON MO: Allow larger range for CCP and CI values ...................................................................... OM2000: CON MO: Allow larger range for CCP and CI values it seesm more recent RBS2000 models have much larger CCP and CI value ranges than those of older models. Change-Id: Ib116c1fac901b293929fce34223d1fd0af15d2bc --- M openbsc/src/libbsc/abis_om2000_vty.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 2a89d49..27b1947 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -349,7 +349,7 @@ "Contiguity Index\n" \ DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, - "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + "con-path (add|del) <0-2047> <0-255> deconcentrated <0-63>", CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") { struct con_group *cg = vty->index; @@ -371,7 +371,7 @@ } DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, - "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + "con-path (add|del) <0-2047> <0-255> concentrated <1-16>", CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { struct con_group *cg = vty->index; -- To view, visit https://gerrit.osmocom.org/1242 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib116c1fac901b293929fce34223d1fd0af15d2bc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:41:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:41:50 +0000 Subject: [MERGED] openbsc[master]: Support configuration of CON MO Groups/Paths from VTY In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Support configuration of CON MO Groups/Paths from VTY ...................................................................... Support configuration of CON MO Groups/Paths from VTY The code for supporting the configuration of the OM2000 CON (LAPD Concentrator) MO was so far incomplete and not used from the OM2000 FSM initialization. This patch adds * VTY commands for configuration of CON Groups and Paths * The FSM integration to actually configure the CON MO Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 --- M openbsc/include/openbsc/abis_om2000.h M openbsc/include/openbsc/vty.h M openbsc/src/libbsc/abis_om2000.c M openbsc/src/libbsc/abis_om2000_vty.c M openbsc/src/libcommon/common_vty.c 5 files changed, 237 insertions(+), 71 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/abis_om2000.h b/openbsc/include/openbsc/abis_om2000.h index c745112..b093a03 100644 --- a/openbsc/include/openbsc/abis_om2000.h +++ b/openbsc/include/openbsc/abis_om2000.h @@ -56,6 +56,39 @@ uint8_t ci; }; +/* on-wire format for CON Path */ +struct om2k_con_path { + uint16_t ccp; + uint8_t ci; + uint8_t tag; + uint8_t tei; +} __attribute__ ((packed)); + +/* internal data format for CON group */ +struct con_group { + /* links list of CON groups in BTS */ + struct llist_head list; + struct gsm_bts *bts; + /* CON Group ID */ + uint8_t cg; + /* list of CON paths in this group */ + struct llist_head paths; +}; + +/* internal data format for CON path */ +struct con_path { + /* links with con_group.paths */ + struct llist_head list; + /* CON Connection Point */ + uint16_t ccp; + /* Contiguity Index */ + uint8_t ci; + /* Tag */ + uint8_t tag; + /* TEI */ + uint8_t tei; +}; + extern const struct abis_om2k_mo om2k_mo_cf; extern const struct abis_om2k_mo om2k_mo_is; extern const struct abis_om2k_mo om2k_mo_con; diff --git a/openbsc/include/openbsc/vty.h b/openbsc/include/openbsc/vty.h index 315db0d..ad2cd2a 100644 --- a/openbsc/include/openbsc/vty.h +++ b/openbsc/include/openbsc/vty.h @@ -29,6 +29,7 @@ NAT_BSC_NODE, MSC_NODE, OM2K_NODE, + OM2K_CON_GROUP_NODE, TRUNK_NODE, PGROUP_NODE, MNCC_INT_NODE, diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 8c4bfb3..2733a90 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1132,20 +1132,48 @@ return abis_om2k_sendmsg(bts, msg); } -int abis_om2k_tx_con_conf_req(struct gsm_bts *bts, uint8_t *data, - unsigned int len) +int abis_om2k_tx_con_conf_req(struct gsm_bts *bts) { struct msgb *msg = om2k_msgb_alloc(); struct abis_om2k_hdr *o2k; + struct con_group *grp; + unsigned int num_grps = 0; - o2k = (struct abis_om2k_hdr *) msgb_put(msg, sizeof(*o2k)); + /* count number of groups in linked list */ + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) + num_grps++; + + if (!num_grps) + return -EINVAL; + + /* first build the value part of the OM2K_DEI_CON_CONN_LIST DEI */ + msgb_put_u8(msg, num_grps); + llist_for_each_entry(grp, &bts->rbs2000.con.conn_groups, list) { + struct con_path *cp; + unsigned int num_paths = 0; + llist_for_each_entry(cp, &grp->paths, list) + num_paths++; + msgb_put_u8(msg, num_paths); + llist_for_each_entry(cp, &grp->paths, list) { + struct om2k_con_path *om2k_cp; + om2k_cp = (struct om2k_con_path *) msgb_put(msg, sizeof(*om2k_cp)); + om2k_cp->ccp = htons(cp->ccp); + om2k_cp->ci = cp->ci; + om2k_cp->tag = cp->tag; + om2k_cp->tei = cp->tei; + } + } + msgb_push_u8(msg, msgb_length(msg)); + msgb_push_u8(msg, OM2K_DEI_CON_CONN_LIST); + + /* pre-pend the list number DEIs */ + msgb_tv_push(msg, OM2K_DEI_END_LIST_NR, 1); + msgb_tv_push(msg, OM2K_DEI_LIST_NR, 1); + + /* pre-pend the OM2K header */ + o2k = (struct abis_om2k_hdr *) msgb_push(msg, sizeof(*o2k)); fill_om2k_hdr(o2k, &bts->rbs2000.con.om2k_mo.addr, OM2K_MSGT_CON_CONF_REQ); - - msgb_tv_put(msg, OM2K_DEI_LIST_NR, 1); - msgb_tv_put(msg, OM2K_DEI_END_LIST_NR, 1); - - msgb_tlv_put(msg, OM2K_DEI_CON_CONN_LIST, len, data); DEBUGP(DNM, "Tx MO=%s %s\n", om2k_mo_name(&bts->rbs2000.con.om2k_mo.addr), @@ -1566,8 +1594,7 @@ abis_om2k_tx_is_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_CON: - /* TODO */ - //abis_om2k_tx_con_conf_req(omfp->trx->bts, data, len); + abis_om2k_tx_con_conf_req(omfp->trx->bts); break; case OM2K_MO_CLS_TX: abis_om2k_tx_tx_conf_req(omfp->trx); @@ -2061,6 +2088,7 @@ OM2K_BTS_EVT_START, OM2K_BTS_EVT_CF_DONE, OM2K_BTS_EVT_IS_DONE, + OM2K_BTS_EVT_CON_DONE, OM2K_BTS_EVT_TF_DONE, OM2K_BTS_EVT_TRX_DONE, OM2K_BTS_EVT_STOP, @@ -2070,6 +2098,7 @@ { OM2K_BTS_EVT_START, "START" }, { OM2K_BTS_EVT_CF_DONE, "CF-DONE" }, { OM2K_BTS_EVT_IS_DONE, "IS-DONE" }, + { OM2K_BTS_EVT_CON_DONE, "CON-DONE" }, { OM2K_BTS_EVT_TF_DONE, "TF-DONE" }, { OM2K_BTS_EVT_TRX_DONE, "TRX-DONE" }, { OM2K_BTS_EVT_STOP, "STOP" }, @@ -2080,6 +2109,7 @@ OM2K_BTS_S_INIT, OM2K_BTS_S_WAIT_CF, OM2K_BTS_S_WAIT_IS, + OM2K_BTS_S_WAIT_CON, OM2K_BTS_S_WAIT_TF, OM2K_BTS_S_WAIT_TRX, OM2K_BTS_S_DONE, @@ -2121,6 +2151,18 @@ struct gsm_bts *bts = obfp->bts; OSMO_ASSERT(event == OM2K_BTS_EVT_IS_DONE); + osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_CON, + BTS_FSM_TIMEOUT, 0); + om2k_mo_fsm_start(fi, OM2K_BTS_EVT_CON_DONE, bts->c0, + &bts->rbs2000.con.om2k_mo); +} + +static void om2k_bts_s_wait_con(struct osmo_fsm_inst *fi, uint32_t event, void *data) +{ + struct om2k_bts_fsm_priv *obfp = fi->priv; + struct gsm_bts *bts = obfp->bts; + + OSMO_ASSERT(event == OM2K_BTS_EVT_CON_DONE); /* TF can take a long time to initialize, wait for 10min */ osmo_fsm_inst_state_chg(fi, OM2K_BTS_S_WAIT_TF, 600, 0); om2k_mo_fsm_start(fi, OM2K_BTS_EVT_TF_DONE, bts->c0, @@ -2178,10 +2220,17 @@ [OM2K_BTS_S_WAIT_IS] = { .in_event_mask = S(OM2K_BTS_EVT_IS_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | - S(OM2K_BTS_S_WAIT_TF), + S(OM2K_BTS_S_WAIT_CON), .name = "WAIT-IS", .action = om2k_bts_s_wait_is, }, + [OM2K_BTS_S_WAIT_CON] = { + .in_event_mask = S(OM2K_BTS_EVT_CON_DONE), + .out_state_mask = S(OM2K_BTS_S_ERROR) | + S(OM2K_BTS_S_WAIT_TF), + .name = "WAIT-CON", + .action = om2k_bts_s_wait_con, + }, [OM2K_BTS_S_WAIT_TF] = { .in_event_mask = S(OM2K_BTS_EVT_TF_DONE), .out_state_mask = S(OM2K_BTS_S_ERROR) | diff --git a/openbsc/src/libbsc/abis_om2000_vty.c b/openbsc/src/libbsc/abis_om2000_vty.c index 64d205c..2a89d49 100644 --- a/openbsc/src/libbsc/abis_om2000_vty.c +++ b/openbsc/src/libbsc/abis_om2000_vty.c @@ -48,9 +48,18 @@ 1, }; +static struct cmd_node om2k_con_group_node = { + OM2K_CON_GROUP_NODE, + "%s(om2k-con-group)# ", + 1, +}; + +struct con_group; + struct oml_node_state { struct gsm_bts *bts; struct abis_om2k_mo mo; + struct con_group *cg; }; static int dummy_config_write(struct vty *v) @@ -246,65 +255,113 @@ return CMD_SUCCESS; } - -struct con_conn_group { - struct llist_head list; - - uint8_t cg; - uint16_t ccp; - uint8_t tag; - uint8_t tei; -}; - -static void add_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static struct con_group *con_group_find_or_create(struct gsm_bts *bts, uint8_t cg) { - struct con_conn_group *ent = talloc_zero(bts, struct con_conn_group); + struct con_group *ent; + llist_for_each_entry(ent, &bts->rbs2000.con.conn_groups, list) { + if (ent->cg == cg) + return ent; + } + + ent = talloc_zero(bts, struct con_group); + ent->bts = bts; ent->cg = cg; - ent->ccp = ccp; - ent->tag = tag; - ent->tei = tei; - + INIT_LLIST_HEAD(&ent->paths); llist_add_tail(&ent->list, &bts->rbs2000.con.conn_groups); + + return ent; } -static int del_con_list(struct gsm_bts *bts, uint8_t cg, uint16_t ccp, - uint8_t tag, uint8_t tei) +static int con_group_del(struct gsm_bts *bts, uint8_t cg_id) { - struct con_conn_group *grp, *grp2; + struct con_group *cg, *cg2; - llist_for_each_entry_safe(grp, grp2, &bts->rbs2000.con.conn_groups, list) { - if (grp->cg == cg && grp->ccp == ccp && grp->tag == tag - && grp->tei == tei) { - llist_del(&grp->list); - talloc_free(grp); + llist_for_each_entry_safe(cg, cg2, &bts->rbs2000.con.conn_groups, list) { + if (cg->cg == cg_id) { + llist_del(&cg->list); + talloc_free(cg); + return 0; + }; + } + return -ENOENT; +} + +static void con_group_add_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp = talloc_zero(cg, struct con_path); + + cp->ccp = ccp; + cp->ci = ci; + cp->tag = tag; + cp->tei = tei; + llist_add(&cp->list, &cg->paths); +} + +static int con_group_del_path(struct con_group *cg, uint16_t ccp, + uint8_t ci, uint8_t tag, uint8_t tei) +{ + struct con_path *cp, *cp2; + llist_for_each_entry_safe(cp, cp2, &cg->paths, list) { + if (cp->ccp == ccp && cp->ci == ci && cp->tag == tag && + cp->tei == tei) { + llist_del(&cp->list); + talloc_free(cp); return 0; } } return -ENOENT; } -#define CON_LIST_HELP "CON connetiton list\n" \ - "Add entry to CON list\n" \ - "Delete entry from CON list\n" \ - "Connection Group Number\n" \ - "CON Connection Point\n" \ - -DEFUN(om2k_con_list_dec, om2k_con_list_dec_cmd, - "con-connection-list (add|del) <1-255> <0-1023> deconcentrated", - CON_LIST_HELP "De-concentrated in/outlet\n") +DEFUN(cfg_om2k_con_group, cfg_om2k_con_group_cmd, + "con-connection-group <1-31>", + "Configure a CON (Concentrator) Connection Group\n" + "CON Connection Group Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); + struct gsm_bts *bts = vty->index; + struct con_group *cg; + uint8_t cgid = atoi(argv[0]); + + if (bts->type != GSM_BTS_TYPE_RBS2000) { + vty_out(vty, "%% CON MO only exists in RBS2000%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + cg = con_group_find_or_create(bts, cgid); + if (!cg) { + vty_out(vty, "%% Cannot create CON Group%s", + VTY_NEWLINE); + return CMD_WARNING; + } + + vty->node = OM2K_CON_GROUP_NODE; + vty->index = cg; + + return CMD_SUCCESS; +} + +#define CON_PATH_HELP "CON Path (In/Out)\n" \ + "Add CON Path to Concentration Group\n" \ + "Delete CON Path from Concentration Group\n" \ + "CON Conection Point\n" \ + "Contiguity Index\n" \ + +DEFUN(cfg_om2k_con_path_dec, cfg_om2k_con_path_dec_cmd, + "con-path (add|del) <0-1023> <0-7> deconcentrated <0-63>", + CON_PATH_HELP "De-concentrated in/outlet\n" "TEI Value\n") +{ + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tei = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, 0, 0xff); + con_group_add_path(cg, ccp, ci, 0, tei); else { - if (del_con_list(bts, cg, ccp, 0, 0xff) < 0) { - vty_out(vty, "%% No matching CON list entry%s", + if (con_group_del_path(cg, ccp, ci, 0, tei) < 0) { + vty_out(vty, "%% No matching CON Path%s", VTY_NEWLINE); return CMD_WARNING; } @@ -313,20 +370,19 @@ return CMD_SUCCESS; } -DEFUN(om2k_con_list_tei, om2k_con_list_tei_cmd, - "con-connection-list (add|del) <1-255> <0-1023> tei <0-63>", - CON_LIST_HELP "Concentrated in/outlet with TEI\n" "TEI Number\n") +DEFUN(cfg_om2k_con_path_conc, cfg_om2k_con_path_conc_cmd, + "con-path (add|del) <0-1023> <0-7> concentrated <1-16>", + CON_PATH_HELP "Concentrated in/outlet\n" "Tag Number\n") { - struct oml_node_state *oms = vty->index; - struct gsm_bts *bts = oms->bts; - uint8_t cg = atoi(argv[1]); - uint16_t ccp = atoi(argv[2]); - uint8_t tei = atoi(argv[3]); + struct con_group *cg = vty->index; + uint16_t ccp = atoi(argv[1]); + uint8_t ci = atoi(argv[2]); + uint8_t tag = atoi(argv[3]); if (!strcmp(argv[0], "add")) - add_con_list(bts, cg, ccp, cg, tei); + con_group_add_path(cg, ccp, ci, tag, 0xff); else { - if (del_con_list(bts, cg, ccp, cg, tei) < 0) { + if (con_group_del_path(cg, ccp, ci, tag, 0xff) < 0) { vty_out(vty, "%% No matching CON list entry%s", VTY_NEWLINE); return CMD_WARNING; @@ -437,22 +493,35 @@ return CMD_SUCCESS; } +static void dump_con_group(struct vty *vty, struct con_group *cg) +{ + struct con_path *cp; + + llist_for_each_entry(cp, &cg->paths, list) { + vty_out(vty, " con-path add %u %u ", cp->ccp, cp->ci); + if (cp->tei == 0xff) { + vty_out(vty, "concentrated %u%s", cp->tag, + VTY_NEWLINE); + } else { + vty_out(vty, "deconcentrated %u%s", cp->tei, + VTY_NEWLINE); + } + } +} + void abis_om2k_config_write_bts(struct vty *vty, struct gsm_bts *bts) { struct is_conn_group *igrp; - struct con_conn_group *cgrp; + struct con_group *cgrp; llist_for_each_entry(igrp, &bts->rbs2000.is.conn_groups, list) vty_out(vty, " is-connection-list add %u %u %u%s", igrp->icp1, igrp->icp2, igrp->ci, VTY_NEWLINE); llist_for_each_entry(cgrp, &bts->rbs2000.con.conn_groups, list) { - vty_out(vty, " con-connection-list add %u %u ", - cgrp->cg, cgrp->ccp); - if (cgrp->tei == 0xff) - vty_out(vty, "deconcentrated%s", VTY_NEWLINE); - else - vty_out(vty, "tei %u%s", cgrp->tei, VTY_NEWLINE); + vty_out(vty, " con-connection-group %u%s", cgrp->cg, + VTY_NEWLINE); + dump_con_group(vty, cgrp); } } @@ -474,10 +543,14 @@ install_element(OM2K_NODE, &om2k_test_cmd); install_element(OM2K_NODE, &om2k_cap_req_cmd); install_element(OM2K_NODE, &om2k_conf_req_cmd); - install_element(OM2K_NODE, &om2k_con_list_dec_cmd); - install_element(OM2K_NODE, &om2k_con_list_tei_cmd); + + install_node(&om2k_con_group_node, dummy_config_write); + vty_install_default(OM2K_CON_GROUP_NODE); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_dec_cmd); + install_element(OM2K_CON_GROUP_NODE, &cfg_om2k_con_path_conc_cmd); install_element(BTS_NODE, &cfg_bts_is_conn_list_cmd); + install_element(BTS_NODE, &cfg_om2k_con_group_cmd); return 0; } diff --git a/openbsc/src/libcommon/common_vty.c b/openbsc/src/libcommon/common_vty.c index a0674f0..834da51 100644 --- a/openbsc/src/libcommon/common_vty.c +++ b/openbsc/src/libcommon/common_vty.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -79,6 +80,15 @@ talloc_free(vty->index); vty->index = NULL; break; + case OM2K_CON_GROUP_NODE: + vty->node = BTS_NODE; + { + struct con_group *cg = vty->index; + struct gsm_bts *bts = cg->bts; + vty->index = bts; + vty->index_sub = &bts->description; + } + break; case NAT_BSC_NODE: vty->node = NAT_NODE; { -- To view, visit https://gerrit.osmocom.org/1240 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I56dc1b5e35adef3a2078bcf9536537eb0f454192 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:43:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:43:12 +0000 Subject: osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1046 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:43:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:43:32 +0000 Subject: osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:02 +0000 Subject: osmo-bts[master]: Replace link_id constant with define In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:05 +0000 Subject: [MERGED] osmo-bts[master]: Replace link_id constant with define In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Replace link_id constant with define ...................................................................... Replace link_id constant with define Instead of using constant for link_id directly, use shared define value. Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8 --- M include/osmo-bts/l1sap.h M src/common/scheduler.c M src/osmo-bts-litecell15/l1_if.c M src/osmo-bts-octphy/l1_if.c M src/osmo-bts-sysmo/l1_if.c M src/osmo-bts-trx/l1_if.c 6 files changed, 57 insertions(+), 53 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h index 97a2f04..dcebc1d 100644 --- a/include/osmo-bts/l1sap.h +++ b/include/osmo-bts/l1sap.h @@ -3,6 +3,10 @@ #include +/* lchan link ID */ +#define LID_SACCH 0x40 +#define LID_DEDIC 0x00 + /* timeslot and subslot from chan_nr */ #define L1SAP_CHAN2TS(chan_nr) (chan_nr & 7) #define L1SAP_CHAN2SS_TCHH(chan_nr) ((chan_nr >> 3) & 1) @@ -10,7 +14,7 @@ #define L1SAP_CHAN2SS_SDCCH8(chan_nr) ((chan_nr >> 3) & 7) /* logical channel from chan_nr + link_id */ -#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == 0x40) +#define L1SAP_IS_LINK_SACCH(link_id) ((link_id & 0xC0) == LID_SACCH) #define L1SAP_IS_CHAN_TCHF(chan_nr) ((chan_nr & 0xf8) == 0x08) #define L1SAP_IS_CHAN_TCHH(chan_nr) ((chan_nr & 0xf0) == 0x10) #define L1SAP_IS_CHAN_SDCCH4(chan_nr) ((chan_nr & 0xe0) == 0x20) diff --git a/src/common/scheduler.c b/src/common/scheduler.c index ec66cfc..db1f977 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -116,44 +116,44 @@ */ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = { - { 0, TRXC_IDLE, 0, 0, "IDLE", NULL, tx_idle_fn, NULL, 1 }, - { 0, TRXC_FCCH, 0, 0, "FCCH", NULL, tx_fcch_fn, NULL, 1 }, - { 0, TRXC_SCH, 0, 0, "SCH", NULL, tx_sch_fn, NULL, 1 }, - { 0, TRXC_BCCH, 0x80, 0x00, "BCCH", rts_data_fn, tx_data_fn, NULL, 1 }, - { 0, TRXC_RACH, 0x88, 0x00, "RACH", NULL, NULL, rx_rach_fn, 1 }, - { 0, TRXC_CCCH, 0x90, 0x00, "CCCH", rts_data_fn, tx_data_fn, NULL, 1 }, - { 0, TRXC_TCHF, 0x08, 0x00, "TCH/F", rts_tchf_fn, tx_tchf_fn, rx_tchf_fn, 0 }, - { 0, TRXC_TCHH_0, 0x10, 0x00, "TCH/H(0)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, - { 0, TRXC_TCHH_1, 0x18, 0x00, "TCH/H(1)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, - { 0, TRXC_SDCCH4_0, 0x20, 0x00, "SDCCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_1, 0x28, 0x00, "SDCCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_2, 0x30, 0x00, "SDCCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH4_3, 0x38, 0x00, "SDCCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_0, 0x40, 0x00, "SDCCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_1, 0x48, 0x00, "SDCCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_2, 0x50, 0x00, "SDCCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_3, 0x58, 0x00, "SDCCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_4, 0x60, 0x00, "SDCCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_5, 0x68, 0x00, "SDCCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_6, 0x70, 0x00, "SDCCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SDCCH8_7, 0x78, 0x00, "SDCCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTF, 0x08, 0x40, "SACCH/TF", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTH_0, 0x10, 0x40, "SACCH/TH(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCHTH_1, 0x18, 0x40, "SACCH/TH(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_0, 0x20, 0x40, "SACCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_1, 0x28, 0x40, "SACCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_2, 0x30, 0x40, "SACCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH4_3, 0x38, 0x40, "SACCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_0, 0x40, 0x40, "SACCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_1, 0x48, 0x40, "SACCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_2, 0x50, 0x40, "SACCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_3, 0x58, 0x40, "SACCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_4, 0x60, 0x40, "SACCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_5, 0x68, 0x40, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_6, 0x70, 0x40, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 0, TRXC_SACCH8_7, 0x78, 0x40, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, - { 1, TRXC_PDTCH, 0x08, 0x00, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, - { 1, TRXC_PTCCH, 0x08, 0x00, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_IDLE, 0, LID_DEDIC, "IDLE", NULL, tx_idle_fn, NULL, 1 }, + { 0, TRXC_FCCH, 0, LID_DEDIC, "FCCH", NULL, tx_fcch_fn, NULL, 1 }, + { 0, TRXC_SCH, 0, LID_DEDIC, "SCH", NULL, tx_sch_fn, NULL, 1 }, + { 0, TRXC_BCCH, 0x80, LID_DEDIC, "BCCH", rts_data_fn, tx_data_fn, NULL, 1 }, + { 0, TRXC_RACH, 0x88, LID_DEDIC, "RACH", NULL, NULL, rx_rach_fn, 1 }, + { 0, TRXC_CCCH, 0x90, LID_DEDIC, "CCCH", rts_data_fn, tx_data_fn, NULL, 1 }, + { 0, TRXC_TCHF, 0x08, LID_DEDIC, "TCH/F", rts_tchf_fn, tx_tchf_fn, rx_tchf_fn, 0 }, + { 0, TRXC_TCHH_0, 0x10, LID_DEDIC, "TCH/H(0)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, + { 0, TRXC_TCHH_1, 0x18, LID_DEDIC, "TCH/H(1)", rts_tchh_fn, tx_tchh_fn, rx_tchh_fn, 0 }, + { 0, TRXC_SDCCH4_0, 0x20, LID_DEDIC, "SDCCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_1, 0x28, LID_DEDIC, "SDCCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_2, 0x30, LID_DEDIC, "SDCCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH4_3, 0x38, LID_DEDIC, "SDCCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_0, 0x40, LID_DEDIC, "SDCCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_1, 0x48, LID_DEDIC, "SDCCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_2, 0x50, LID_DEDIC, "SDCCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_3, 0x58, LID_DEDIC, "SDCCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_4, 0x60, LID_DEDIC, "SDCCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_5, 0x68, LID_DEDIC, "SDCCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_6, 0x70, LID_DEDIC, "SDCCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SDCCH8_7, 0x78, LID_DEDIC, "SDCCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTF, 0x08, LID_SACCH, "SACCH/TF", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTH_0, 0x10, LID_SACCH, "SACCH/TH(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCHTH_1, 0x18, LID_SACCH, "SACCH/TH(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_0, 0x20, LID_SACCH, "SACCH/4(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_1, 0x28, LID_SACCH, "SACCH/4(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_2, 0x30, LID_SACCH, "SACCH/4(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH4_3, 0x38, LID_SACCH, "SACCH/4(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_0, 0x40, LID_SACCH, "SACCH/8(0)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_1, 0x48, LID_SACCH, "SACCH/8(1)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_2, 0x50, LID_SACCH, "SACCH/8(2)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_3, 0x58, LID_SACCH, "SACCH/8(3)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_4, 0x60, LID_SACCH, "SACCH/8(4)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_5, 0x68, LID_SACCH, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_6, 0x70, LID_SACCH, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 0, TRXC_SACCH8_7, 0x78, LID_SACCH, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, + { 1, TRXC_PDTCH, 0x08, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 }, + { 1, TRXC_PTCCH, 0x08, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 }, }; diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c index 9d57c2f..4a6c739 100644 --- a/src/osmo-bts-litecell15/l1_if.c +++ b/src/osmo-bts-litecell15/l1_if.c @@ -788,9 +788,9 @@ if (chan_nr) { fn = rts_ind->u32Fn; if (rts_ind->sapi == GsmL1_Sapi_Sacch) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; /* recycle the msgb and use it for the L1 primitive, * which means that we (or our caller) must not free it */ rc = msgb_trim(l1p_msg, sizeof(*l1sap)); @@ -917,7 +917,7 @@ return ENOTSUP; } fn = data_ind->u32Fn; - link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? 0x40 : 0x00; + link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c index c4105ac..0fc51fc 100644 --- a/src/osmo-bts-octphy/l1_if.c +++ b/src/osmo-bts-octphy/l1_if.c @@ -862,9 +862,9 @@ chan_nr = chan_nr_by_sapi(trx->ts[ts_num].pchan, sapi, sc, ts_num, fn); if (chan_nr) { if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; rc = msgb_trim(l1p_msg, sizeof(*l1sap)); if (rc < 0) @@ -985,9 +985,9 @@ } if (sapi == cOCTVC1_GSM_SAPI_ENUM_SACCH) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; memset(&l1sap, 0, sizeof(l1sap)); diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index d14eac4..61ffe39 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -783,9 +783,9 @@ if (chan_nr) { fn = rts_ind->u32Fn; if (rts_ind->sapi == GsmL1_Sapi_Sacch) - link_id = 0x40; + link_id = LID_SACCH; else - link_id = 0; + link_id = LID_DEDIC; /* recycle the msgb and use it for the L1 primitive, * which means that we (or our caller) must not free it */ rc = msgb_trim(l1p_msg, sizeof(*l1sap)); @@ -911,7 +911,7 @@ return ENOTSUP; } fn = data_ind->u32Fn; - link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? 0x40 : 0x00; + link_id = (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC; process_meas_res(trx, chan_nr, &data_ind->measParam); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index 4465f3b..ea2088b 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -591,9 +591,9 @@ break; } /* activate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x00, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 1); /* activate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x40, 1); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 1); /* set mode */ trx_sched_set_mode(&l1h->l1s, chan_nr, lchan->rsl_cmode, lchan->tch_mode, @@ -641,12 +641,12 @@ break; } /* deactivate associated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x40, 0); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_SACCH, 0); if (!l1sap->u.info.u.act_req.sacch_only) { /* set lchan inactive */ lchan_set_state(lchan, LCHAN_S_NONE); /* deactivate dedicated channel */ - trx_sched_set_lchan(&l1h->l1s, chan_nr, 0x00, 0); + trx_sched_set_lchan(&l1h->l1s, chan_nr, LID_DEDIC, 0); /* confirm only on dedicated channel */ mph_info_chan_confirm(l1h, chan_nr, PRIM_INFO_DEACTIVATE, 0); -- To view, visit https://gerrit.osmocom.org/1236 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:08 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:08 +0000 Subject: [MERGED] osmo-bts[master]: Remove duplicated code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Remove duplicated code ...................................................................... Remove duplicated code Having duplicated code to fill in fn & tn values makes it harder to read and modify static gsmtap_p* functions. Fix this by removing the duplication and moving the common code one level up. Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383 --- M src/common/l1sap.c 1 file changed, 11 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 71c4b0b..f4bc5ce 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -205,15 +205,13 @@ /* send primitive as gsmtap */ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *tn, uint8_t *ss, uint32_t *fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len) { struct msgb *msg = l1sap->oph.msg; uint8_t chan_nr, link_id; *data = msg->data + sizeof(struct osmo_phsap_prim); *len = msg->len - sizeof(struct osmo_phsap_prim); - *fn = l1sap->u.data.fn; - *tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); chan_nr = l1sap->u.data.chan_nr; link_id = l1sap->u.data.link_id; @@ -234,7 +232,7 @@ #warning Set BS_AG_BLKS_RES /* The sapi depends on DSP configuration, not * on the actual SYSTEM INFORMATION 3. */ - if (L1SAP_FN2CCCHBLOCK(*fn) >= 1) + if (L1SAP_FN2CCCHBLOCK(fn) >= 1) *chan_type = GSMTAP_CHANNEL_PCH; else *chan_type = GSMTAP_CHANNEL_AGCH; @@ -246,18 +244,16 @@ } static int gsmtap_pdch(struct osmo_phsap_prim *l1sap, uint8_t *chan_type, - uint8_t *tn, uint8_t *ss, uint32_t *fn, uint8_t **data, int *len) + uint8_t *ss, uint32_t fn, uint8_t **data, int *len) { struct msgb *msg = l1sap->oph.msg; *data = msg->data + sizeof(struct osmo_phsap_prim); *len = msg->len - sizeof(struct osmo_phsap_prim); - *fn = l1sap->u.data.fn; - *tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); - if (L1SAP_IS_PTCCH(*fn)) { + if (L1SAP_IS_PTCCH(fn)) { *chan_type = GSMTAP_CHANNEL_PTCCH; - *ss = L1SAP_FN2PTCCHBLOCK(*fn); + *ss = L1SAP_FN2PTCCHBLOCK(fn); if (l1sap->oph.primitive == PRIM_OP_INDICATION) { if ((*data[0]) == 7) @@ -309,12 +305,14 @@ uplink = 0; /* fall through */ case OSMO_PRIM(PRIM_PH_DATA, PRIM_OP_INDICATION): + fn = l1sap->u.data.fn; + tn = L1SAP_CHAN2TS(l1sap->u.data.chan_nr); if (ts_is_pdch(&trx->ts[tn])) - rc = gsmtap_pdch(l1sap, &chan_type, &tn, &ss, &fn, &data, - &len); + rc = gsmtap_pdch(l1sap, &chan_type, &ss, fn, &data, + &len); else - rc = gsmtap_ph_data(l1sap, &chan_type, &tn, &ss, &fn, - &data, &len); + rc = gsmtap_ph_data(l1sap, &chan_type, &ss, fn, &data, + &len); break; case OSMO_PRIM(PRIM_PH_RACH, PRIM_OP_INDICATION): rc = gsmtap_ph_rach(l1sap, &chan_type, &tn, &ss, &fn, &data, -- To view, visit https://gerrit.osmocom.org/1235 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:45 +0000 Subject: openbsc[master]: Add empty libcommon-cs In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:53 +0000 Subject: openbsc[master]: define mncc_recv_cb_t to avoid code dup In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:44:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:44:59 +0000 Subject: openbsc[master]: move to libcommon-cs: net init 1: rename to bsc_network_init In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:45:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:45:19 +0000 Subject: openbsc[master]: move to libcommon-cs: net init 3: actual move In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If06316b97002390dc9a434686750cb96193ea63b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:45:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:45:47 +0000 Subject: openbsc[master]: tests: drop unused libmsc, unneeded duplicate libbsc linking In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1132 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9073eba41a1cd3136ed7a9def6fe8aaf282eaa18 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:45:59 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:45:59 +0000 Subject: openbsc[master]: move to libcommon-cs: global vty gsm_network pointer In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1133 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I26c5c47de08f899b896813d09612d5cb2f8e42d6 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:46:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:46:02 +0000 Subject: openbsc[master]: move to libcommon-cs: network VTY that isn't BSC-specific In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1134 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I871b7b32a0c56fdce983e409cf244ec487d24e71 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:46:13 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:46:13 +0000 Subject: openbsc[master]: Move timezone settings up to network level In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1137 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I69848887d92990f3d6f969be80f6ef91f6bdbbe8 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 20:46:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 13 Nov 2016 20:46:18 +0000 Subject: openbsc[master]: move to libcommon-cs: net timezone VTY config In-Reply-To: References: Message-ID: Patch Set 5: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1138 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9712b2e07b4f1ab8d2e4ad40a8d771e98ed25b20 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 21:29:08 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 21:29:08 +0000 Subject: [PATCH] libosmocore[master]: wqueue: Reject messges if queue is considered full Message-ID: Review at https://gerrit.osmocom.org/1243 wqueue: Reject messges if queue is considered full The write queue was always meant to not queue more than the max_length messages but the implementation never rejected a message. Begin to log and enforce the queue size limit, add a testcase to verify the code and initialize except_cb as part of a fix for that new test case. Real applications might now run into the queue limit and drop messages where they just queued them before. It is unfortunate but I still think it is good to implement the routine as it was intended. We need to review osmo_wqueue_enqueue once more to see that no msgb is leaked. Change-Id: I1e6aef30f3e73d4bcf2967bc49f0783aa65395ae --- M .gitignore M src/write_queue.c M tests/Makefile.am M tests/testsuite.at A tests/write_queue/wqueue_test.c A tests/write_queue/wqueue_test.ok 6 files changed, 103 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/43/1243/1 diff --git a/.gitignore b/.gitignore index 90c8c85..50209b0 100644 --- a/.gitignore +++ b/.gitignore @@ -95,6 +95,7 @@ tests/gsup/gsup_test tests/tlv/tlv_test tests/fsm/fsm_test +tests/write_queue/wqueue_test utils/osmo-arfcn utils/osmo-auc-gen diff --git a/src/write_queue.c b/src/write_queue.c index 3e488ae..c7a4320 100644 --- a/src/write_queue.c +++ b/src/write_queue.c @@ -1,6 +1,6 @@ /* Generic write queue implementation */ /* - * (C) 2010 by Holger Hans Peter Freyther + * (C) 2010-2016 by Holger Hans Peter Freyther * (C) 2010 by On-Waves * * All Rights Reserved @@ -23,6 +23,7 @@ #include #include +#include /*! \addtogroup write_queue * @{ @@ -93,6 +94,7 @@ queue->current_length = 0; queue->read_cb = NULL; queue->write_cb = NULL; + queue->except_cb = NULL; queue->bfd.cb = osmo_wqueue_bfd_cb; INIT_LLIST_HEAD(&queue->msg_queue); } @@ -104,8 +106,11 @@ */ int osmo_wqueue_enqueue(struct osmo_wqueue *queue, struct msgb *data) { -// if (queue->current_length + 1 >= queue->max_length) -// LOGP(DMSC, LOGL_ERROR, "The queue is full. Dropping not yet implemented.\n"); + if (queue->current_length >= queue->max_length) { + LOGP(DLGLOBAL, LOGL_ERROR, + "wqueue(%p) is full. Rejecting msgb\n", queue); + return -ENOSPC; + } ++queue->current_length; msgb_enqueue(&queue->msg_queue, data); diff --git a/tests/Makefile.am b/tests/Makefile.am index ae5735a..8b6acbc 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,7 +13,8 @@ vty/vty_test comp128/comp128_test utils/utils_test \ smscb/gsm0341_test stats/stats_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ - sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test + sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test \ + write_queue/wqueue_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -129,6 +130,9 @@ fsm_fsm_test_SOURCES = fsm/fsm_test.c fsm_fsm_test_LDADD = $(top_builddir)/src/libosmocore.la +write_queue_wqueue_test_SOURCES = write_queue/wqueue_test.c +write_queue_wqueue_test_LDADD = $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac :;{ \ @@ -164,7 +168,7 @@ utils/utils_test.ok stats/stats_test.ok \ bitvec/bitvec_test.ok msgb/msgb_test.ok bits/bitcomp_test.ok \ sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \ - fsm/fsm_test.ok fsm/fsm_test.err + fsm/fsm_test.ok fsm/fsm_test.err write_queue/wqueue_test.ok DISTCLEANFILES = atconfig diff --git a/tests/testsuite.at b/tests/testsuite.at index 2f274f9..3b8efe3 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -177,6 +177,12 @@ AT_CHECK([$abs_top_builddir/tests/stats/stats_test], [0], [expout], [ignore]) AT_CLEANUP +AT_SETUP([write_queue]) +AT_KEYWORDS([write_queue]) +cat $abs_srcdir/write_queue/wqueue_test.ok > expout +AT_CHECK([$abs_top_builddir/tests/write_queue/wqueue_test], [0], [expout], [ignore]) +AT_CLEANUP + AT_SETUP([bssgp-fc]) AT_KEYWORDS([bssgp-fc]) cat $abs_srcdir/gb/bssgp_fc_tests.ok > expout diff --git a/tests/write_queue/wqueue_test.c b/tests/write_queue/wqueue_test.c new file mode 100644 index 0000000..827e4e8 --- /dev/null +++ b/tests/write_queue/wqueue_test.c @@ -0,0 +1,81 @@ +#include +#include +#include + +static const struct log_info_cat default_categories[] = { +}; + +static const struct log_info log_info = { + .cat = default_categories, + .num_cat = ARRAY_SIZE(default_categories), +}; + +static void test_wqueue_limit(void) +{ + struct msgb *msg; + struct osmo_wqueue wqueue; + int rc; + + osmo_wqueue_init(&wqueue, 0); + OSMO_ASSERT(wqueue.max_length == 0); + OSMO_ASSERT(wqueue.current_length == 0); + OSMO_ASSERT(wqueue.read_cb == NULL); + OSMO_ASSERT(wqueue.write_cb == NULL); + OSMO_ASSERT(wqueue.except_cb == NULL); + + /* try to add and fail */ + msg = msgb_alloc(4096, "msg1"); + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc < 0); + + /* add one and fail on the second */ + wqueue.max_length = 1; + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(wqueue.current_length == 1); + msg = msgb_alloc(4096, "msg2"); + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc < 0); + + /* add one more */ + wqueue.max_length = 2; + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(wqueue.current_length == 2); + + /* release everything */ + osmo_wqueue_clear(&wqueue); + OSMO_ASSERT(wqueue.current_length == 0); + OSMO_ASSERT(wqueue.max_length == 2); + + /* Add two, fail on the third, free it and the queue */ + msg = msgb_alloc(4096, "msg3"); + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(wqueue.current_length == 1); + msg = msgb_alloc(4096, "msg4"); + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc == 0); + OSMO_ASSERT(wqueue.current_length == 2); + msg = msgb_alloc(4096, "msg5"); + rc = osmo_wqueue_enqueue(&wqueue, msg); + OSMO_ASSERT(rc < 0); + OSMO_ASSERT(wqueue.current_length == 2); + msgb_free(msg); + osmo_wqueue_clear(&wqueue); +} + +int main(int argc, char **argv) +{ + struct log_target *stderr_target; + + log_init(&log_info, NULL); + stderr_target = log_target_create_stderr(); + log_add_target(stderr_target); + log_set_print_filename(stderr_target, 0); + + test_wqueue_limit(); + + printf("Done\n"); + return 0; +} diff --git a/tests/write_queue/wqueue_test.ok b/tests/write_queue/wqueue_test.ok new file mode 100644 index 0000000..a965a70 --- /dev/null +++ b/tests/write_queue/wqueue_test.ok @@ -0,0 +1 @@ +Done -- To view, visit https://gerrit.osmocom.org/1243 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e6aef30f3e73d4bcf2967bc49f0783aa65395ae Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Holger Freyther From gerrit-no-reply at lists.osmocom.org Sun Nov 13 21:31:45 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 21:31:45 +0000 Subject: openbsc[master]: ussd: Add band-aid for interrogationSS In-Reply-To: References: Message-ID: Patch Set 6: @neels: Any rejection? -- To view, visit https://gerrit.osmocom.org/503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 21:42:19 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 21:42:19 +0000 Subject: libosmocore[master]: socket: export osmo_sockaddr_equal() as library function In-Reply-To: References: Message-ID: Patch Set 1: Who will use it? -- To view, visit https://gerrit.osmocom.org/1148 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I174fe1b894e5da0fefed81f95546c24776233421 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 21:49:38 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 21:49:38 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 6: (5 comments) https://gerrit.osmocom.org/#/c/415/6/tests/bitvec/bitvec_test.c File tests/bitvec/bitvec_test.c: Line 158: OSMO_ASSERT (num == result); Have a pre-condition (e.g. state of curbit) and a post condition (curbit)? Line 256: printf ("bitvec_runlength....\n"); test_array doesn't terminate with a \n maybe you add it here as well? Line 259: bitvec_set_uint(&bv, 0xff, 8); So you insert eight '1' and rewind to the start.. Line 261: test_bitvec_rl_curbit(&bv, 1, 64, 8); and now you read these eight bits.. going through the byte aligned case Line 262: test_bitvec_rl_curbit(&bv,0 , 64, 56); and now you can read 56 zeros.. where do you define the size of the bitvec? It would be good if you rely on your own size of the bitvec instead of the state of a previous test? What about testing the unaligned case? -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Nov 13 21:57:14 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 21:57:14 +0000 Subject: libosmo-abis[master]: add basic unixsocket support In-Reply-To: References: Message-ID: Patch Set 2: (4 comments) Nice! where do we use SOL_PACKET? And FreeBSD portability is no concern.. we just disable/fail if somebody tries that on FreeBSD https://gerrit.osmocom.org/#/c/1198/2/src/input/unixsocket.c File src/input/unixsocket.c: Line 68: ret = read(bfd->fd, msg->data, UNIXSOCKET_ALLOC_SIZE - 16); Why -16? your msgb doesn't have any headroom anyway? Line 73: perror("read "); doesn't end up in the logging framework. socket, ret, errno would be good in a commit message Line 112: LOGP(DLINP, LOGL_INFO, "unixsocket: sending: %s", msgb_hexdump(msg)); obviously reduce log level in the future Line 161: const char *sock_path = "/tmp/rsl_oml"; We have precedence with mncc but /tmp is a "free for all" place and we would need to think of permissions.. and running two in parallel? Would an abstract socket help? -- To view, visit https://gerrit.osmocom.org/1198 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia5723b09a5c68a0505829dc732def981e60a907a Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Nov 13 22:02:39 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 22:02:39 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (3 comments) https://gerrit.osmocom.org/#/c/1216/3/src/tbf.cpp File src/tbf.cpp: Line 1035: /* Start Tmr only if it is UL TBF */ Does the entire message exist for DL as well? Maybe move the method to the UL subclass of the tbf? Line 1273: ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); eeek can't we just remember somehow else we need to generate reject? https://gerrit.osmocom.org/#/c/1216/3/src/tbf.h File src/tbf.h: Line 267: void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, This is not a method of the TBF? Move to a different header file? I know it _creates_ a tbf and sets internal state to be used for the reject scheduling.. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Nov 13 22:05:09 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 22:05:09 +0000 Subject: osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 13 22:06:20 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Sun, 13 Nov 2016 22:06:20 +0000 Subject: osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 6 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 00:02:11 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 00:02:11 +0000 Subject: openbsc[master]: move to libcommon-cs: net init 2: move bsc_network_init decl... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 tweak still pending -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 00:41:43 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 00:41:43 +0000 Subject: openbsc[master]: ussd: Add band-aid for interrogationSS In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 I guess you can add your own +2 :) -- To view, visit https://gerrit.osmocom.org/503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 01:14:59 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 01:14:59 +0000 Subject: [MERGED] osmo-pcu[master]: Handle packet access reject during EPDAN/PDAN with channel d... In-Reply-To: References: Message-ID: arvind.sirsikar has submitted this change and it was merged. Change subject: Handle packet access reject during EPDAN/PDAN with channel description ...................................................................... Handle packet access reject during EPDAN/PDAN with channel description When PDAN/EPDAN with channel description is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 --- M src/bts.cpp M src/encoding.cpp M src/encoding.h M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 9 files changed, 135 insertions(+), 12 deletions(-) Approvals: arvind.sirsikar: Looks good to me, but someone else must approve; Verified Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/bts.cpp b/src/bts.cpp index 4e6b5e9..0668c2d 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1077,16 +1077,23 @@ } /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we pacekt access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ if (tbf->ms()) { @@ -1179,16 +1186,23 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { - LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " - "message, so we provide one:\n"); /* This call will register the new TBF with the MS on success */ - tbf_alloc_ul(bts_data(), tbf->trx->trx_no, + gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), + tbf->trx->trx_no, tbf->ms_class(), tbf->ms()->egprs_ms_class(), tbf->tlli(), tbf->ta(), tbf->ms()); - /* schedule uplink assignment */ - tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + /* schedule uplink assignment or reject*/ + if (ul_tbf) { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we provide one:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS; + } else { + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF in ack " + "message, so we send packet access reject:\n"); + tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + } } /* get measurements */ diff --git a/src/encoding.cpp b/src/encoding.cpp index ca72b0f..e5a8605 100644 --- a/src/encoding.cpp +++ b/src/encoding.cpp @@ -1391,3 +1391,28 @@ return AR_NEED_MORE_BLOCKS; } + +/* + * Refer 44.060 version 7.27.0 Release 7 + * section 7.1.3.2.1 On receipt of a PACKET RESOURCE REQUEST message + * 8.1.2.5 Establishment of uplink TBF + */ +void Encoding::write_packet_access_reject( + bitvec * dest, uint32_t tlli) +{ + unsigned wp = 0; + + bitvec_write_field(dest, wp, 0x1, 2); // Payload Type + bitvec_write_field(dest, wp, 0x0, 2); // Uplink block with TDMA FN + bitvec_write_field(dest, wp, 0, 1); // No Polling Bit + bitvec_write_field(dest, wp, 0x0, 3); // Uplink state flag + bitvec_write_field(dest, wp, + MT_PACKET_ACCESS_REJECT, 6); // MESSAGE TYPE + bitvec_write_field(dest, wp, 0, 2); // fixed 00 + bitvec_write_field(dest, wp, 0x0, 1); // TLLI / G-RNTI : bit (32) + bitvec_write_field(dest, wp, tlli, 32); // CONTENTION_RESOLUTION_TLLI + bitvec_write_field(dest, wp, 1, 1); // WAIT_INDICATION size in seconds + /* TODO: make it configurable */ + bitvec_write_field(dest, wp, 5, 8); // WAIT_INDICATION value + bitvec_write_field(dest, wp, 0, 1); // WAIT_INDICATION size in seconds +} diff --git a/src/encoding.h b/src/encoding.h index 79dc32d..6164b89 100644 --- a/src/encoding.h +++ b/src/encoding.h @@ -74,6 +74,9 @@ static void encode_rbb(const char *show_rbb, uint8_t *rbb); + static void write_packet_access_reject( + bitvec * dest, uint32_t tlli); + static void write_packet_uplink_ack( struct gprs_rlcmac_bts *bts, bitvec * dest, struct gprs_rlcmac_ul_tbf *tbf, bool is_final, diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index f486075..a3723df 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -72,7 +72,8 @@ *poll_tbf = dl_tbf; if (dl_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = dl_tbf; - if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || dl_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = dl_tbf; } @@ -137,7 +138,11 @@ */ if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) - msg = ul_ass_tbf->create_ul_ass(fn, ts); + if (tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else + msg = ul_ass_tbf->create_ul_ass(fn, ts); else if (tbf == dl_ass_tbf && tbf->direction == GPRS_RLCMAC_UL_TBF) msg = dl_ass_tbf->create_dl_ass(fn, ts); else if (tbf == ul_ack_tbf) diff --git a/src/tbf.cpp b/src/tbf.cpp index 0ac8ace..2d82727 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1013,6 +1013,29 @@ return msg; } +struct msgb *gprs_rlcmac_tbf::create_packet_access_reject() +{ + struct msgb *msg; + + msg = msgb_alloc(23, "rlcmac_ul_ass_rej"); + + bitvec *packet_access_rej = bitvec_alloc(23); + + bitvec_unhex(packet_access_rej, + "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); + + Encoding::write_packet_access_reject( + packet_access_rej, tlli()); + + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); + + bitvec_free(packet_access_rej); + ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + + return msg; + +} + struct msgb *gprs_rlcmac_tbf::create_ul_ass(uint32_t fn, uint8_t ts) { struct msgb *msg; diff --git a/src/tbf.h b/src/tbf.h index 3205f6e..e044053 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -64,6 +64,7 @@ enum gprs_rlcmac_tbf_ul_ass_state { GPRS_RLCMAC_UL_ASS_NONE = 0, GPRS_RLCMAC_UL_ASS_SEND_ASS, /* send uplink assignment on next RTS */ + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ, /* send assignment reject next RTS */ GPRS_RLCMAC_UL_ASS_WAIT_ACK, /* wait for PACKET CONTROL ACK */ }; @@ -103,6 +104,7 @@ struct msgb *create_dl_ass(uint32_t fn, uint8_t ts); struct msgb *create_ul_ass(uint32_t fn, uint8_t ts); + struct msgb *create_packet_access_reject(); GprsMs *ms() const; void set_ms(GprsMs *ms); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 339390b..213bd12 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,29 @@ ARRAY_SIZE(default_categories), }; +void test_packet_access_rej_epdan() +{ + BTS the_bts; + uint32_t tlli = 0xffeeddcc; + + printf("=== start %s ===\n", __func__); + setup_bts(&the_bts, 4); + static gprs_rlcmac_dl_tbf *dl_tbf = tbf_init(&the_bts, 1); + + dl_tbf->update_ms(tlli, GPRS_RLCMAC_DL_TBF); + + struct msgb *msg = dl_tbf->create_packet_access_reject(); + + printf("packet reject: %s\n", + osmo_hexdump(msg->data, 23)); + + OSMO_ASSERT(!strcmp(osmo_hexdump(msg->data, 23), + "40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b ")); + printf("=== end %s ===\n", __func__); + +} + + int main(int argc, char **argv) { struct vty_app_info pcu_vty_info = {0}; @@ -2874,6 +2897,7 @@ test_tbf_li_decoding(); test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); + test_packet_access_rej_epdan(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index 627cdc3..a680812 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6846,3 +6846,27 @@ No PDCH available. No PDCH resource for single block allocation.sending Immediate Assignment Uplink (AGCH) reject Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=4d 06 3a 10 70 8b 29 14 70 8b 29 14 70 8b 29 14 70 8b 29 14 0b 2b 2b +Searching for first unallocated TFI: TRX=0 + Found TFI=0. +********** TBF starts here ********** +Allocating DL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because not enabled +- Assign downlink TS=4 TFI=0 +PDCH(TS 4, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL), 1 TBFs, USFs = 00, TFIs = 00000001. +- Setting Control TS 4 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL): trx = 0, ul_slots = 10, dl_slots = 10 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 0 +TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW +The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed +TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index f921dfc..dc07fc7 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -72,3 +72,6 @@ === end test_immediate_assign_rej_multi_block === === start test_immediate_assign_rej_single_block === === end test_immediate_assign_rej_single_block === +=== start test_packet_access_rej_epdan === +packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +=== end test_packet_access_rej_epdan === -- To view, visit https://gerrit.osmocom.org/1209 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I096a3bb44a65533b9e9b091925dd5f70a8696d6 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Nov 14 01:15:16 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 01:15:16 +0000 Subject: [MERGED] osmo-pcu[master]: Add BTS level counters In-Reply-To: References: Message-ID: arvind.sirsikar has submitted this change and it was merged. Change subject: Add BTS level counters ...................................................................... Add BTS level counters Adds counters for MCS blocks, 11 bit Rach counters and others. Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M src/tbf_ul.cpp 6 files changed, 294 insertions(+), 4 deletions(-) Approvals: Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/bts.cpp b/src/bts.cpp index 0668c2d..fe3368d 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -88,6 +88,46 @@ { "llc.dl_bytes", "RLC encapsulated PDUs"}, { "llc.ul_bytes", "full PDUs received "}, { "rach.requests", "RACH requests "}, + { "11bit_rach.requests", "11BIT_RACH requests "}, + { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_DL", "Immediate Assign DL "}, + { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.dl_assignment", "Packet DL Assignment "}, + { "ul.control", "UL control Block "}, + { "ul.assignment_poll_timeout", "UL Assign Timeout "}, + { "ul.assignment_failed", "UL Assign Failed "}, + { "dl.assignment_timeout", "DL Assign Timeout "}, + { "dl.assignment_failed", "DL Assign Failed "}, + { "pkt.ul_ack_nack_timeout", "PUAN Poll Timeout "}, + { "pkt.ul_ack_nack_failed", "PUAN poll Failed "}, + { "pkt.dl_ack_nack_timeout", "PDAN poll Timeout "}, + { "pkt.dl_ack_nack_failed", "PDAN poll Failed "}, + { "gprs.downlink_cs1", "CS1 downlink "}, + { "gprs.downlink_cs2", "CS2 downlink "}, + { "gprs.downlink_cs3", "CS3 downlink "}, + { "gprs.downlink_cs4", "CS4 downlink "}, + { "egprs.downlink_mcs1", "MCS1 downlink "}, + { "egprs.downlink_mcs2", "MCS2 downlink "}, + { "egprs.downlink_mcs3", "MCS3 downlink "}, + { "egprs.downlink_mcs4", "MCS4 downlink "}, + { "egprs.downlink_mcs5", "MCS5 downlink "}, + { "egprs.downlink_mcs6", "MCS6 downlink "}, + { "egprs.downlink_mcs7", "MCS7 downlink "}, + { "egprs.downlink_mcs8", "MCS8 downlink "}, + { "egprs.downlink_mcs9", "MCS9 downlink "}, + { "gprs.uplink_cs1", "CS1 Uplink "}, + { "gprs.uplink_cs2", "CS2 Uplink "}, + { "gprs.uplink_cs3", "CS3 Uplink "}, + { "gprs.uplink_cs4", "CS4 Uplink "}, + { "egprs.uplink_mcs1", "MCS1 Uplink "}, + { "egprs.uplink_mcs2", "MCS2 Uplink "}, + { "egprs.uplink_mcs3", "MCS3 Uplink "}, + { "egprs.uplink_mcs4", "MCS4 Uplink "}, + { "egprs.uplink_mcs5", "MCS5 Uplink "}, + { "egprs.uplink_mcs6", "MCS6 Uplink "}, + { "egprs.uplink_mcs7", "MCS7 Uplink "}, + { "egprs.uplink_mcs8", "MCS8 Uplink "}, + { "egprs.uplink_mcs9", "MCS9 Uplink "}, }; static const struct rate_ctr_group_desc bts_ctrg_desc = { @@ -485,6 +525,9 @@ rach_frame(); + if (is_11bit) + rach_frame_11bit(); + LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, " "so we provide one \n" "ra=0x%02x Fn=%u qta=%d is_11bit=%d:\n", ra, Fn, qta, is_11bit); @@ -573,8 +616,10 @@ m_bts.alpha, m_bts.gamma, -1, burst_type, sb); } - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_ul_tbf(); pcu_l1if_tx_agch(immediate_assignment, plen); + } bitvec_free(immediate_assignment); @@ -699,8 +744,11 @@ (tbf->pdch[ts]->last_rts_fn + 21216) % 2715648, tbf->ta(), tbf->trx->arfcn, ts, tbf->tsc(), 7, poll, tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); - if (plen >= 0) + if (plen >= 0) { + immediate_assignment_dl_tbf(); pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + } + bitvec_free(immediate_assignment); } @@ -1363,6 +1411,7 @@ decode_gsm_rlcmac_uplink(rlc_block, ul_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- RX : Uplink Control Block -------------------------\n"); + bts()->rlc_rcvd_control(); switch (ul_control_block->u.MESSAGE_TYPE) { case MT_PACKET_CONTROL_ACK: rcv_control_ack(&ul_control_block->u.Packet_Control_Acknowledgement, fn); diff --git a/src/bts.h b/src/bts.h index 8bea371..33f5483 100644 --- a/src/bts.h +++ b/src/bts.h @@ -265,6 +265,46 @@ CTR_LLC_DL_BYTES, CTR_LLC_UL_BYTES, CTR_RACH_REQUESTS, + CTR_11BIT_RACH_REQUESTS, + CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_DL_ASSIGNMENT, + CTR_RLC_RECV_CONTROL, + CTR_PUA_POLL_TIMEDOUT, + CTR_PUA_POLL_FAILED, + CTR_PDA_POLL_TIMEDOUT, + CTR_PDA_POLL_FAILED, + CTR_PUAN_POLL_TIMEDOUT, + CTR_PUAN_POLL_FAILED, + CTR_PDAN_POLL_TIMEDOUT, + CTR_PDAN_POLL_FAILED, + CTR_GPRS_DL_CS1, + CTR_GPRS_DL_CS2, + CTR_GPRS_DL_CS3, + CTR_GPRS_DL_CS4, + CTR_EGPRS_DL_MCS1, + CTR_EGPRS_DL_MCS2, + CTR_EGPRS_DL_MCS3, + CTR_EGPRS_DL_MCS4, + CTR_EGPRS_DL_MCS5, + CTR_EGPRS_DL_MCS6, + CTR_EGPRS_DL_MCS7, + CTR_EGPRS_DL_MCS8, + CTR_EGPRS_DL_MCS9, + CTR_GPRS_UL_CS1, + CTR_GPRS_UL_CS2, + CTR_GPRS_UL_CS3, + CTR_GPRS_UL_CS4, + CTR_EGPRS_UL_MCS1, + CTR_EGPRS_UL_MCS2, + CTR_EGPRS_UL_MCS3, + CTR_EGPRS_UL_MCS4, + CTR_EGPRS_UL_MCS5, + CTR_EGPRS_UL_MCS6, + CTR_EGPRS_UL_MCS7, + CTR_EGPRS_UL_MCS8, + CTR_EGPRS_UL_MCS9, }; enum { @@ -352,6 +392,46 @@ void llc_dl_bytes(int bytes); void llc_ul_bytes(int bytes); void rach_frame(); + void rach_frame_11bit(); + void immediate_assignment_ul_tbf(); + void immediate_assignment_dl_tbf(); + void pkt_ul_assignment(); + void pkt_dl_assignemnt(); + void rlc_rcvd_control(); + void pua_poll_timedout(); + void pua_poll_failed(); + void pda_poll_timedout(); + void pda_poll_failed(); + void pkt_ul_ack_nack_poll_timedout(); + void pkt_ul_ack_nack_poll_failed(); + void pkt_dl_ack_nack_poll_timedout(); + void pkt_dl_ack_nack_poll_failed(); + void gprs_dl_cs1(); + void gprs_dl_cs2(); + void gprs_dl_cs3(); + void gprs_dl_cs4(); + void egprs_dl_mcs1(); + void egprs_dl_mcs2(); + void egprs_dl_mcs3(); + void egprs_dl_mcs4(); + void egprs_dl_mcs5(); + void egprs_dl_mcs6(); + void egprs_dl_mcs7(); + void egprs_dl_mcs8(); + void egprs_dl_mcs9(); + void gprs_ul_cs1(); + void gprs_ul_cs2(); + void gprs_ul_cs3(); + void gprs_ul_cs4(); + void egprs_ul_mcs1(); + void egprs_ul_mcs2(); + void egprs_ul_mcs3(); + void egprs_ul_mcs4(); + void egprs_ul_mcs5(); + void egprs_ul_mcs6(); + void egprs_ul_mcs7(); + void egprs_ul_mcs8(); + void egprs_ul_mcs9(); void ms_present(int32_t n); int32_t ms_present_get(); @@ -505,6 +585,46 @@ CREATE_COUNT_ADD_INLINE(llc_dl_bytes, CTR_LLC_DL_BYTES); CREATE_COUNT_ADD_INLINE(llc_ul_bytes, CTR_LLC_UL_BYTES); CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); +CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); +CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); +CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); +CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pua_poll_failed, CTR_PUA_POLL_FAILED); +CREATE_COUNT_INLINE(pda_poll_timedout, CTR_PDA_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pda_poll_failed, CTR_PDA_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_timedout, CTR_PUAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_ul_ack_nack_poll_failed, CTR_PUAN_POLL_FAILED); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_timedout, CTR_PDAN_POLL_TIMEDOUT); +CREATE_COUNT_INLINE(pkt_dl_ack_nack_poll_failed, CTR_PDAN_POLL_FAILED); +CREATE_COUNT_INLINE(gprs_dl_cs1, CTR_GPRS_DL_CS1); +CREATE_COUNT_INLINE(gprs_dl_cs2, CTR_GPRS_DL_CS2); +CREATE_COUNT_INLINE(gprs_dl_cs3, CTR_GPRS_DL_CS3); +CREATE_COUNT_INLINE(gprs_dl_cs4, CTR_GPRS_DL_CS4); +CREATE_COUNT_INLINE(egprs_dl_mcs1, CTR_EGPRS_DL_MCS1); +CREATE_COUNT_INLINE(egprs_dl_mcs2, CTR_EGPRS_DL_MCS2); +CREATE_COUNT_INLINE(egprs_dl_mcs3, CTR_EGPRS_DL_MCS3); +CREATE_COUNT_INLINE(egprs_dl_mcs4, CTR_EGPRS_DL_MCS4); +CREATE_COUNT_INLINE(egprs_dl_mcs5, CTR_EGPRS_DL_MCS5); +CREATE_COUNT_INLINE(egprs_dl_mcs6, CTR_EGPRS_DL_MCS6); +CREATE_COUNT_INLINE(egprs_dl_mcs7, CTR_EGPRS_DL_MCS7); +CREATE_COUNT_INLINE(egprs_dl_mcs8, CTR_EGPRS_DL_MCS8); +CREATE_COUNT_INLINE(egprs_dl_mcs9, CTR_EGPRS_DL_MCS9); +CREATE_COUNT_INLINE(gprs_ul_cs1, CTR_GPRS_UL_CS1); +CREATE_COUNT_INLINE(gprs_ul_cs2, CTR_GPRS_UL_CS2); +CREATE_COUNT_INLINE(gprs_ul_cs3, CTR_GPRS_UL_CS3); +CREATE_COUNT_INLINE(gprs_ul_cs4, CTR_GPRS_UL_CS4); +CREATE_COUNT_INLINE(egprs_ul_mcs1, CTR_EGPRS_UL_MCS1); +CREATE_COUNT_INLINE(egprs_ul_mcs2, CTR_EGPRS_UL_MCS2); +CREATE_COUNT_INLINE(egprs_ul_mcs3, CTR_EGPRS_UL_MCS3); +CREATE_COUNT_INLINE(egprs_ul_mcs4, CTR_EGPRS_UL_MCS4); +CREATE_COUNT_INLINE(egprs_ul_mcs5, CTR_EGPRS_UL_MCS5); +CREATE_COUNT_INLINE(egprs_ul_mcs6, CTR_EGPRS_UL_MCS6); +CREATE_COUNT_INLINE(egprs_ul_mcs7, CTR_EGPRS_UL_MCS7); +CREATE_COUNT_INLINE(egprs_ul_mcs8, CTR_EGPRS_UL_MCS8); +CREATE_COUNT_INLINE(egprs_ul_mcs9, CTR_EGPRS_UL_MCS9); #undef CREATE_COUNT_INLINE diff --git a/src/tbf.cpp b/src/tbf.cpp index 2d82727..072d0af 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -508,12 +508,14 @@ } ul_ack_state = GPRS_RLCMAC_UL_ACK_NONE; bts->rlc_ack_timedout(); + bts->pkt_ul_ack_nack_poll_timedout(); if (state_is(GPRS_RLCMAC_FINISHED)) { gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(this); ul_tbf->m_n3103++; if (ul_tbf->m_n3103 == ul_tbf->bts->bts_data()->n3103) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3103 exceeded\n"); + bts->pkt_ul_ack_nack_poll_failed(); ul_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(ul_tbf, 3169, ul_tbf->bts->bts_data()->t3169, 0); return; @@ -533,11 +535,13 @@ ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pua_poll_timedout(); if (n3105 == bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pua_poll_failed(); return; } /* reschedule UL assignment */ @@ -553,11 +557,13 @@ dl_ass_state = GPRS_RLCMAC_DL_ASS_NONE; n3105++; bts->rlc_ass_timedout(); + bts->pda_poll_timedout(); if (n3105 == bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(this, 3195, bts_data()->t3195, 0); bts->rlc_ass_failed(); + bts->pda_poll_failed(); return; } /* reschedule DL assignment */ @@ -574,12 +580,15 @@ dl_tbf->n3105++; if (dl_tbf->state_is(GPRS_RLCMAC_RELEASING)) bts->rlc_rel_timedout(); - else + else { bts->rlc_ack_timedout(); + bts->pkt_dl_ack_nack_poll_timedout(); + } if (dl_tbf->n3105 == dl_tbf->bts->bts_data()->n3105) { LOGP(DRLCMAC, LOGL_NOTICE, "- N3105 exceeded\n"); dl_tbf->set_state(GPRS_RLCMAC_RELEASING); tbf_timer_start(dl_tbf, 3195, dl_tbf->bts_data()->t3195, 0); + bts->pkt_dl_ack_nack_poll_failed(); bts->rlc_ack_failed(); return; } @@ -991,6 +1000,7 @@ encode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Downlink Assignment -------------------------\n"); + bts->pkt_dl_assignemnt(); bitvec_pack(ass_vec, msgb_put(msg, 23)); bitvec_free(ass_vec); talloc_free(mac_control_block); @@ -1087,6 +1097,7 @@ decode_gsm_rlcmac_downlink(ass_vec, mac_control_block); LOGPC(DCSN1, LOGL_NOTICE, "\n"); LOGP(DRLCMAC, LOGL_DEBUG, "------------------------- TX : Packet Uplink Assignment -------------------------\n"); + bts->pkt_ul_assignment(); bitvec_free(ass_vec); talloc_free(mac_control_block); diff --git a/src/tbf.h b/src/tbf.h index e044053..1e98a24 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -379,6 +379,7 @@ int abort(); void egprs_calc_window_size(); + void update_coding_scheme_counter_dl(const GprsCodingScheme cs); /* TODO: add the gettimeofday as parameter */ struct msgb *llc_dequeue(bssgp_bvc_ctx *bctx); @@ -467,6 +468,8 @@ struct gprs_rlc_data *block, uint8_t *data, const uint8_t block_idx); + void update_coding_scheme_counter_ul(const GprsCodingScheme cs); + /* Please note that all variables here will be reset when changing * from WAIT RELEASE back to FLOW state (re-use of TBF). * All states that need reset must be in this struct, so this is why diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index f6836f8..185521d 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -648,6 +648,7 @@ num_bsns += 1; } + update_coding_scheme_counter_dl(cs); /* * if the intial mcs is 8 and retransmission mcs is either 6 or 3 * we have to include the padding of 6 octets in first segment @@ -1330,3 +1331,56 @@ m_window.set_ws(ws); } + +void gprs_rlcmac_dl_tbf::update_coding_scheme_counter_dl(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_dl_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_dl_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_dl_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_dl_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_dl_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_dl_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_dl_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_dl_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_dl_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_dl_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_dl_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_dl_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_dl_mcs9(); + break; + } + } +} diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index f67ffd7..420fc1a 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -175,7 +175,7 @@ /* Increment RX-counter */ this->m_rx_counter++; - + update_coding_scheme_counter_ul(rlc->cs); /* Loop over num_blocks */ for (block_idx = 0; block_idx < rlc->num_data_blocks; block_idx++) { int num_chunks; @@ -517,3 +517,56 @@ } return assemble_status; } + +void gprs_rlcmac_ul_tbf::update_coding_scheme_counter_ul(const GprsCodingScheme cs) +{ + uint8_t coding_scheme = 0; + + coding_scheme = GprsCodingScheme::Scheme(cs); + if (cs.isGprs()) { + switch (coding_scheme) { + case GprsCodingScheme::CS1 : + bts->gprs_ul_cs1(); + break; + case GprsCodingScheme::CS2 : + bts->gprs_ul_cs2(); + break; + case GprsCodingScheme::CS3 : + bts->gprs_ul_cs3(); + break; + case GprsCodingScheme::CS4 : + bts->gprs_ul_cs4(); + break; + } + } else { + switch (coding_scheme) { + case GprsCodingScheme::MCS1 : + bts->egprs_ul_mcs1(); + break; + case GprsCodingScheme::MCS2 : + bts->egprs_ul_mcs2(); + break; + case GprsCodingScheme::MCS3 : + bts->egprs_ul_mcs3(); + break; + case GprsCodingScheme::MCS4 : + bts->egprs_ul_mcs4(); + break; + case GprsCodingScheme::MCS5 : + bts->egprs_ul_mcs5(); + break; + case GprsCodingScheme::MCS6 : + bts->egprs_ul_mcs6(); + break; + case GprsCodingScheme::MCS7 : + bts->egprs_ul_mcs7(); + break; + case GprsCodingScheme::MCS8 : + bts->egprs_ul_mcs8(); + break; + case GprsCodingScheme::MCS9 : + bts->egprs_ul_mcs9(); + break; + } + } +} -- To view, visit https://gerrit.osmocom.org/1167 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I605b0d66eb217decd35cbb8f87abfa577760245a Gerrit-PatchSet: 7 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: mrinal From gerrit-no-reply at lists.osmocom.org Mon Nov 14 04:22:27 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 14 Nov 2016 04:22:27 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 6: (2 comments) https://gerrit.osmocom.org/#/c/415/6/tests/bitvec/bitvec_test.c File tests/bitvec/bitvec_test.c: Line 259: bitvec_set_uint(&bv, 0xff, 8); > So you insert eight '1' and rewind to the start.. yes Line 262: test_bitvec_rl_curbit(&bv,0 , 64, 56); > and now you can read 56 zeros.. where do you define the size of the bitvec? ok I will add test case for unaligned case in my next patch set. Thanks, Pravin -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 14 06:19:36 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 14 Nov 2016 06:19:36 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/415/6/tests/bitvec/bitvec_test.c File tests/bitvec/bitvec_test.c: Line 262: test_bitvec_rl_curbit(&bv,0 , 64, 56); > ok I will add test case for unaligned case in my next patch set. Size of bitvec is defined in the starting of the main function Line number : 183 -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 14 06:32:19 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 14 Nov 2016 06:32:19 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#7). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c M tests/bitvec/bitvec_test.ok 4 files changed, 68 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/7 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..ba19e1f 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/* \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index a98a91c..72162f1 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -150,6 +150,15 @@ } } +static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits, + int result ) +{ + int num = 0; + OSMO_ASSERT (bv->cur_bit == 0); + num = bitvec_rl_curbit(bv, b, max_bits); + OSMO_ASSERT (num == result); +} + static void test_array() { struct bitvec b; @@ -245,6 +254,17 @@ test_array(); + printf ("\nbitvec_runlength....\n"); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xff, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 6); + printf("\nbitvec ok.\n"); return 0; diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index e256108..6281973 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -166,4 +166,6 @@ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ +bitvec_runlength.... + bitvec ok. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Mon Nov 14 06:36:22 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 14 Nov 2016 06:36:22 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 6: (5 comments) https://gerrit.osmocom.org/#/c/415/6/tests/bitvec/bitvec_test.c File tests/bitvec/bitvec_test.c: Line 158: OSMO_ASSERT (num == result); > Have a pre-condition (e.g. state of curbit) and a post condition (curbit)? Done Line 256: printf ("bitvec_runlength....\n"); > test_array doesn't terminate with a \n maybe you add it here as well? Done Line 259: bitvec_set_uint(&bv, 0xff, 8); > yes Done Line 261: test_bitvec_rl_curbit(&bv, 1, 64, 8); > and now you read these eight bits.. going through the byte aligned case Done Line 262: test_bitvec_rl_curbit(&bv,0 , 64, 56); > ok I will add test case for unaligned case in my next patch set. Done -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 14 06:49:42 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 06:49:42 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 3: (3 comments) https://gerrit.osmocom.org/#/c/1216/3/src/tbf.cpp File src/tbf.cpp: Line 1035: /* Start Tmr only if it is UL TBF */ > Does the entire message exist for DL as well? Maybe move the method to the This function is valid for both DL and UL classes. UL-TBF creation while indicated in PDAN/EPDAN is handled as DL TBF. Packet resource case is handled with UL-TBF(This patch has those changes) Line 1273: ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); > eeek can't we just remember somehow else we need to generate reject? As there was no UL_TBF created when we received Rach request. We need to create the UL-TBF for triggering of Packet access reject :(. https://gerrit.osmocom.org/#/c/1216/3/src/tbf.h File src/tbf.h: Line 267: void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, > This is not a method of the TBF? Move to a different header file? I know it Yes. It is more relevant for UL-TBF. But there is not header file for UL-TBF, I have kept it int tbf.h. I will move the definition to tbf_ul.cpp file. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 14 06:57:22 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 06:57:22 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/1216/3/src/tbf.h File src/tbf.h: Line 267: void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, > Yes. It is more relevant for UL-TBF. But there is not header file for UL-TB since ul_tbf_dtor is static inside tbf.cpp, movement of the function cannot be done until ul_tbf_dtor is made non static. so keeping this function inside the tbf.cpp Let me know if any comments. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 3 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 14 07:02:12 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 07:02:12 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1216 to look at the new patch set (#4). Handle packet access reject during packet resource request When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 7 files changed, 338 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/16/1216/4 diff --git a/src/bts.cpp b/src/bts.cpp index fe3368d..4a78dfc 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1333,8 +1333,13 @@ egprs_ms_class); ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, egprs_ms_class, tlli, ta, ms); - if (!ul_tbf) + + /* if no resource send packet resource reject */ + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); return; + } /* set control ts to current MS's TS, until assignment complete */ LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a3723df..a8b716d 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -56,7 +56,9 @@ *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || ul_tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } @@ -136,8 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - - if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) + if (tbf == ul_ass_tbf && tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else if (tbf == ul_ass_tbf && tbf->direction == + GPRS_RLCMAC_DL_TBF) if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) msg = ul_ass_tbf->create_packet_access_reject(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 072d0af..b324f0e 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1042,6 +1042,9 @@ bitvec_free(packet_access_rej); ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + /* Start Tmr only if it is UL TBF */ + if (direction == GPRS_RLCMAC_UL_TBF) + tbf_timer_start(this, 0, Tassign_pacch); return msg; } @@ -1271,3 +1274,32 @@ { return ts == control_ts; } + +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts) +{ + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); + if (!ul_tbf) + return; + + talloc_set_destructor(ul_tbf, ul_tbf_dtor); + new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + if (!ms) + ms = bts->bts->ms_alloc(0, 0); + + ms->set_tlli(tlli); + + llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + ul_tbf->bts->tbf_ul_created(); + ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + + ul_tbf->set_ms(ms); + ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + ul_tbf->control_ts = ts; + ul_tbf->trx = trx; +} diff --git a/src/tbf.h b/src/tbf.h index 1e98a24..ef730db 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -264,6 +264,8 @@ uint8_t ms_class, uint8_t egprs_ms_class, uint8_t single_slot); void tbf_free(struct gprs_rlcmac_tbf *tbf); +void handle_tbf_reject(struct gprs_rlcmac_bts *bts, GprsMs *ms, + uint32_t tlli, uint8_t trx_no, uint8_t ts_no); int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 213bd12..6bfe9cc 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,80 @@ ARRAY_SIZE(default_categories), }; +static void test_packet_access_rej_prr() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + uint8_t trx_no = 0; + RlcMacUplink_t ulreq = {0}; + Packet_Resource_Request_t *presreq = NULL; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + uint32_t rach_fn = fn - 51; + uint32_t sba_fn = fn + 52; + uint32_t tlli = 0xffeeddcc; + MS_Radio_Access_capability_t *pmsradiocap = NULL; + Multislot_capability_t *pmultislotcap = NULL; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + int rc = 0; + + /* + * Trigger rach till resources(USF) exhaust + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + presreq = &ulreq.u.Packet_Resource_Request; + presreq->PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + presreq->ID.UnionType = 1; /* != 0 */ + presreq->ID.u.TLLI = tlli; + presreq->Exist_MS_Radio_Access_capability = 1; + pmsradiocap = &presreq->MS_Radio_Access_capability; + pmsradiocap->Count_MS_RA_capability_value = 1; + pmsradiocap->MS_RA_capability_value[0].u.Content. + Exist_Multislot_capability = 1; + pmultislotcap = &pmsradiocap->MS_RA_capability_value[0]. + u.Content.Multislot_capability; + + pmultislotcap->Exist_GPRS_multislot_class = 1; + pmultislotcap->GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + pmultislotcap->Exist_EGPRS_multislot_class = 1; + pmultislotcap->EGPRS_multislot_class = egprs_ms_class; + } + + send_ul_mac_block(&the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* trigger packet access reject */ + uint8_t bn = fn2bn(fn); + + rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), + trx_no, ts_no, fn, bn); + + OSMO_ASSERT(rc == 0); + + printf("=== end %s ===\n", __func__); +} void test_packet_access_rej_epdan() { BTS the_bts; @@ -2898,6 +2972,7 @@ test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); test_packet_access_rej_epdan(); + test_packet_access_rej_prr(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index a680812..1e863fe 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6870,3 +6870,216 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled! +MS supports EGPRS multislot class 11. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource +Creating MS object, TLLI = 0x00000000 +Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN +Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer 0. +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Destroying MS object, TLLI = 0x00000000 diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index dc07fc7..d62fedd 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -75,3 +75,5 @@ === start test_packet_access_rej_epdan === packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_packet_access_rej_epdan === +=== start test_packet_access_rej_prr === +=== end test_packet_access_rej_prr === -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Nov 14 07:02:58 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 07:02:58 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: Holger, Any update on this patch? -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 07:04:47 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 14 Nov 2016 07:04:47 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+1 Verified+1 -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 11:41:37 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 14 Nov 2016 11:41:37 +0000 Subject: [PATCH] libosmocore[master]: RSL: Add defines for ericsson systinfo SI13 Message-ID: Review at https://gerrit.osmocom.org/1244 RSL: Add defines for ericsson systinfo SI13 Ericsson uses non standard information element tags when setting up the SI13 system information configuration. This applies to RSL_SYSTEM_INFO_13, which is normally 0x28, instead Ericsson uses RSL_ERIC_SYSTEM_INFO_13, which is set to 0x0C. Furthermore, Ericsson adds a propritary field called BCCH-Mapping, which is tagged as 0xf2 (RSL_IE_ERIC_BCCH_MAPPING) This patch addes these two information element tags in gsm_08_58.h Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/1244/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index 03337e7..7d523c5 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -293,6 +293,9 @@ RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc, RSL_IE_IPAC_RTP_MPLEX = 0xfd, RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe, + + /* Ericsson */ + RSL_IE_ERIC_BCCH_MAPPING= 0xf2, }; /* Chapter 9.3.1 */ @@ -461,6 +464,7 @@ #define RSL_EXT_MEAS_ORDER 0x47 #define RSL_MEAS_INFO 0x48 #define RSL_SYSTEM_INFO_13 0x28 +#define RSL_ERIC_SYSTEM_INFO_13 0x0C #define RSL_SYSTEM_INFO_2quater 0x29 #define RSL_SYSTEM_INFO_9 0x2a #define RSL_SYSTEM_INFO_18 0x2b -- To view, visit https://gerrit.osmocom.org/1244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Mon Nov 14 11:48:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 11:48:58 +0000 Subject: [PATCH] openbsc[master]: Add empty libcommon-cs In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1123 to look at the new patch set (#3). Add empty libcommon-cs This will gradually soak up code shared by libbsc and libmsc. Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/common_cs.h M openbsc/src/Makefile.am A openbsc/src/libcommon-cs/Makefile.am A openbsc/src/libcommon-cs/common_cs.c A openbsc/src/libcommon-cs/common_cs_vty.c 7 files changed, 62 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/1123/3 diff --git a/openbsc/configure.ac b/openbsc/configure.ac index b18ecc1..093d42f 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -214,6 +214,7 @@ src/libcommon/Makefile src/libfilter/Makefile src/libiu/Makefile + src/libcommon-cs/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 5737a4b..d9d8e99 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -13,6 +13,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + common_cs.h \ crc24.h \ ctrl.h \ db.h \ diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/openbsc/include/openbsc/common_cs.h @@ -0,0 +1 @@ +#pragma once diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 272292a..cfad7df 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -27,6 +27,7 @@ libmsc \ libtrau \ libfilter \ + libcommon-cs \ $(NULL) # Conditional Libraries diff --git a/openbsc/src/libcommon-cs/Makefile.am b/openbsc/src/libcommon-cs/Makefile.am new file mode 100644 index 0000000..f3921ba --- /dev/null +++ b/openbsc/src/libcommon-cs/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +noinst_LIBRARIES = libcommon-cs.a + +libcommon_cs_a_SOURCES = \ + common_cs.c \ + common_cs_vty.c diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 14 11:48:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 11:48:58 +0000 Subject: [PATCH] openbsc[master]: move to libcommon-cs: net init 2: move bsc_network_init decl... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1126 to look at the new patch set (#3). move to libcommon-cs: net init 2: move bsc_network_init decl to new .h bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b --- M openbsc/include/openbsc/Makefile.am M openbsc/include/openbsc/abis_nm.h A openbsc/include/openbsc/common_bsc.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/ipaccess/ipaccess-config.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/utils/bs11_config.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 9 files changed, 17 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/1126/3 diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index d9d8e99..2b54c43 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -13,6 +13,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + common_bsc.h \ common_cs.h \ crc24.h \ ctrl.h \ diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index 965f158..2465452 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -26,6 +26,8 @@ #include #include +#include + struct cell_global_id { uint16_t mcc; uint16_t mnc; diff --git a/openbsc/include/openbsc/common_bsc.h b/openbsc/include/openbsc/common_bsc.h new file mode 100644 index 0000000..7960383 --- /dev/null +++ b/openbsc/include/openbsc/common_bsc.h @@ -0,0 +1,9 @@ +#pragma once + +#include +#include + +struct gsm_network *bsc_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index ea450be..d4a4d6d 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -415,11 +415,6 @@ extern void talloc_ctx_init(void *ctx_root); -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); - int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 06589f7..1ef8e3e 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 214926b..917dd73 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index ee43a40..8b05637 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -32,7 +32,7 @@ #include -#include +#include #include #include #include diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 0c730a2..351bb5a 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 15248f2..0c7b5ce 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 14 11:48:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 11:48:58 +0000 Subject: [PATCH] openbsc[master]: gsm_subscriber_connection: mark BSC specific items In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1142 to look at the new patch set (#6). gsm_subscriber_connection: mark BSC specific items This is intended to prepare for splitting gsm_subscriber_connection into BSC and MSC specific structs, to make the splitting patch more readable. Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 --- M openbsc/include/openbsc/gsm_data.h 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/42/1142/6 diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 04d1126..ac573c4 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -132,19 +132,19 @@ int mncc_rtp_connect_pending; /* bsc structures */ - struct osmo_bsc_sccp_con *sccp_con; + struct osmo_bsc_sccp_con *sccp_con; /* BSC */ /* back pointers */ struct gsm_network *network; int in_release; - struct gsm_lchan *lchan; - struct gsm_lchan *ho_lchan; - struct gsm_bts *bts; + struct gsm_lchan *lchan; /* BSC */ + struct gsm_lchan *ho_lchan; /* BSC */ + struct gsm_bts *bts; /* BSC */ /* for assignment handling */ - struct osmo_timer_list T10; - struct gsm_lchan *secondary_lchan; + struct osmo_timer_list T10; /* BSC */ + struct gsm_lchan *secondary_lchan; /* BSC */ }; -- To view, visit https://gerrit.osmocom.org/1142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 14 11:50:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 14 Nov 2016 11:50:03 +0000 Subject: openbsc[master]: Add empty libcommon-cs In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 re-add earlier +2, just a micro tweak -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 12:05:55 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Mon, 14 Nov 2016 12:05:55 +0000 Subject: [PATCH] openbsc[master]: rsl: support for ericssons propritary SI13 format In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1183 to look at the new patch set (#3). rsl: support for ericssons propritary SI13 format Ericsson has introduced a propritary format to issue the S13 BCCH information. Normally the system info type field for SI13 would be encoded as 0x28. Ericsson encodes that field as 0x02 and ads a bcch mapping parameter, (IEI=F2) This patch sets the BCCH mapping to 0x00 (=BCCH Normal) statically (0xF200) The new constands are added to libosmocore, see commit: f0f9c8c29daaefbf9cff19177ade4a13ffb2e36c Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/83/1183/3 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 36487c7..b7f7a75 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -237,8 +237,17 @@ init_dchan_hdr(dh, RSL_MT_BCCH_INFO); dh->chan_nr = RSL_CHAN_BCCH; - msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (trx->bts->type == GSM_BTS_TYPE_RBS2000 + && type == RSL_SYSTEM_INFO_13) { + /* Ericsson proprietary encoding of SI13 */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); + } else { + /* Normal encoding */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + } msg->dst = trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/1183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Nov 14 12:40:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Mon, 14 Nov 2016 12:40:36 +0000 Subject: openbsc[master]: rsl: support for ericssons propritary SI13 format In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 13:58:44 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 14 Nov 2016 13:58:44 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 6: > (5 comments) Hi, I have addressed all the comments for the last patch.Please let me know the status. Thanks, Pravin -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 6 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 14 16:20:32 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Mon, 14 Nov 2016 16:20:32 +0000 Subject: [PATCH] openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1212 to look at the new patch set (#2). gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info In case the link_info is deleted we have to stop handling the stored messages inside link_info. Not doing so can lead to invalid memory being accessed. Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/include/openbsc/gb_proxy.h M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gb_proxy_tlli.c 3 files changed, 27 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/12/1212/2 diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h index c396d2b..e10894f 100644 --- a/openbsc/include/openbsc/gb_proxy.h +++ b/openbsc/include/openbsc/gb_proxy.h @@ -208,7 +208,7 @@ struct gbproxy_link_info *gbproxy_update_link_state_dl( struct gbproxy_peer *peer, time_t now, struct gprs_gb_parse_context *parse_ctx); -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx); int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now); diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 111f052..d95139f 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -318,7 +318,7 @@ link_info->vu_gen_tx_bss = GBPROXY_INIT_VU_GEN_TX; } -static void gbproxy_flush_stored_messages(struct gbproxy_peer *peer, +static int gbproxy_flush_stored_messages(struct gbproxy_peer *peer, struct msgb *msg, time_t now, struct gbproxy_link_info* link_info, @@ -349,8 +349,13 @@ peer, link_info, &len_change, &tmp_parse_ctx); - gbproxy_update_link_state_after(peer, link_info, now, - &tmp_parse_ctx); + rc = gbproxy_update_link_state_after(peer, link_info, now, + &tmp_parse_ctx); + if (rc == 1) { + LOGP(DLLC, LOGL_NOTICE, "link_info deleted while flushing stored messages\n"); + msgb_free(stored_msg); + return -1; + } rc = gbprox_relay2sgsn(peer->cfg, stored_msg, msgb_bvci(msg), link_info->sgsn_nsei); @@ -364,6 +369,8 @@ parse_ctx->llc_msg_name : "BSSGP"); msgb_free(stored_msg); } + + return 0; } static int gbproxy_gsm48_to_peer(struct gbproxy_peer *peer, @@ -465,9 +472,12 @@ gsm48_hdr_pdisc(parse_ctx->g48_hdr) == GSM48_PDISC_MM_GPRS && gsm48_hdr_msg_type(parse_ctx->g48_hdr) == GSM48_MT_GMM_ID_RESP; - /* The IMSI is now available */ - gbproxy_flush_stored_messages(peer, msg, now, link_info, - parse_ctx); + /* The IMSI is now available. If flushing the messages fails, + * then link_info has been deleted and we should return + * immediately. */ + if (gbproxy_flush_stored_messages(peer, msg, now, link_info, + parse_ctx) < 0) + return 0; gbproxy_reset_imsi_acquisition(link_info); diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c index 0aa0632..3b3b976 100644 --- a/openbsc/src/gprs/gb_proxy_tlli.c +++ b/openbsc/src/gprs/gb_proxy_tlli.c @@ -348,18 +348,18 @@ gbproxy_attach_link_info(peer, now, link_info); } -static void gbproxy_unregister_link_info(struct gbproxy_peer *peer, +static int gbproxy_unregister_link_info(struct gbproxy_peer *peer, struct gbproxy_link_info *link_info) { if (!link_info) - return; + return 1; if (link_info->tlli.ptmsi == GSM_RESERVED_TMSI && !link_info->imsi_len) { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list (P-TMSI or IMSI are not set)\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); - return; + return 1; } link_info->tlli.current = 0; @@ -371,7 +371,7 @@ gbproxy_reset_link(link_info); - return; + return 0; } int gbproxy_imsi_matches(struct gbproxy_config *cfg, @@ -668,12 +668,13 @@ return link_info; } -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx) { + int rc = 0; if (parse_ctx->invalidate_tlli && link_info) { int keep_info = peer->cfg->keep_link_infos == GBPROX_KEEP_ALWAYS || @@ -684,11 +685,12 @@ if (keep_info) { LOGP(DGPRS, LOGL_INFO, "Unregistering TLLI %08x\n", link_info->tlli.current); - gbproxy_unregister_link_info(peer, link_info); + rc = gbproxy_unregister_link_info(peer, link_info); } else { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); + rc = 1; } } else if (parse_ctx->to_bss && parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && link_info) { @@ -714,6 +716,8 @@ } gbproxy_remove_stale_link_infos(peer, now); + + return rc; } -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Nov 15 01:35:59 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 01:35:59 +0000 Subject: [PATCH] osmo-bts[master]: l1sap: Fix use-after-free in loopback mode. Message-ID: Review at https://gerrit.osmocom.org/1245 l1sap: Fix use-after-free in loopback mode. Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 --- M src/common/l1sap.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/1245/1 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f4bc5ce..553011f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -925,6 +925,9 @@ } msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; } lchan->rtp_tx_marker = false; -- To view, visit https://gerrit.osmocom.org/1245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Tue Nov 15 01:54:00 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 01:54:00 +0000 Subject: [PATCH] osmo-bts[master]: l1sap: Fix use-after-free in loopback mode. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1245 to look at the new patch set (#2). l1sap: Fix use-after-free in loopback mode. By default l1sap_tch_ind() returns 0 which signals to its caller that message has been processed and can be freed. In case of loopback we're forwarding the message to dl_tch_queue who will free it later. Returning 1 from l1sap_tch_ind() prevents caller from freeing message. Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 --- M src/common/l1sap.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/45/1245/2 diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f4bc5ce..553011f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -925,6 +925,9 @@ } msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; } lchan->rtp_tx_marker = false; -- To view, visit https://gerrit.osmocom.org/1245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 15 02:03:38 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 02:03:38 +0000 Subject: [PATCH] osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... Message-ID: Review at https://gerrit.osmocom.org/1246 trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts. Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts. This was not a proper behaviour, because it was used to "control maximum distance a handset can attach from" which is controlled by Access Bursts max TA. Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds support for this configuration command into osmo-bts-trx. If you wonder why would you need that - some test equipment (namely R&S CMD57) has really bad timing sync and can generate signal a few symbols off. That prevents osmo-trx from properly receiving otherwise perfectly good bursts generated by CMD57. This configuration is a solution for this. Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 5 files changed, 53 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/1246/1 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ea2088b..202a05e 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -197,6 +197,10 @@ trx_if_cmd_setmaxdly(l1h, l1h->config.maxdly); l1h->config.maxdly_sent = 1; } + if (l1h->config.maxdlynb_valid && !l1h->config.maxdlynb_sent) { + trx_if_cmd_setmaxdlynb(l1h, l1h->config.maxdlynb); + l1h->config.maxdlynb_sent = 1; + } for (tn = 0; tn < TRX_NR_TS; tn++) { if (l1h->config.slottype_valid[tn] @@ -217,6 +221,7 @@ plink->u.osmotrx.power_sent = 0; } l1h->config.maxdly_sent = 0; + l1h->config.maxdlynb_sent = 0; for (tn = 0; tn < TRX_NR_TS; tn++) l1h->config.slottype_sent[tn] = 0; } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 187303c..f0b2e67 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -24,6 +24,10 @@ int maxdly; int maxdly_sent; + int maxdlynb_valid; + int maxdlynb; + int maxdlynb_sent; + uint8_t slotmask; int slottype_valid[TRX_NR_TS]; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 42d383c..989e77a 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -281,6 +281,11 @@ return trx_ctrl_cmd(l1h, 0, "SETMAXDLY", "%d", dly); } +int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly) +{ + return trx_ctrl_cmd(l1h, 0, "SETMAXDLYNB", "%d", dly); +} + int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type) { return trx_ctrl_cmd(l1h, 1, "SETSLOT", "%d %d", tn, type); diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 8659c4a..fdc8a8d 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -22,6 +22,7 @@ int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db); int trx_if_cmd_setpower(struct trx_l1h *l1h, int db); int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly); +int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly); int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type); int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn); int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn); diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3aec8ba..c7ce72f 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -105,6 +105,11 @@ VTY_NEWLINE); else vty_out(vty, " maxdly : undefined%s", VTY_NEWLINE); + if (l1h->config.maxdlynb_valid) + vty_out(vty, " maxdlynb : %d%s", l1h->config.maxdlynb, + VTY_NEWLINE); + else + vty_out(vty, " maxdlynb : undefined%s", VTY_NEWLINE); for (tn = 0; tn < TRX_NR_TS; tn++) { if (!((1 << tn) & l1h->config.slotmask)) vty_out(vty, " slot #%d: unsupported%s", tn, @@ -248,6 +253,23 @@ l1h->config.maxdly = atoi(argv[0]); l1h->config.maxdly_valid = 1; l1h->config.maxdly_sent = 0; + l1if_provision_transceiver_trx(l1h); + + return CMD_SUCCESS; +} + + +DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd, + "osmotrx maxdlynb <0-31>", + "Set the maximum delay of GSM symbols\n" + "GSM symbols (approx. 1.1km per symbol)\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + l1h->config.maxdlynb = atoi(argv[0]); + l1h->config.maxdlynb_valid = 1; + l1h->config.maxdlynb_sent = 0; l1if_provision_transceiver_trx(l1h); return CMD_SUCCESS; @@ -400,6 +422,18 @@ return CMD_SUCCESS; } +DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, + "no osmotrx maxdlynb", + NO_STR "Unset the maximum delay of GSM symbols\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + l1h->config.maxdlynb_valid = 0; + + return CMD_SUCCESS; +} + DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR @@ -458,6 +492,8 @@ if (l1h->config.maxdly_valid) vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); + if (l1h->config.maxdlynb_valid) + vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s", l1h->config.slotmask & 1, @@ -520,6 +556,8 @@ install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); + install_element(PHY_INST_NODE, &cfg_phyinst_maxdlynb_cmd); + install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdlynb_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Tue Nov 15 02:12:29 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 02:12:29 +0000 Subject: [PATCH] osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. Message-ID: Review at https://gerrit.osmocom.org/1247 vty: Add commands to manually activate/deactivate a channel. This is the easiest way I found to make BTS level loopback to work. Another way to implement this is to have BSC/NITB to send the OML command, but it's a longer path with no clear benefits. Note, that the current code hardcodes the channel to be TCH/F with v1 speech, which is what we need for the basic BER testing. We may want to extend this later to support more channel types. Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 --- M src/common/vty.c 1 file changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/1247/1 diff --git a/src/common/vty.c b/src/common/vty.c index b4aa616..f56f5b5 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -1055,6 +1055,64 @@ return CMD_SUCCESS; } +DEFUN(bts_t_t_l_activate, + bts_t_t_l_activate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> activate", + BTS_T_T_L_STR "Activate channel\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* set channel configuration */ + /* TODO: let user choose speech mode */ + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + /* no encryption */ + memset(&lchan->encr, 0, sizeof(lchan->encr)); + + /* activate the channel */ + lchan->rel_act_kind = LCHAN_REL_ACT_OML; + rc = l1sap_chan_act(lchan->ts->trx, gsm_lchan2chan_nr(lchan), NULL); + if (rc < 0) { + vty_out(vty, "%% can't activate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(bts_t_t_l_deactivate, + bts_t_t_l_deactivate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> deactivate", + BTS_T_T_L_STR "Deactivate channel\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* deactivate the channel */ + rc = l1sap_chan_rel(lchan->ts->trx, gsm_lchan2chan_nr(lchan)); + if (rc < 0) { + vty_out(vty, "%% can't deactivate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) { cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names, @@ -1113,6 +1171,8 @@ install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd); install_element(ENABLE_NODE, &bts_t_t_l_loopback_cmd); install_element(ENABLE_NODE, &no_bts_t_t_l_loopback_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_activate_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_deactivate_cmd); install_element(CONFIG_NODE, &cfg_phy_cmd); install_node(&phy_node, config_write_phy); -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris From gerrit-no-reply at lists.osmocom.org Tue Nov 15 02:19:36 2016 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 15 Nov 2016 02:19:36 +0000 Subject: osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Patch Set 1: How much is a few symbols? There can be some ambiguity from 156/157 burst placement and front/end padding. But I'm guessing the timing error is high enough to break the default max delay? -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 09:06:27 2016 From: gerrit-no-reply at lists.osmocom.org (daniel) Date: Tue, 15 Nov 2016 09:06:27 +0000 Subject: [PATCH] libosmocore[master]: vty: Skip printing non-initialized log categories Message-ID: Review at https://gerrit.osmocom.org/1248 vty: Skip printing non-initialized log categories Without this patch the vty command show logging vty will cause a segfault if not all elements of the log_categories array are defined. Ticket: OW#3053 Sponsored-by: On-Waves ehf Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2 --- M src/vty/logging_vty.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/48/1248/1 diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index a23c1a7..d2fca81 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -275,6 +275,9 @@ for (i = 0; i < info->num_cat; i++) { const struct log_category *cat = &tgt->categories[i]; + /* Skip categories that were not initialized */ + if (!info->cat[i].name) + continue; vty_out(vty, " %-10s %-10s %-8s %s%s", info->cat[i].name+1, log_level_str(cat->loglevel), cat->enabled ? "Enabled" : "Disabled", -- To view, visit https://gerrit.osmocom.org/1248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: daniel From gerrit-no-reply at lists.osmocom.org Tue Nov 15 11:02:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 15 Nov 2016 11:02:46 +0000 Subject: osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 One problem I see with this is that the BSC would not be informed of the lchan being in use. I could imagine setting LCHAN_REL_ACT_RSL instead to send an (unrequested) RSL Chan De-/Act Ack to the BSC, but this I guess would currently be dropped anyway. So the BSC might try to RSL Act the same channel at any time. This is obviously a hacky feature, and I guess the VTY docs should indicate this somehow...? -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 11:06:38 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 15 Nov 2016 11:06:38 +0000 Subject: osmo-bts[master]: l1sap: Fix use-after-free in loopback mode. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 11:12:21 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 15 Nov 2016 11:12:21 +0000 Subject: osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1247/1/src/common/vty.c File src/common/vty.c: Line 1061: BTS_T_T_L_STR "Activate channel\n") so, maybe this could say "Manually activate channel (may disrupt regular service!)" -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 15 18:22:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 15 Nov 2016 18:22:43 +0000 Subject: [PATCH] libosmocore[master]: Extend IPA error logging Message-ID: Review at https://gerrit.osmocom.org/1249 Extend IPA error logging Output more information in case of IPA protocol errors to make debugging easier. Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Related: SYS#3028 --- M src/gsm/ipa.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/49/1249/1 diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 05e8967..f44c328 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -108,12 +108,12 @@ t_tag = *cur++; if (t_len < len_offset) { - LOGP(DLMI, LOGL_ERROR, "minimal offset not included: %d\n", t_len); + LOGP(DLMI, LOGL_ERROR, "minimal offset not included: %d < %d\n", t_len, len_offset); return -EINVAL; } if (t_len > len + 1) { - LOGP(DLMI, LOGL_ERROR, "The tag does not fit: %d\n", t_len); + LOGP(DLMI, LOGL_ERROR, "The tag does not fit: %d > %d\n", t_len, len + 1); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/1249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 15 18:30:53 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 15 Nov 2016 18:30:53 +0000 Subject: [PATCH] openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion Message-ID: Review at https://gerrit.osmocom.org/1250 OM2000: Fixup based on Coverity Scan suggestion This commit fixes Coverity Scan defect: CID 151901: Insecure data handling (TAINTED_SCALAR) Passing tainted variable "tag_len" to a tainted sink. Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/1250/1 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 2733a90..7c2d754 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -2438,10 +2438,10 @@ } /* Display fault report bits (helper function of display_fault_maps()) */ -static bool display_fault_bits(const uint8_t *vect, unsigned int len, +static bool display_fault_bits(const uint8_t *vect, uint16_t len, uint8_t dei, const struct abis_om2k_mo *mo) { - int i; + unsigned int i; int k; bool faults_present = false; int first = 1; -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Nov 15 18:38:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 15 Nov 2016 18:38:09 +0000 Subject: [PATCH] libosmocore[master]: build: make check: disable sim_test when built with --disabl... Message-ID: Review at https://gerrit.osmocom.org/1251 build: make check: disable sim_test when built with --disable-pcsc Numerous issues caused sim_test to be attempted even though libosmosim was not built: In configure.ac, the ENABLE_PCSC variable lacked an AC_SUBST() to be exported. Furthermore in configure.ac, no value 'yes'/'no' was assigned to the ENABLE_PCSC variable, only to the enable_pcsc value. In testsuite.at, encapsulating the sim_test in 'if ENABLE_PCSC' seems to have no effect, regardless (not even when using a variable that should be defined accurately). So fix with these steps, similarly to how we do it in openbsc: In AC_ARG_ENABLE, directly use 'ENABLE_PCSC' to assign 'yes'/'no'. Export the same using AC_SUBST(). Add tests/atlocal.in to translate ENABLE_PCSC to enable_sim_test (also add atlocal to AC_OUTPUT and distclean). Use enable_sim_test in testuite.at, as seen in openbsc: use AT_CHECK() to indicate skipping the test if enable_sim_test isn't 'yes'. Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 --- M configure.ac M tests/Makefile.am A tests/atlocal.in M tests/testsuite.at 4 files changed, 14 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/51/1251/1 diff --git a/configure.ac b/configure.ac index ea68839..ec03c26 100644 --- a/configure.ac +++ b/configure.ac @@ -104,15 +104,16 @@ AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])], [ - enable_pcsc=$enableval + ENABLE_PCSC=$enableval ], [ - enable_pcsc="yes" + ENABLE_PCSC="yes" ]) -AS_IF([test "x$enable_pcsc" = "xyes"], [ +AS_IF([test "x$ENABLE_PCSC" = "xyes"], [ PKG_CHECK_MODULES(PCSC, libpcsclite) ]) -AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes") +AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes") +AC_SUBST(ENABLE_PCSC) AC_ARG_ENABLE(plugin, [AS_HELP_STRING( @@ -231,6 +232,7 @@ src/gb/Makefile src/ctrl/Makefile tests/Makefile + tests/atlocal utils/Makefile Doxyfile.core Doxyfile.gsm diff --git a/tests/Makefile.am b/tests/Makefile.am index ae5735a..f5d095d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,10 +13,14 @@ vty/vty_test comp128/comp128_test utils/utils_test \ smscb/gsm0341_test stats/stats_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ - sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test + tlv/tlv_test gsup/gsup_test fsm/fsm_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test +endif + +if ENABLE_PCSC +check_PROGRAMS += sim/sim_test endif utils_utils_test_SOURCES = utils/utils_test.c @@ -166,7 +170,7 @@ sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \ fsm/fsm_test.ok fsm/fsm_test.err -DISTCLEANFILES = atconfig +DISTCLEANFILES = atconfig atlocal TESTSUITE = $(srcdir)/testsuite diff --git a/tests/atlocal.in b/tests/atlocal.in new file mode 100644 index 0000000..cd27532 --- /dev/null +++ b/tests/atlocal.in @@ -0,0 +1 @@ +enable_sim_test='@ENABLE_PCSC@' diff --git a/tests/testsuite.at b/tests/testsuite.at index 2f274f9..77038bc 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -186,6 +186,7 @@ AT_SETUP([sim]) AT_KEYWORDS([sim]) +AT_CHECK([test "x$enable_sim_test" = xyes || exit 77]) cat $abs_srcdir/sim/sim_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sim/sim_test], [0], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/1251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 15 18:40:43 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Tue, 15 Nov 2016 18:40:43 +0000 Subject: [PATCH] openbsc[master]: SNDCP: Fixup based on Coverity Scan suggestion Message-ID: Review at https://gerrit.osmocom.org/1252 SNDCP: Fixup based on Coverity Scan suggestion This commit fixes Coverity Scan defect: CID 151900: Null pointer dereferences (FORWARD_NULL) Passing null pointer "comp_field->v42bis_params->nsapi" to "memcpy", which dereferences it. Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39 --- M openbsc/src/gprs/gprs_sndcp_comp.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/52/1252/1 diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/openbsc/src/gprs/gprs_sndcp_comp.c index cae0039..1591f80 100644 --- a/openbsc/src/gprs/gprs_sndcp_comp.c +++ b/openbsc/src/gprs/gprs_sndcp_comp.c @@ -72,7 +72,7 @@ } else if (comp_field->v44_params) { comp_entity->nsapi_len = comp_field->v44_params->nsapi_len; memcpy(comp_entity->nsapi, - comp_field->v42bis_params->nsapi, + comp_field->v44_params->nsapi, sizeof(comp_entity->nsapi)); } else { /* The caller is expected to check carefully if the all -- To view, visit https://gerrit.osmocom.org/1252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Tue Nov 15 21:02:05 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 21:02:05 +0000 Subject: [PATCH] osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1247 to look at the new patch set (#2). vty: Add commands to manually activate/deactivate a channel. This is the easiest way I found to make BTS level loopback to work. Another way to implement this is to have BSC/NITB to send the OML command, but it's a longer path with no clear benefits. Note, that the current code hardcodes the channel to be TCH/F with v1 speech, which is what we need for the basic BER testing. We may want to extend this later to support more channel types. Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 --- M src/common/vty.c 1 file changed, 60 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/1247/2 diff --git a/src/common/vty.c b/src/common/vty.c index b4aa616..85c67a2 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -1055,6 +1055,64 @@ return CMD_SUCCESS; } +DEFUN(bts_t_t_l_activate, + bts_t_t_l_activate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> activate", + BTS_T_T_L_STR "Manually activate a logical channel (FOR TEST USE ONLY! Will disrupt normal operation of the channel)\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* set channel configuration */ + /* TODO: let user choose speech mode */ + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + /* no encryption */ + memset(&lchan->encr, 0, sizeof(lchan->encr)); + + /* activate the channel */ + lchan->rel_act_kind = LCHAN_REL_ACT_OML; + rc = l1sap_chan_act(lchan->ts->trx, gsm_lchan2chan_nr(lchan), NULL); + if (rc < 0) { + vty_out(vty, "%% can't activate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(bts_t_t_l_deactivate, + bts_t_t_l_deactivate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> deactivate", + BTS_T_T_L_STR "Deactivate a manually activated channel (DO NOT apply to channels activated by BSC or NITB)\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* deactivate the channel */ + rc = l1sap_chan_rel(lchan->ts->trx, gsm_lchan2chan_nr(lchan)); + if (rc < 0) { + vty_out(vty, "%% can't deactivate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) { cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names, @@ -1113,6 +1171,8 @@ install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd); install_element(ENABLE_NODE, &bts_t_t_l_loopback_cmd); install_element(ENABLE_NODE, &no_bts_t_t_l_loopback_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_activate_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_deactivate_cmd); install_element(CONFIG_NODE, &cfg_phy_cmd); install_node(&phy_node, config_write_phy); -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 15 21:05:19 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Tue, 15 Nov 2016 21:05:19 +0000 Subject: osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Patch Set 2: > This > is obviously a hacky feature, and I guess the VTY docs should > indicate this somehow...? See updated patch with a more detailed and scary description. -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:31:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:31:18 +0000 Subject: libosmocore[master]: vty: Skip printing non-initialized log categories In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:31:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:31:20 +0000 Subject: [MERGED] libosmocore[master]: vty: Skip printing non-initialized log categories In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Skip printing non-initialized log categories ...................................................................... vty: Skip printing non-initialized log categories Without this patch the vty command show logging vty will cause a segfault if not all elements of the log_categories array are defined. Ticket: OW#3053 Sponsored-by: On-Waves ehf Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2 --- M src/vty/logging_vty.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/logging_vty.c b/src/vty/logging_vty.c index a23c1a7..d2fca81 100644 --- a/src/vty/logging_vty.c +++ b/src/vty/logging_vty.c @@ -275,6 +275,9 @@ for (i = 0; i < info->num_cat; i++) { const struct log_category *cat = &tgt->categories[i]; + /* Skip categories that were not initialized */ + if (!info->cat[i].name) + continue; vty_out(vty, " %-10s %-10s %-8s %s%s", info->cat[i].name+1, log_level_str(cat->loglevel), cat->enabled ? "Enabled" : "Disabled", -- To view, visit https://gerrit.osmocom.org/1248 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieeba649c3bde6c9376d8e32b00b92beb37c08ef2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:31:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:31:46 +0000 Subject: openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:32:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:32:04 +0000 Subject: [MERGED] openbsc[master]: gbproxy: Check whether gbproxy_update_link_state_after() del... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info ...................................................................... gbproxy: Check whether gbproxy_update_link_state_after() deletes the link_info In case the link_info is deleted we have to stop handling the stored messages inside link_info. Not doing so can lead to invalid memory being accessed. Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/include/openbsc/gb_proxy.h M openbsc/src/gprs/gb_proxy.c M openbsc/src/gprs/gb_proxy_tlli.c 3 files changed, 27 insertions(+), 13 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gb_proxy.h b/openbsc/include/openbsc/gb_proxy.h index c396d2b..e10894f 100644 --- a/openbsc/include/openbsc/gb_proxy.h +++ b/openbsc/include/openbsc/gb_proxy.h @@ -208,7 +208,7 @@ struct gbproxy_link_info *gbproxy_update_link_state_dl( struct gbproxy_peer *peer, time_t now, struct gprs_gb_parse_context *parse_ctx); -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx); int gbproxy_remove_stale_link_infos(struct gbproxy_peer *peer, time_t now); diff --git a/openbsc/src/gprs/gb_proxy.c b/openbsc/src/gprs/gb_proxy.c index 111f052..d95139f 100644 --- a/openbsc/src/gprs/gb_proxy.c +++ b/openbsc/src/gprs/gb_proxy.c @@ -318,7 +318,7 @@ link_info->vu_gen_tx_bss = GBPROXY_INIT_VU_GEN_TX; } -static void gbproxy_flush_stored_messages(struct gbproxy_peer *peer, +static int gbproxy_flush_stored_messages(struct gbproxy_peer *peer, struct msgb *msg, time_t now, struct gbproxy_link_info* link_info, @@ -349,8 +349,13 @@ peer, link_info, &len_change, &tmp_parse_ctx); - gbproxy_update_link_state_after(peer, link_info, now, - &tmp_parse_ctx); + rc = gbproxy_update_link_state_after(peer, link_info, now, + &tmp_parse_ctx); + if (rc == 1) { + LOGP(DLLC, LOGL_NOTICE, "link_info deleted while flushing stored messages\n"); + msgb_free(stored_msg); + return -1; + } rc = gbprox_relay2sgsn(peer->cfg, stored_msg, msgb_bvci(msg), link_info->sgsn_nsei); @@ -364,6 +369,8 @@ parse_ctx->llc_msg_name : "BSSGP"); msgb_free(stored_msg); } + + return 0; } static int gbproxy_gsm48_to_peer(struct gbproxy_peer *peer, @@ -465,9 +472,12 @@ gsm48_hdr_pdisc(parse_ctx->g48_hdr) == GSM48_PDISC_MM_GPRS && gsm48_hdr_msg_type(parse_ctx->g48_hdr) == GSM48_MT_GMM_ID_RESP; - /* The IMSI is now available */ - gbproxy_flush_stored_messages(peer, msg, now, link_info, - parse_ctx); + /* The IMSI is now available. If flushing the messages fails, + * then link_info has been deleted and we should return + * immediately. */ + if (gbproxy_flush_stored_messages(peer, msg, now, link_info, + parse_ctx) < 0) + return 0; gbproxy_reset_imsi_acquisition(link_info); diff --git a/openbsc/src/gprs/gb_proxy_tlli.c b/openbsc/src/gprs/gb_proxy_tlli.c index 0aa0632..3b3b976 100644 --- a/openbsc/src/gprs/gb_proxy_tlli.c +++ b/openbsc/src/gprs/gb_proxy_tlli.c @@ -348,18 +348,18 @@ gbproxy_attach_link_info(peer, now, link_info); } -static void gbproxy_unregister_link_info(struct gbproxy_peer *peer, +static int gbproxy_unregister_link_info(struct gbproxy_peer *peer, struct gbproxy_link_info *link_info) { if (!link_info) - return; + return 1; if (link_info->tlli.ptmsi == GSM_RESERVED_TMSI && !link_info->imsi_len) { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list (P-TMSI or IMSI are not set)\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); - return; + return 1; } link_info->tlli.current = 0; @@ -371,7 +371,7 @@ gbproxy_reset_link(link_info); - return; + return 0; } int gbproxy_imsi_matches(struct gbproxy_config *cfg, @@ -668,12 +668,13 @@ return link_info; } -void gbproxy_update_link_state_after( +int gbproxy_update_link_state_after( struct gbproxy_peer *peer, struct gbproxy_link_info *link_info, time_t now, struct gprs_gb_parse_context *parse_ctx) { + int rc = 0; if (parse_ctx->invalidate_tlli && link_info) { int keep_info = peer->cfg->keep_link_infos == GBPROX_KEEP_ALWAYS || @@ -684,11 +685,12 @@ if (keep_info) { LOGP(DGPRS, LOGL_INFO, "Unregistering TLLI %08x\n", link_info->tlli.current); - gbproxy_unregister_link_info(peer, link_info); + rc = gbproxy_unregister_link_info(peer, link_info); } else { LOGP(DGPRS, LOGL_INFO, "Removing TLLI %08x from list\n", link_info->tlli.current); gbproxy_delete_link_info(peer, link_info); + rc = 1; } } else if (parse_ctx->to_bss && parse_ctx->tlli_enc && parse_ctx->new_ptmsi_enc && link_info) { @@ -714,6 +716,8 @@ } gbproxy_remove_stale_link_infos(peer, now); + + return rc; } -- To view, visit https://gerrit.osmocom.org/1212 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ieb8503e9e94e7a5ac450ad8aa1713ec4f21cdea5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:32:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:32:04 +0000 Subject: [MERGED] openbsc[master]: test/gbproxy: Test for possible memory corruption when link_... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: test/gbproxy: Test for possible memory corruption when link_info is freed ...................................................................... test/gbproxy: Test for possible memory corruption when link_info is freed This test is to trigger the use-after free issue in commit bff7b0d80972. If compiled with address-sanitizer the test will abort without the fix. Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Ticket: OW#3049 Sponsored-by: On-Waves ehf --- M openbsc/tests/gbproxy/gbproxy_test.c M openbsc/tests/gbproxy/gbproxy_test.ok 2 files changed, 276 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/tests/gbproxy/gbproxy_test.c b/openbsc/tests/gbproxy/gbproxy_test.c index b32ccb5..577daa9 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.c +++ b/openbsc/tests/gbproxy/gbproxy_test.c @@ -4817,6 +4817,100 @@ cleanup_test(); } +static void test_gbproxy_stored_messages() +{ + struct gprs_ns_inst *nsi = gprs_ns_instantiate(gprs_ns_callback, NULL); + struct sockaddr_in bss_peer[1] = {{0},}; + struct sockaddr_in sgsn_peer= {0}; + struct gprs_ra_id rai_bss = + {.mcc = 112, .mnc = 332, .lac = 16464, .rac = 96}; + struct gprs_ra_id rai_unknown = + {.mcc = 1, .mnc = 99, .lac = 99, .rac = 96}; + uint16_t cell_id = 0x1234; + + const uint32_t ptmsi = 0xefe2b700; + const uint32_t local_tlli = 0xefe2b700; + + const uint32_t foreign_tlli1 = 0x8000dead; + + struct gbproxy_peer *peer; + unsigned bss_nu = 0; + unsigned sgsn_nu = 0; + + OSMO_ASSERT(local_tlli == gprs_tmsi2tlli(ptmsi, TLLI_LOCAL)); + + bssgp_nsi = nsi; + gbcfg.nsi = bssgp_nsi; + gbcfg.nsip_sgsn_nsei = SGSN_NSEI; + gbcfg.core_mcc = 0; + gbcfg.core_mnc = 0; + gbcfg.core_apn = talloc_zero_size(NULL, 100); + gbcfg.core_apn_size = gprs_str_to_apn(gbcfg.core_apn, 100, "foo.bar"); + gbcfg.patch_ptmsi = 0; + gbcfg.acquire_imsi = 1; + gbcfg.keep_link_infos = 0; + + configure_sgsn_peer(&sgsn_peer); + configure_bss_peers(bss_peer, ARRAY_SIZE(bss_peer)); + + printf("=== %s ===\n", __func__); + printf("--- Initialise SGSN ---\n\n"); + + connect_sgsn(nsi, &sgsn_peer, SGSN_NSEI); + + printf("--- Initialise BSS 1 ---\n\n"); + + setup_ns(nsi, &bss_peer[0], 0x1001, 0x1000); + setup_bssgp(nsi, &bss_peer[0], 0x1002); + + peer = gbproxy_peer_by_nsei(&gbcfg, 0x1000); + OSMO_ASSERT(peer != NULL); + + send_bssgp_reset_ack(nsi, &sgsn_peer, 0x1002); + + gprs_dump_nsi(nsi); + dump_global(stdout, 0); + dump_peers(stdout, 0, 0, &gbcfg); + + printf("--- Establish first LLC connection ---\n\n"); + + send_llc_ul_ui(nsi, "ATTACH REQUEST", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_unknown, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_attach_req, sizeof(dtap_attach_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_dl_ui(nsi, "IDENT REQUEST", &sgsn_peer, 0x1002, + foreign_tlli1, 0, NULL, 0, + GPRS_SAPI_GMM, sgsn_nu++, + dtap_identity_req, sizeof(dtap_identity_req)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "DETACH ACCEPT", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_detach_acc, sizeof(dtap_detach_acc)); + + dump_peers(stdout, 0, 0, &gbcfg); + + send_llc_ul_ui(nsi, "IDENT RESPONSE", &bss_peer[0], 0x1002, + foreign_tlli1, &rai_bss, cell_id, + GPRS_SAPI_GMM, bss_nu++, + dtap_identity_resp, sizeof(dtap_identity_resp)); + + dump_peers(stdout, 0, 0, &gbcfg); + + dump_global(stdout, 0); + + gbprox_reset(&gbcfg); + gprs_ns_destroy(nsi); + nsi = NULL; + + cleanup_test(); +} + static struct log_info_cat gprs_categories[] = { [DGPRS] = { .name = "DGPRS", @@ -4870,6 +4964,7 @@ test_gbproxy_secondary_sgsn(); test_gbproxy_keep_info(); test_gbproxy_tlli_expire(); + test_gbproxy_stored_messages(); printf("===== GbProxy test END\n\n"); exit(EXIT_SUCCESS); diff --git a/openbsc/tests/gbproxy/gbproxy_test.ok b/openbsc/tests/gbproxy/gbproxy_test.ok index 0ef976f..737aec0 100644 --- a/openbsc/tests/gbproxy/gbproxy_test.ok +++ b/openbsc/tests/gbproxy/gbproxy_test.ok @@ -7059,5 +7059,186 @@ TLLI-Cache: 1 TLLI c0000d80, IMSI 12345678, AGE 0, IMSI matches +=== test_gbproxy_stored_messages === +--- Initialise SGSN --- + +MESSAGE to SGSN at 0x05060708:32000, msg length 12 +02 00 81 01 01 82 01 01 04 82 01 00 + +PROCESSING RESET_ACK from 0x05060708:32000 +03 01 82 01 01 04 82 01 00 + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0a + +result (RESET_ACK) = 1 + +PROCESSING ALIVE_ACK from 0x05060708:32000 +0b + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +06 + +result (ALIVE_ACK) = 1 + +PROCESSING UNBLOCK_ACK from 0x05060708:32000 +07 + +==> got signal NS_UNBLOCK, NS-VC 0x0101/5.6.7.8:32000 + +result (UNBLOCK_ACK) = 0 + +PROCESSING ALIVE from 0x05060708:32000 +0a + +MESSAGE to SGSN at 0x05060708:32000, msg length 1 +0b + +result (ALIVE) = 1 + +--- Initialise BSS 1 --- + +Setup NS-VC: remote 0x01020304:1111, NSVCI 0x1001(4097), NSEI 0x1000(4096) + +PROCESSING RESET from 0x01020304:1111 +02 00 81 01 01 82 10 01 04 82 10 00 + +==> got signal NS_RESET, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 9 +03 01 82 10 01 04 82 10 00 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0a + +result (RESET) = 9 + +PROCESSING ALIVE from 0x01020304:1111 +0a + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +0b + +result (ALIVE) = 1 + +PROCESSING UNBLOCK from 0x01020304:1111 +06 + +==> got signal NS_UNBLOCK, NS-VC 0x1001/1.2.3.4:1111 + +MESSAGE to BSS at 0x01020304:1111, msg length 1 +07 + +result (UNBLOCK) = 1 + +PROCESSING ALIVE_ACK from 0x01020304:1111 +0b + +result (ALIVE_ACK) = 0 + +Setup BSSGP: remote 0x01020304:1111, BVCI 0x1002(4098) + +PROCESSING BVC_RESET from 0x01020304:1111 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +CALLBACK, event 0, msg length 18, bvci 0x0000 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x0000, msg length 18 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 22 +00 00 00 00 22 04 82 10 02 07 81 08 08 88 11 22 33 40 50 60 10 00 + +result (BVC_RESET) = 22 + +PROCESSING BVC_RESET_ACK from 0x05060708:32000 +00 00 00 00 23 04 82 10 02 + +CALLBACK, event 0, msg length 5, bvci 0x0000 +00 00 00 00 23 04 82 10 02 + +NS UNITDATA MESSAGE to BSS, BVCI 0x0000, msg length 5 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 9 +00 00 00 00 23 04 82 10 02 + +result (BVC_RESET_ACK) = 9 + +Current NS-VCIs: + VCI 0x1001, NSEI 0x1000, peer 0x01020304:1111 + VCI 0x0101, NSEI 0x0100, peer 0x05060708:32000 + NS-VC Block count : 1 + +Gbproxy global: +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + TLLI-Cache: 0 +--- Establish first LLC connection --- + +PROCESSING ATTACH REQUEST from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +CALLBACK, event 0, msg length 75, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 24 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 28 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 00 09 41 c4 01 08 15 01 b7 f8 36 + +result (ATTACH REQUEST) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING IDENT REQUEST from 0x05060708:32000 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +CALLBACK, event 0, msg length 23, bvci 0x1002 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +NS UNITDATA MESSAGE to BSS, BVCI 0x1002, msg length 23 (gprs_ns_sendmsg) +MESSAGE to BSS at 0x01020304:1111, msg length 27 +00 00 10 02 00 80 00 de ad 00 50 20 16 82 02 58 0e 89 41 c0 01 08 15 01 ff 6c ba + +result (IDENT REQUEST) = 27 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 1, IMSI acquisition in progress +PROCESSING DETACH ACCEPT from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +CALLBACK, event 0, msg length 32, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 09 01 c0 05 08 06 00 f8 92 41 + +result (DETACH ACCEPT) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI cache size : 1 + TLLI-Cache: 1 + TLLI 8000dead -> 8000dead, IMSI (none), AGE 0, STORED 2, IMSI acquisition in progress +PROCESSING IDENT RESPONSE from 0x01020304:1111 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3 + +CALLBACK, event 0, msg length 40, bvci 0x1002 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 11 22 33 40 50 60 12 34 00 80 0e 00 11 01 c0 09 08 16 08 11 12 13 14 15 16 17 18 ba 14 c3 + +NS UNITDATA MESSAGE to SGSN, BVCI 0x1002, msg length 75 (gprs_ns_sendmsg) +MESSAGE to SGSN at 0x05060708:32000, msg length 79 +00 00 10 02 01 80 00 de ad 00 00 04 08 88 00 f1 99 00 63 60 12 34 00 80 0e 00 34 01 c0 01 08 01 02 f5 e0 21 08 02 05 f4 fb c5 46 79 11 22 33 40 50 60 19 18 b3 43 2b 25 96 62 00 60 80 9a c2 c6 62 00 60 80 ba c8 c6 62 00 60 80 00 16 6d 01 + +result (IDENT RESPONSE) = 0 + +Peers: + NSEI 4096, BVCI 4098, not blocked, RAI 112-332-16464-96 + Attach Request count : 1 + TLLI-Cache: 0 +Gbproxy global: ===== GbProxy test END -- To view, visit https://gerrit.osmocom.org/1213 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5e8c6626ba43342740f08d699383bdded739079f Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: daniel Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:32:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:32:19 +0000 Subject: openbsc[master]: SNDCP: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:32:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:32:21 +0000 Subject: [MERGED] openbsc[master]: SNDCP: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: SNDCP: Fixup based on Coverity Scan suggestion ...................................................................... SNDCP: Fixup based on Coverity Scan suggestion This commit fixes Coverity Scan defect: CID 151900: Null pointer dereferences (FORWARD_NULL) Passing null pointer "comp_field->v42bis_params->nsapi" to "memcpy", which dereferences it. Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39 --- M openbsc/src/gprs/gprs_sndcp_comp.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_sndcp_comp.c b/openbsc/src/gprs/gprs_sndcp_comp.c index cae0039..1591f80 100644 --- a/openbsc/src/gprs/gprs_sndcp_comp.c +++ b/openbsc/src/gprs/gprs_sndcp_comp.c @@ -72,7 +72,7 @@ } else if (comp_field->v44_params) { comp_entity->nsapi_len = comp_field->v44_params->nsapi_len; memcpy(comp_entity->nsapi, - comp_field->v42bis_params->nsapi, + comp_field->v44_params->nsapi, sizeof(comp_entity->nsapi)); } else { /* The caller is expected to check carefully if the all -- To view, visit https://gerrit.osmocom.org/1252 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iff83e21168a267dd4b4c401ab7c603e029b3ac39 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:33:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:33:26 +0000 Subject: libosmocore[master]: build: make check: disable sim_test when built with --disabl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:34:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:34:45 +0000 Subject: openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1250/1/openbsc/src/libbsc/abis_om2000.c File openbsc/src/libbsc/abis_om2000.c: Line 2441: static bool display_fault_bits(const uint8_t *vect, uint16_t len, why uint16_t? why couldn't both 'len' and 'i' be unsigned ints? -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:35:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:35:28 +0000 Subject: libosmocore[master]: Extend IPA error logging In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:35:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:35:37 +0000 Subject: openbsc[master]: abisip-find: use protocol constant In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 15 22:35:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Tue, 15 Nov 2016 22:35:38 +0000 Subject: [MERGED] openbsc[master]: abisip-find: use protocol constant In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abisip-find: use protocol constant ...................................................................... abisip-find: use protocol constant Use library define instead of directly using hardcoded value. Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413 --- M openbsc/src/ipaccess/abisip-find.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/ipaccess/abisip-find.c b/openbsc/src/ipaccess/abisip-find.c index 87c6e50..9fe7df6 100644 --- a/openbsc/src/ipaccess/abisip-find.c +++ b/openbsc/src/ipaccess/abisip-find.c @@ -138,8 +138,8 @@ if (len < 0) return len; - /* 2 bytes length, 1 byte protocol (0xfe) */ - if (buf[2] != 0xfe) + /* 2 bytes length, 1 byte protocol */ + if (buf[2] != IPAC_PROTO_IPACCESS) return 0; if (buf[4] != IPAC_MSGT_ID_RESP) -- To view, visit https://gerrit.osmocom.org/1224 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie9b8bc55bf40cf005434f27e205d47ffab959413 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 09:29:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 16 Nov 2016 09:29:24 +0000 Subject: [MERGED] libosmocore[master]: Extend IPA error logging In-Reply-To: References: Message-ID: Max has submitted this change and it was merged. Change subject: Extend IPA error logging ...................................................................... Extend IPA error logging Output more information in case of IPA protocol errors to make debugging easier. Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Related: SYS#3028 --- M src/gsm/ipa.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 05e8967..f44c328 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -108,12 +108,12 @@ t_tag = *cur++; if (t_len < len_offset) { - LOGP(DLMI, LOGL_ERROR, "minimal offset not included: %d\n", t_len); + LOGP(DLMI, LOGL_ERROR, "minimal offset not included: %d < %d\n", t_len, len_offset); return -EINVAL; } if (t_len > len + 1) { - LOGP(DLMI, LOGL_ERROR, "The tag does not fit: %d\n", t_len); + LOGP(DLMI, LOGL_ERROR, "The tag does not fit: %d > %d\n", t_len, len + 1); return -EINVAL; } -- To view, visit https://gerrit.osmocom.org/1249 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7632d6e679e076bfbec9abc12da4a46cc27ccea1 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 16 09:32:15 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 16 Nov 2016 09:32:15 +0000 Subject: libosmocore[master]: build: make check: disable sim_test when built with --disabl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:04:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:04:33 +0000 Subject: [PATCH] libosmo-abis[master]: lapd_pcap.h: Add missing #include files Message-ID: Review at https://gerrit.osmocom.org/1253 lapd_pcap.h: Add missing #include files we reference 'struct msgb' and mode_t, so we have to #include the right header files. Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 --- M include/osmocom/abis/lapd_pcap.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/53/1253/1 diff --git a/include/osmocom/abis/lapd_pcap.h b/include/osmocom/abis/lapd_pcap.h index e1b587e..36ddd7f 100644 --- a/include/osmocom/abis/lapd_pcap.h +++ b/include/osmocom/abis/lapd_pcap.h @@ -1,6 +1,9 @@ #ifndef _LAPD_PCAP_H_ #define _LAPD_PCAP_H_ +#include +#include + #define OSMO_LAPD_PCAP_INPUT 0 #define OSMO_LAPD_PCAP_OUTPUT 1 -- To view, visit https://gerrit.osmocom.org/1253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:04:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:04:33 +0000 Subject: [PATCH] libosmo-abis[master]: e1_input: remove superflous semi colon Message-ID: Review at https://gerrit.osmocom.org/1254 e1_input: remove superflous semi colon Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f --- M src/e1_input.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/54/1254/1 diff --git a/src/e1_input.c b/src/e1_input.c index 970bdb9..2c8a541 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -232,7 +232,7 @@ struct e1inp_sign_link *sign_link = msg->dst; struct e1inp_driver *e1inp_driver; struct e1inp_ts *e1i_ts; -; + msg->l2h = msg->data; /* don't know how to route this message. */ -- To view, visit https://gerrit.osmocom.org/1254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:07:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:07:36 +0000 Subject: [PATCH] libosmo-abis[master]: lapd_pcap.h: Add missing #include lines In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1253 to look at the new patch set (#2). lapd_pcap.h: Add missing #include lines we reference 'struct msgb' and mode_t, so we have to #include the right header files. Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 --- M include/osmocom/abis/lapd_pcap.h 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/53/1253/2 diff --git a/include/osmocom/abis/lapd_pcap.h b/include/osmocom/abis/lapd_pcap.h index e1b587e..36ddd7f 100644 --- a/include/osmocom/abis/lapd_pcap.h +++ b/include/osmocom/abis/lapd_pcap.h @@ -1,6 +1,9 @@ #ifndef _LAPD_PCAP_H_ #define _LAPD_PCAP_H_ +#include +#include + #define OSMO_LAPD_PCAP_INPUT 0 #define OSMO_LAPD_PCAP_OUTPUT 1 -- To view, visit https://gerrit.osmocom.org/1253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:07:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:07:39 +0000 Subject: libosmo-abis[master]: lapd_pcap.h: Add missing #include lines In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:07:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:07:47 +0000 Subject: [MERGED] libosmo-abis[master]: lapd_pcap.h: Add missing #include lines In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: lapd_pcap.h: Add missing #include lines ...................................................................... lapd_pcap.h: Add missing #include lines we reference 'struct msgb' and mode_t, so we have to #include the right header files. Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 --- M include/osmocom/abis/lapd_pcap.h 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/abis/lapd_pcap.h b/include/osmocom/abis/lapd_pcap.h index e1b587e..36ddd7f 100644 --- a/include/osmocom/abis/lapd_pcap.h +++ b/include/osmocom/abis/lapd_pcap.h @@ -1,6 +1,9 @@ #ifndef _LAPD_PCAP_H_ #define _LAPD_PCAP_H_ +#include +#include + #define OSMO_LAPD_PCAP_INPUT 0 #define OSMO_LAPD_PCAP_OUTPUT 1 -- To view, visit https://gerrit.osmocom.org/1253 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iac8f905182b60782202bdf75e04d47ea89dc3863 Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:07:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:07:51 +0000 Subject: libosmo-abis[master]: e1_input: remove superflous semi colon In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:08:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:08:05 +0000 Subject: [MERGED] libosmo-abis[master]: e1_input: remove superflous semi colon In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: e1_input: remove superflous semi colon ...................................................................... e1_input: remove superflous semi colon Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f --- M src/e1_input.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/e1_input.c b/src/e1_input.c index 970bdb9..2c8a541 100644 --- a/src/e1_input.c +++ b/src/e1_input.c @@ -232,7 +232,7 @@ struct e1inp_sign_link *sign_link = msg->dst; struct e1inp_driver *e1inp_driver; struct e1inp_ts *e1i_ts; -; + msg->l2h = msg->data; /* don't know how to route this message. */ -- To view, visit https://gerrit.osmocom.org/1254 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7e9079cbac1d9920da2aace35810682b49ec532f Gerrit-PatchSet: 2 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: lynxis lazus From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:08:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:08:50 +0000 Subject: libosmocore[master]: RSL: Add defines for ericsson systinfo SI13 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 10:08:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 10:08:55 +0000 Subject: [MERGED] libosmocore[master]: RSL: Add defines for ericsson systinfo SI13 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: RSL: Add defines for ericsson systinfo SI13 ...................................................................... RSL: Add defines for ericsson systinfo SI13 Ericsson uses non standard information element tags when setting up the SI13 system information configuration. This applies to RSL_SYSTEM_INFO_13, which is normally 0x28, instead Ericsson uses RSL_ERIC_SYSTEM_INFO_13, which is set to 0x0C. Furthermore, Ericsson adds a propritary field called BCCH-Mapping, which is tagged as 0xf2 (RSL_IE_ERIC_BCCH_MAPPING) This patch addes these two information element tags in gsm_08_58.h Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index 03337e7..7d523c5 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -293,6 +293,9 @@ RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc, RSL_IE_IPAC_RTP_MPLEX = 0xfd, RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe, + + /* Ericsson */ + RSL_IE_ERIC_BCCH_MAPPING= 0xf2, }; /* Chapter 9.3.1 */ @@ -461,6 +464,7 @@ #define RSL_EXT_MEAS_ORDER 0x47 #define RSL_MEAS_INFO 0x48 #define RSL_SYSTEM_INFO_13 0x28 +#define RSL_ERIC_SYSTEM_INFO_13 0x0C #define RSL_SYSTEM_INFO_2quater 0x29 #define RSL_SYSTEM_INFO_9 0x2a #define RSL_SYSTEM_INFO_18 0x2b -- To view, visit https://gerrit.osmocom.org/1244 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idc27352e286b9b8bbcbf0b31bdb676c3d13487a9 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 13:45:27 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Wed, 16 Nov 2016 13:45:27 +0000 Subject: [PATCH] openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1250 to look at the new patch set (#2). OM2000: Fixup based on Coverity Scan suggestion This commit fixes Coverity Scan defect: CID 151901: Insecure data handling (TAINTED_SCALAR) Passing tainted variable "tag_len" to a tainted sink. Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/50/1250/2 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 2733a90..ae23e50 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -2438,10 +2438,10 @@ } /* Display fault report bits (helper function of display_fault_maps()) */ -static bool display_fault_bits(const uint8_t *vect, unsigned int len, +static bool display_fault_bits(const uint8_t *vect, uint16_t len, uint8_t dei, const struct abis_om2k_mo *mo) { - int i; + uint16_t i; int k; bool faults_present = false; int first = 1; -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 13:59:49 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 16 Nov 2016 13:59:49 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 7: Hi, I have addressed all the comments for the last patch.Please let me know the status. Thanks, Pravin -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 14:22:47 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 16 Nov 2016 14:22:47 +0000 Subject: openbsc[master]: pcu_if: original pcu sock interface from osmo-bts In-Reply-To: References: Message-ID: Patch Set 6: I agree with Neels - this direct inclusion of gsm_data_shared.h from another git repo have already caused confusion and build issues for customers in the past. I think we should get rid of it instead of adding another similar potential confusion source. -- To view, visit https://gerrit.osmocom.org/1169 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I46b0a65f1633c40053d43b57b786b042f20f12bd Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: dexter Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 15:59:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 15:59:25 +0000 Subject: [PATCH] libosmocore[master]: gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers Message-ID: Review at https://gerrit.osmocom.org/1255 gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 22 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/55/1255/1 diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index 7d523c5..a7a2ccf 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -293,11 +293,30 @@ RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc, RSL_IE_IPAC_RTP_MPLEX = 0xfd, RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe, - - /* Ericsson */ - RSL_IE_ERIC_BCCH_MAPPING= 0xf2, }; +/* Ericsson specific IEs, clash with above partially, so they're not + * part of the enum */ +#define RSL_IE_ERIC_INST_NR 0x48 +#define RSL_IE_ERIC_PGSL_TIMERS 0x49 +#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a +#define RSL_IE_ERIC_POWER_INFO 0xf0 +#define RSL_IE_ERIC_MOBILE_ID 0xf1 +#define RSL_IE_ERIC_BCCH_MAPPING 0xf2 +#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3 +#define RSL_IE_ERIC_CNTR_CTRL 0xf4 +#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5 +#define RSL_IE_ERIC_CNTR_REPORT 0xf6 +#define RSL_IE_ERIC_ICP_CONN 0xf7 +#define RSL_IE_ERIC_EMR_SUPPORT 0xf8 +#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9 +#define RSL_IE_ERIC_VGCS_REL 0xfa +#define RSL_IE_ERIC_REP_PER_NCH 0xfb +#define RSL_IE_ERIC_NY2 0xfc +#define RSL_IE_ERIC_T3115 0xfd +#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe +#define RSL_IE_ERIC_FULL_NCH_INFO 0xff + /* Chapter 9.3.1 */ #define RSL_CHAN_NR_MASK 0xf8 #define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */ -- To view, visit https://gerrit.osmocom.org/1255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:34:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:34:40 +0000 Subject: libosmocore[master]: gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:34:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:34:42 +0000 Subject: [MERGED] libosmocore[master]: gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers ...................................................................... gsm_08_58.h: Add more Ericsson specific RSL IE Identifiers Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629 --- M include/osmocom/gsm/protocol/gsm_08_58.h 1 file changed, 22 insertions(+), 3 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h index 7d523c5..a7a2ccf 100644 --- a/include/osmocom/gsm/protocol/gsm_08_58.h +++ b/include/osmocom/gsm/protocol/gsm_08_58.h @@ -293,11 +293,30 @@ RSL_IE_IPAC_RTP_PAYLOAD2= 0xfc, RSL_IE_IPAC_RTP_MPLEX = 0xfd, RSL_IE_IPAC_RTP_MPLEX_ID= 0xfe, - - /* Ericsson */ - RSL_IE_ERIC_BCCH_MAPPING= 0xf2, }; +/* Ericsson specific IEs, clash with above partially, so they're not + * part of the enum */ +#define RSL_IE_ERIC_INST_NR 0x48 +#define RSL_IE_ERIC_PGSL_TIMERS 0x49 +#define RSL_IE_ERIC_REPEAT_DL_FACCH 0x4a +#define RSL_IE_ERIC_POWER_INFO 0xf0 +#define RSL_IE_ERIC_MOBILE_ID 0xf1 +#define RSL_IE_ERIC_BCCH_MAPPING 0xf2 +#define RSL_IE_ERIC_PACKET_PAG_IND 0xf3 +#define RSL_IE_ERIC_CNTR_CTRL 0xf4 +#define RSL_IE_ERIC_CNTR_CTRL_ACK 0xf5 +#define RSL_IE_ERIC_CNTR_REPORT 0xf6 +#define RSL_IE_ERIC_ICP_CONN 0xf7 +#define RSL_IE_ERIC_EMR_SUPPORT 0xf8 +#define RSL_IE_ERIC_EGPRS_REQ_REF 0xf9 +#define RSL_IE_ERIC_VGCS_REL 0xfa +#define RSL_IE_ERIC_REP_PER_NCH 0xfb +#define RSL_IE_ERIC_NY2 0xfc +#define RSL_IE_ERIC_T3115 0xfd +#define RSL_IE_ERIC_ACTIVATE_FLAG 0xfe +#define RSL_IE_ERIC_FULL_NCH_INFO 0xff + /* Chapter 9.3.1 */ #define RSL_CHAN_NR_MASK 0xf8 #define RSL_CHAN_NR_1 0x08 /*< bit to add for 2nd,... lchan */ -- To view, visit https://gerrit.osmocom.org/1255 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib43948da956f23609b1b0995ecac0c796cc7c629 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:35:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:35:09 +0000 Subject: openbsc[master]: rbs2000: Add missing bts feature definitions In-Reply-To: References: Message-ID: Patch Set 7: Verified+1 -- To view, visit https://gerrit.osmocom.org/1170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I777a67862084aa6cca39cfc43f5708e47608b0e6 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:35:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:35:12 +0000 Subject: [MERGED] openbsc[master]: rbs2000: Add missing bts feature definitions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rbs2000: Add missing bts feature definitions ...................................................................... rbs2000: Add missing bts feature definitions function bts_model_rbs2k_start() in bts_ericsson_rbs2000.c lacks the feature definition for GPRS and EGPRS. Change-Id: I777a67862084aa6cca39cfc43f5708e47608b0e6 --- M openbsc/src/libbsc/bts_ericsson_rbs2000.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/src/libbsc/bts_ericsson_rbs2000.c b/openbsc/src/libbsc/bts_ericsson_rbs2000.c index faf6f05..1abf4a3 100644 --- a/openbsc/src/libbsc/bts_ericsson_rbs2000.c +++ b/openbsc/src/libbsc/bts_ericsson_rbs2000.c @@ -182,6 +182,8 @@ model_rbs2k.features.data = &model_rbs2k._features_data[0]; model_rbs2k.features.data_len = sizeof(model_rbs2k._features_data); + gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_GPRS); + gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_EGPRS); gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_HOPPING); gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_HSCSD); gsm_btsmodel_set_feature(&model_rbs2k, BTS_FEAT_MULTI_TSC); -- To view, visit https://gerrit.osmocom.org/1170 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I777a67862084aa6cca39cfc43f5708e47608b0e6 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:35:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:35:34 +0000 Subject: openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:35:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:35:45 +0000 Subject: openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Patch Set 3: Verified+1 -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:35:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:35:47 +0000 Subject: [MERGED] openbsc[master]: OM2000: Fixup based on Coverity Scan suggestion In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Fixup based on Coverity Scan suggestion ...................................................................... OM2000: Fixup based on Coverity Scan suggestion This commit fixes Coverity Scan defect: CID 151901: Insecure data handling (TAINTED_SCALAR) Passing tainted variable "tag_len" to a tainted sink. Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved; Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 2733a90..ae23e50 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -2438,10 +2438,10 @@ } /* Display fault report bits (helper function of display_fault_maps()) */ -static bool display_fault_bits(const uint8_t *vect, unsigned int len, +static bool display_fault_bits(const uint8_t *vect, uint16_t len, uint8_t dei, const struct abis_om2k_mo *mo) { - int i; + uint16_t i; int k; bool faults_present = false; int first = 1; -- To view, visit https://gerrit.osmocom.org/1250 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic71ed6a3bbb228bc03e95bfc4a6f5fe09cf5a021 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:37:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:37:32 +0000 Subject: osmo-bts[master]: l1sap: Fix use-after-free in loopback mode. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:37:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:37:35 +0000 Subject: [MERGED] osmo-bts[master]: l1sap: Fix use-after-free in loopback mode. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: l1sap: Fix use-after-free in loopback mode. ...................................................................... l1sap: Fix use-after-free in loopback mode. By default l1sap_tch_ind() returns 0 which signals to its caller that message has been processed and can be freed. In case of loopback we're forwarding the message to dl_tch_queue who will free it later. Returning 1 from l1sap_tch_ind() prevents caller from freeing message. Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 --- M src/common/l1sap.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/l1sap.c b/src/common/l1sap.c index f4bc5ce..553011f 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -925,6 +925,9 @@ } msgb_enqueue(&lchan->dl_tch_queue, msg); + + /* Return 1 to signal that we're still using msg and it should not be freed */ + return 1; } lchan->rtp_tx_marker = false; -- To view, visit https://gerrit.osmocom.org/1245 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:38:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:38:48 +0000 Subject: osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:38:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:38:52 +0000 Subject: [MERGED] osmo-bts[master]: vty: Add commands to manually activate/deactivate a channel. In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Add commands to manually activate/deactivate a channel. ...................................................................... vty: Add commands to manually activate/deactivate a channel. This is the easiest way I found to make BTS level loopback to work. Another way to implement this is to have BSC/NITB to send the OML command, but it's a longer path with no clear benefits. Note, that the current code hardcodes the channel to be TCH/F with v1 speech, which is what we need for the basic BER testing. We may want to extend this later to support more channel types. Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 --- M src/common/vty.c 1 file changed, 60 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/vty.c b/src/common/vty.c index b4aa616..85c67a2 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -1055,6 +1055,64 @@ return CMD_SUCCESS; } +DEFUN(bts_t_t_l_activate, + bts_t_t_l_activate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> activate", + BTS_T_T_L_STR "Manually activate a logical channel (FOR TEST USE ONLY! Will disrupt normal operation of the channel)\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* set channel configuration */ + /* TODO: let user choose speech mode */ + lchan->tch_mode = GSM48_CMODE_SPEECH_V1; + lchan->rsl_cmode = RSL_CMOD_SPD_SPEECH; + /* no encryption */ + memset(&lchan->encr, 0, sizeof(lchan->encr)); + + /* activate the channel */ + lchan->rel_act_kind = LCHAN_REL_ACT_OML; + rc = l1sap_chan_act(lchan->ts->trx, gsm_lchan2chan_nr(lchan), NULL); + if (rc < 0) { + vty_out(vty, "%% can't activate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + +DEFUN(bts_t_t_l_deactivate, + bts_t_t_l_deactivate_cmd, + "bts <0-0> trx <0-0> ts <0-7> lchan <0-1> deactivate", + BTS_T_T_L_STR "Deactivate a manually activated channel (DO NOT apply to channels activated by BSC or NITB)\n") +{ + struct gsm_network *net = gsmnet_from_vty(vty); + struct gsm_lchan *lchan; + int rc; + + lchan = resolve_lchan(net, argv, 0); + if (!lchan) { + vty_out(vty, "%% can't find BTS%s", VTY_NEWLINE); + return CMD_WARNING; + } + + /* deactivate the channel */ + rc = l1sap_chan_rel(lchan->ts->trx, gsm_lchan2chan_nr(lchan)); + if (rc < 0) { + vty_out(vty, "%% can't deactivate channel%s", VTY_NEWLINE); + return CMD_WARNING; + } + + return CMD_SUCCESS; +} + int bts_vty_init(struct gsm_bts *bts, const struct log_info *cat) { cfg_trx_gsmtap_sapi_cmd.string = vty_cmd_string_from_valstr(bts, gsmtap_sapi_names, @@ -1113,6 +1171,8 @@ install_element(ENABLE_NODE, &bts_t_t_l_jitter_buf_cmd); install_element(ENABLE_NODE, &bts_t_t_l_loopback_cmd); install_element(ENABLE_NODE, &no_bts_t_t_l_loopback_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_activate_cmd); + install_element(ENABLE_NODE, &bts_t_t_l_deactivate_cmd); install_element(CONFIG_NODE, &cfg_phy_cmd); install_node(&phy_node, config_write_phy); -- To view, visit https://gerrit.osmocom.org/1247 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:40:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:40:34 +0000 Subject: osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) https://gerrit.osmocom.org/#/c/1246/1/src/osmo-bts-trx/trx_vty.c File src/osmo-bts-trx/trx_vty.c: Line 264: "Set the maximum delay of GSM symbols\n" the documentation is a 100% copy+paste from 'maxdly'. It is therefore confusing to the user. Please make sure that the interactive VTY help is as useful as possible and provides some indication that differentiates the two commands. -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:40:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:40:43 +0000 Subject: libosmocore[master]: build: make check: disable sim_test when built with --disabl... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 16:40:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 16:40:44 +0000 Subject: [MERGED] libosmocore[master]: build: make check: disable sim_test when built with --disabl... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: build: make check: disable sim_test when built with --disable-pcsc ...................................................................... build: make check: disable sim_test when built with --disable-pcsc Numerous issues caused sim_test to be attempted even though libosmosim was not built: In configure.ac, the ENABLE_PCSC variable lacked an AC_SUBST() to be exported. Furthermore in configure.ac, no value 'yes'/'no' was assigned to the ENABLE_PCSC variable, only to the enable_pcsc value. In testsuite.at, encapsulating the sim_test in 'if ENABLE_PCSC' seems to have no effect, regardless (not even when using a variable that should be defined accurately). So fix with these steps, similarly to how we do it in openbsc: In AC_ARG_ENABLE, directly use 'ENABLE_PCSC' to assign 'yes'/'no'. Export the same using AC_SUBST(). Add tests/atlocal.in to translate ENABLE_PCSC to enable_sim_test (also add atlocal to AC_OUTPUT and distclean). Use enable_sim_test in testuite.at, as seen in openbsc: use AT_CHECK() to indicate skipping the test if enable_sim_test isn't 'yes'. Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 --- M configure.ac M tests/Makefile.am A tests/atlocal.in M tests/testsuite.at 4 files changed, 14 insertions(+), 6 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index ea68839..ec03c26 100644 --- a/configure.ac +++ b/configure.ac @@ -104,15 +104,16 @@ AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])], [ - enable_pcsc=$enableval + ENABLE_PCSC=$enableval ], [ - enable_pcsc="yes" + ENABLE_PCSC="yes" ]) -AS_IF([test "x$enable_pcsc" = "xyes"], [ +AS_IF([test "x$ENABLE_PCSC" = "xyes"], [ PKG_CHECK_MODULES(PCSC, libpcsclite) ]) -AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes") +AM_CONDITIONAL(ENABLE_PCSC, test "x$ENABLE_PCSC" = "xyes") +AC_SUBST(ENABLE_PCSC) AC_ARG_ENABLE(plugin, [AS_HELP_STRING( @@ -231,6 +232,7 @@ src/gb/Makefile src/ctrl/Makefile tests/Makefile + tests/atlocal utils/Makefile Doxyfile.core Doxyfile.gsm diff --git a/tests/Makefile.am b/tests/Makefile.am index ae5735a..f5d095d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -13,10 +13,14 @@ vty/vty_test comp128/comp128_test utils/utils_test \ smscb/gsm0341_test stats/stats_test \ bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test \ - sim/sim_test tlv/tlv_test gsup/gsup_test fsm/fsm_test + tlv/tlv_test gsup/gsup_test fsm/fsm_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test +endif + +if ENABLE_PCSC +check_PROGRAMS += sim/sim_test endif utils_utils_test_SOURCES = utils/utils_test.c @@ -166,7 +170,7 @@ sim/sim_test.ok tlv/tlv_test.ok gsup/gsup_test.ok \ fsm/fsm_test.ok fsm/fsm_test.err -DISTCLEANFILES = atconfig +DISTCLEANFILES = atconfig atlocal TESTSUITE = $(srcdir)/testsuite diff --git a/tests/atlocal.in b/tests/atlocal.in new file mode 100644 index 0000000..cd27532 --- /dev/null +++ b/tests/atlocal.in @@ -0,0 +1 @@ +enable_sim_test='@ENABLE_PCSC@' diff --git a/tests/testsuite.at b/tests/testsuite.at index 2f274f9..77038bc 100644 --- a/tests/testsuite.at +++ b/tests/testsuite.at @@ -186,6 +186,7 @@ AT_SETUP([sim]) AT_KEYWORDS([sim]) +AT_CHECK([test "x$enable_sim_test" = xyes || exit 77]) cat $abs_srcdir/sim/sim_test.ok > expout AT_CHECK([$abs_top_builddir/tests/sim/sim_test], [0], [expout], [ignore]) AT_CLEANUP -- To view, visit https://gerrit.osmocom.org/1251 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9e8740c7d2dfbd272e22fee85972ef3fda7184a8 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Wed Nov 16 17:01:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 17:01:42 +0000 Subject: [MERGED] openbsc[master]: rsl: support for ericssons propritary SI13 format In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: rsl: support for ericssons propritary SI13 format ...................................................................... rsl: support for ericssons propritary SI13 format Ericsson has introduced a propritary format to issue the S13 BCCH information. Normally the system info type field for SI13 would be encoded as 0x28. Ericsson encodes that field as 0x02 and ads a bcch mapping parameter, (IEI=F2) This patch sets the BCCH mapping to 0x00 (=BCCH Normal) statically (0xF200) The new constands are added to libosmocore, see commit: f0f9c8c29daaefbf9cff19177ade4a13ffb2e36c Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index 36487c7..b7f7a75 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -237,8 +237,17 @@ init_dchan_hdr(dh, RSL_MT_BCCH_INFO); dh->chan_nr = RSL_CHAN_BCCH; - msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); - msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + if (trx->bts->type == GSM_BTS_TYPE_RBS2000 + && type == RSL_SYSTEM_INFO_13) { + /* Ericsson proprietary encoding of SI13 */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, RSL_ERIC_SYSTEM_INFO_13); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + msgb_tv_put(msg, RSL_IE_ERIC_BCCH_MAPPING, 0x00); + } else { + /* Normal encoding */ + msgb_tv_put(msg, RSL_IE_SYSINFO_TYPE, type); + msgb_tlv_put(msg, RSL_IE_FULL_BCCH_INFO, len, data); + } msg->dst = trx->rsl_link; -- To view, visit https://gerrit.osmocom.org/1183 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie0900f9b810744172b3090ce1b0ef7b7a1132946 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 17:20:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 17:20:44 +0000 Subject: [PATCH] openbsc[master]: OM2000: Add three IEs to TCH activation about which we have ... Message-ID: Review at https://gerrit.osmocom.org/1256 OM2000: Add three IEs to TCH activation about which we have no clue Change-Id: Ie3067606033e894c558659ddf0025d01b8198cf9 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 4 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/56/1256/1 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index ae23e50..6105fec 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1417,6 +1417,10 @@ msgb_tv_put(msg, OM2K_DEI_LSC_FILT_TIME, 10); /* units of 100ms */ msgb_tv_put(msg, OM2K_DEI_CALL_SUPV_TIME, 8); msgb_tv_put(msg, OM2K_DEI_ENCR_ALG, 0x00); + /* Not sure what those below mean */ + msgb_tv_put(msg, 0x9e, 0x00); + msgb_tv_put(msg, 0x9f, 0x37); + msgb_tv_put(msg, 0xa0, 0x01); break; } -- To view, visit https://gerrit.osmocom.org/1256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie3067606033e894c558659ddf0025d01b8198cf9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 17:20:44 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 17:20:44 +0000 Subject: [PATCH] openbsc[master]: OM2000: Fix missing dynamic TCH initialization Message-ID: Review at https://gerrit.osmocom.org/1257 OM2000: Fix missing dynamic TCH initialization When OM2000 has confirmed that a TS is started, call dyn_ts_init() on the timeslot to start the processing for fully dynamic (osmocom style) TCH/F_TCH/H_PDCH. This should in turn trigger the activation of idle timeslots as PDCH until we want to allocate any of them for TCH/F or TCH/H. Change-Id: I1a1fd61d6afd85449cacad4bacfb830252dab6b1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 12 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/57/1257/1 diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 6105fec..0dffb15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1282,6 +1283,8 @@ case GSM_PCHAN_TCH_F: case GSM_PCHAN_TCH_H: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: + case GSM_PCHAN_TCH_F_TCH_H_PDCH: return 8; default: return 0; @@ -1674,6 +1677,15 @@ static void om2k_mo_st_wait_opinfo_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct om2k_mo_fsm_priv *omfp = fi->priv; + + /* if we have just received opinfo accept for the timeslot, + * start dynamic TCH switching procedures */ + if (omfp->mo->addr.class == OM2K_MO_CLS_TS) { + struct gsm_bts_trx_s *ts; + ts = mo2obj(omfp->trx->bts, &omfp->mo->addr); + dyn_ts_init(ts); + } osmo_fsm_inst_state_chg(fi, OM2K_ST_DONE, 0, 0); } -- To view, visit https://gerrit.osmocom.org/1257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1a1fd61d6afd85449cacad4bacfb830252dab6b1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 19:08:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 19:08:20 +0000 Subject: openbsc[master]: OM2000: Add three IEs to TCH activation about which we have ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie3067606033e894c558659ddf0025d01b8198cf9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 19:08:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 19:08:22 +0000 Subject: [MERGED] openbsc[master]: OM2000: Add three IEs to TCH activation about which we have ... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Add three IEs to TCH activation about which we have no clue ...................................................................... OM2000: Add three IEs to TCH activation about which we have no clue Change-Id: Ie3067606033e894c558659ddf0025d01b8198cf9 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 4 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index ae23e50..6105fec 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -1417,6 +1417,10 @@ msgb_tv_put(msg, OM2K_DEI_LSC_FILT_TIME, 10); /* units of 100ms */ msgb_tv_put(msg, OM2K_DEI_CALL_SUPV_TIME, 8); msgb_tv_put(msg, OM2K_DEI_ENCR_ALG, 0x00); + /* Not sure what those below mean */ + msgb_tv_put(msg, 0x9e, 0x00); + msgb_tv_put(msg, 0x9f, 0x37); + msgb_tv_put(msg, 0xa0, 0x01); break; } -- To view, visit https://gerrit.osmocom.org/1256 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie3067606033e894c558659ddf0025d01b8198cf9 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 19:08:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 19:08:35 +0000 Subject: openbsc[master]: OM2000: Fix missing dynamic TCH initialization In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1a1fd61d6afd85449cacad4bacfb830252dab6b1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 16 19:08:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 19:08:37 +0000 Subject: [MERGED] openbsc[master]: OM2000: Fix missing dynamic TCH initialization In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: OM2000: Fix missing dynamic TCH initialization ...................................................................... OM2000: Fix missing dynamic TCH initialization When OM2000 has confirmed that a TS is started, call dyn_ts_init() on the timeslot to start the processing for fully dynamic (osmocom style) TCH/F_TCH/H_PDCH. This should in turn trigger the activation of idle timeslots as PDCH until we want to allocate any of them for TCH/F or TCH/H. Change-Id: I1a1fd61d6afd85449cacad4bacfb830252dab6b1 --- M openbsc/src/libbsc/abis_om2000.c 1 file changed, 12 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_om2000.c b/openbsc/src/libbsc/abis_om2000.c index 6105fec..0dffb15 100644 --- a/openbsc/src/libbsc/abis_om2000.c +++ b/openbsc/src/libbsc/abis_om2000.c @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -1282,6 +1283,8 @@ case GSM_PCHAN_TCH_F: case GSM_PCHAN_TCH_H: case GSM_PCHAN_PDCH: + case GSM_PCHAN_TCH_F_PDCH: + case GSM_PCHAN_TCH_F_TCH_H_PDCH: return 8; default: return 0; @@ -1674,6 +1677,15 @@ static void om2k_mo_st_wait_opinfo_accept(struct osmo_fsm_inst *fi, uint32_t event, void *data) { + struct om2k_mo_fsm_priv *omfp = fi->priv; + + /* if we have just received opinfo accept for the timeslot, + * start dynamic TCH switching procedures */ + if (omfp->mo->addr.class == OM2K_MO_CLS_TS) { + struct gsm_bts_trx_s *ts; + ts = mo2obj(omfp->trx->bts, &omfp->mo->addr); + dyn_ts_init(ts); + } osmo_fsm_inst_state_chg(fi, OM2K_ST_DONE, 0, 0); } -- To view, visit https://gerrit.osmocom.org/1257 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I1a1fd61d6afd85449cacad4bacfb830252dab6b1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 16 22:31:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 22:31:45 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy Message-ID: Review at https://gerrit.osmocom.org/1258 Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 5 files changed, 86 insertions(+), 161 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/1 diff --git a/configure.ac b/configure.ac index 1e8a4ec..53345b2 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--distable-pcu-socket], + [disable support for the PCU socket [default=yes]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..3e86d81 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + $(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 22:33:03 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Wed, 16 Nov 2016 22:33:03 +0000 Subject: [PATCH] osmo-pcu[master]: Install the pcuif_proto.h header file Message-ID: Review at https://gerrit.osmocom.org/1259 Install the pcuif_proto.h header file So far, we used to keep a copy of the header file around in both osmo-pcu and osmo-bts projects. Before we start introducing a third copy in openbsc, let's have the osmo-pcu install the header file and make the other programs use that. Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d --- M Makefile.am M configure.ac A include/Makefile.am R include/osmocom/pcu/pcuif_proto.h M src/Makefile.am M src/osmobts_sock.cpp M src/pcu_l1_if.cpp 7 files changed, 10 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/59/1259/1 diff --git a/Makefile.am b/Makefile.am index 4cbc114..12cb478 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = src examples tests +SUBDIRS = include src examples tests EXTRA_DIST = osmoappdesc.py diff --git a/configure.ac b/configure.ac index 022a7f7..dcde2ed 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ AC_SUBST(STD_DEFINES_AND_INCLUDES) AC_OUTPUT( + include/Makefile src/Makefile examples/Makefile tests/Makefile diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..e40a9c0 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +nobase_include_HEADERS = \ + osmocom/pcu/pcuif_proto.h diff --git a/src/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h similarity index 100% rename from src/pcuif_proto.h rename to include/osmocom/pcu/pcuif_proto.h diff --git a/src/Makefile.am b/src/Makefile.am index 9b047e7..7cc239b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ # AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) if ENABLE_SYSMODSP AM_CPPFLAGS += -DENABLE_DIRECT_PHY @@ -78,7 +78,6 @@ gprs_rlcmac.h \ gprs_ms.h \ gprs_ms_storage.h \ - pcuif_proto.h \ pcu_l1_if.h \ gsm_timer.h \ bitvector.h \ @@ -98,6 +97,9 @@ gprs_coding_scheme.h \ egprs_rlc_compression.h +nobase_include_HEADERS = + osmocom/pcu/pcuif_proto.h + osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 21a404f..f589dc2 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index f1c73c9..9e80b93 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/1259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Wed Nov 16 22:36:45 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 16 Nov 2016 22:36:45 +0000 Subject: [PATCH] osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1246 to look at the new patch set (#2). trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts. Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts. This was not a proper behaviour, because it was used to "control maximum distance a handset can attach from" which is controlled by Access Bursts max TA. Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds support for this configuration command into osmo-bts-trx. If you wonder why would you need that - some test equipment (namely R&S CMD57) has really bad timing sync and can generate signal a few symbols off. That prevents osmo-trx from properly receiving otherwise perfectly good bursts generated by CMD57. This configuration is a solution for this. Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 --- M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/l1_if.h M src/osmo-bts-trx/trx_if.c M src/osmo-bts-trx/trx_if.h M src/osmo-bts-trx/trx_vty.c 5 files changed, 68 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/46/1246/2 diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ea2088b..202a05e 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -197,6 +197,10 @@ trx_if_cmd_setmaxdly(l1h, l1h->config.maxdly); l1h->config.maxdly_sent = 1; } + if (l1h->config.maxdlynb_valid && !l1h->config.maxdlynb_sent) { + trx_if_cmd_setmaxdlynb(l1h, l1h->config.maxdlynb); + l1h->config.maxdlynb_sent = 1; + } for (tn = 0; tn < TRX_NR_TS; tn++) { if (l1h->config.slottype_valid[tn] @@ -217,6 +221,7 @@ plink->u.osmotrx.power_sent = 0; } l1h->config.maxdly_sent = 0; + l1h->config.maxdlynb_sent = 0; for (tn = 0; tn < TRX_NR_TS; tn++) l1h->config.slottype_sent[tn] = 0; } diff --git a/src/osmo-bts-trx/l1_if.h b/src/osmo-bts-trx/l1_if.h index 187303c..f0b2e67 100644 --- a/src/osmo-bts-trx/l1_if.h +++ b/src/osmo-bts-trx/l1_if.h @@ -24,6 +24,10 @@ int maxdly; int maxdly_sent; + int maxdlynb_valid; + int maxdlynb; + int maxdlynb_sent; + uint8_t slotmask; int slottype_valid[TRX_NR_TS]; diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 42d383c..989e77a 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -281,6 +281,11 @@ return trx_ctrl_cmd(l1h, 0, "SETMAXDLY", "%d", dly); } +int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly) +{ + return trx_ctrl_cmd(l1h, 0, "SETMAXDLYNB", "%d", dly); +} + int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type) { return trx_ctrl_cmd(l1h, 1, "SETSLOT", "%d %d", tn, type); diff --git a/src/osmo-bts-trx/trx_if.h b/src/osmo-bts-trx/trx_if.h index 8659c4a..fdc8a8d 100644 --- a/src/osmo-bts-trx/trx_if.h +++ b/src/osmo-bts-trx/trx_if.h @@ -22,6 +22,7 @@ int trx_if_cmd_setrxgain(struct trx_l1h *l1h, int db); int trx_if_cmd_setpower(struct trx_l1h *l1h, int db); int trx_if_cmd_setmaxdly(struct trx_l1h *l1h, int dly); +int trx_if_cmd_setmaxdlynb(struct trx_l1h *l1h, int dly); int trx_if_cmd_setslot(struct trx_l1h *l1h, uint8_t tn, uint8_t type); int trx_if_cmd_rxtune(struct trx_l1h *l1h, uint16_t arfcn); int trx_if_cmd_txtune(struct trx_l1h *l1h, uint16_t arfcn); diff --git a/src/osmo-bts-trx/trx_vty.c b/src/osmo-bts-trx/trx_vty.c index 3aec8ba..ca347e8 100644 --- a/src/osmo-bts-trx/trx_vty.c +++ b/src/osmo-bts-trx/trx_vty.c @@ -105,6 +105,11 @@ VTY_NEWLINE); else vty_out(vty, " maxdly : undefined%s", VTY_NEWLINE); + if (l1h->config.maxdlynb_valid) + vty_out(vty, " maxdlynb : %d%s", l1h->config.maxdlynb, + VTY_NEWLINE); + else + vty_out(vty, " maxdlynb : undefined%s", VTY_NEWLINE); for (tn = 0; tn < TRX_NR_TS; tn++) { if (!((1 << tn) & l1h->config.slotmask)) vty_out(vty, " slot #%d: unsupported%s", tn, @@ -239,7 +244,13 @@ DEFUN(cfg_phyinst_maxdly, cfg_phyinst_maxdly_cmd, "osmotrx maxdly <0-31>", - "Set the maximum delay of GSM symbols\n" + "Set the maximum acceptable delay of an Access Burst (in GSM symbols)." + " Access Burst is the first burst a mobile transmits in order to establish" + " a connection and it is used to estimate Timing Advance (TA) which is" + " then applied to Normal Bursts to compensate for signal delay due to" + " distance. So changing this setting effectively changes maximum range of" + " the cell, because if we receive an Access Burst with a delay higher than" + " this value, it will be ignored and connection is dropped.\n" "GSM symbols (approx. 1.1km per symbol)\n") { struct phy_instance *pinst = vty->index; @@ -248,6 +259,31 @@ l1h->config.maxdly = atoi(argv[0]); l1h->config.maxdly_valid = 1; l1h->config.maxdly_sent = 0; + l1if_provision_transceiver_trx(l1h); + + return CMD_SUCCESS; +} + + +DEFUN(cfg_phyinst_maxdlynb, cfg_phyinst_maxdlynb_cmd, + "osmotrx maxdlynb <0-31>", + "Set the maximum acceptable delay of a Normal Burst (in GSM symbols)." + " USE FOR TESTING ONLY, DON'T CHANGE IN PRODUCTION USE!" + " During normal operation, Normal Bursts delay are controled by a Timing" + " Advance control loop and thus Normal Bursts arrive to a BTS with no more" + " than a couple GSM symbols, which is already taken into account in osmo-trx." + " So changing this setting will have no effect in production installations" + " except increasing osmo-trx CPU load. This setting is only useful when" + " testing with a transmitter which can't precisely synchronize to the BTS" + " downlink signal, like e.g. R&S CMD57.\n" + "GSM symbols (approx. 1.1km per symbol)\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + l1h->config.maxdlynb = atoi(argv[0]); + l1h->config.maxdlynb_valid = 1; + l1h->config.maxdlynb_sent = 0; l1if_provision_transceiver_trx(l1h); return CMD_SUCCESS; @@ -400,6 +436,18 @@ return CMD_SUCCESS; } +DEFUN(cfg_phyinst_no_maxdlynb, cfg_phyinst_no_maxdlynb_cmd, + "no osmotrx maxdlynb", + NO_STR "Unset the maximum delay of GSM symbols\n") +{ + struct phy_instance *pinst = vty->index; + struct trx_l1h *l1h = pinst->u.osmotrx.hdl; + + l1h->config.maxdlynb_valid = 0; + + return CMD_SUCCESS; +} + DEFUN(cfg_phy_transc_ip, cfg_phy_transc_ip_cmd, "osmotrx ip HOST", OSMOTRX_STR @@ -458,6 +506,8 @@ if (l1h->config.maxdly_valid) vty_out(vty, " maxdly %d%s", l1h->config.maxdly, VTY_NEWLINE); + if (l1h->config.maxdlynb_valid) + vty_out(vty, " maxdlynb %d%s", l1h->config.maxdlynb, VTY_NEWLINE); if (l1h->config.slotmask != 0xff) vty_out(vty, " slotmask %d %d %d %d %d %d %d %d%s", l1h->config.slotmask & 1, @@ -520,6 +570,8 @@ install_element(PHY_INST_NODE, &cfg_phy_power_on_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_maxdly_cmd); install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdly_cmd); + install_element(PHY_INST_NODE, &cfg_phyinst_maxdlynb_cmd); + install_element(PHY_INST_NODE, &cfg_phyinst_no_maxdlynb_cmd); return 0; } -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Wed Nov 16 23:39:42 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 16 Nov 2016 23:39:42 +0000 Subject: osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Patch Set 2: (1 comment) > How much is a few symbols? There can be some ambiguity from 156/157 > burst placement and front/end padding. But I'm guessing the timing > error is high enough to break the default max delay? IIRC osmo-trx stopped decoding when delay was more than 2 or 3 symbols, and I've seen up to 10 symbols with my CMD57 (and I'm sure it's not the limit, because it was drifting further). https://gerrit.osmocom.org/#/c/1246/1/src/osmo-bts-trx/trx_vty.c File src/osmo-bts-trx/trx_vty.c: Line 264: return CMD_SUCCESS; > the documentation is a 100% copy+paste from 'maxdly'. It is therefore confu Good point, thank you for the feedback. Please see an updated patch. -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 16 23:39:50 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Wed, 16 Nov 2016 23:39:50 +0000 Subject: osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Patch Set 2: > (1 comment) Good point, thank you for the feedback. Please see an updated patch. -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 05:44:44 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 17 Nov 2016 05:44:44 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 4: Any update on this patch? -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 05:48:52 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Thu, 17 Nov 2016 05:48:52 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: Hi Harald and Team, Let me know your opinion on this patch. As this patch is pending for long time, we would like to finalise on this. I am re-iterating that the main intension of this patch was to test the setup with fewer set of MS with equal resources allocated for performance without re compiling the PCU(only configuration file modification is required). Thanks, Aravind Sirsikar -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 06:59:33 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 17 Nov 2016 06:59:33 +0000 Subject: [PATCH] openbsc[master]: Correct Logging macro for pdpctx_timer_start Message-ID: Review at https://gerrit.osmocom.org/1260 Correct Logging macro for pdpctx_timer_start This commit corrects the Logging macro used in pdpctx_timer_start. Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/60/1260/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 8de3bf7..b30b8d3 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1978,7 +1978,7 @@ unsigned int seconds) { if (osmo_timer_pending(&pdp->timer)) - LOGMMCTXP(LOGL_ERROR, pdp->mm, "Starting MM timer %u while old " + LOGPDPCTXP(LOGL_ERROR, pdp, "Starting PDP timer %u while old " "timer %u pending\n", T, pdp->T); pdp->T = T; pdp->num_T_exp = 0; -- To view, visit https://gerrit.osmocom.org/1260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 17 06:59:33 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 17 Nov 2016 06:59:33 +0000 Subject: [PATCH] openbsc[master]: Add support for pdpctx_timer_stop Message-ID: Review at https://gerrit.osmocom.org/1261 Add support for pdpctx_timer_stop Timer T3395 starts at the transmission of Deactivate PDP request using pdpctx_timer_start but there was no corresponding stop function. The timer is stopped when Deactivate PDP Context Accept is received. This according to 3gpp spec reference 24.008 section 6.1.3.4.2. Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/61/1261/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index b30b8d3..1fc2784 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1990,6 +1990,14 @@ osmo_timer_schedule(&pdp->timer, seconds, 0); } +static void pdpctx_timer_stop(struct sgsn_pdp_ctx *pdp, unsigned int T) +{ + if (pdp->T != T) + LOGPDPCTXP(LOGL_ERROR, pdp, "Stopping PDP timer %u but " + "%u is running\n", T, pdp->T); + osmo_timer_del(&pdp->timer); +} + #if 0 static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) { @@ -2464,7 +2472,8 @@ mm->imsi, transaction_id); return 0; } - + /* stop timer 3395 */ + pdpctx_timer_stop(pdp, 3395); return sgsn_delete_pdp_ctx(pdp); } -- To view, visit https://gerrit.osmocom.org/1261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 17 06:59:33 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 17 Nov 2016 06:59:33 +0000 Subject: [PATCH] openbsc[master]: Support Deactivate PDP Context Request from network Message-ID: Review at https://gerrit.osmocom.org/1262 Support Deactivate PDP Context Request from network This commit will enable trigger of Deactivate PDP context Request message based on the IMSI of the subscriber. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c 2 files changed, 17 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/1262/1 diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index 24e286c..c72171a 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -369,6 +369,8 @@ * ottherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn); +void drop_pdp_for_ms(const char *imsi); + char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); /* diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index e5a54d9..99b04a4 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -667,6 +667,21 @@ } } +/* High-level function to be called for PDP deactivation initiated from SGSN */ +void drop_pdp_for_ms(const char *imsi) +{ + OSMO_ASSERT(imsi != NULL); + struct sgsn_mm_ctx *mm; + struct sgsn_pdp_ctx *pdp; + + /* Search the PDP for this subscriber */ + mm = sgsn_mm_ctx_by_imsi(imsi); + llist_for_each_entry(pdp, &mm->pdp_list, list) { + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_DEACT_REGULAR); + LOGPDPCTXP(LOGL_NOTICE, pdp, "SGSN initiated Deactivate PDP\n"); + } +} + /* High-level function to be called in case a GGSN has disappeared or * otherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn) -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 17 06:59:33 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 17 Nov 2016 06:59:33 +0000 Subject: [PATCH] openbsc[master]: Trigger Deactivate PDP context Request from SGSN VTY Message-ID: Review at https://gerrit.osmocom.org/1263 Trigger Deactivate PDP context Request from SGSN VTY In SGSN for acl based authorization IMSI values of all registered MS are maintained. Through imsi_acl_del Deactivate PDP context Request from network can be triggered. Hence, It will remove all PDP context related to that MS. Change-Id: Ide0cd4af828b753d24d2e507967d1c2e652ee05e --- M openbsc/src/gprs/gprs_gmm.c M openbsc/src/gprs/sgsn_vty.c 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/63/1263/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 1fc2784..345c6bd 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -2537,6 +2537,8 @@ break; case GSM48_MT_GSM_DEACT_PDP_ACK: rc = gsm48_rx_gsm_deact_pdp_ack(mmctx, msg); + if (sgsn_auth_state(mmctx) != SGSN_AUTH_ACCEPTED) + gsm0408_gprs_access_cancelled(mmctx, GMM_CAUSE_GPRS_NOTALLOWED); break; case GSM48_MT_GSM_STATUS: rc = gsm48_rx_gsm_status(mmctx, msg); diff --git a/openbsc/src/gprs/sgsn_vty.c b/openbsc/src/gprs/sgsn_vty.c index 1b477e5..8220028 100644 --- a/openbsc/src/gprs/sgsn_vty.c +++ b/openbsc/src/gprs/sgsn_vty.c @@ -573,9 +573,11 @@ if (!strcmp(op, "add")) rc = sgsn_acl_add(imsi, g_cfg); - else + else { + vty_out(vty, "%% Network initiated PDP deactivate%s", VTY_NEWLINE); + drop_pdp_for_ms(imsi); rc = sgsn_acl_del(imsi, g_cfg); - + } if (rc < 0) { vty_out(vty, "%% unable to %s ACL%s", op, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/1263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ide0cd4af828b753d24d2e507967d1c2e652ee05e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 17 07:56:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 07:56:36 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: Hi Aravind, > Hi Harald and Team, Please note that those kind of messages or mails are *not at all* helping. I personally find them very annoying. We have a gerrti patch tracking system to always know what patches are pending and never loose any patch. Nobody else submitting any patches is posting such questions. Furthermore, as I have stated many times by now, I personally are not qualified to do osmo-pcu re-work beyond a very formal "coding standards" level. The people involved in osmo-pcu are: Andreas Eversberg, Ivan Kluchnikov, Jacob Erlbeck and Holger Freyther. Most of them seem to have lost interest and/or time, leaving right now primarily Holger as person capable to do review an approval of patches. -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 09:20:26 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Thu, 17 Nov 2016 09:20:26 +0000 Subject: openbsc[master]: Correct Logging macro for pdpctx_timer_start In-Reply-To: References: Message-ID: Patch Set 1: > Build Failed > > http://jenkins.osmocom.org/jenkins/job/OpenBSC-gerrit/1322/ : > FAILURE In our environment the compilation is successful but jenkins reports it as failed with an error as below, ====================================================================== ERROR: testBSCreload (__main__.TestVTYNAT) ---------------------------------------------------------------------- Traceback (most recent call last): File "./vty_test_runner.py", line 783, in testBSCreload b0 = nat_bsc_sock_test(0, "lol") File "./vty_test_runner.py", line 1299, in nat_bsc_sock_test ipa_handle_resp(bsc, tk, verbose) File "./vty_test_runner.py", line 1283, in ipa_handle_resp ipa_send_resp(x, tk, verbose) File "./vty_test_runner.py", line 1211, in ipa_send_resp return x.send("\x00\x07\xfe\x05\x00\x04\x01" + tk) error: [Errno 32] Broken pipe Please let me know what next to be done for this. -- To view, visit https://gerrit.osmocom.org/1260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 10:16:28 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 10:16:28 +0000 Subject: osmo-pcu[master]: Install the pcuif_proto.h header file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 10:20:59 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 10:20:59 +0000 Subject: openbsc[master]: gsm_subscriber_connection: mark BSC specific items In-Reply-To: References: Message-ID: Patch Set 6: Could you move this patch right next to the split patch you're referring to in the commit message? As it is now it's unclear how few comments make some patch more readable. -- To view, visit https://gerrit.osmocom.org/1142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 12:37:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 12:37:23 +0000 Subject: [PATCH] openbsc[master]: Add gsn-restart to top-level .gitignore Message-ID: Review at https://gerrit.osmocom.org/1264 Add gsn-restart to top-level .gitignore Change-Id: Ib84c5382acdbbf0a1b4f6ebc1a639661789ed5d8 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/64/1264/1 diff --git a/.gitignore b/.gitignore index 89bf7df..21164ef 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ debian/*.log +gsn_restart -- To view, visit https://gerrit.osmocom.org/1264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib84c5382acdbbf0a1b4f6ebc1a639661789ed5d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 12:37:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 12:37:23 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplexor Message-ID: Review at https://gerrit.osmocom.org/1265 Add IPA multiplexor Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 266 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/1 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..f408acc --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,266 @@ +#!/usr/bin/python3 + +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexor: add/remove/parse (extended) header + """ + version = "0.0.1" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p != None: + return list(d.keys())[list(d.values()).index(p)] + return None + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext != None: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + else: + return struct.pack(">HB", len(data) + 1, proto) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + (dlen, proto) = struct.unpack(">HB", data[:3]) + if self.PROTO['OSMO'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + if self.PROTO['CCM'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + return dlen, proto, None, data[3:] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexor + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def del_header(self, data): + """ + Strip CTRL protocol header while correctly checking and removing extension + Returns data length and the data without header (or None if parsing failed) + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return dlen, None + return dlen, d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair where var could be None in case of error message + """ + (s, i, var, val) = data.split(' ', 3) + if 'ERROR' == s: + (_, _, var) = data.split(' ', 2) + return None, var + if 'TRAP' == s and i != '0': + return None, 'TRAP with non-zero id %s' % i + if op != None: + if 'SET_REPLY' == s and i != op: + return None, 'SET reply with unexpected id %s' % i + if 'GET_REPLY' == s and i != op: + return None, 'GET reply with unexpected id %s' % i + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("TRAP 0 %s %s" %(var, val)) + + def cmd(self, var, val = None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("SET %s %s %s" %(r, var, val)) + return r, self.add_header("GET %s %s" %(r, var)) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val != None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexor v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 12:37:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 12:37:23 +0000 Subject: [PATCH] openbsc[master]: Simplify bsc_control.py Message-ID: Review at https://gerrit.osmocom.org/1266 Simplify bsc_control.py Use functions from ipa module to simplify existing code and to facilitate testing of ipa module. Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 --- M openbsc/contrib/bsc_control.py 1 file changed, 18 insertions(+), 56 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/1266/1 diff --git a/openbsc/contrib/bsc_control.py b/openbsc/contrib/bsc_control.py index de0c2a9..a0d25b1 100755 --- a/openbsc/contrib/bsc_control.py +++ b/openbsc/contrib/bsc_control.py @@ -1,28 +1,18 @@ #!/usr/bin/python -import sys,os, random from optparse import OptionParser +from ipa import Ctrl import socket -import struct verbose = False -def prefix_ipa_ctrl_header(data): - return struct.pack(">HBB", len(data)+1, 0xee, 0) + data - -def ipa_ctrl_header(header): - (plen, ipa_proto, osmo_proto) = struct.unpack(">HBB", header) - return None if (ipa_proto != 0xee or osmo_proto != 0) else plen - def remove_ipa_ctrl_header(data): - if (len(data) < 4): - raise BaseException("Answer too short!") - plen = ipa_ctrl_header(data[:4]) - if (None == plen): + (plen, d) = Ctrl().del_header(data) + if None == d: raise BaseException("Wrong protocol in answer!") - if (plen + 3 > len(data)): + if plen + 3 > len(data): print "Warning: Wrong payload length (expected %i, got %i)" % (plen, len(data) - 3) - return data[4:plen+3], data[plen+3:] + return d[:plen + 3], d[plen + 3:] def connect(host, port): if verbose: @@ -33,43 +23,20 @@ sck.connect((host, port)) return sck -def send(sck, data): - if verbose: - print "Sending \"%s\"" %(data) - data = prefix_ipa_ctrl_header(data) - sck.send(data) - -def do_set(var, value, op_id, sck): - setmsg = "SET %s %s %s" %(op_id, var, value) - send(sck, setmsg) - -def do_get(var, op_id, sck): - getmsg = "GET %s %s" %(op_id, var) - send(sck, getmsg) - def do_set_get(sck, var, value = None): - r = random.randint(1, sys.maxint) - if (value != None): - s = 'SET_REPLY' - do_set(var, value, r, sck) - else: - s = 'GET_REPLY' - do_get(var, r, sck) - (answer, data) = remove_ipa_ctrl_header(sck.recv(4096)) - x = answer.split() - if (s == x[0] and str(r) == x[1] and var == x[2]): - return None if ('SET_REPLY' == s and value != x[3]) else x[3] - return None + (r, c) = Ctrl().cmd(var, value) + sck.send(c) + (_, answer) = Ctrl().del_header(sck.recv(4096)) + return (answer,) + Ctrl().verify(answer, r, var, value) def set_var(sck, var, val): - return do_set_get(sck, var, val) + do_set_get(sck, var, val) def get_var(sck, var): - return do_set_get(sck, var) + (_, _, v) = do_set_get(sck, var) + return v if __name__ == '__main__': - random.seed() - parser = OptionParser("Usage: %prog [options] var [value]") parser.add_option("-d", "--host", dest="host", help="connect to HOST", metavar="HOST") @@ -79,8 +46,6 @@ dest="cmd_get", help="perform GET operation") parser.add_option("-s", "--set", action="store_true", dest="cmd_set", help="perform SET operation") - parser.add_option("-i", "--id", dest="op_id", default=random.randint(1, sys.maxint), - help="set id manually", metavar="ID") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="be verbose", default=False) parser.add_option("-m", "--monitor", action="store_true", @@ -104,26 +69,23 @@ if options.cmd_set: if len(args) < 2: parser.error("Set requires var and value arguments") - do_set(args[0], ' '.join(args[1:]), options.op_id, sock) + (a, _, _) = do_set_get(sock, args[0], ' '.join(args[1:])) + print "Got message:", a if options.cmd_get: if len(args) != 1: parser.error("Get requires the var argument") - do_get(args[0], options.op_id, sock) - - data = sock.recv(1024) - while (len(data)>0): - (answer, data) = remove_ipa_ctrl_header(data) - print "Got message:", answer + (a, _, _) = do_set_get(sock, args[0]) + print "Got message:", a if options.monitor: - while (True): + while True: data = sock.recv(1024) if len(data) == 0: print "Connection is gone." break - while (len(data)>0): + while len(data) > 0: (answer, data) = remove_ipa_ctrl_header(data) print "Got message:", answer -- To view, visit https://gerrit.osmocom.org/1266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 12:37:23 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 12:37:23 +0000 Subject: [PATCH] openbsc[master]: Use IPA module for vty tests Message-ID: Review at https://gerrit.osmocom.org/1267 Use IPA module for vty tests Replace hackish ipa_send_* routines with proper implementation from IPA module thus making it part of extended tests. Change-Id: If13ed7fd243ce3aeef505d2e8468e221aa62f79e --- M openbsc/tests/vty_test_runner.py 1 file changed, 9 insertions(+), 31 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/67/1267/1 diff --git a/openbsc/tests/vty_test_runner.py b/openbsc/tests/vty_test_runner.py index a73dadd..b909623 100644 --- a/openbsc/tests/vty_test_runner.py +++ b/openbsc/tests/vty_test_runner.py @@ -15,13 +15,16 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -import os +import os, sys import time import unittest import socket import osmopy.obscvty as obscvty import osmopy.osmoutil as osmoutil + +sys.path.append("../contrib") +from ipa import IPA confpath = '.' @@ -912,13 +915,13 @@ self.assertEqual(data, "\x00\x01\xfe\x04") print "Going to send ID_RESP response" - res = ipa_send_resp(ussdSocket, "\x6b\x65\x79") + res = ussdSocket.send(IPA().id_resp(IPA().tag_name('key'))) self.assertEqual(res, 10) # initiating PING/PONG cycle to know, that the ID_RESP message has been processed print "Going to send PING request" - res = ipa_send_ping(ussdSocket) + res = ussdSocket.send(IPA().ping()) self.assertEqual(res, 4) print "Expecting PONG response" @@ -1185,31 +1188,6 @@ test = unittest.TestLoader().loadTestsFromTestCase(TestVTYNAT) suite.addTest(test) -def ipa_send_pong(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: PONG!" - return x.send("\x00\x01\xfe\x01") - -def ipa_send_ping(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: PING?" - return x.send("\x00\x01\xfe\x00") - -def ipa_send_ack(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: IPA ID ACK" - return x.send("\x00\x01\xfe\x06") - -def ipa_send_reset(x, verbose = False): - if (verbose): - print "\tBSC -> NAT: RESET" - return x.send("\x00\x12\xfd\x09\x00\x03\x05\x07\x02\x42\xfe\x02\x42\xfe\x06\x00\x04\x30\x04\x01\x20") - -def ipa_send_resp(x, tk, verbose = False): - if (verbose): - print "\tBSC -> NAT: IPA ID RESP" - return x.send("\x00\x07\xfe\x05\x00\x04\x01" + tk) - def nat_bsc_reload(x): x.vty.command("configure terminal") x.vty.command("nat") @@ -1265,11 +1243,11 @@ if "0001fe00" == s: if (verbose): print "\tBSC <- NAT: PING?" - ipa_send_pong(x, verbose) + x.send(IPA().pong()) elif "0001fe06" == s: if (verbose): print "\tBSC <- NAT: IPA ID ACK" - ipa_send_ack(x, verbose) + x.send(IPA().id_ack()) elif "0001fe00" == s: if (verbose): print "\tBSC <- NAT: PONG!" @@ -1280,7 +1258,7 @@ def ipa_handle_resp(x, tk, verbose = False): s = data2str(x.recv(38)) if "0023fe040108010701020103010401050101010011" in s: - ipa_send_resp(x, tk, verbose) + x.send(IPA().id_resp(IPA().identity(name = tk.encode('utf-8')))) else: if (verbose): print "\tBSC <- NAT: ", s -- To view, visit https://gerrit.osmocom.org/1267 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If13ed7fd243ce3aeef505d2e8468e221aa62f79e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 12:37:24 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 12:37:24 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex Message-ID: Review at https://gerrit.osmocom.org/1268 Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 171 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/1 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..1c6dcdd --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,171 @@ +#!/usr/bin/python3 + +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CTRL(self, data): + """ + For basic tests only - this should be replaced with proper handling routine: see CtrlServer for example + """ + if self.factory.debug: + print('ctrl received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + + def handle_OSMO(self, d, ex): + """ + Dispatcher point for OSMO subprotocols: OAP, GSUP etc handling should be added here + """ + if ex == IPA.EXT['CTRL']: + self.handle_CTRL(d) + + def handle_CCM(self, data, msgt): + """ + CCM (IPA Connection Management) - only basic logic necessary for tests is implemented + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.test_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + if pr == IPA.PROTO['CCM']: + self.handle_CCM(d, ex) + if pr == IPA.PROTO['OSMO']: + self.handle_OSMO(d, ex) + + def connectionMade(self): + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() # We have to resetDelay() here to drop internal state to default values to make reconnection logic work + + +class IPAServer(IPACommon): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from IPACommon + """ + def connectionMade(self): + print('IPA server connection made!') + super(IPAServer, self).connectionMade() # keep reconnection logic working + self.transport.write(IPA().id_get()) + + +class CtrlServer(IPACommon): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from IPACommon + """ + def connectionMade(self): + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() # keep reconnection logic working + self.transport.write(Ctrl().trap('LOL', 'what')) + + def handle_CTRL(self, data): + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + print('ctrl received %s (%s) %s' % (cmd, op, v)) + if 'SET' == cmd: + reply = 'SET_REPLY %s %s' % (op, v) + if 'GET' == cmd: + reply = 'ERROR %s No variable found' % op + self.transport.write(reply.encode('utf-8')) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + test_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False): + #ReconnectingClientFactory.__init__(self) # need this to be able to modify noisy attribute + if proto: + self.protocol = proto + if debug: + self.debug = debug + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + +if __name__ == '__main__': + print("Twisted IPA app with IPA v%s loaded." % IPA.version) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + #reactor.connectTCP('localhost', 4249, IPAFactory(debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + #reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(debug = True)) + reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 13:59:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 17 Nov 2016 13:59:52 +0000 Subject: openbsc[master]: gsm_subscriber_connection: mark BSC specific items In-Reply-To: References: Message-ID: Patch Set 6: As in my comment on patch set 4 above, the splitting patch does not yet exist. It's going to take a while still, because the VLR is currently further up the todo list. So this patch is merely recording the knowledge I gathered at some point on which items should go to which side. It's really not such an important patch anyway :) -- To view, visit https://gerrit.osmocom.org/1142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:10:52 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 17 Nov 2016 14:10:52 +0000 Subject: openbsc[master]: Correct Logging macro for pdpctx_timer_start In-Reply-To: References: Message-ID: Patch Set 1: > error: [Errno 32] Broken pipe FYI, this is a sporadic failure on our build server. The next step is to merely retrigger the build, which Max has done for you. Retrigger can be carried out by "anyone" with a login on jenkins.osmocom.org. -- To view, visit https://gerrit.osmocom.org/1260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:17:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 14:17:58 +0000 Subject: openbsc[master]: Correct Logging macro for pdpctx_timer_start In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:18:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 14:18:00 +0000 Subject: [MERGED] openbsc[master]: Correct Logging macro for pdpctx_timer_start In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Correct Logging macro for pdpctx_timer_start ...................................................................... Correct Logging macro for pdpctx_timer_start This commit corrects the Logging macro used in pdpctx_timer_start. Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 8de3bf7..b30b8d3 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1978,7 +1978,7 @@ unsigned int seconds) { if (osmo_timer_pending(&pdp->timer)) - LOGMMCTXP(LOGL_ERROR, pdp->mm, "Starting MM timer %u while old " + LOGPDPCTXP(LOGL_ERROR, pdp, "Starting PDP timer %u while old " "timer %u pending\n", T, pdp->T); pdp->T = T; pdp->num_T_exp = 0; -- To view, visit https://gerrit.osmocom.org/1260 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id4e3a7fb934ed82af8096fda9ddd3f4550e05844 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:18:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 17 Nov 2016 14:18:06 +0000 Subject: openbsc[master]: Add gsn-restart to top-level .gitignore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 so, you run the ggsn binary from within the openbsc source tree? :) AFAICT 'gsn_restart' is not related to openbsc.git, correct me if I'm wrong. -- To view, visit https://gerrit.osmocom.org/1264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib84c5382acdbbf0a1b4f6ebc1a639661789ed5d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:18:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 14:18:25 +0000 Subject: openbsc[master]: Add support for pdpctx_timer_stop In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:18:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 14:18:50 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:18:53 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 14:18:53 +0000 Subject: openbsc[master]: Trigger Deactivate PDP context Request from SGSN VTY In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1263 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ide0cd4af828b753d24d2e507967d1c2e652ee05e Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:28:20 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:28:20 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 7: Wow, you are wasting your time, your employers time, your customers time and mime. The Osmocom project is not about doing the least to get some code into the library. It didn't work for the tree based RLE decoding and it will not work here.. The future of the Osmocom project is still ahead of us and we build code like that. Comment to patchset 6 is not addressed... -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 7 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:29:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 17 Nov 2016 14:29:30 +0000 Subject: openbsc[master]: Simplify bsc_control.py In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) minor tweaks, changes generally look good otherwise. Would also be good not to mix so many changes in a single patch... You remove the random seed and a cmdline arg, which is not at all mentioned in the commit log. Using the ipa module is just one tiny fraction of this patch. https://gerrit.osmocom.org/#/c/1266/1/openbsc/contrib/bsc_control.py File openbsc/contrib/bsc_control.py: Line 11: if None == d: IMHO yoda conditionals are unusual in py, and the failure case you want to guard against is illegal anyway: if d = None: ^ SyntaxError: invalid syntax Line 73: print "Got message:", a mixed indenting styles ... we should probably drop all tabs in another commit. But better not add more tabs in this patch either. -- To view, visit https://gerrit.osmocom.org/1266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:32:15 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:32:15 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:32:21 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:32:21 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 1: -Code-Review -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:33:16 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:33:16 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 Enter a random IMSI.. and see it burn with a NULL pointer dereference... -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:35:54 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:35:54 +0000 Subject: openbsc[master]: Add support for pdpctx_timer_stop In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1261/1/openbsc/src/gprs/gprs_gmm.c File openbsc/src/gprs/gprs_gmm.c: Line 1997: "%u is running\n", T, pdp->T); So why is it a good idea to stop the timer anyway? -- To view, visit https://gerrit.osmocom.org/1261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:40:36 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:40:36 +0000 Subject: osmo-pcu[master]: Install the pcuif_proto.h header file In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:49:10 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:49:10 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (1 comment) Can you please describe the memory lifetime of this ad-hoc tbf? When will it be deleted? Can you test this in the testcase that there is no more tbf around? https://gerrit.osmocom.org/#/c/1216/4/src/tbf.cpp File src/tbf.cpp: Line 1289: new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); Oh. I didn't notice you call the ctor here. But we can make it public. Nothing prevents us from doing that. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 17 14:51:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Thu, 17 Nov 2016 14:51:37 +0000 Subject: osmo-pcu[master]: Fix: DL slot allocation based on direction configured In-Reply-To: References: Message-ID: Patch Set 8: I am reluctant to say +2 because we don't want something that looks good in a lab but in reality will be worse. My proposal is we move this topic to the mailinglist and you provide an analysis. Out of the top of my head I can think of: * Simulate allocation patterns with both algorithms until nothing can be allocated * graph that result somehow so we can compare the out of resource handling? -- To view, visit https://gerrit.osmocom.org/819 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4b4a99194ccae68bb3417bce538d16e944d5ec71 Gerrit-PatchSet: 8 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 16:32:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 16:32:39 +0000 Subject: [PATCH] openbsc[master]: bsc_control.py: use ipa.py module In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1266 to look at the new patch set (#2). bsc_control.py: use ipa.py module Simplify code by using Ctrl implementation from ipa.py Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 --- M openbsc/contrib/bsc_control.py 1 file changed, 18 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/1266/2 diff --git a/openbsc/contrib/bsc_control.py b/openbsc/contrib/bsc_control.py index ba86947..0987e65 100755 --- a/openbsc/contrib/bsc_control.py +++ b/openbsc/contrib/bsc_control.py @@ -1,29 +1,20 @@ #!/usr/bin/python # -*- mode: python-mode; py-indent-tabs-mode: nil -*- -import sys,os, random +import random from optparse import OptionParser +from ipa import Ctrl import socket -import struct verbose = False -def prefix_ipa_ctrl_header(data): - return struct.pack(">HBB", len(data)+1, 0xee, 0) + data - -def ipa_ctrl_header(header): - (plen, ipa_proto, osmo_proto) = struct.unpack(">HBB", header) - return None if (ipa_proto != 0xee or osmo_proto != 0) else plen - def remove_ipa_ctrl_header(data): - if (len(data) < 4): - raise BaseException("Answer too short!") - plen = ipa_ctrl_header(data[:4]) - if (None == plen): + (plen, d) = Ctrl().del_header(data) + if d is None: raise BaseException("Wrong protocol in answer!") - if (plen + 3 > len(data)): - print "Warning: Wrong payload length (expected %i, got %i)" % (plen, len(data) - 3) - return data[4:plen+3], data[plen+3:] + if plen + 3 > len(data): + print "Warning: Wrong payload length (expected %i, got %i)" % (plen, len(data) - 3) + return d[:plen + 3], d[plen + 3:] def connect(host, port): if verbose: @@ -34,39 +25,18 @@ sck.connect((host, port)) return sck -def send(sck, data): - if verbose: - print "Sending \"%s\"" %(data) - data = prefix_ipa_ctrl_header(data) - sck.send(data) - -def do_set(var, value, op_id, sck): - setmsg = "SET %s %s %s" %(op_id, var, value) - send(sck, setmsg) - -def do_get(var, op_id, sck): - getmsg = "GET %s %s" %(op_id, var) - send(sck, getmsg) - def do_set_get(sck, var, value = None): - r = random.randint(1, sys.maxint) - if (value != None): - s = 'SET_REPLY' - do_set(var, value, r, sck) - else: - s = 'GET_REPLY' - do_get(var, r, sck) - (answer, data) = remove_ipa_ctrl_header(sck.recv(4096)) - x = answer.split() - if (s == x[0] and str(r) == x[1] and var == x[2]): - return None if ('SET_REPLY' == s and value != x[3]) else x[3] - return None + (r, c) = Ctrl().cmd(var, value) + sck.send(c) + (_, answer) = Ctrl().del_header(sck.recv(4096)) + return (answer,) + Ctrl().verify(answer, r, var, value) def set_var(sck, var, val): - return do_set_get(sck, var, val) + do_set_get(sck, var, val) def get_var(sck, var): - return do_set_get(sck, var) + (_, _, v) = do_set_get(sck, var) + return v if __name__ == '__main__': random.seed() @@ -105,17 +75,14 @@ if options.cmd_set: if len(args) < 2: parser.error("Set requires var and value arguments") - do_set(args[0], ' '.join(args[1:]), options.op_id, sock) + (a, _, _) = do_set_get(sock, args[0], ' '.join(args[1:])) + print "Got message:", a if options.cmd_get: if len(args) != 1: parser.error("Get requires the var argument") - do_get(args[0], options.op_id, sock) - - data = sock.recv(1024) - while (len(data)>0): - (answer, data) = remove_ipa_ctrl_header(data) - print "Got message:", answer + (a, _, _) = do_set_get(sock, args[0]) + print "Got message:", a if options.monitor: while True: -- To view, visit https://gerrit.osmocom.org/1266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 17 16:32:40 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 16:32:40 +0000 Subject: [PATCH] openbsc[master]: bsc_control.py: style corrections Message-ID: Review at https://gerrit.osmocom.org/1269 bsc_control.py: style corrections * replace some tabs indent with spaces * add comment to make sure no new tabs are used for indentation by emacs * remove unnecessary parenthesis Change-Id: Ib79fd4317d40ee4fd87b090b9faf8ebaf4bfca64 --- M openbsc/contrib/bsc_control.py 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/69/1269/1 diff --git a/openbsc/contrib/bsc_control.py b/openbsc/contrib/bsc_control.py index de0c2a9..ba86947 100755 --- a/openbsc/contrib/bsc_control.py +++ b/openbsc/contrib/bsc_control.py @@ -1,4 +1,5 @@ #!/usr/bin/python +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- import sys,os, random from optparse import OptionParser @@ -25,13 +26,13 @@ return data[4:plen+3], data[plen+3:] def connect(host, port): - if verbose: - print "Connecting to host %s:%i" % (host, port) + if verbose: + print "Connecting to host %s:%i" % (host, port) - sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - sck.setblocking(1) - sck.connect((host, port)) - return sck + sck = socket.socket(socket.AF_INET, socket.SOCK_STREAM) + sck.setblocking(1) + sck.connect((host, port)) + return sck def send(sck, data): if verbose: @@ -91,24 +92,24 @@ verbose = options.verbose if options.cmd_set and options.cmd_get: - parser.error("Get and set options are mutually exclusive!") + parser.error("Get and set options are mutually exclusive!") if not (options.cmd_get or options.cmd_set or options.monitor): - parser.error("One of -m, -g, or -s must be set") + parser.error("One of -m, -g, or -s must be set") if not (options.host): - parser.error("Destination host and port required!") + parser.error("Destination host and port required!") sock = connect(options.host, options.port) if options.cmd_set: - if len(args) < 2: - parser.error("Set requires var and value arguments") + if len(args) < 2: + parser.error("Set requires var and value arguments") do_set(args[0], ' '.join(args[1:]), options.op_id, sock) if options.cmd_get: - if len(args) != 1: - parser.error("Get requires the var argument") + if len(args) != 1: + parser.error("Get requires the var argument") do_get(args[0], options.op_id, sock) data = sock.recv(1024) @@ -117,14 +118,14 @@ print "Got message:", answer if options.monitor: - while (True): - data = sock.recv(1024) - if len(data) == 0: - print "Connection is gone." - break + while True: + data = sock.recv(1024) + if len(data) == 0: + print "Connection is gone." + break - while (len(data)>0): - (answer, data) = remove_ipa_ctrl_header(data) - print "Got message:", answer + while len(data) > 0: + (answer, data) = remove_ipa_ctrl_header(data) + print "Got message:", answer sock.close() -- To view, visit https://gerrit.osmocom.org/1269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib79fd4317d40ee4fd87b090b9faf8ebaf4bfca64 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 16:32:40 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 16:32:40 +0000 Subject: [PATCH] openbsc[master]: bsc_control.py: remove unused -i option Message-ID: Review at https://gerrit.osmocom.org/1270 bsc_control.py: remove unused -i option Change-Id: I10cc7c069354cced2bba84fe67c69c28b8596ded --- M openbsc/contrib/bsc_control.py 1 file changed, 0 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/70/1270/1 diff --git a/openbsc/contrib/bsc_control.py b/openbsc/contrib/bsc_control.py index 0987e65..3c71248 100755 --- a/openbsc/contrib/bsc_control.py +++ b/openbsc/contrib/bsc_control.py @@ -1,7 +1,6 @@ #!/usr/bin/python # -*- mode: python-mode; py-indent-tabs-mode: nil -*- -import random from optparse import OptionParser from ipa import Ctrl import socket @@ -39,8 +38,6 @@ return v if __name__ == '__main__': - random.seed() - parser = OptionParser("Usage: %prog [options] var [value]") parser.add_option("-d", "--host", dest="host", help="connect to HOST", metavar="HOST") @@ -50,8 +47,6 @@ dest="cmd_get", help="perform GET operation") parser.add_option("-s", "--set", action="store_true", dest="cmd_set", help="perform SET operation") - parser.add_option("-i", "--id", dest="op_id", default=random.randint(1, sys.maxint), - help="set id manually", metavar="ID") parser.add_option("-v", "--verbose", action="store_true", dest="verbose", help="be verbose", default=False) parser.add_option("-m", "--monitor", action="store_true", -- To view, visit https://gerrit.osmocom.org/1270 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I10cc7c069354cced2bba84fe67c69c28b8596ded Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 17 16:33:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 16:33:43 +0000 Subject: openbsc[master]: Add gsn-restart to top-level .gitignore In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 you're right, damn! -- To view, visit https://gerrit.osmocom.org/1264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib84c5382acdbbf0a1b4f6ebc1a639661789ed5d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 17 16:33:50 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 16:33:50 +0000 Subject: [ABANDON] openbsc[master]: Add gsn-restart to top-level .gitignore In-Reply-To: References: Message-ID: Max has abandoned this change. Change subject: Add gsn-restart to top-level .gitignore ...................................................................... Abandoned -- To view, visit https://gerrit.osmocom.org/1264 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: abandon Gerrit-Change-Id: Ib84c5382acdbbf0a1b4f6ebc1a639661789ed5d8 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 17 18:00:10 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 18:00:10 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplexor In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#3). Add IPA multiplexor Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 268 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/3 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..61653b1 --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,268 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexor: add/remove/parse (extended) header + """ + version = "0.0.1" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p != None: + return list(d.keys())[list(d.values()).index(p)] + return 'UNKNOWN' + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext != None: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + else: + return struct.pack(">HB", len(data) + 1, proto) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + (dlen, proto) = struct.unpack(">HB", data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + return dlen, proto, None, data[3:] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexor + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def del_header(self, data): + """ + Strip CTRL protocol header while correctly checking and removing extension + Returns data length and the data without header (or None if parsing failed) + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return dlen, None + return dlen, d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if 'ERROR' == s: + return None, v + if 'GET' == s: + return v, None + (s, i, var, val) = data.split(' ', 3) + if 'TRAP' == s and i != '0': + return None, 'TRAP with non-zero id %s' % i + if op != None: + if 'SET_REPLY' == s and i != op: + return None, 'SET reply with unexpected id %s' % i + if 'GET_REPLY' == s and i != op: + return None, 'GET reply with unexpected id %s' % i + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("TRAP 0 %s %s" %(var, val)) + + def cmd(self, var, val = None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("SET %s %s %s" %(r, var, val)) + return r, self.add_header("GET %s %s" %(r, var)) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val != None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexor v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 17 18:00:10 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 17 Nov 2016 18:00:10 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#3). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 322 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/3 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..7fed1ce --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,322 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class IPAServer(IPACommon): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from IPACommon + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from IPACommon + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(IPACommon): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from IPACommon + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from IPACommon + Send TRAP upon connection + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA app with IPA v%s loaded." % IPA.version) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + #reactor.connectTCP('localhost', 4249, IPAFactory(debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Thu Nov 17 20:11:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 20:11:00 +0000 Subject: [PATCH] osmo-pcu[master]: pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for... Message-ID: Review at https://gerrit.osmocom.org/1273 pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for array iteration Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 --- M src/pcu_l1_if.cpp 1 file changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/73/1273/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index f1c73c9..e1ebbde 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -340,8 +340,8 @@ struct gprs_bssgp_pcu *pcu; struct gprs_rlcmac_pdch *pdch; struct in_addr ia; - int rc = 0, ts; - uint8_t trx; + int rc = 0; + unsigned int trx, ts; int i; if (info_ind->version != PCU_IF_VERSION) { @@ -357,9 +357,9 @@ LOGP(DL1IF, LOGL_NOTICE, "BTS not available\n"); bssgp_failed: /* free all TBF */ - for (trx = 0; trx < 8; trx++) { + for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) { bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; - for (ts = 0; ts < 8; ts++) + for (ts = 0; ts < ARRAY_SIZE(bts->trx[0].pdch); ts++) bts->trx[trx].pdch[ts].free_resources(); } gprs_bssgp_destroy(); @@ -451,7 +451,7 @@ bts->initial_cs_ul = bts->initial_cs_dl; } - for (trx = 0; trx < 8; trx++) { + for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) { bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; if ((info_ind->flags & PCU_IF_FLAG_SYSMO) && info_ind->trx[trx].hlayer1) { @@ -476,7 +476,7 @@ #endif } - for (ts = 0; ts < 8; ts++) { + for (ts = 0; ts < ARRAY_SIZE(bts->trx[0].pdch); ts++) { pdch = &bts->trx[trx].pdch[ts]; if ((info_ind->trx[trx].pdch_mask & (1 << ts))) { /* FIXME: activate dynamically at RLCMAC */ -- To view, visit https://gerrit.osmocom.org/1273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Nov 17 20:11:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 20:11:01 +0000 Subject: [PATCH] osmo-pcu[master]: Fix GSMTAP logging in case direct PHY access is enabled Message-ID: Review at https://gerrit.osmocom.org/1274 Fix GSMTAP logging in case direct PHY access is enabled In the existing code, GSMTAP messages were only generated in case no direct PHY access was being used (i.e. in the case all user traffic goes over the PCU socket). I'm not quite sure what the reason is for that would be and conclud this is not intentional. Let's first send the message to GSMTAP and then decide whether to send it via the direct PHY access or via the PCU socket into the BTS/BSC. Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/74/1274/1 diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index e1ebbde..fb17653 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -129,6 +129,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, @@ -137,7 +138,6 @@ return; } #endif - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); pcu_tx_data_req(trx, ts, PCU_IF_SAPI_PDTCH, arfcn, fn, block_nr, msg->data, msg->len); msgb_free(msg); @@ -148,6 +148,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, @@ -156,7 +157,6 @@ return; } #endif - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); pcu_tx_data_req(trx, ts, PCU_IF_SAPI_PTCCH, arfcn, fn, block_nr, msg->data, msg->len); msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Thu Nov 17 20:11:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 17 Nov 2016 20:11:01 +0000 Subject: [PATCH] osmo-pcu[master]: PCU: Send Immedate Assignment over AGCH, not PCH Message-ID: Review at https://gerrit.osmocom.org/1275 PCU: Send Immedate Assignment over AGCH, not PCH For some unknown reason, the bts class of the PCU appears to be transmitting its immediate assignments via the PCH, rather than the AGCH. I don't think this is intentional. Change-Id: I5bebc5a15efcd6c74b50f02585ffcc8f53cf2ee3 --- M src/bts.cpp 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/75/1275/1 diff --git a/src/bts.cpp b/src/bts.cpp index fe3368d..763fa2a 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -746,7 +746,7 @@ tbf->poll_fn, m_bts.alpha, m_bts.gamma, -1); if (plen >= 0) { immediate_assignment_dl_tbf(); - pcu_l1if_tx_pch(immediate_assignment, plen, imsi); + pcu_l1if_tx_agch(immediate_assignment, plen); } bitvec_free(immediate_assignment); -- To view, visit https://gerrit.osmocom.org/1275 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bebc5a15efcd6c74b50f02585ffcc8f53cf2ee3 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 18 10:15:25 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Nov 2016 10:15:25 +0000 Subject: osmo-pcu[master]: Fix GSMTAP logging in case direct PHY access is enabled In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 18 10:16:55 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Nov 2016 10:16:55 +0000 Subject: osmo-pcu[master]: pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 18 10:19:38 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 18 Nov 2016 10:19:38 +0000 Subject: osmo-bts[master]: cosmetic: tweak README In-Reply-To: References: Message-ID: Patch Set 1: (1 comment) https://gerrit.osmocom.org/#/c/1241/1/README File README: Line 26: * software-defined radio based osmo-bts-trx (e.g. BS210) You probably meant B210? -- To view, visit https://gerrit.osmocom.org/1241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 18 10:21:58 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 18 Nov 2016 10:21:58 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 4: -Code-Review -Verified (1 comment) >Can you please describe the memory lifetime of this ad-hoc tbf Earlier I had re-used macro #define Tassign_pacch 2,0. which defines the life time of TBF as 2 seconds. To reduce the life of TBF, In this patch I have introduced macro #define Treject_pacch 0,2000 which defines the life of TBF as 2000 micro seconds. The TBF shall be deleted on handle_timeout functionality already present in PCU. I have added new test case test_packet_access_rej_prr_no_other_tbfs, which will validate the TBF deletion( As seen from generated test file). https://gerrit.osmocom.org/#/c/1216/4/src/tbf.cpp File src/tbf.cpp: Line 1289: new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); > Oh. I didn't notice you call the ctor here. But we can make it public. Noth Ok. I will do necessary modification. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 4 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 18 10:30:27 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Fri, 18 Nov 2016 10:30:27 +0000 Subject: [PATCH] osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Hello Max, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1216 to look at the new patch set (#5). Handle packet access reject during packet resource request When Packet resource request is received, PCU will generate the packet access reject if no resources are present. The encoding is done based on section 7.1.3.2.1 and 8.1.2.5 of 44.060 version 7.27.0 Release 7. This patch also includes the test case to validate the generated packet access reject message. This patch is integration tested on Osmo-trx setup with Ettus B210 board and LG F70 MS with some simulation code changes in Osmo-pcu. Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 --- M src/bts.cpp M src/gprs_rlcmac_sched.cpp M src/tbf.cpp M src/tbf.h M src/tbf_ul.cpp M tests/tbf/TbfTest.cpp M tests/tbf/TbfTest.err M tests/tbf/TbfTest.ok 8 files changed, 397 insertions(+), 5 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/16/1216/5 diff --git a/src/bts.cpp b/src/bts.cpp index fe3368d..4a78dfc 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -1333,8 +1333,13 @@ egprs_ms_class); ul_tbf = tbf_alloc_ul(bts_data(), trx_no(), ms_class, egprs_ms_class, tlli, ta, ms); - if (!ul_tbf) + + /* if no resource send packet resource reject */ + if (!ul_tbf) { + handle_tbf_reject(bts_data(), ms, tlli, + trx_no(), ts_no); return; + } /* set control ts to current MS's TS, until assignment complete */ LOGP(DRLCMAC, LOGL_DEBUG, "Change control TS to %d until assinment is complete.\n", ts_no); diff --git a/src/gprs_rlcmac_sched.cpp b/src/gprs_rlcmac_sched.cpp index a3723df..a8b716d 100644 --- a/src/gprs_rlcmac_sched.cpp +++ b/src/gprs_rlcmac_sched.cpp @@ -56,7 +56,9 @@ *ul_ack_tbf = ul_tbf; if (ul_tbf->dl_ass_state == GPRS_RLCMAC_DL_ASS_SEND_ASS) *dl_ass_tbf = ul_tbf; - if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS) + if (ul_tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS + || ul_tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) *ul_ass_tbf = ul_tbf; #warning "Is this supposed to be fair? The last TBF for each wins? Maybe use llist_add_tail and skip once we have all states?" } @@ -136,8 +138,11 @@ * because they may kill the TBF when the CONTROL ACK is * received, thus preventing the others from being processed. */ - - if (tbf == ul_ass_tbf && tbf->direction == GPRS_RLCMAC_DL_TBF) + if (tbf == ul_ass_tbf && tbf->ul_ass_state == + GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) + msg = ul_ass_tbf->create_packet_access_reject(); + else if (tbf == ul_ass_tbf && tbf->direction == + GPRS_RLCMAC_DL_TBF) if (tbf->ul_ass_state == GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ) msg = ul_ass_tbf->create_packet_access_reject(); diff --git a/src/tbf.cpp b/src/tbf.cpp index 072d0af..d16f08b 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -659,7 +659,7 @@ memset(&m_usf, 0, sizeof(m_usf)); } -static int ul_tbf_dtor(struct gprs_rlcmac_ul_tbf *tbf) +int ul_tbf_dtor(struct gprs_rlcmac_ul_tbf *tbf) { tbf->~gprs_rlcmac_ul_tbf(); return 0; @@ -1042,6 +1042,10 @@ bitvec_free(packet_access_rej); ul_ass_state = GPRS_RLCMAC_UL_ASS_NONE; + /* Start Tmr only if it is UL TBF */ + if (direction == GPRS_RLCMAC_UL_TBF) + tbf_timer_start(this, 0, Treject_pacch); + return msg; } diff --git a/src/tbf.h b/src/tbf.h index 1e98a24..b6ef0bc 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -40,6 +40,7 @@ #define Tassign_agch 0,200000 /* waiting after IMM.ASS confirm */ #define Tassign_pacch 2,0 /* timeout for pacch assigment */ +#define Treject_pacch 0,2000 /* timeout for tbf reject for PRR*/ enum gprs_rlcmac_tbf_state { GPRS_RLCMAC_NULL = 0, /* new created TBF */ @@ -265,11 +266,16 @@ void tbf_free(struct gprs_rlcmac_tbf *tbf); +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, + GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts_no); + int tbf_assign_control_ts(struct gprs_rlcmac_tbf *tbf); void tbf_timer_start(struct gprs_rlcmac_tbf *tbf, unsigned int T, unsigned int seconds, unsigned int microseconds); +int ul_tbf_dtor(struct gprs_rlcmac_ul_tbf *tbf); + inline bool gprs_rlcmac_tbf::state_is(enum gprs_rlcmac_tbf_state rhs) const { return state == rhs; diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp index 420fc1a..6b5c006 100644 --- a/src/tbf_ul.cpp +++ b/src/tbf_ul.cpp @@ -570,3 +570,34 @@ } } } + +struct gprs_rlcmac_ul_tbf *handle_tbf_reject(struct gprs_rlcmac_bts *bts, + GprsMs *ms, uint32_t tlli, uint8_t trx_no, uint8_t ts) +{ + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + struct gprs_rlcmac_trx *trx = &bts->trx[trx_no]; + + ul_tbf = talloc(tall_pcu_ctx, struct gprs_rlcmac_ul_tbf); + if (!ul_tbf) + return ul_tbf; + + talloc_set_destructor(ul_tbf, ul_tbf_dtor); + new (ul_tbf) gprs_rlcmac_ul_tbf(bts->bts); + if (!ms) + ms = bts->bts->ms_alloc(0, 0); + + ms->set_tlli(tlli); + + llist_add(&ul_tbf->list(), &bts->bts->ul_tbfs()); + ul_tbf->bts->tbf_ul_created(); + ul_tbf->set_state(GPRS_RLCMAC_ASSIGN); + ul_tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_PACCH); + + ul_tbf->set_ms(ms); + ul_tbf->update_ms(tlli, GPRS_RLCMAC_UL_TBF); + ul_tbf->ul_ass_state = GPRS_RLCMAC_UL_ASS_SEND_ASS_REJ; + ul_tbf->control_ts = ts; + ul_tbf->trx = trx; + + return ul_tbf; +} diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp index 213bd12..fb58bdc 100644 --- a/tests/tbf/TbfTest.cpp +++ b/tests/tbf/TbfTest.cpp @@ -2831,6 +2831,114 @@ ARRAY_SIZE(default_categories), }; +static void test_packet_access_rej_prr_no_other_tbfs() +{ + BTS the_bts; + uint32_t fn = 2654218; + int ts_no = 7; + uint8_t trx_no = 0; + uint32_t tlli = 0xffeeddcc; + struct gprs_rlcmac_ul_tbf *ul_tbf = NULL; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + int rc = 0; + + ul_tbf = handle_tbf_reject(the_bts.bts_data(), NULL, tlli, + trx_no, ts_no); + + OSMO_ASSERT(ul_tbf != 0); + + /* trigger packet access reject */ + uint8_t bn = fn2bn(fn); + + rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), + trx_no, ts_no, fn, bn); + + OSMO_ASSERT(rc == 0); + + ul_tbf->handle_timeout(); + + printf("=== end %s ===\n", __func__); +} + +static void test_packet_access_rej_prr() +{ + BTS the_bts; + uint32_t fn = 2654218; + uint16_t qta = 31; + int ts_no = 7; + uint8_t trx_no = 0; + RlcMacUplink_t ulreq = {0}; + Packet_Resource_Request_t *presreq = NULL; + uint8_t ms_class = 11; + uint8_t egprs_ms_class = 11; + uint32_t rach_fn = fn - 51; + uint32_t sba_fn = fn + 52; + uint32_t tlli = 0xffeeddcc; + MS_Radio_Access_capability_t *pmsradiocap = NULL; + Multislot_capability_t *pmultislotcap = NULL; + + printf("=== start %s ===\n", __func__); + + setup_bts(&the_bts, ts_no, 4); + + int rc = 0; + + /* + * Trigger rach till resources(USF) exhaust + */ + rc = the_bts.rcv_rach(0x78, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x79, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7a, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7b, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7c, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7d, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + rc = the_bts.rcv_rach(0x7e, rach_fn, qta, 0, + GSM_L1_BURST_TYPE_ACCESS_0); + + /* fake a resource request */ + ulreq.u.MESSAGE_TYPE = MT_PACKET_RESOURCE_REQUEST; + presreq = &ulreq.u.Packet_Resource_Request; + presreq->PayloadType = GPRS_RLCMAC_CONTROL_BLOCK; + presreq->ID.UnionType = 1; /* != 0 */ + presreq->ID.u.TLLI = tlli; + presreq->Exist_MS_Radio_Access_capability = 1; + pmsradiocap = &presreq->MS_Radio_Access_capability; + pmsradiocap->Count_MS_RA_capability_value = 1; + pmsradiocap->MS_RA_capability_value[0].u.Content. + Exist_Multislot_capability = 1; + pmultislotcap = &pmsradiocap->MS_RA_capability_value[0]. + u.Content.Multislot_capability; + + pmultislotcap->Exist_GPRS_multislot_class = 1; + pmultislotcap->GPRS_multislot_class = ms_class; + if (egprs_ms_class) { + pmultislotcap->Exist_EGPRS_multislot_class = 1; + pmultislotcap->EGPRS_multislot_class = egprs_ms_class; + } + + send_ul_mac_block(&the_bts, trx_no, ts_no, &ulreq, sba_fn); + + /* trigger packet access reject */ + uint8_t bn = fn2bn(fn); + + rc = gprs_rlcmac_rcv_rts_block(the_bts.bts_data(), + trx_no, ts_no, fn, bn); + + OSMO_ASSERT(rc == 0); + + printf("=== end %s ===\n", __func__); +} + void test_packet_access_rej_epdan() { BTS the_bts; @@ -2898,6 +3006,8 @@ test_tbf_epdan_out_of_rx_window(); test_immediate_assign_rej(); test_packet_access_rej_epdan(); + test_packet_access_rej_prr(); + test_packet_access_rej_prr_no_other_tbfs(); if (getenv("TALLOC_REPORT_FULL")) talloc_report_full(tall_pcu_ctx, stderr); diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index a680812..53d2bf6 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6870,3 +6870,230 @@ TBF(TFI=0 TLLI=0x00000000 DIR=DL STATE=NULL) changes state from NULL to FLOW The MS object cannot fully confirm an unexpected TLLI: 0xffeeddcc, partly confirmed TBF(TFI=0 TLLI=0xffeeddcc DIR=DL STATE=FLOW) append +MS requests UL TBF on RACH, so we provide one +ra=0x78 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=0 USF=0 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL), 1 TBFs, USFs = 01, TFIs = 00000001. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x78, Fn=2654167 (17,25,9) +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=0 USF=0 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 78 8b 29 07 00 c8 00 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x79 Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=1 USF=1 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL), 2 TBFs, USFs = 03, TFIs = 00000003. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x79, Fn=2654167 (17,25,9) +TBF(TFI=1 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=1 USF=1 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 79 8b 29 07 00 c8 42 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7a Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=2 USF=2 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL), 3 TBFs, USFs = 07, TFIs = 00000007. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7a, Fn=2654167 (17,25,9) +TBF(TFI=2 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=2 USF=2 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7a 8b 29 07 00 c8 84 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7b Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=3 USF=3 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL), 4 TBFs, USFs = 0f, TFIs = 0000000f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7b, Fn=2654167 (17,25,9) +TBF(TFI=3 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=3 USF=3 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7b 8b 29 07 00 c8 c6 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7c Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=4 USF=4 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL), 5 TBFs, USFs = 1f, TFIs = 0000001f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7c, Fn=2654167 (17,25,9) +TBF(TFI=4 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=4 USF=4 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7c 8b 29 07 00 c9 08 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7d Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=5 USF=5 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL), 6 TBFs, USFs = 3f, TFIs = 0000003f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7d, Fn=2654167 (17,25,9) +TBF(TFI=5 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=5 USF=5 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7d 8b 29 07 00 c9 4a 70 0b 2b 2b 2b 2b 2b 2b 2b +MS requests UL TBF on RACH, so we provide one +ra=0x7e Fn=2654167 qta=31 is_11bit=0: +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=0/0 +Creating MS object, TLLI = 0x00000000 +Slot Allocation (Algorithm A) for class 0 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Assign uplink TS=7 TFI=6 USF=6 +PDCH(TS 7, TRX 0): Attaching TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL), 7 TBFs, USFs = 7f, TFIs = 0000007f. +- Setting Control TS 7 +Attaching TBF to MS object, TLLI = 0x00000000, TBF = TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) +Allocated TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL): trx = 0, ul_slots = 80, dl_slots = 00 +Modifying MS object, TLLI = 0x00000000, TA 220 -> 7 +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to FLOW +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) starting timer 3169. +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) [UPLINK] START +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) RX: [PCU <- BTS] RACH qbit-ta=31 ra=0x7e, Fn=2654167 (17,25,9) +TBF(TFI=6 TLLI=0x00000000 DIR=UL STATE=FLOW) TX: START Immediate Assignment Uplink (AGCH) + - TRX=0 (0) TS=7 TA=7 TSC=0 TFI=6 USF=6 +Sending data request: trx=0 ts=0 sapi=2 arfcn=0 fn=0 block=0 data=2d 06 3f 10 0f 00 00 7e 8b 29 07 00 c9 8c 70 0b 2b 2b 2b 2b 2b 2b 2b +Got RLC block, coding scheme: CS-1, length: 23 (23)) ++++++++++++++++++++++++++ RX : Uplink Control Block +++++++++++++++++++++++++ +------------------------- RX : Uplink Control Block ------------------------- +MS requests UL TBF in packet resource request of single block, so we provide one: +MS requests UL TBF in packet resource request of single block, but there is no resource request scheduled! +MS supports EGPRS multislot class 11. +********** TBF starts here ********** +Allocating UL TBF: MS_CLASS=11/11 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, TLLI = 0x00000000, MS class 0 -> 11 +Modifying MS object, TLLI = 0x00000000, EGPRS MS class 0 -> 11 +Slot Allocation (Algorithm A) for class 11 +- Skipping TS 0, because not enabled +- Skipping TS 1, because not enabled +- Skipping TS 2, because not enabled +- Skipping TS 3, because not enabled +- Skipping TS 4, because not enabled +- Skipping TS 5, because not enabled +- Skipping TS 6, because not enabled +- Skipping TS 7, because no USF available +- Failed to allocate a TS, no USF available +No PDCH resource +Creating MS object, TLLI = 0x00000000 +Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN +Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +Received RTS for PDCH: TRX=0 TS=7 FN=2654218 block_nr=8 scheduling USF=0 for required uplink resource of UL TFI=0 +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer 0. +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +Destroying MS object, TLLI = 0x00000000 +Creating MS object, TLLI = 0x00000000 +Modifying MS object, UL TLLI: 0x00000000 -> 0xffeeddcc, not yet confirmed +TBF(TFI=0 TLLI=0x00000000 DIR=UL STATE=NULL) changes state from NULL to ASSIGN +Attaching TBF to MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) starting timer 0. +Scheduling control message at RTS for TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) (TRX=0, TS=7) +Sending data request: trx=0 ts=7 sapi=5 arfcn=0 fn=2654218 block=8 data=47 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) timer 0 expired. +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) releasing due to PACCH assignment timeout. +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) free +TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) stopping timer 0. +Detaching TBF from MS object, TLLI = 0xffeeddcc, TBF = TBF(TFI=0 TLLI=0xffeeddcc DIR=UL STATE=ASSIGN) +Destroying MS object, TLLI = 0xffeeddcc +********** TBF ends here ********** diff --git a/tests/tbf/TbfTest.ok b/tests/tbf/TbfTest.ok index dc07fc7..aa3194c 100644 --- a/tests/tbf/TbfTest.ok +++ b/tests/tbf/TbfTest.ok @@ -75,3 +75,7 @@ === start test_packet_access_rej_epdan === packet reject: 40 84 7f f7 6e e6 41 4b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b 2b === end test_packet_access_rej_epdan === +=== start test_packet_access_rej_prr === +=== end test_packet_access_rej_prr === +=== start test_packet_access_rej_prr_no_other_tbfs === +=== end test_packet_access_rej_prr_no_other_tbfs === -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Fri Nov 18 19:04:31 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 18 Nov 2016 19:04:31 +0000 Subject: openbsc[master]: ussd: Add band-aid for interrogationSS In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 18 19:04:37 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Fri, 18 Nov 2016 19:04:37 +0000 Subject: [MERGED] openbsc[master]: ussd: Add band-aid for interrogationSS In-Reply-To: References: Message-ID: Holger Freyther has submitted this change and it was merged. Change subject: ussd: Add band-aid for interrogationSS ...................................................................... ussd: Add band-aid for interrogationSS This is a speculative change for interrogateSS and by not answering the request the radio connection would remain open long. The SS/USSD code is from a time where none of knew much about GSM. We do not support SS but should reject it. We have checked for an empty string in the text field to guess if it is a result/release to not send more information. The right way forward is to decode the ASN1 into the fields REQUEST/RESULT(last). Fix an issue and make the code worse. Assume ss_code > 0 to see if this is a interrogate invoke. The issue is that code 0 is a well defined value but unlikely to be used. MAP ASN1 definition: SS-Code ::= OCTET STRING (SIZE (1)) -- This type is used to represent the code identifying a single -- supplementary service, a group of supplementary services, or -- all supplementary services. The services and abbreviations -- used are defined in TS 3GPP TS 22.004 [5]. The internal structure is -- defined as follows: -- -- bits 87654321: group (bits 8765), and specific service -- (bits 4321) allSS SS-Code ::= '00000000'B Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 --- M openbsc/include/openbsc/gsm_04_80.h M openbsc/src/libmsc/gsm_04_80.c M openbsc/src/libmsc/ussd.c 3 files changed, 20 insertions(+), 12 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, but someone else must approve Harald Welte: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index 0a60652..74701ac 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -9,10 +9,10 @@ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char* response_text, - const struct ussd_request *req); + const struct ss_request *req); int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *msg, - const struct ussd_request *request); + const struct ss_request *request); int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text); int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn); diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c index f1d75f2..1744455 100644 --- a/openbsc/src/libmsc/gsm_04_80.c +++ b/openbsc/src/libmsc/gsm_04_80.c @@ -63,7 +63,7 @@ /* Send response to a mobile-originated ProcessUnstructuredSS-Request */ int gsm0480_send_ussd_response(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, const char *response_text, - const struct ussd_request *req) + const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD RSP"); struct gsm48_hdr *gh; @@ -111,7 +111,7 @@ int gsm0480_send_ussd_reject(struct gsm_subscriber_connection *conn, const struct msgb *in_msg, - const struct ussd_request *req) + const struct ss_request *req) { struct msgb *msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REJ"); struct gsm48_hdr *gh; diff --git a/openbsc/src/libmsc/ussd.c b/openbsc/src/libmsc/ussd.c index 7f01eae..f12c1f2 100644 --- a/openbsc/src/libmsc/ussd.c +++ b/openbsc/src/libmsc/ussd.c @@ -38,19 +38,19 @@ const char USSD_TEXT_OWN_NUMBER[] = "*#100#"; /* Forward declarations of network-specific handler functions */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ussd_request *req); +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req); /* Entrypoint - handler function common to all mobile-originated USSDs */ int handle_rcv_ussd(struct gsm_subscriber_connection *conn, struct msgb *msg) { int rc; - struct ussd_request req; + struct ss_request req; struct gsm48_hdr *gh; memset(&req, 0, sizeof(req)); gh = msgb_l3(msg); - rc = gsm0480_decode_ussd_request(gh, msgb_l3len(msg), &req); + rc = gsm0480_decode_ss_request(gh, msgb_l3len(msg), &req); if (!rc) { DEBUGP(DMM, "Unhandled SS\n"); rc = gsm0480_send_ussd_reject(conn, msg, &req); @@ -58,15 +58,23 @@ return rc; } - /* Release-Complete */ - if (req.text[0] == '\0') + /* Interrogation or releaseComplete? */ + if (req.ussd_text[0] == '\0' || req.ussd_text[0] == 0xFF) { + if (req.ss_code > 0) { + /* Assume interrogateSS or modification of it and reject */ + rc = gsm0480_send_ussd_reject(conn, msg, &req); + msc_release_connection(conn); + return rc; + } + /* Still assuming a Release-Complete and returning */ return 0; + } - if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.text)) { + if (!strcmp(USSD_TEXT_OWN_NUMBER, (const char *)req.ussd_text)) { DEBUGP(DMM, "USSD: Own number requested\n"); rc = send_own_number(conn, msg, &req); } else { - DEBUGP(DMM, "Unhandled USSD %s\n", req.text); + DEBUGP(DMM, "Unhandled USSD %s\n", req.ussd_text); rc = gsm0480_send_ussd_reject(conn, msg, &req); } @@ -76,7 +84,7 @@ } /* A network-specific handler function */ -static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ussd_request *req) +static int send_own_number(struct gsm_subscriber_connection *conn, const struct msgb *msg, const struct ss_request *req) { char *own_number = conn->subscr->extension; char response_string[GSM_EXTENSION_LENGTH + 20]; -- To view, visit https://gerrit.osmocom.org/503 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib0dc4485388f030eb172fe21f5327b7ab94751f5 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Holger Freyther Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 22 11:35:02 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Tue, 22 Nov 2016 11:35:02 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#8). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c M tests/bitvec/bitvec_test.ok 4 files changed, 86 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/8 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..c895cff 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/*! \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex + temp_res); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index a98a91c..6b732b9 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -150,6 +150,15 @@ } } +static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits, + int result ) +{ + int num = 0; + OSMO_ASSERT (bv->cur_bit < max_bits); + num = bitvec_rl_curbit(bv, b, max_bits); + OSMO_ASSERT (num == result); +} + static void test_array() { struct bitvec b; @@ -245,7 +254,35 @@ test_array(); - printf("\nbitvec ok.\n"); + printf("\nbitvec_runlength....\n"); + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xff, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 6); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 0, 52, 52); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 2; + test_bitvec_rl_curbit(&bv, 0, 64, 58); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0x07, 8); + bitvec_set_uint(&bv, 0xf8, 8); + bv.cur_bit -= 11; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 1, 64, 0); + + printf("\nbitvec ok.\n"); return 0; } diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index e256108..6281973 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -166,4 +166,6 @@ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ +bitvec_runlength.... + bitvec ok. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Tue Nov 22 11:38:06 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 22 Nov 2016 11:38:06 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 8: Post condition is not checked... What is curbit after the routine? Code/doc says curbit increases and it is the third time I ask for a more strong post condition in your test... -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 8 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 22 12:23:52 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Tue, 22 Nov 2016 12:23:52 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#9). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c M tests/bitvec/bitvec_test.ok 4 files changed, 88 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/9 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..c895cff 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/*! \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex + temp_res); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index a98a91c..d06a26f 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -150,6 +150,17 @@ } } +static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits, + int result ) +{ + int num = 0; + int readIndex = bv->cur_bit; + OSMO_ASSERT (bv->cur_bit < max_bits); + num = bitvec_rl_curbit(bv, b, max_bits); + readIndex += num; + OSMO_ASSERT (bv->cur_bit == readIndex); +} + static void test_array() { struct bitvec b; @@ -245,7 +256,35 @@ test_array(); - printf("\nbitvec ok.\n"); + printf("\nbitvec_runlength....\n"); + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xff, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 6); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 0, 52, 52); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 2; + test_bitvec_rl_curbit(&bv, 0, 64, 58); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0x07, 8); + bitvec_set_uint(&bv, 0xf8, 8); + bv.cur_bit -= 11; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 1, 64, 0); + + printf("\nbitvec ok.\n"); return 0; } diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index e256108..6281973 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -166,4 +166,6 @@ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ +bitvec_runlength.... + bitvec ok. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Tue Nov 22 13:15:30 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 22 Nov 2016 13:15:30 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 9: ... and now "result" is an unused variable? I just can't spend more time in reviewing than it would take me to write it correctly... -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 22 13:17:13 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 22 Nov 2016 13:17:13 +0000 Subject: osmo-pcu[master]: pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 22 13:17:41 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Tue, 22 Nov 2016 13:17:41 +0000 Subject: osmo-pcu[master]: Fix GSMTAP logging in case direct PHY access is enabled In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 22 16:58:38 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Tue, 22 Nov 2016 16:58:38 +0000 Subject: [PATCH] libosmocore[master]: utils/conv_gen.py: separate code definitions In-Reply-To: References: Message-ID: Hello tnt, Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1223 to look at the new patch set (#2). utils/conv_gen.py: separate code definitions This change separates the convolutional code definitions from the code generator logic, allowing us to make further changes in more specific way. For example, adding some new codes, you change the conv_codes.py only because such change isn't related to the generator. Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa --- A utils/conv_codes_gsm.py M utils/conv_gen.py 2 files changed, 728 insertions(+), 714 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/23/1223/2 diff --git a/utils/conv_codes_gsm.py b/utils/conv_codes_gsm.py new file mode 100644 index 0000000..1bee6db --- /dev/null +++ b/utils/conv_codes_gsm.py @@ -0,0 +1,706 @@ +#!/usr/bin/python2 + +from conv_gen import ConvolutionalCode +from conv_gen import poly + +# Polynomials according to 3GPP TS 05.03 Annex B +G0 = poly(0, 3, 4) +G1 = poly(0, 1, 3, 4) +G2 = poly(0, 2, 4) +G3 = poly(0, 1, 2, 3, 4) +G4 = poly(0, 2, 3, 5, 6) +G5 = poly(0, 1, 4, 6) +G6 = poly(0, 1, 2, 3, 4, 6) +G7 = poly(0, 1, 2, 3, 6) + +# Shared polynomials +shared_polys = { + "xcch" : [ + ( G0, 1 ), + ( G1, 1 ), + ], + "mcs" : [ + ( G4, 1 ), + ( G7, 1 ), + ( G5, 1 ), + ], +} + +# Convolutional code definitions +conv_codes = [ + # xCCH definition + ConvolutionalCode( + 224, + shared_polys["xcch"], + name = "xcch", + description = [ + "xCCH convolutional code:", + "228 bits blocks, rate 1/2, k = 5", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # RACH definition + ConvolutionalCode( + 14, + shared_polys["xcch"], + name = "rach", + description = ["RACH convolutional code"] + ), + + # SCH definition + ConvolutionalCode( + 35, + shared_polys["xcch"], + name = "sch", + description = ["SCH convolutional code"] + ), + + # CS2 definition + ConvolutionalCode( + 290, + shared_polys["xcch"], + puncture = [ + 15, 19, 23, 27, 31, 35, 43, 47, 51, 55, 59, 63, 67, 71, + 75, 79, 83, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, + 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 187, 191, 195, + 199, 203, 207, 211, 215, 219, 223, 227, 235, 239, 243, 247, 251, 255, + 259, 263, 267, 271, 275, 283, 287, 291, 295, 299, 303, 307, 311, 315, + 319, 323, 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 371, 379, + 383, 387, 391, 395, 399, 403, 407, 411, 415, 419, 427, 431, 435, 439, + 443, 447, 451, 455, 459, 463, 467, 475, 479, 483, 487, 491, 495, 499, + 503, 507, 511, 515, 523, 527, 531, 535, 539, 543, 547, 551, 555, 559, + 563, 571, 575, 579, 583, 587, -1 + ], + name = "cs2", + description = [ + "CS2 convolutional code:", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # CS3 definition + ConvolutionalCode( + 334, + shared_polys["xcch"], + puncture = [ + 15, 17, 21, 23, 27, 29, 33, 35, 39, 41, 45, 47, 51, 53, + 57, 59, 63, 65, 69, 71, 75, 77, 81, 83, 87, 89, 93, 95, + 99, 101, 105, 107, 111, 113, 117, 119, 123, 125, 129, 131, 135, 137, + 141, 143, 147, 149, 153, 155, 159, 161, 165, 167, 171, 173, 177, 179, + 183, 185, 189, 191, 195, 197, 201, 203, 207, 209, 213, 215, 219, 221, + 225, 227, 231, 233, 237, 239, 243, 245, 249, 251, 255, 257, 261, 263, + 267, 269, 273, 275, 279, 281, 285, 287, 291, 293, 297, 299, 303, 305, + 309, 311, 315, 317, 321, 323, 327, 329, 333, 335, 339, 341, 345, 347, + 351, 353, 357, 359, 363, 365, 369, 371, 375, 377, 381, 383, 387, 389, + 393, 395, 399, 401, 405, 407, 411, 413, 417, 419, 423, 425, 429, 431, + 435, 437, 441, 443, 447, 449, 453, 455, 459, 461, 465, 467, 471, 473, + 477, 479, 483, 485, 489, 491, 495, 497, 501, 503, 507, 509, 513, 515, + 519, 521, 525, 527, 531, 533, 537, 539, 543, 545, 549, 551, 555, 557, + 561, 563, 567, 569, 573, 575, 579, 581, 585, 587, 591, 593, 597, 599, + 603, 605, 609, 611, 615, 617, 621, 623, 627, 629, 633, 635, 639, 641, + 645, 647, 651, 653, 657, 659, 663, 665, 669, 671, -1 + ], + name = "cs3", + description = [ + "CS3 convolutional code:", + "G0 = 1 + D3 + D4", + "G1 = 1 + D + D3 + D4", + ] + ), + + # TCH_AFS_12_2 definition + ConvolutionalCode( + 250, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 363, + 365, 369, 373, 377, 379, 381, 385, 389, 393, 395, 397, 401, + 405, 409, 411, 413, 417, 421, 425, 427, 429, 433, 437, 441, + 443, 445, 449, 453, 457, 459, 461, 465, 469, 473, 475, 477, + 481, 485, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, + -1 + ], + name = 'tch_afs_12_2', + description = [ + "TCH/AFS 12.2 kbits convolutional code:", + "250 bits block, rate 1/2, punctured", + "G0/G0 = 1", + "G1/G0 = 1 + D + D3 + D4 / 1 + D3 + D4", + ] + ), + + # TCH_AFS_10_2 definition + ConvolutionalCode( + 210, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 1, 4, 7, 10, 16, 19, 22, 28, 31, 34, 40, 43, + 46, 52, 55, 58, 64, 67, 70, 76, 79, 82, 88, 91, + 94, 100, 103, 106, 112, 115, 118, 124, 127, 130, 136, 139, + 142, 148, 151, 154, 160, 163, 166, 172, 175, 178, 184, 187, + 190, 196, 199, 202, 208, 211, 214, 220, 223, 226, 232, 235, + 238, 244, 247, 250, 256, 259, 262, 268, 271, 274, 280, 283, + 286, 292, 295, 298, 304, 307, 310, 316, 319, 322, 325, 328, + 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, + 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, 400, + 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, + 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, + 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, 505, 508, + 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, + 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, + 583, 586, 589, 592, 595, 598, 601, 604, 607, 609, 610, 613, + 616, 619, 621, 622, 625, 627, 628, 631, 633, 634, 636, 637, + 639, 640, -1 + ], + name = 'tch_afs_10_2', + description = [ + "TCH/AFS 10.2 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_7_95 definition + ConvolutionalCode( + 165, + [ + ( 1, 1 ), + ( G5, G4 ), + ( G6, G4 ), + ], + puncture = [ + 1, 2, 4, 5, 8, 22, 70, 118, 166, 214, 262, 310, + 317, 319, 325, 332, 334, 341, 343, 349, 356, 358, 365, 367, + 373, 380, 382, 385, 389, 391, 397, 404, 406, 409, 413, 415, + 421, 428, 430, 433, 437, 439, 445, 452, 454, 457, 461, 463, + 469, 476, 478, 481, 485, 487, 490, 493, 500, 502, 503, 505, + 506, 508, 509, 511, 512, -1 + ], + name = 'tch_afs_7_95', + description = [ + "TCH/AFS 7.95 kbits convolutional code:", + "G4/G4 = 1", + "G5/G4 = 1 + D + D4 + D6 / 1 + D2 + D3 + D5 + D6", + "G6/G4 = 1 + D + D2 + D3 + D4 + D6 / 1 + D2 + D3 + D5 + D6", + ] + ), + + # TCH_AFS_7_4 definition + ConvolutionalCode( + 154, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 0, 355, 361, 367, 373, 379, 385, 391, 397, 403, 409, 415, + 421, 427, 433, 439, 445, 451, 457, 460, 463, 466, 468, 469, + 471, 472, -1 + ], + name = 'tch_afs_7_4', + description = [ + "TCH/AFS 7.4 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_6_7 definition + ConvolutionalCode( + 140, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 1, 3, 7, 11, 15, 27, 39, 55, 67, 79, 95, 107, + 119, 135, 147, 159, 175, 187, 199, 215, 227, 239, 255, 267, + 279, 287, 291, 295, 299, 303, 307, 311, 315, 319, 323, 327, + 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 369, 371, + 375, 377, 379, 383, 385, 387, 391, 393, 395, 399, 401, 403, + 407, 409, 411, 415, 417, 419, 423, 425, 427, 431, 433, 435, + 439, 441, 443, 447, 449, 451, 455, 457, 459, 463, 465, 467, + 471, 473, 475, 479, 481, 483, 487, 489, 491, 495, 497, 499, + 503, 505, 507, 511, 513, 515, 519, 521, 523, 527, 529, 531, + 535, 537, 539, 543, 545, 547, 549, 551, 553, 555, 557, 559, + 561, 563, 565, 567, 569, 571, 573, 575, -1 + ], + name = 'tch_afs_6_7', + description = [ + "TCH/AFS 6.7 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_5_9 definition + ConvolutionalCode( + 124, + [ + ( G4, G6 ), + ( G5, G6 ), + ( 1, 1), + ( 1, 1), + ], + puncture = [ + 0, 1, 3, 5, 7, 11, 15, 31, 47, 63, 79, 95, + 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, 271, 287, + 303, 319, 327, 331, 335, 343, 347, 351, 359, 363, 367, 375, + 379, 383, 391, 395, 399, 407, 411, 415, 423, 427, 431, 439, + 443, 447, 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, + 495, 499, 503, 507, 509, 511, 512, 513, 515, 516, 517, 519, + -1 + ], + name = 'tch_afs_5_9', + description = [ + "TCH/AFS 5.9 kbits convolutional code:", + "124 bits", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G6/G6 = 1", + "G6/G6 = 1", + ] + ), + + # TCH_AFS_5_15 definition + ConvolutionalCode( + 109, + [ + ( G1, G3 ), + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 0, 4, 5, 9, 10, 14, 15, 20, 25, 30, 35, 40, + 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, + 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, + 290, 300, 310, 315, 320, 325, 330, 334, 335, 340, 344, 345, + 350, 354, 355, 360, 364, 365, 370, 374, 375, 380, 384, 385, + 390, 394, 395, 400, 404, 405, 410, 414, 415, 420, 424, 425, + 430, 434, 435, 440, 444, 445, 450, 454, 455, 460, 464, 465, + 470, 474, 475, 480, 484, 485, 490, 494, 495, 500, 504, 505, + 510, 514, 515, 520, 524, 525, 529, 530, 534, 535, 539, 540, + 544, 545, 549, 550, 554, 555, 559, 560, 564, -1 + ], + name = 'tch_afs_5_15', + description = [ + "TCH/AFS 5.15 kbits convolutional code:", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", + "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", + "G3/G3 = 1", + "G3/G3 = 1", + ] + ), + + # TCH_AFS_4_75 definition + ConvolutionalCode( + 101, + [ + ( G4, G6 ), + ( G4, G6 ), + ( G5, G6 ), + ( 1, 1 ), + ( 1, 1 ), + ], + puncture = [ + 0, 1, 2, 4, 5, 7, 9, 15, 25, 35, 45, 55, + 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165, 175, + 185, 195, 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, + 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 400, 405, + 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 459, 460, + 465, 470, 475, 479, 480, 485, 490, 495, 499, 500, 505, 509, + 510, 515, 517, 519, 520, 522, 524, 525, 526, 527, 529, 530, + 531, 532, 534, -1 + ], + name = 'tch_afs_4_75', + description = [ + "TCH/AFS 4.75 kbits convolutional code:", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", + "G6/G6 = 1", + "G6/G6 = 1", + ] + ), + + # TCH_FR definition + ConvolutionalCode( + 185, + shared_polys["xcch"], + name = "tch_fr", + description = ["TCH/F convolutional code"] + ), + + # TCH_HR definition + ConvolutionalCode( + 98, + [ + ( G4, 1 ), + ( G5, 1 ), + ( G6, 1 ), + ], + puncture = [ + 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, + 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, + 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, + 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, + 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, + 181, 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 214, + 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, + 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 295, + 298, 301, 304, 307, 310, -1, + ], + name = "tch_hr", + description = ["TCH/H convolutional code"] + ), + + # TCH_AHS_7_95 definition + ConvolutionalCode( + 129, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 5, 7, 11, 15, 19, 23, 27, 31, 35, 43, + 47, 51, 55, 59, 63, 67, 71, 79, 83, 87, 91, 95, + 99, 103, 107, 115, 119, 123, 127, 131, 135, 139, 143, 151, + 155, 159, 163, 167, 171, 175, 177, 179, 183, 185, 187, 191, + 193, 195, 197, 199, 203, 205, 207, 211, 213, 215, 219, 221, + 223, 227, 229, 231, 233, 235, 239, 241, 243, 247, 249, 251, + 255, 257, 259, 261, 263, 265, -1, + ], + name = "tch_ahs_7_95", + description = ["TCH/AHS 7.95 kbits convolutional code"] + ), + + # TCH_AHS_7_4 definition + ConvolutionalCode( + 126, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 7, 11, 19, 23, 27, 35, 39, 43, 51, 55, + 59, 67, 71, 75, 83, 87, 91, 99, 103, 107, 115, 119, + 123, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, + 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, + 221, 223, 227, 229, 231, 235, 237, 239, 243, 245, 247, 251, + 253, 255, 257, 259, -1, + ], + name = "tch_ahs_7_4", + description = ["TCH/AHS 7.4 kbits convolutional code"] + ), + + # TCH_AHS_6_7 definition + ConvolutionalCode( + 116, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 3, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, + 109, 119, 129, 139, 149, 159, 167, 169, 177, 179, 187, 189, + 197, 199, 203, 207, 209, 213, 217, 219, 223, 227, 229, 231, + 233, 235, 237, 239, -1, + ], + name = "tch_ahs_6_7", + description = ["TCH/AHS 6.7 kbits convolutional code"] + ), + + # TCH_AHS_5_9 definition + ConvolutionalCode( + 108, + [ + ( 1, 1 ), + ( G1, G0 ), + ], + puncture = [ + 1, 15, 71, 127, 139, 151, 163, 175, 187, 195, 203, 211, + 215, 219, 221, 223, -1, + ], + name = "tch_ahs_5_9", + description = ["TCH/AHS 5.9 kbits convolutional code"] + ), + + # TCH_AHS_5_15 definition + ConvolutionalCode( + 97, + [ + ( G1, G3 ), + ( G2, G3 ), + ( 1, 1 ), + ], + puncture = [ + 0, 1, 3, 4, 6, 9, 12, 15, 18, 21, 27, 33, + 39, 45, 51, 54, 57, 63, 69, 75, 81, 87, 90, 93, + 99, 105, 111, 117, 123, 126, 129, 135, 141, 147, 153, 159, + 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192, 195, + 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, + 234, 237, 240, 243, 244, 246, 249, 252, 255, 256, 258, 261, + 264, 267, 268, 270, 273, 276, 279, 280, 282, 285, 288, 289, + 291, 294, 295, 297, 298, 300, 301, -1, + ], + name = "tch_ahs_5_15", + description = ["TCH/AHS 5.15 kbits convolutional code"] + ), + + # TCH_AHS_4_75 definition + ConvolutionalCode( + 89, + [ + ( 1, 1 ), + ( G5, G4 ), + ( G6, G4 ), + ], + puncture = [ + 1, 2, 4, 5, 7, 8, 10, 13, 16, 22, 28, 34, + 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, + 112, 118, 124, 130, 136, 142, 148, 151, 154, 160, 163, 166, + 172, 175, 178, 184, 187, 190, 196, 199, 202, 208, 211, 214, + 220, 223, 226, 232, 235, 238, 241, 244, 247, 250, 253, 256, + 259, 262, 265, 268, 271, 274, 275, 277, 278, 280, 281, 283, + 284, -1, + ], + name = "tch_ahs_4_75", + description = ["TCH/AHS 4.75 kbits convolutional code"] + ), + + # EDGE MCS1_DL_HDR definition + ConvolutionalCode( + 36, + shared_polys["mcs"], + name = "mcs1_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-1 DL header convolutional code:", + "42 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS1_UL_HDR definition + ConvolutionalCode( + 39, + shared_polys["mcs"], + name = "mcs1_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-1 UL header convolutional code:", + "45 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS1 definition + ConvolutionalCode( + 190, + shared_polys["mcs"], + name = "mcs1", + description = [ + "EDGE MCS-1 data convolutional code:", + "196 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS2 definition + ConvolutionalCode( + 238, + shared_polys["mcs"], + name = "mcs2", + description = [ + "EDGE MCS-2 data convolutional code:", + "244 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS3 definition + ConvolutionalCode( + 310, + shared_polys["mcs"], + name = "mcs3", + description = [ + "EDGE MCS-3 data convolutional code:", + "316 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS4 definition + ConvolutionalCode( + 366, + shared_polys["mcs"], + name = "mcs4", + description = [ + "EDGE MCS-4 data convolutional code:", + "372 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5_DL_HDR definition + ConvolutionalCode( + 33, + shared_polys["mcs"], + name = "mcs5_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-5 DL header convolutional code:", + "39 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5_UL_HDR definition + ConvolutionalCode( + 45, + shared_polys["mcs"], + name = "mcs5_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-5 UL header convolutional code:", + "51 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS5 definition + ConvolutionalCode( + 462, + shared_polys["mcs"], + name = "mcs5", + description = [ + "EDGE MCS-5 data convolutional code:", + "468 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS6 definition + ConvolutionalCode( + 606, + shared_polys["mcs"], + name = "mcs6", + description = [ + "EDGE MCS-6 data convolutional code:", + "612 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7_DL_HDR definition + ConvolutionalCode( + 45, + shared_polys["mcs"], + name = "mcs7_dl_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-7 DL header convolutional code:", + "51 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7_UL_HDR definition + ConvolutionalCode( + 54, + shared_polys["mcs"], + name = "mcs7_ul_hdr", + term_type = "CONV_TERM_TAIL_BITING", + description = [ + "EDGE MCS-7 UL header convolutional code:", + "60 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS7 definition + ConvolutionalCode( + 462, + shared_polys["mcs"], + name = "mcs7", + description = [ + "EDGE MCS-7 data convolutional code:", + "468 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS8 definition + ConvolutionalCode( + 558, + shared_polys["mcs"], + name = "mcs8", + description = [ + "EDGE MCS-8 data convolutional code:", + "564 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), + + # EDGE MCS9 definition + ConvolutionalCode( + 606, + shared_polys["mcs"], + name = "mcs9", + description = [ + "EDGE MCS-9 data convolutional code:", + "612 bits blocks, rate 1/3, k = 7", + "G4 = 1 + D2 + D3 + D5 + D6", + "G7 = 1 + D + D2 + D3 + D6", + "G5 = 1 + D + D4 + D6" + ] + ), +] diff --git a/utils/conv_gen.py b/utils/conv_gen.py index 1ecb550..60580ed 100644 --- a/utils/conv_gen.py +++ b/utils/conv_gen.py @@ -25,6 +25,7 @@ import sys, os, math from functools import reduce +import conv_codes_gsm class ConvolutionalCode(object): @@ -247,736 +248,43 @@ fi.write("\n") -def print_shared(fi): +def print_shared(fi, shared_polys): for (name, polys) in shared_polys.items(): # HACK code = ConvolutionalCode(0, polys, name = name) code.print_state_and_output(fi) -# Polynomials according to 3GPP TS 05.03 Annex B -G0 = poly(0, 3, 4) -G1 = poly(0, 1, 3, 4) -G2 = poly(0, 2, 4) -G3 = poly(0, 1, 2, 3, 4) -G4 = poly(0, 2, 3, 5, 6) -G5 = poly(0, 1, 4, 6) -G6 = poly(0, 1, 2, 3, 4, 6) -G7 = poly(0, 1, 2, 3, 6) - -shared_polys = { - "xcch" : [ - ( G0, 1 ), - ( G1, 1 ), - ], - "mcs" : [ - ( G4, 1 ), - ( G7, 1 ), - ( G5, 1 ), - ], -} - -conv_codes = [ - # xCCH definition - ConvolutionalCode( - 224, - shared_polys["xcch"], - name = "xcch", - description = [ - "xCCH convolutional code:", - "228 bits blocks, rate 1/2, k = 5", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # RACH definition - ConvolutionalCode( - 14, - shared_polys["xcch"], - name = "rach", - description = ["RACH convolutional code"] - ), - - # SCH definition - ConvolutionalCode( - 35, - shared_polys["xcch"], - name = "sch", - description = ["SCH convolutional code"] - ), - - # CS2 definition - ConvolutionalCode( - 290, - shared_polys["xcch"], - puncture = [ - 15, 19, 23, 27, 31, 35, 43, 47, 51, 55, 59, 63, 67, 71, - 75, 79, 83, 91, 95, 99, 103, 107, 111, 115, 119, 123, 127, 131, - 139, 143, 147, 151, 155, 159, 163, 167, 171, 175, 179, 187, 191, 195, - 199, 203, 207, 211, 215, 219, 223, 227, 235, 239, 243, 247, 251, 255, - 259, 263, 267, 271, 275, 283, 287, 291, 295, 299, 303, 307, 311, 315, - 319, 323, 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 371, 379, - 383, 387, 391, 395, 399, 403, 407, 411, 415, 419, 427, 431, 435, 439, - 443, 447, 451, 455, 459, 463, 467, 475, 479, 483, 487, 491, 495, 499, - 503, 507, 511, 515, 523, 527, 531, 535, 539, 543, 547, 551, 555, 559, - 563, 571, 575, 579, 583, 587, -1 - ], - name = "cs2", - description = [ - "CS2 convolutional code:", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # CS3 definition - ConvolutionalCode( - 334, - shared_polys["xcch"], - puncture = [ - 15, 17, 21, 23, 27, 29, 33, 35, 39, 41, 45, 47, 51, 53, - 57, 59, 63, 65, 69, 71, 75, 77, 81, 83, 87, 89, 93, 95, - 99, 101, 105, 107, 111, 113, 117, 119, 123, 125, 129, 131, 135, 137, - 141, 143, 147, 149, 153, 155, 159, 161, 165, 167, 171, 173, 177, 179, - 183, 185, 189, 191, 195, 197, 201, 203, 207, 209, 213, 215, 219, 221, - 225, 227, 231, 233, 237, 239, 243, 245, 249, 251, 255, 257, 261, 263, - 267, 269, 273, 275, 279, 281, 285, 287, 291, 293, 297, 299, 303, 305, - 309, 311, 315, 317, 321, 323, 327, 329, 333, 335, 339, 341, 345, 347, - 351, 353, 357, 359, 363, 365, 369, 371, 375, 377, 381, 383, 387, 389, - 393, 395, 399, 401, 405, 407, 411, 413, 417, 419, 423, 425, 429, 431, - 435, 437, 441, 443, 447, 449, 453, 455, 459, 461, 465, 467, 471, 473, - 477, 479, 483, 485, 489, 491, 495, 497, 501, 503, 507, 509, 513, 515, - 519, 521, 525, 527, 531, 533, 537, 539, 543, 545, 549, 551, 555, 557, - 561, 563, 567, 569, 573, 575, 579, 581, 585, 587, 591, 593, 597, 599, - 603, 605, 609, 611, 615, 617, 621, 623, 627, 629, 633, 635, 639, 641, - 645, 647, 651, 653, 657, 659, 663, 665, 669, 671, -1 - ], - name = "cs3", - description = [ - "CS3 convolutional code:", - "G0 = 1 + D3 + D4", - "G1 = 1 + D + D3 + D4", - ] - ), - - # TCH_AFS_12_2 definition - ConvolutionalCode( - 250, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 321, 325, 329, 333, 337, 341, 345, 349, 353, 357, 361, 363, - 365, 369, 373, 377, 379, 381, 385, 389, 393, 395, 397, 401, - 405, 409, 411, 413, 417, 421, 425, 427, 429, 433, 437, 441, - 443, 445, 449, 453, 457, 459, 461, 465, 469, 473, 475, 477, - 481, 485, 489, 491, 493, 495, 497, 499, 501, 503, 505, 507, - -1 - ], - name = 'tch_afs_12_2', - description = [ - "TCH/AFS 12.2 kbits convolutional code:", - "250 bits block, rate 1/2, punctured", - "G0/G0 = 1", - "G1/G0 = 1 + D + D3 + D4 / 1 + D3 + D4", - ] - ), - - # TCH_AFS_10_2 definition - ConvolutionalCode( - 210, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 1, 4, 7, 10, 16, 19, 22, 28, 31, 34, 40, 43, - 46, 52, 55, 58, 64, 67, 70, 76, 79, 82, 88, 91, - 94, 100, 103, 106, 112, 115, 118, 124, 127, 130, 136, 139, - 142, 148, 151, 154, 160, 163, 166, 172, 175, 178, 184, 187, - 190, 196, 199, 202, 208, 211, 214, 220, 223, 226, 232, 235, - 238, 244, 247, 250, 256, 259, 262, 268, 271, 274, 280, 283, - 286, 292, 295, 298, 304, 307, 310, 316, 319, 322, 325, 328, - 331, 334, 337, 340, 343, 346, 349, 352, 355, 358, 361, 364, - 367, 370, 373, 376, 379, 382, 385, 388, 391, 394, 397, 400, - 403, 406, 409, 412, 415, 418, 421, 424, 427, 430, 433, 436, - 439, 442, 445, 448, 451, 454, 457, 460, 463, 466, 469, 472, - 475, 478, 481, 484, 487, 490, 493, 496, 499, 502, 505, 508, - 511, 514, 517, 520, 523, 526, 529, 532, 535, 538, 541, 544, - 547, 550, 553, 556, 559, 562, 565, 568, 571, 574, 577, 580, - 583, 586, 589, 592, 595, 598, 601, 604, 607, 609, 610, 613, - 616, 619, 621, 622, 625, 627, 628, 631, 633, 634, 636, 637, - 639, 640, -1 - ], - name = 'tch_afs_10_2', - description = [ - "TCH/AFS 10.2 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_7_95 definition - ConvolutionalCode( - 165, - [ - ( 1, 1 ), - ( G5, G4 ), - ( G6, G4 ), - ], - puncture = [ - 1, 2, 4, 5, 8, 22, 70, 118, 166, 214, 262, 310, - 317, 319, 325, 332, 334, 341, 343, 349, 356, 358, 365, 367, - 373, 380, 382, 385, 389, 391, 397, 404, 406, 409, 413, 415, - 421, 428, 430, 433, 437, 439, 445, 452, 454, 457, 461, 463, - 469, 476, 478, 481, 485, 487, 490, 493, 500, 502, 503, 505, - 506, 508, 509, 511, 512, -1 - ], - name = 'tch_afs_7_95', - description = [ - "TCH/AFS 7.95 kbits convolutional code:", - "G4/G4 = 1", - "G5/G4 = 1 + D + D4 + D6 / 1 + D2 + D3 + D5 + D6", - "G6/G4 = 1 + D + D2 + D3 + D4 + D6 / 1 + D2 + D3 + D5 + D6", - ] - ), - - # TCH_AFS_7_4 definition - ConvolutionalCode( - 154, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 0, 355, 361, 367, 373, 379, 385, 391, 397, 403, 409, 415, - 421, 427, 433, 439, 445, 451, 457, 460, 463, 466, 468, 469, - 471, 472, -1 - ], - name = 'tch_afs_7_4', - description = [ - "TCH/AFS 7.4 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_6_7 definition - ConvolutionalCode( - 140, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 1, 3, 7, 11, 15, 27, 39, 55, 67, 79, 95, 107, - 119, 135, 147, 159, 175, 187, 199, 215, 227, 239, 255, 267, - 279, 287, 291, 295, 299, 303, 307, 311, 315, 319, 323, 327, - 331, 335, 339, 343, 347, 351, 355, 359, 363, 367, 369, 371, - 375, 377, 379, 383, 385, 387, 391, 393, 395, 399, 401, 403, - 407, 409, 411, 415, 417, 419, 423, 425, 427, 431, 433, 435, - 439, 441, 443, 447, 449, 451, 455, 457, 459, 463, 465, 467, - 471, 473, 475, 479, 481, 483, 487, 489, 491, 495, 497, 499, - 503, 505, 507, 511, 513, 515, 519, 521, 523, 527, 529, 531, - 535, 537, 539, 543, 545, 547, 549, 551, 553, 555, 557, 559, - 561, 563, 565, 567, 569, 571, 573, 575, -1 - ], - name = 'tch_afs_6_7', - description = [ - "TCH/AFS 6.7 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_5_9 definition - ConvolutionalCode( - 124, - [ - ( G4, G6 ), - ( G5, G6 ), - ( 1, 1), - ( 1, 1), - ], - puncture = [ - 0, 1, 3, 5, 7, 11, 15, 31, 47, 63, 79, 95, - 111, 127, 143, 159, 175, 191, 207, 223, 239, 255, 271, 287, - 303, 319, 327, 331, 335, 343, 347, 351, 359, 363, 367, 375, - 379, 383, 391, 395, 399, 407, 411, 415, 423, 427, 431, 439, - 443, 447, 455, 459, 463, 467, 471, 475, 479, 483, 487, 491, - 495, 499, 503, 507, 509, 511, 512, 513, 515, 516, 517, 519, - -1 - ], - name = 'tch_afs_5_9', - description = [ - "TCH/AFS 5.9 kbits convolutional code:", - "124 bits", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G6/G6 = 1", - "G6/G6 = 1", - ] - ), - - # TCH_AFS_5_15 definition - ConvolutionalCode( - 109, - [ - ( G1, G3 ), - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 0, 4, 5, 9, 10, 14, 15, 20, 25, 30, 35, 40, - 50, 60, 70, 80, 90, 100, 110, 120, 130, 140, 150, 160, - 170, 180, 190, 200, 210, 220, 230, 240, 250, 260, 270, 280, - 290, 300, 310, 315, 320, 325, 330, 334, 335, 340, 344, 345, - 350, 354, 355, 360, 364, 365, 370, 374, 375, 380, 384, 385, - 390, 394, 395, 400, 404, 405, 410, 414, 415, 420, 424, 425, - 430, 434, 435, 440, 444, 445, 450, 454, 455, 460, 464, 465, - 470, 474, 475, 480, 484, 485, 490, 494, 495, 500, 504, 505, - 510, 514, 515, 520, 524, 525, 529, 530, 534, 535, 539, 540, - 544, 545, 549, 550, 554, 555, 559, 560, 564, -1 - ], - name = 'tch_afs_5_15', - description = [ - "TCH/AFS 5.15 kbits convolutional code:", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G1/G3 = 1 + D + D3 + D4 / 1 + D + D2 + D3 + D4", - "G2/G3 = 1 + D2 + D4 / 1 + D + D2 + D3 + D4", - "G3/G3 = 1", - "G3/G3 = 1", - ] - ), - - # TCH_AFS_4_75 definition - ConvolutionalCode( - 101, - [ - ( G4, G6 ), - ( G4, G6 ), - ( G5, G6 ), - ( 1, 1 ), - ( 1, 1 ), - ], - puncture = [ - 0, 1, 2, 4, 5, 7, 9, 15, 25, 35, 45, 55, - 65, 75, 85, 95, 105, 115, 125, 135, 145, 155, 165, 175, - 185, 195, 205, 215, 225, 235, 245, 255, 265, 275, 285, 295, - 305, 315, 325, 335, 345, 355, 365, 375, 385, 395, 400, 405, - 410, 415, 420, 425, 430, 435, 440, 445, 450, 455, 459, 460, - 465, 470, 475, 479, 480, 485, 490, 495, 499, 500, 505, 509, - 510, 515, 517, 519, 520, 522, 524, 525, 526, 527, 529, 530, - 531, 532, 534, -1 - ], - name = 'tch_afs_4_75', - description = [ - "TCH/AFS 4.75 kbits convolutional code:", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G4/G6 = 1 + D2 + D3 + D5 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G5/G6 = 1 + D + D4 + D6 / 1 + D + D2 + D3 + D4 + D6", - "G6/G6 = 1", - "G6/G6 = 1", - ] - ), - - # TCH_FR definition - ConvolutionalCode( - 185, - shared_polys["xcch"], - name = "tch_fr", - description = ["TCH/F convolutional code"] - ), - - # TCH_HR definition - ConvolutionalCode( - 98, - [ - ( G4, 1 ), - ( G5, 1 ), - ( G6, 1 ), - ], - puncture = [ - 1, 4, 7, 10, 13, 16, 19, 22, 25, 28, 31, 34, - 37, 40, 43, 46, 49, 52, 55, 58, 61, 64, 67, 70, - 73, 76, 79, 82, 85, 88, 91, 94, 97, 100, 103, 106, - 109, 112, 115, 118, 121, 124, 127, 130, 133, 136, 139, 142, - 145, 148, 151, 154, 157, 160, 163, 166, 169, 172, 175, 178, - 181, 184, 187, 190, 193, 196, 199, 202, 205, 208, 211, 214, - 217, 220, 223, 226, 229, 232, 235, 238, 241, 244, 247, 250, - 253, 256, 259, 262, 265, 268, 271, 274, 277, 280, 283, 295, - 298, 301, 304, 307, 310, -1, - ], - name = "tch_hr", - description = ["TCH/H convolutional code"] - ), - - # TCH_AHS_7_95 definition - ConvolutionalCode( - 129, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 5, 7, 11, 15, 19, 23, 27, 31, 35, 43, - 47, 51, 55, 59, 63, 67, 71, 79, 83, 87, 91, 95, - 99, 103, 107, 115, 119, 123, 127, 131, 135, 139, 143, 151, - 155, 159, 163, 167, 171, 175, 177, 179, 183, 185, 187, 191, - 193, 195, 197, 199, 203, 205, 207, 211, 213, 215, 219, 221, - 223, 227, 229, 231, 233, 235, 239, 241, 243, 247, 249, 251, - 255, 257, 259, 261, 263, 265, -1, - ], - name = "tch_ahs_7_95", - description = ["TCH/AHS 7.95 kbits convolutional code"] - ), - - # TCH_AHS_7_4 definition - ConvolutionalCode( - 126, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 7, 11, 19, 23, 27, 35, 39, 43, 51, 55, - 59, 67, 71, 75, 83, 87, 91, 99, 103, 107, 115, 119, - 123, 131, 135, 139, 143, 147, 151, 155, 159, 163, 167, 171, - 175, 179, 183, 187, 191, 195, 199, 203, 207, 211, 215, 219, - 221, 223, 227, 229, 231, 235, 237, 239, 243, 245, 247, 251, - 253, 255, 257, 259, -1, - ], - name = "tch_ahs_7_4", - description = ["TCH/AHS 7.4 kbits convolutional code"] - ), - - # TCH_AHS_6_7 definition - ConvolutionalCode( - 116, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 3, 9, 19, 29, 39, 49, 59, 69, 79, 89, 99, - 109, 119, 129, 139, 149, 159, 167, 169, 177, 179, 187, 189, - 197, 199, 203, 207, 209, 213, 217, 219, 223, 227, 229, 231, - 233, 235, 237, 239, -1, - ], - name = "tch_ahs_6_7", - description = ["TCH/AHS 6.7 kbits convolutional code"] - ), - - # TCH_AHS_5_9 definition - ConvolutionalCode( - 108, - [ - ( 1, 1 ), - ( G1, G0 ), - ], - puncture = [ - 1, 15, 71, 127, 139, 151, 163, 175, 187, 195, 203, 211, - 215, 219, 221, 223, -1, - ], - name = "tch_ahs_5_9", - description = ["TCH/AHS 5.9 kbits convolutional code"] - ), - - # TCH_AHS_5_15 definition - ConvolutionalCode( - 97, - [ - ( G1, G3 ), - ( G2, G3 ), - ( 1, 1 ), - ], - puncture = [ - 0, 1, 3, 4, 6, 9, 12, 15, 18, 21, 27, 33, - 39, 45, 51, 54, 57, 63, 69, 75, 81, 87, 90, 93, - 99, 105, 111, 117, 123, 126, 129, 135, 141, 147, 153, 159, - 162, 165, 168, 171, 174, 177, 180, 183, 186, 189, 192, 195, - 198, 201, 204, 207, 210, 213, 216, 219, 222, 225, 228, 231, - 234, 237, 240, 243, 244, 246, 249, 252, 255, 256, 258, 261, - 264, 267, 268, 270, 273, 276, 279, 280, 282, 285, 288, 289, - 291, 294, 295, 297, 298, 300, 301, -1, - ], - name = "tch_ahs_5_15", - description = ["TCH/AHS 5.15 kbits convolutional code"] - ), - - # TCH_AHS_4_75 definition - ConvolutionalCode( - 89, - [ - ( 1, 1 ), - ( G5, G4 ), - ( G6, G4 ), - ], - puncture = [ - 1, 2, 4, 5, 7, 8, 10, 13, 16, 22, 28, 34, - 40, 46, 52, 58, 64, 70, 76, 82, 88, 94, 100, 106, - 112, 118, 124, 130, 136, 142, 148, 151, 154, 160, 163, 166, - 172, 175, 178, 184, 187, 190, 196, 199, 202, 208, 211, 214, - 220, 223, 226, 232, 235, 238, 241, 244, 247, 250, 253, 256, - 259, 262, 265, 268, 271, 274, 275, 277, 278, 280, 281, 283, - 284, -1, - ], - name = "tch_ahs_4_75", - description = ["TCH/AHS 4.75 kbits convolutional code"] - ), - - # EDGE MCS1_DL_HDR definition - ConvolutionalCode( - 36, - shared_polys["mcs"], - name = "mcs1_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-1 DL header convolutional code:", - "42 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS1_UL_HDR definition - ConvolutionalCode( - 39, - shared_polys["mcs"], - name = "mcs1_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-1 UL header convolutional code:", - "45 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS1 definition - ConvolutionalCode( - 190, - shared_polys["mcs"], - name = "mcs1", - description = [ - "EDGE MCS-1 data convolutional code:", - "196 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS2 definition - ConvolutionalCode( - 238, - shared_polys["mcs"], - name = "mcs2", - description = [ - "EDGE MCS-2 data convolutional code:", - "244 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS3 definition - ConvolutionalCode( - 310, - shared_polys["mcs"], - name = "mcs3", - description = [ - "EDGE MCS-3 data convolutional code:", - "316 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS4 definition - ConvolutionalCode( - 366, - shared_polys["mcs"], - name = "mcs4", - description = [ - "EDGE MCS-4 data convolutional code:", - "372 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5_DL_HDR definition - ConvolutionalCode( - 33, - shared_polys["mcs"], - name = "mcs5_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-5 DL header convolutional code:", - "39 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5_UL_HDR definition - ConvolutionalCode( - 45, - shared_polys["mcs"], - name = "mcs5_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-5 UL header convolutional code:", - "51 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS5 definition - ConvolutionalCode( - 462, - shared_polys["mcs"], - name = "mcs5", - description = [ - "EDGE MCS-5 data convolutional code:", - "468 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS6 definition - ConvolutionalCode( - 606, - shared_polys["mcs"], - name = "mcs6", - description = [ - "EDGE MCS-6 data convolutional code:", - "612 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7_DL_HDR definition - ConvolutionalCode( - 45, - shared_polys["mcs"], - name = "mcs7_dl_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-7 DL header convolutional code:", - "51 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7_UL_HDR definition - ConvolutionalCode( - 54, - shared_polys["mcs"], - name = "mcs7_ul_hdr", - term_type = "CONV_TERM_TAIL_BITING", - description = [ - "EDGE MCS-7 UL header convolutional code:", - "60 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS7 definition - ConvolutionalCode( - 462, - shared_polys["mcs"], - name = "mcs7", - description = [ - "EDGE MCS-7 data convolutional code:", - "468 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS8 definition - ConvolutionalCode( - 558, - shared_polys["mcs"], - name = "mcs8", - description = [ - "EDGE MCS-8 data convolutional code:", - "564 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), - - # EDGE MCS9 definition - ConvolutionalCode( - 606, - shared_polys["mcs"], - name = "mcs9", - description = [ - "EDGE MCS-9 data convolutional code:", - "612 bits blocks, rate 1/3, k = 7", - "G4 = 1 + D2 + D3 + D5 + D6", - "G7 = 1 + D + D2 + D3 + D6", - "G5 = 1 + D + D4 + D6" - ] - ), -] - -if __name__ == '__main__': - path = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() - prefix = "gsm0503" - - sys.stderr.write("Generating convolutional codes...\n") - +def generate_codes(codes, path, prefix): # Open a new file for writing - f = open(os.path.join(path, "gsm0503_conv.c"), 'w') + f = open(os.path.join(path, prefix + "_conv.c"), 'w') f.write(mod_license + "\n") f.write("#include \n") f.write("#include \n\n") - print_shared(f) + + # Print shared tables first + if hasattr(codes, "shared_polys"): + print_shared(f, codes.shared_polys) # Generate the tables one by one - for code in conv_codes: + for code in codes.conv_codes: sys.stderr.write("Generate '%s' definition\n" % code.name) # Check whether shared polynomials are used shared = None - for (name, polys) in shared_polys.items(): - if code.polys == polys: - shared = name - break + if hasattr(codes, "shared_polys"): + for (name, polys) in codes.shared_polys.items(): + if code.polys == polys: + shared = name + break code.gen_tables(prefix, f, shared_tables = shared) +if __name__ == '__main__': + path = sys.argv[1] if len(sys.argv) > 1 else os.getcwd() + + sys.stderr.write("Generating convolutional codes...\n") + + # Generate GSM specific codes + generate_codes(conv_codes_gsm, path, "gsm0503") + sys.stderr.write("Generation complete.\n") -- To view, visit https://gerrit.osmocom.org/1223 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I3428561251b7d7a180d1e9b6fcaad50bdbbc37fa Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: tnt From gerrit-no-reply at lists.osmocom.org Tue Nov 22 23:05:27 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Nov 2016 23:05:27 +0000 Subject: [PATCH] osmo-bts[master]: cosmetic: tweak README In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1241 to look at the new patch set (#2). cosmetic: tweak README I noticed that the README is prominently shown on github, so it makes sense to get rid of the worst typos and misinformation there. Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb --- M README 1 file changed, 22 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/41/1241/2 diff --git a/README b/README index 967b080..1fe6e8c 100644 --- a/README +++ b/README @@ -1,26 +1,29 @@ -Repository forw the Osmocom BTS implementation. += Repository for the Osmocom BTS implementation. = -This code implementes the Layer 2 and higher of a more or less -conventional GSM BTS (Base Transceiver Station) - however, using an -Abis/IP interface, rather than the old-fashioned E1/T1. +For most complete and accurate information, please refer to +https://osmocom.org/projects/osmobts/wiki + +To submit patches, please refer to +https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit +(Note: github pull requests are rejected by a bot) + +== Summary == + +This code implements Layer 2 and higher of a more or less conventional GSM BTS +(Base Transceiver Station) - however, using an Abis/IP interface, rather than +the old-fashioned E1/T1. Specifically, this includes - * BTS-Side implementation of TS 08.58 (RSL) and TS 12.21 (OML) - * BTS-Side implementation of LAPDm (using libosmocore/libosmogsm) - * A somewhat separated interface between those higher layer parts - and the Layer1 interface. + * BTS-side implementation of TS 08.58 (RSL) and TS 12.21 (OML) + * BTS-side implementation of LAPDm (using libosmocore/libosmogsm) + * A somewhat separated interface between those higher layer parts and the + Layer1 interface. -Right now, only one hardware and Layer1 are supported: The sysmocom -sysmoBTS. - -There is some experimental and way incomplete code to use a couple of -OsmocomBB phones and run them in the BTS. However, the required code -for the Calypso DSP code have not been written yet. This would still -require a lot of work. - -Some additional work is being done in using some parts of the OpenBTS -L1FEC and glue it against omso-bts. This code is called osmo-trx and -requires the jolly/trx branch of this repository. +Several kinds of BTS hardware are supported: + * sysmocom sysmoBTS + * Octasic octphy + * Nutaq litecell 1.5 + * software-defined radio based osmo-bts-trx (e.g. B210) == Known Limitations == @@ -52,5 +55,3 @@ * Doesn't yet include MAC address in Abis/IP Identity message * MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power and ciphering. The dispatch should take a look at the hLayer3. - - -- To view, visit https://gerrit.osmocom.org/1241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Tue Nov 22 23:26:07 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 22 Nov 2016 23:26:07 +0000 Subject: openbsc[master]: Add IPA multiplexor In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (14 comments) Mostly style comments, feel free to disagree https://gerrit.osmocom.org/#/c/1265/3/openbsc/contrib/ipa.py File openbsc/contrib/ipa.py: Line 27: class IPA(object): IMvHO despite being an acronym, the class name should avoid all-caps Line 29: Stateless IPA protocol multiplexor: add/remove/parse (extended) header IMHO the spelling should be "multiplexer" with "er" Line 35: PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) typically in named args to function calls, there are no spaces around the '=' Line 45: """ A single line docstring like this could stay on a single line, especially if the function is short. Same numerous times below. def f(): "single line comment" code() Line 48: return 'UNKNOWN' I think better would be to return None or raise an exception. If it needs to be a constant, rather define in a global var. Also use 'is' for 'None', and also early exit: if p is None: return None return list(... Line 50: def __tag(self, t, v): any particular reason for *double* underscore? Line 94: if ext != None: 'if ext is not None:' Line 113: return self.__tag(self.IDTAG['SERNR'], data) I think it would be good to define the IDTAG keys as constants, like the TCP_PORT_OML above, to avoid typo errors in calling code. (Only worth it if there will actually be calling code hardcoding these names.) Line 163: def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): here I'd also drop the spaces around '='. Line 229: if 'ERROR' == s: you like yoda conditionals :) but they have no benefit in python. I don't like how a hardcoded string is used to make decisions, it should be a string constant defined once. Line 236: if op != None: if op is not None: Line 249: def cmd(self, var, val = None): val=None Line 263: if k != var or (val != None and v != val): 'val is not None' Line 268: print("IPA multiplexor v%s loaded." % IPA.version) multiplexer -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 23 06:26:59 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Wed, 23 Nov 2016 06:26:59 +0000 Subject: osmo-pcu[master]: Handle packet access reject during packet resource request In-Reply-To: References: Message-ID: Patch Set 5: Holger, I believe,i have addressed all the comments. Let me know if anything else needs to be corrected. -- To view, visit https://gerrit.osmocom.org/1216 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I05ff25124b58905586caa0c0c37023d69724f121 Gerrit-PatchSet: 5 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: arvind.sirsikar Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 23 07:07:01 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 23 Nov 2016 07:07:01 +0000 Subject: openbsc[master]: Add support for pdpctx_timer_stop In-Reply-To: References: Message-ID: Patch Set 1: > (1 comment) This function is as same as mmctx_timer_stop,which is there in existing code. pdp context/mm context will hold only one timer value(T). pdp context/mm context expects the same timer to be stopped, which is started. if some other timer is tried to be stopped, we need to stop the timer anyways since the Timer(T) is already in bad shape. hence stopping it. -- To view, visit https://gerrit.osmocom.org/1261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 23 12:23:41 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 23 Nov 2016 12:23:41 +0000 Subject: [MERGED] openbsc[master]: Add support for pdpctx_timer_stop In-Reply-To: References: Message-ID: pravin has submitted this change and it was merged. Change subject: Add support for pdpctx_timer_stop ...................................................................... Add support for pdpctx_timer_stop Timer T3395 starts at the transmission of Deactivate PDP request using pdpctx_timer_start but there was no corresponding stop function. The timer is stopped when Deactivate PDP Context Accept is received. This according to 3gpp spec reference 24.008 section 6.1.3.4.2. Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index b30b8d3..1fc2784 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -1990,6 +1990,14 @@ osmo_timer_schedule(&pdp->timer, seconds, 0); } +static void pdpctx_timer_stop(struct sgsn_pdp_ctx *pdp, unsigned int T) +{ + if (pdp->T != T) + LOGPDPCTXP(LOGL_ERROR, pdp, "Stopping PDP timer %u but " + "%u is running\n", T, pdp->T); + osmo_timer_del(&pdp->timer); +} + #if 0 static void msgb_put_pdp_addr_ipv4(struct msgb *msg, uint32_t ipaddr) { @@ -2464,7 +2472,8 @@ mm->imsi, transaction_id); return 0; } - + /* stop timer 3395 */ + pdpctx_timer_stop(pdp, 3395); return sgsn_delete_pdp_ctx(pdp); } -- To view, visit https://gerrit.osmocom.org/1261 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I825c0a47d39e784dd1b8251f564609262530a5c6 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:01:45 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:01:45 +0000 Subject: osmo-bts[master]: cosmetic: tweak README In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:01:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:01:54 +0000 Subject: [MERGED] osmo-bts[master]: cosmetic: tweak README In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: cosmetic: tweak README ...................................................................... cosmetic: tweak README I noticed that the README is prominently shown on github, so it makes sense to get rid of the worst typos and misinformation there. Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb --- M README 1 file changed, 22 insertions(+), 21 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/README b/README index 967b080..1fe6e8c 100644 --- a/README +++ b/README @@ -1,26 +1,29 @@ -Repository forw the Osmocom BTS implementation. += Repository for the Osmocom BTS implementation. = -This code implementes the Layer 2 and higher of a more or less -conventional GSM BTS (Base Transceiver Station) - however, using an -Abis/IP interface, rather than the old-fashioned E1/T1. +For most complete and accurate information, please refer to +https://osmocom.org/projects/osmobts/wiki + +To submit patches, please refer to +https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit +(Note: github pull requests are rejected by a bot) + +== Summary == + +This code implements Layer 2 and higher of a more or less conventional GSM BTS +(Base Transceiver Station) - however, using an Abis/IP interface, rather than +the old-fashioned E1/T1. Specifically, this includes - * BTS-Side implementation of TS 08.58 (RSL) and TS 12.21 (OML) - * BTS-Side implementation of LAPDm (using libosmocore/libosmogsm) - * A somewhat separated interface between those higher layer parts - and the Layer1 interface. + * BTS-side implementation of TS 08.58 (RSL) and TS 12.21 (OML) + * BTS-side implementation of LAPDm (using libosmocore/libosmogsm) + * A somewhat separated interface between those higher layer parts and the + Layer1 interface. -Right now, only one hardware and Layer1 are supported: The sysmocom -sysmoBTS. - -There is some experimental and way incomplete code to use a couple of -OsmocomBB phones and run them in the BTS. However, the required code -for the Calypso DSP code have not been written yet. This would still -require a lot of work. - -Some additional work is being done in using some parts of the OpenBTS -L1FEC and glue it against omso-bts. This code is called osmo-trx and -requires the jolly/trx branch of this repository. +Several kinds of BTS hardware are supported: + * sysmocom sysmoBTS + * Octasic octphy + * Nutaq litecell 1.5 + * software-defined radio based osmo-bts-trx (e.g. B210) == Known Limitations == @@ -52,5 +55,3 @@ * Doesn't yet include MAC address in Abis/IP Identity message * MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power and ciphering. The dispatch should take a look at the hLayer3. - - -- To view, visit https://gerrit.osmocom.org/1241 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:03:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:03:01 +0000 Subject: [MERGED] osmo-pcu[master]: Fix GSMTAP logging in case direct PHY access is enabled In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix GSMTAP logging in case direct PHY access is enabled ...................................................................... Fix GSMTAP logging in case direct PHY access is enabled In the existing code, GSMTAP messages were only generated in case no direct PHY access was being used (i.e. in the case all user traffic goes over the PCU socket). I'm not quite sure what the reason is for that would be and conclud this is not intentional. Let's first send the message to GSMTAP and then decide whether to send it via the direct PHY access or via the PCU socket into the BTS/BSC. Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade --- M src/pcu_l1_if.cpp 1 file changed, 2 insertions(+), 2 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index e1ebbde..fb17653 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -129,6 +129,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 0, fn, arfcn, block_nr, @@ -137,7 +138,6 @@ return; } #endif - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); pcu_tx_data_req(trx, ts, PCU_IF_SAPI_PDTCH, arfcn, fn, block_nr, msg->data, msg->len); msgb_free(msg); @@ -148,6 +148,7 @@ { struct gprs_rlcmac_bts *bts = bts_main_data(); + gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); #ifdef ENABLE_DIRECT_PHY if (bts->trx[trx].fl1h) { l1if_pdch_req(bts->trx[trx].fl1h, ts, 1, fn, arfcn, block_nr, @@ -156,7 +157,6 @@ return; } #endif - gsmtap_send(bts->gsmtap, arfcn, ts, GSMTAP_CHANNEL_PACCH, 0, fn, 0, 0, msg->data, msg->len); pcu_tx_data_req(trx, ts, PCU_IF_SAPI_PTCCH, arfcn, fn, block_nr, msg->data, msg->len); msgb_free(msg); -- To view, visit https://gerrit.osmocom.org/1274 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5d2e018f7009cb947abc874881c0c440feca3ade Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:03:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:03:01 +0000 Subject: [MERGED] osmo-pcu[master]: pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for array iteration ...................................................................... pcu_l1_if: get rid of magic numbers and use ARRAY_SIZE() for array iteration Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 --- M src/pcu_l1_if.cpp 1 file changed, 6 insertions(+), 6 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index f1c73c9..e1ebbde 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -340,8 +340,8 @@ struct gprs_bssgp_pcu *pcu; struct gprs_rlcmac_pdch *pdch; struct in_addr ia; - int rc = 0, ts; - uint8_t trx; + int rc = 0; + unsigned int trx, ts; int i; if (info_ind->version != PCU_IF_VERSION) { @@ -357,9 +357,9 @@ LOGP(DL1IF, LOGL_NOTICE, "BTS not available\n"); bssgp_failed: /* free all TBF */ - for (trx = 0; trx < 8; trx++) { + for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) { bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; - for (ts = 0; ts < 8; ts++) + for (ts = 0; ts < ARRAY_SIZE(bts->trx[0].pdch); ts++) bts->trx[trx].pdch[ts].free_resources(); } gprs_bssgp_destroy(); @@ -451,7 +451,7 @@ bts->initial_cs_ul = bts->initial_cs_dl; } - for (trx = 0; trx < 8; trx++) { + for (trx = 0; trx < ARRAY_SIZE(bts->trx); trx++) { bts->trx[trx].arfcn = info_ind->trx[trx].arfcn; if ((info_ind->flags & PCU_IF_FLAG_SYSMO) && info_ind->trx[trx].hlayer1) { @@ -476,7 +476,7 @@ #endif } - for (ts = 0; ts < 8; ts++) { + for (ts = 0; ts < ARRAY_SIZE(bts->trx[0].pdch); ts++) { pdch = &bts->trx[trx].pdch[ts]; if ((info_ind->trx[trx].pdch_mask & (1 << ts))) { /* FIXME: activate dynamically at RLCMAC */ -- To view, visit https://gerrit.osmocom.org/1273 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I61d00950b4eb0b8bcbaf386d5081be84580dac75 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:03:01 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:03:01 +0000 Subject: [MERGED] osmo-pcu[master]: Install the pcuif_proto.h header file In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Install the pcuif_proto.h header file ...................................................................... Install the pcuif_proto.h header file So far, we used to keep a copy of the header file around in both osmo-pcu and osmo-bts projects. Before we start introducing a third copy in openbsc, let's have the osmo-pcu install the header file and make the other programs use that. Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d --- M Makefile.am M configure.ac A include/Makefile.am R include/osmocom/pcu/pcuif_proto.h M src/Makefile.am M src/osmobts_sock.cpp M src/pcu_l1_if.cpp 7 files changed, 10 insertions(+), 5 deletions(-) Approvals: Max: Looks good to me, but someone else must approve Jenkins Builder: Verified Holger Freyther: Looks good to me, approved diff --git a/Makefile.am b/Makefile.am index 4cbc114..12cb478 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6 -SUBDIRS = src examples tests +SUBDIRS = include src examples tests EXTRA_DIST = osmoappdesc.py diff --git a/configure.ac b/configure.ac index 022a7f7..dcde2ed 100644 --- a/configure.ac +++ b/configure.ac @@ -83,6 +83,7 @@ AC_SUBST(STD_DEFINES_AND_INCLUDES) AC_OUTPUT( + include/Makefile src/Makefile examples/Makefile tests/Makefile diff --git a/include/Makefile.am b/include/Makefile.am new file mode 100644 index 0000000..e40a9c0 --- /dev/null +++ b/include/Makefile.am @@ -0,0 +1,2 @@ +nobase_include_HEADERS = \ + osmocom/pcu/pcuif_proto.h diff --git a/src/pcuif_proto.h b/include/osmocom/pcu/pcuif_proto.h similarity index 100% rename from src/pcuif_proto.h rename to include/osmocom/pcu/pcuif_proto.h diff --git a/src/Makefile.am b/src/Makefile.am index 9b047e7..7cc239b 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -19,7 +19,7 @@ # AUTOMAKE_OPTIONS = subdir-objects -AM_CPPFLAGS = $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/include $(STD_DEFINES_AND_INCLUDES) $(LIBOSMOCORE_CFLAGS) $(LIBOSMOGB_CFLAGS) $(LIBOSMOGSM_CFLAGS) if ENABLE_SYSMODSP AM_CPPFLAGS += -DENABLE_DIRECT_PHY @@ -78,7 +78,6 @@ gprs_rlcmac.h \ gprs_ms.h \ gprs_ms_storage.h \ - pcuif_proto.h \ pcu_l1_if.h \ gsm_timer.h \ bitvector.h \ @@ -98,6 +97,9 @@ gprs_coding_scheme.h \ egprs_rlc_compression.h +nobase_include_HEADERS = + osmocom/pcu/pcuif_proto.h + osmo_pcu_SOURCES = pcu_main.cpp if ENABLE_SYSMODSP diff --git a/src/osmobts_sock.cpp b/src/osmobts_sock.cpp index 21a404f..f589dc2 100644 --- a/src/osmobts_sock.cpp +++ b/src/osmobts_sock.cpp @@ -35,7 +35,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp index fb17653..b892597 100644 --- a/src/pcu_l1_if.cpp +++ b/src/pcu_l1_if.cpp @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include -- To view, visit https://gerrit.osmocom.org/1259 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I60976c9be5488256d1ff55fdc5aa548e3705400d Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:05:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:05:14 +0000 Subject: openbsc[master]: move to libcommon-cs: net init 2: move bsc_network_init decl... In-Reply-To: References: Message-ID: Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 24 00:06:05 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Thu, 24 Nov 2016 00:06:05 +0000 Subject: openbsc[master]: move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_crea... In-Reply-To: References: Message-ID: Patch Set 4: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I212c2567b56191022b683674c1c4daf842839946 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 24 11:45:33 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Nov 2016 11:45:33 +0000 Subject: [PATCH] osmo-bts[master]: TRX: prevent segfault upon phy init or cleanup Message-ID: Review at https://gerrit.osmocom.org/1276 TRX: prevent segfault upon phy init or cleanup Previously if multiply phy instances were configured but not used osmo-bts-trx would segfault. Change-Id: Id979506731ea92401458f1060e87aeb690901539 --- M src/common/scheduler.c M src/osmo-bts-trx/l1_if.c M src/osmo-bts-trx/trx_if.c 3 files changed, 12 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/1276/1 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index db1f977..fd5c584 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -166,6 +166,9 @@ uint8_t tn; unsigned int i; + if (!trx) + return -EINVAL; + l1t->trx = trx; LOGP(DL1C, LOGL_NOTICE, "Init scheduler for trx=%u\n", l1t->trx->nr); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ea2088b..8bafe8c 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -71,17 +71,18 @@ return NULL; l1h->phy_inst = pinst; - trx_sched_init(&l1h->l1s, pinst->trx); + rc = trx_sched_init(&l1h->l1s, pinst->trx); + if (rc < 0) + goto err; rc = trx_if_open(l1h); - if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler\n"); + if (rc < 0) goto err; - } return l1h; err: + LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler\n"); l1if_close(l1h); return NULL; } diff --git a/src/osmo-bts-trx/trx_if.c b/src/osmo-bts-trx/trx_if.c index 42d383c..c5bdcd8 100644 --- a/src/osmo-bts-trx/trx_if.c +++ b/src/osmo-bts-trx/trx_if.c @@ -618,8 +618,10 @@ while (!llist_empty(&l1h->trx_ctrl_list)) { tcm = llist_entry(l1h->trx_ctrl_list.next, struct trx_ctrl_msg, list); - llist_del(&tcm->list); - talloc_free(tcm); + if (tcm) { + llist_del(&tcm->list); + talloc_free(tcm); + } } } -- To view, visit https://gerrit.osmocom.org/1276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id979506731ea92401458f1060e87aeb690901539 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Thu Nov 24 15:47:35 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Nov 2016 15:47:35 +0000 Subject: osmo-bts[master]: TRX: prevent segfault upon phy init or cleanup In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (1 comment) looks good, except for... https://gerrit.osmocom.org/#/c/1276/1/src/osmo-bts-trx/trx_if.c File src/osmo-bts-trx/trx_if.c: Line 621: if (tcm) { this doesn't really make sense. tcm should never be null. If it is, then llist_entry() above has dereferenced an invalid l1h->trx_ctrl_list.next which happens to point at NULL + . -- To view, visit https://gerrit.osmocom.org/1276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id979506731ea92401458f1060e87aeb690901539 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Thu Nov 24 16:01:43 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Nov 2016 16:01:43 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplexor In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#4). Add IPA multiplexor Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 271 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/4 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..e0cec4c --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,271 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.1" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + else: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + (dlen, proto) = struct.unpack(">HB", data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + return dlen, proto, None, data[3:] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def del_header(self, data): + """ + Strip CTRL protocol header while correctly checking and removing extension + Returns data length and the data without header (or None if parsing failed) + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return dlen, None + return dlen, d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == CTRL_ERR: + return None, v + if s == CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == CTRL_GET + '_' + CTRL_REP or s == CTRL_SET + '_' + CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (CTRL_TRAP, var, val)) + + def cmd(self, var, val = None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("%s %s %s %s" % (CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (CTRL_GET, r, var)) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Thu Nov 24 16:03:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Thu, 24 Nov 2016 16:03:28 +0000 Subject: openbsc[master]: gsm_subscriber_connection: mark BSC specific items In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 reinstate previous +2, which was lost only due to more verbose commit log message -- To view, visit https://gerrit.osmocom.org/1142 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib9666225fb9bfec2cf1e364343560571869fe6a7 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Thu Nov 24 16:08:46 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Thu, 24 Nov 2016 16:08:46 +0000 Subject: openbsc[master]: Add IPA multiplexor In-Reply-To: References: Message-ID: Patch Set 3: (7 comments) The rest should be fixed in new version. https://gerrit.osmocom.org/#/c/1265/3/openbsc/contrib/ipa.py File openbsc/contrib/ipa.py: Line 27: class IPA(object): > IMvHO despite being an acronym, the class name should avoid all-caps I think it's better to stick to the same names as in libosmocore. Line 35: PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) > typically in named args to function calls, there are no spaces around the ' This would decrease readability without providing any obvious benefits. Line 45: """ > A single line docstring like this could stay on a single line, especially i I think it's better to use the same style for docstrings regardless of how many lies they consist of right now. Line 48: return 'UNKNOWN' > I think better would be to return None or raise an exception. This would make dispatcher code which uses it unnecessary hard without providing any obvious benefits. Line 50: def __tag(self, t, v): > any particular reason for *double* underscore? that's python syntax for private functions. Line 113: return self.__tag(self.IDTAG['SERNR'], data) > I think it would be good to define the IDTAG keys as constants, like the TC Calling code is expected to work with tag_* functions. Line 163: def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): > here I'd also drop the spaces around '='. why? it's easier to read when spaces are there. -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:45 +0000 Subject: [MERGED] openbsc[master]: move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_crea... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej() ...................................................................... move to libcommon-cs: gsm48_create_mm_serv_rej(), gsm48_create_loc_upd_rej() Used by libbsc, libmsc as well as osmo-bsc and osmo-bsc_nat. Moving gsm48_create* to libcommon-cs affects linking of osmo-bsc_nat, resulting in undefined references to gsm48_extract_mi() and gsm48_paging_extract_mi(); fix that by placing libfilter.a left of libbsc.a upon linker invocation. Change-Id: I212c2567b56191022b683674c1c4daf842839946 --- M openbsc/src/libbsc/gsm_04_08_utils.c M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/osmo-bsc_nat/Makefile.am 3 files changed, 34 insertions(+), 34 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/gsm_04_08_utils.c b/openbsc/src/libbsc/gsm_04_08_utils.c index 46df108..98f0790 100644 --- a/openbsc/src/libbsc/gsm_04_08_utils.c +++ b/openbsc/src/libbsc/gsm_04_08_utils.c @@ -634,39 +634,6 @@ return 0; } -struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) -{ - struct msgb *msg; - struct gsm48_hdr *gh; - - msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ"); - if (!msg) - return NULL; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_MM; - gh->msg_type = GSM48_MT_MM_CM_SERV_REJ; - gh->data[0] = value; - - return msg; -} - -struct msgb *gsm48_create_loc_upd_rej(uint8_t cause) -{ - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ"); - if (!msg) - return NULL; - - gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); - gh->proto_discr = GSM48_PDISC_MM; - gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT; - gh->data[0] = cause; - return msg; -} - /* 9.2.5 CM service accept */ int gsm48_tx_mm_serv_ack(struct gsm_subscriber_connection *conn) { diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 0efec23..8d09b7e 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -80,3 +80,36 @@ return net; } + +struct msgb *gsm48_create_mm_serv_rej(enum gsm48_reject_value value) +{ + struct msgb *msg; + struct gsm48_hdr *gh; + + msg = gsm48_msgb_alloc_name("GSM 04.08 SERV REJ"); + if (!msg) + return NULL; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_CM_SERV_REJ; + gh->data[0] = value; + + return msg; +} + +struct msgb *gsm48_create_loc_upd_rej(uint8_t cause) +{ + struct gsm48_hdr *gh; + struct msgb *msg; + + msg = gsm48_msgb_alloc_name("GSM 04.08 LOC UPD REJ"); + if (!msg) + return NULL; + + gh = (struct gsm48_hdr *) msgb_put(msg, sizeof(*gh) + 1); + gh->proto_discr = GSM48_PDISC_MM; + gh->msg_type = GSM48_MT_MM_LOC_UPD_REJECT; + gh->data[0] = cause; + return msg; +} diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/openbsc/src/osmo-bsc_nat/Makefile.am index 141b892..be33d28 100644 --- a/openbsc/src/osmo-bsc_nat/Makefile.am +++ b/openbsc/src/osmo-bsc_nat/Makefile.am @@ -41,11 +41,11 @@ osmo_bsc_nat_LDADD = \ $(top_builddir)/src/libmgcp/libmgcp.a \ + $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ - $(top_builddir)/src/libfilter/libfilter.a \ $(LIBOSMOSCCP_LIBS) \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ -- To view, visit https://gerrit.osmocom.org/1128 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I212c2567b56191022b683674c1c4daf842839946 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:45 +0000 Subject: [MERGED] openbsc[master]: move to libcommon-cs: net init 3: actual move In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move to libcommon-cs: net init 3: actual move ...................................................................... move to libcommon-cs: net init 3: actual move Reincarnate gsm_network_init() as the parts not specific to libbsc. Move from bsc_network_init() those bits that are not BSC specific (and useful for upcoming osmo-cscn). Add libcommon-cs to all linkages that use gsm_network_init(). Note: the only requirement to allow linking gsm_network_init() without libbsc is to keep the call to gsm_net_update_ctype() out of libcommon-cs. The other items are kept out of libcommon-cs because it makes sense semantically. But the separation is not strong in that the BSC specific data members are of course still omnipresent in struct gsm_network. If bsc_network_init() is not called, these are not initialized properly -- for now no users of uninitialized members exist. So this is just a first step towards a sensible split of the BSC and MSC gsm_network structs. The long term aim should be to have entirely separate structs with some common general items. Change-Id: If06316b97002390dc9a434686750cb96193ea63b --- M openbsc/include/openbsc/common_cs.h M openbsc/src/ipaccess/Makefile.am M openbsc/src/libbsc/net_init.c M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/osmo-bsc/Makefile.am M openbsc/src/osmo-bsc_nat/Makefile.am M openbsc/src/osmo-nitb/Makefile.am M openbsc/src/utils/Makefile.am M openbsc/tests/bsc-nat/Makefile.am M openbsc/tests/bsc/Makefile.am M openbsc/tests/channel/Makefile.am M openbsc/tests/db/Makefile.am M openbsc/tests/gsm0408/Makefile.am M openbsc/tests/subscr/Makefile.am M openbsc/tests/trau/Makefile.am 15 files changed, 84 insertions(+), 35 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 612d754..8549a83 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -1,6 +1,13 @@ #pragma once +#include + struct msgb; struct gsm_network; typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); + +struct gsm_network *gsm_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv); diff --git a/openbsc/src/ipaccess/Makefile.am b/openbsc/src/ipaccess/Makefile.am index 784a578..6c4d95c 100644 --- a/openbsc/src/ipaccess/Makefile.am +++ b/openbsc/src/ipaccess/Makefile.am @@ -48,6 +48,7 @@ # FIXME: resolve the bogus dependencies patched around here: ipaccess_config_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBCRYPT) \ diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 07a4423..f728d3f 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -17,12 +17,9 @@ * */ +#include #include -#include #include -#include - -#include struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, @@ -30,11 +27,8 @@ mncc_recv_cb_t mncc_recv) { struct gsm_network *net; - const char *default_regexp = ".*"; - net = talloc_zero(ctx, struct gsm_network); - if (!net) - return NULL; + net = gsm_network_init(ctx, country_code, network_code, mncc_recv); net->bsc_data = talloc_zero(net, struct osmo_bsc_data); if (!net->bsc_data) { @@ -42,27 +36,11 @@ return NULL; } - net->subscr_group = talloc_zero(net, struct gsm_subscriber_group); - if (!net->subscr_group) { - talloc_free(net); - return NULL; - } - - if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, - &default_regexp) != 0) - return NULL; - /* Init back pointer */ net->bsc_data->auto_off_timeout = -1; net->bsc_data->network = net; INIT_LLIST_HEAD(&net->bsc_data->mscs); - net->subscr_group->net = net; - net->auto_create_subscr = true; - net->auto_assign_exten = true; - - net->country_code = country_code; - net->network_code = network_code; net->num_bts = 0; net->reject_cause = GSM48_REJECT_ROAMING_NOT_ALLOWED; net->T3101 = GSM_T3101_DEFAULT; @@ -79,22 +57,12 @@ net->handover.pwr_hysteresis = 3; net->handover.max_distance = 9999; - INIT_LLIST_HEAD(&net->trans_list); - INIT_LLIST_HEAD(&net->upqueue); INIT_LLIST_HEAD(&net->bts_list); - INIT_LLIST_HEAD(&net->subscr_conns); /* init statistics */ net->bsc_ctrs = rate_ctr_group_alloc(net, &bsc_ctrg_desc, 0); - net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); - net->active_calls = osmo_counter_alloc("msc.active_calls"); - net->mncc_recv = mncc_recv; - net->ext_min = GSM_MIN_EXTEN; - net->ext_max = GSM_MAX_EXTEN; gsm_net_update_ctype(net); - - net->dyn_ts_allow_tch_f = true; return net; } diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 99aa0cf..0efec23 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -1,6 +1,8 @@ /* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). * * (C) 2016 by sysmocom s.m.f.c. + * (C) 2008-2010 by Harald Welte + * (C) 2014 by Holger Hans Peter Freyther * All Rights Reserved * * This program is free software; you can redistribute it and/or modify @@ -17,3 +19,64 @@ * along with this program. If not, see . * */ + +#include + +#include + +#include +#include +#include + +/* Warning: if bsc_network_init() is not called, some of the members of + * gsm_network are not initialized properly and must not be used! (In + * particular the llist heads and stats counters.) + * The long term aim should be to have entirely separate structs for libbsc and + * libmsc with some common general items. + */ +struct gsm_network *gsm_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv) +{ + struct gsm_network *net; + + const char *default_regexp = ".*"; + + net = talloc_zero(ctx, struct gsm_network); + if (!net) + return NULL; + + net->subscr_group = talloc_zero(net, struct gsm_subscriber_group); + if (!net->subscr_group) { + talloc_free(net); + return NULL; + } + + if (gsm_parse_reg(net, &net->authorized_regexp, &net->authorized_reg_str, 1, + &default_regexp) != 0) + return NULL; + + net->subscr_group->net = net; + net->auto_create_subscr = true; + net->auto_assign_exten = true; + + net->country_code = country_code; + net->network_code = network_code; + + INIT_LLIST_HEAD(&net->trans_list); + INIT_LLIST_HEAD(&net->upqueue); + INIT_LLIST_HEAD(&net->subscr_conns); + + /* init statistics */ + net->msc_ctrs = rate_ctr_group_alloc(net, &msc_ctrg_desc, 0); + net->active_calls = osmo_counter_alloc("msc.active_calls"); + + net->mncc_recv = mncc_recv; + net->ext_min = GSM_MIN_EXTEN; + net->ext_max = GSM_MAX_EXTEN; + + net->dyn_ts_allow_tch_f = true; + + return net; +} diff --git a/openbsc/src/osmo-bsc/Makefile.am b/openbsc/src/osmo-bsc/Makefile.am index 2dbfeb8..6f836b0 100644 --- a/openbsc/src/osmo-bsc/Makefile.am +++ b/openbsc/src/osmo-bsc/Makefile.am @@ -41,6 +41,7 @@ osmo_bsc_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ diff --git a/openbsc/src/osmo-bsc_nat/Makefile.am b/openbsc/src/osmo-bsc_nat/Makefile.am index 6027f27..141b892 100644 --- a/openbsc/src/osmo-bsc_nat/Makefile.am +++ b/openbsc/src/osmo-bsc_nat/Makefile.am @@ -42,6 +42,7 @@ osmo_bsc_nat_LDADD = \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(top_builddir)/src/libfilter/libfilter.a \ diff --git a/openbsc/src/osmo-nitb/Makefile.am b/openbsc/src/osmo-nitb/Makefile.am index 60514c0..2a6d2fc 100644 --- a/openbsc/src/osmo-nitb/Makefile.am +++ b/openbsc/src/osmo-nitb/Makefile.am @@ -29,6 +29,7 @@ osmo_nitb_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/src/utils/Makefile.am b/openbsc/src/utils/Makefile.am index 7fcc4e3..6fe840c 100644 --- a/openbsc/src/utils/Makefile.am +++ b/openbsc/src/utils/Makefile.am @@ -50,6 +50,7 @@ bs11_config_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/bsc-nat/Makefile.am b/openbsc/tests/bsc-nat/Makefile.am index fa55d27..40be3a3 100644 --- a/openbsc/tests/bsc-nat/Makefile.am +++ b/openbsc/tests/bsc-nat/Makefile.am @@ -44,6 +44,7 @@ bsc_nat_test_LDADD = \ $(top_builddir)/src/libfilter/libfilter.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/bsc/Makefile.am b/openbsc/tests/bsc/Makefile.am index ddfa437..9de4145 100644 --- a/openbsc/tests/bsc/Makefile.am +++ b/openbsc/tests/bsc/Makefile.am @@ -33,6 +33,7 @@ bsc_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libmgcp/libmgcp.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ diff --git a/openbsc/tests/channel/Makefile.am b/openbsc/tests/channel/Makefile.am index 5654572..5e9583f 100644 --- a/openbsc/tests/channel/Makefile.am +++ b/openbsc/tests/channel/Makefile.am @@ -26,6 +26,7 @@ channel_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ $(LIBOSMOGSM_LIBS) \ diff --git a/openbsc/tests/db/Makefile.am b/openbsc/tests/db/Makefile.am index c4da31c..0eed5cd 100644 --- a/openbsc/tests/db/Makefile.am +++ b/openbsc/tests/db/Makefile.am @@ -35,6 +35,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ @@ -45,4 +46,3 @@ $(LIBCRYPTO_LIBS) \ -ldbi \ $(NULL) - diff --git a/openbsc/tests/gsm0408/Makefile.am b/openbsc/tests/gsm0408/Makefile.am index 11fa6b9..9739ee9 100644 --- a/openbsc/tests/gsm0408/Makefile.am +++ b/openbsc/tests/gsm0408/Makefile.am @@ -25,6 +25,7 @@ gsm0408_test_LDADD = \ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/subscr/Makefile.am b/openbsc/tests/subscr/Makefile.am index fb863d8..52e7947 100644 --- a/openbsc/tests/subscr/Makefile.am +++ b/openbsc/tests/subscr/Makefile.am @@ -33,6 +33,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ diff --git a/openbsc/tests/trau/Makefile.am b/openbsc/tests/trau/Makefile.am index 93ce88e..a446f79 100644 --- a/openbsc/tests/trau/Makefile.am +++ b/openbsc/tests/trau/Makefile.am @@ -33,6 +33,7 @@ $(top_builddir)/src/libbsc/libbsc.a \ $(top_builddir)/src/libmsc/libmsc.a \ $(top_builddir)/src/libbsc/libbsc.a \ + $(top_builddir)/src/libcommon-cs/libcommon-cs.a \ $(top_builddir)/src/libtrau/libtrau.a \ $(top_builddir)/src/libcommon/libcommon.a \ $(LIBOSMOCORE_LIBS) \ -- To view, visit https://gerrit.osmocom.org/1127 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If06316b97002390dc9a434686750cb96193ea63b Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:46 +0000 Subject: [MERGED] openbsc[master]: move to libcommon-cs: net init 2: move bsc_network_init decl... In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move to libcommon-cs: net init 2: move bsc_network_init decl to new .h ...................................................................... move to libcommon-cs: net init 2: move bsc_network_init decl to new .h bsc_network_init() is more fit to live in a BSC specific header, move it to new common_bsc.h. It will probably also absorb the BSC-specific part of gsm_network in the future. Adjust header includes across the board. Particularly, fix abis_nm.h by explicitly including gsm_data.h: it so far relied on other headers to do that, which now is no longer always given. Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b --- M openbsc/include/openbsc/Makefile.am M openbsc/include/openbsc/abis_nm.h A openbsc/include/openbsc/common_bsc.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/ipaccess/ipaccess-config.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/utils/bs11_config.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 9 files changed, 17 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index d9d8e99..2b54c43 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -13,6 +13,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + common_bsc.h \ common_cs.h \ crc24.h \ ctrl.h \ diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index 965f158..2465452 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -26,6 +26,8 @@ #include #include +#include + struct cell_global_id { uint16_t mcc; uint16_t mnc; diff --git a/openbsc/include/openbsc/common_bsc.h b/openbsc/include/openbsc/common_bsc.h new file mode 100644 index 0000000..7960383 --- /dev/null +++ b/openbsc/include/openbsc/common_bsc.h @@ -0,0 +1,9 @@ +#pragma once + +#include +#include + +struct gsm_network *bsc_network_init(void *ctx, + uint16_t country_code, + uint16_t network_code, + mncc_recv_cb_t mncc_recv); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index ea450be..d4a4d6d 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -415,11 +415,6 @@ extern void talloc_ctx_init(void *ctx_root); -struct gsm_network *bsc_network_init(void *ctx, - uint16_t country_code, - uint16_t network_code, - mncc_recv_cb_t mncc_recv); - int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); /* Get reference to a neighbor cell on a given BCCH ARFCN */ diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 06589f7..1ef8e3e 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -38,7 +38,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index 214926b..917dd73 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -36,7 +36,7 @@ #include #include #include -#include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index ee43a40..8b05637 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -32,7 +32,7 @@ #include -#include +#include #include #include #include diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index 0c730a2..351bb5a 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -25,6 +25,7 @@ #include #include +#include #include #include #include diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 15248f2..0c7b5ce 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -24,6 +24,7 @@ #include #include +#include #include #include #include -- To view, visit https://gerrit.osmocom.org/1126 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I9edfb1e748bb1cb484fadd48b0406f5b3098e89b Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:46 +0000 Subject: [MERGED] openbsc[master]: move to libcommon-cs: net init 1: rename to bsc_network_init In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: move to libcommon-cs: net init 1: rename to bsc_network_init ...................................................................... move to libcommon-cs: net init 1: rename to bsc_network_init The gsm_network_init() function initializes a whole lot of BSC specific stuff. Aiming to move some of it to libcommon-cs, first rename it to bsc_network_init(). This will retain the BSC specific stuff when the move is done. Adjust all callers. Future: osmo-cscn will call the more generic part and not the BSC specific part. Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 --- M openbsc/include/openbsc/gsm_data.h M openbsc/src/ipaccess/ipaccess-config.c M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/net_init.c M openbsc/src/utils/bs11_config.c M openbsc/tests/channel/channel_test.c M openbsc/tests/gsm0408/gsm0408_test.c 7 files changed, 10 insertions(+), 8 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index fe3fa29..ea450be 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -415,7 +415,7 @@ extern void talloc_ctx_init(void *ctx_root); -struct gsm_network *gsm_network_init(void *ctx, +struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, uint16_t network_code, mncc_recv_cb_t mncc_recv); diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 3c2d6cc..06589f7 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -986,7 +986,7 @@ } libosmo_abis_init(tall_ctx_config); - bsc_gsmnet = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!bsc_gsmnet) exit(1); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index a1becf8..214926b 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -36,6 +36,7 @@ #include #include #include +#include /* global pointer to the gsm network data structure */ extern struct gsm_network *bsc_gsmnet; @@ -481,7 +482,7 @@ int rc; /* initialize our data structures */ - bsc_gsmnet = gsm_network_init(tall_bsc_ctx, 1, 1, mncc_recv); + bsc_gsmnet = bsc_network_init(tall_bsc_ctx, 1, 1, mncc_recv); if (!bsc_gsmnet) return -ENOMEM; diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index da13a52..07a4423 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -17,13 +17,14 @@ * */ +#include #include #include #include #include -struct gsm_network *gsm_network_init(void *ctx, +struct gsm_network *bsc_network_init(void *ctx, uint16_t country_code, uint16_t network_code, mncc_recv_cb_t mncc_recv) diff --git a/openbsc/src/utils/bs11_config.c b/openbsc/src/utils/bs11_config.c index 20b9ed3..ee43a40 100644 --- a/openbsc/src/utils/bs11_config.c +++ b/openbsc/src/utils/bs11_config.c @@ -897,7 +897,7 @@ handle_options(argc, argv); bts_model_bs11_init(); - gsmnet = gsm_network_init(tall_bs11cfg_ctx, 1, 1, NULL); + gsmnet = bsc_network_init(tall_bs11cfg_ctx, 1, 1, NULL); if (!gsmnet) { fprintf(stderr, "Unable to allocate gsm network\n"); exit(1); diff --git a/openbsc/tests/channel/channel_test.c b/openbsc/tests/channel/channel_test.c index b4a5fb1..0c730a2 100644 --- a/openbsc/tests/channel/channel_test.c +++ b/openbsc/tests/channel/channel_test.c @@ -66,7 +66,7 @@ printf("Testing the gsm_subscriber chan logic\n"); /* Create a dummy network */ - network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); if (!network) exit(1); bts = gsm_bts_alloc(network); diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index e81394f..15248f2 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -122,7 +122,7 @@ static inline void test_si2q_u(void) { struct gsm_bts *bts; - struct gsm_network *network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater UARFCN generation:\n"); if (!network) @@ -149,7 +149,7 @@ static inline void test_si2q_e(void) { struct gsm_bts *bts; - struct gsm_network *network = gsm_network_init(tall_bsc_ctx, 1, 1, NULL); + struct gsm_network *network = bsc_network_init(tall_bsc_ctx, 1, 1, NULL); printf("Testing SYSINFO_TYPE_2quater EARFCN generation:\n"); if (!network) -- To view, visit https://gerrit.osmocom.org/1125 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4816ae19374390fc5c64972f7cad2e9ec3d8bcc3 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:46 +0000 Subject: [MERGED] openbsc[master]: define mncc_recv_cb_t to avoid code dup In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: define mncc_recv_cb_t to avoid code dup ...................................................................... define mncc_recv_cb_t to avoid code dup Put mncc_recv_cb_t in common_cs.h to avoid header include complications: if placing right above struct gsm_network, one must include gsm_data.h to use mncc_recv_cb_t as function parameter in a header, which will include gsm_data_shared.h, which will include common_cs.h (future knowledge). Since I will need to use mncc_recv_cb_t in common_cs.h, including gsm_data.h from there would introduce an #include loop. Avoid that and define mncc_recv_cb_t in common_cs.h to begin with. Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c --- M openbsc/include/openbsc/bss.h M openbsc/include/openbsc/common_cs.h M openbsc/include/openbsc/gsm_data.h M openbsc/src/libbsc/bsc_init.c M openbsc/src/libbsc/net_init.c 5 files changed, 13 insertions(+), 7 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/include/openbsc/bss.h b/openbsc/include/openbsc/bss.h index 49df547..d73776f 100644 --- a/openbsc/include/openbsc/bss.h +++ b/openbsc/include/openbsc/bss.h @@ -1,11 +1,12 @@ #ifndef _BSS_H_ #define _BSS_H_ -struct gsm_network; +#include + struct msgb; /* start and stop network */ -extern int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), const char *cfg_file); +extern int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *cfg_file); extern int bsc_shutdown_net(struct gsm_network *net); /* register all supported BTS */ diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h index 6f70f09..612d754 100644 --- a/openbsc/include/openbsc/common_cs.h +++ b/openbsc/include/openbsc/common_cs.h @@ -1 +1,6 @@ #pragma once + +struct msgb; +struct gsm_network; + +typedef int (*mncc_recv_cb_t)(struct gsm_network *, struct msgb *); diff --git a/openbsc/include/openbsc/gsm_data.h b/openbsc/include/openbsc/gsm_data.h index 70c08c3..fe3fa29 100644 --- a/openbsc/include/openbsc/gsm_data.h +++ b/openbsc/include/openbsc/gsm_data.h @@ -14,6 +14,7 @@ #include #include +#include /** annotations for msgb ownership */ #define __uses @@ -308,7 +309,7 @@ /* layer 4 */ struct mncc_sock_state *mncc_state; - int (*mncc_recv) (struct gsm_network *net, struct msgb *msg); + mncc_recv_cb_t mncc_recv; struct llist_head upqueue; struct llist_head trans_list; struct bsc_api *bsc_api; @@ -417,7 +418,7 @@ struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, - int (*mncc_recv)(struct gsm_network *, struct msgb *)); + mncc_recv_cb_t mncc_recv); int gsm_set_bts_type(struct gsm_bts *bts, enum gsm_bts_type type); diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c index bf6e056..a1becf8 100644 --- a/openbsc/src/libbsc/bsc_init.c +++ b/openbsc/src/libbsc/bsc_init.c @@ -475,8 +475,7 @@ return 0; } -int bsc_bootstrap_network(int (*mncc_recv)(struct gsm_network *, struct msgb *), - const char *config_file) +int bsc_bootstrap_network(mncc_recv_cb_t mncc_recv, const char *config_file) { struct gsm_bts *bts; int rc; diff --git a/openbsc/src/libbsc/net_init.c b/openbsc/src/libbsc/net_init.c index 57e3599..da13a52 100644 --- a/openbsc/src/libbsc/net_init.c +++ b/openbsc/src/libbsc/net_init.c @@ -26,7 +26,7 @@ struct gsm_network *gsm_network_init(void *ctx, uint16_t country_code, uint16_t network_code, - int (*mncc_recv)(struct gsm_network *, struct msgb *)) + mncc_recv_cb_t mncc_recv) { struct gsm_network *net; const char *default_regexp = ".*"; -- To view, visit https://gerrit.osmocom.org/1124 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2e64cffa563750ce9f3172ffba6f9cf5b9280e9c Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 11:41:46 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 11:41:46 +0000 Subject: [MERGED] openbsc[master]: Add empty libcommon-cs In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: Add empty libcommon-cs ...................................................................... Add empty libcommon-cs This will gradually soak up code shared by libbsc and libmsc. Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae --- M openbsc/configure.ac M openbsc/include/openbsc/Makefile.am A openbsc/include/openbsc/common_cs.h M openbsc/src/Makefile.am A openbsc/src/libcommon-cs/Makefile.am A openbsc/src/libcommon-cs/common_cs.c A openbsc/src/libcommon-cs/common_cs_vty.c 7 files changed, 62 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/configure.ac b/openbsc/configure.ac index b18ecc1..093d42f 100644 --- a/openbsc/configure.ac +++ b/openbsc/configure.ac @@ -214,6 +214,7 @@ src/libcommon/Makefile src/libfilter/Makefile src/libiu/Makefile + src/libcommon-cs/Makefile src/osmo-nitb/Makefile src/osmo-bsc/Makefile src/osmo-bsc_nat/Makefile diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 5737a4b..d9d8e99 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -13,6 +13,7 @@ bss.h \ bts_ipaccess_nanobts_omlattr.h \ chan_alloc.h \ + common_cs.h \ crc24.h \ ctrl.h \ db.h \ diff --git a/openbsc/include/openbsc/common_cs.h b/openbsc/include/openbsc/common_cs.h new file mode 100644 index 0000000..6f70f09 --- /dev/null +++ b/openbsc/include/openbsc/common_cs.h @@ -0,0 +1 @@ +#pragma once diff --git a/openbsc/src/Makefile.am b/openbsc/src/Makefile.am index 272292a..cfad7df 100644 --- a/openbsc/src/Makefile.am +++ b/openbsc/src/Makefile.am @@ -27,6 +27,7 @@ libmsc \ libtrau \ libfilter \ + libcommon-cs \ $(NULL) # Conditional Libraries diff --git a/openbsc/src/libcommon-cs/Makefile.am b/openbsc/src/libcommon-cs/Makefile.am new file mode 100644 index 0000000..f3921ba --- /dev/null +++ b/openbsc/src/libcommon-cs/Makefile.am @@ -0,0 +1,20 @@ +AM_CPPFLAGS = \ + $(all_includes) \ + -I$(top_srcdir)/include \ + -I$(top_builddir) \ + $(NULL) + +AM_CFLAGS = \ + -Wall \ + $(LIBOSMOCORE_CFLAGS) \ + $(LIBOSMOGSM_CFLAGS) \ + $(LIBOSMOVTY_CFLAGS) \ + $(LIBOSMOABIS_CFLAGS) \ + $(COVERAGE_CFLAGS) \ + $(NULL) + +noinst_LIBRARIES = libcommon-cs.a + +libcommon_cs_a_SOURCES = \ + common_cs.c \ + common_cs_vty.c diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ diff --git a/openbsc/src/libcommon-cs/common_cs_vty.c b/openbsc/src/libcommon-cs/common_cs_vty.c new file mode 100644 index 0000000..99aa0cf --- /dev/null +++ b/openbsc/src/libcommon-cs/common_cs_vty.c @@ -0,0 +1,19 @@ +/* Code used by both libbsc and libmsc (common_cs means "BSC or MSC"). + * + * (C) 2016 by sysmocom s.m.f.c. + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ -- To view, visit https://gerrit.osmocom.org/1123 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If34e2bd38a099d0799238337468d56e0305ab8ae Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 12:36:55 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 25 Nov 2016 12:36:55 +0000 Subject: [PATCH] osmo-bts[master]: octphy: Fixup for multi-trx support Message-ID: Review at https://gerrit.osmocom.org/1277 octphy: Fixup for multi-trx support The header file octphy/octvc1/gsm/octvc1_gsm_default.h is not visible to the configure script when the octphy header files are referenced via --with-octsdr-2g instead having them installed in /usr/local/include. This results in a failed AC_CHECK_MEMBER check for tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn, even if header files with multi-trx support are used. This commit fixes the problem. See also commit: f5494e84e898f947190466d30d5f932bac0fadf9 Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/1277/1 diff --git a/configure.ac b/configure.ac index 1e8a4ec..3fd6b8a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,12 +70,12 @@ AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then - AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [[#include ]]) oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], [#include ]) + AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [#include ]) CPPFLAGS=$oldCPPFLAGS fi -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Nov 25 12:50:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Fri, 25 Nov 2016 12:50:02 +0000 Subject: osmo-bts[master]: octphy: Fixup for multi-trx support In-Reply-To: References: Message-ID: Patch Set 1: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/1277/1//COMMIT_MSG Commit Message: Line 7: octphy: Fixup for multi-trx support summary is too general: instead e.g.: "octphy: multi-trx support: fix AC_CHECK order" Line 16: This commit fixes the problem. by doing what, or, why is this helping? I don't understand yet why changing the order in configure.ac fixes anything (and I don't want to investigate, this log should tell me). -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 25 13:01:16 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 25 Nov 2016 13:01:16 +0000 Subject: [PATCH] osmo-bts[master]: octphy: multi-trx support: fix AC_CHECK order In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1277 to look at the new patch set (#2). octphy: multi-trx support: fix AC_CHECK order The header file octphy/octvc1/gsm/octvc1_gsm_default.h is not visible to the configure script when the octphy header files are referenced via --with-octsdr-2g instead having them installed in /usr/local/include. This results in a failed AC_CHECK_MEMBER check for tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn, even if header files with multi-trx support are used. The configure.ac script manipulates the CPPFLAGS in order to make the octphy include files visible to AC_CHECK_ and restores the original CPPFLAGS when done. This is required when --with-octsdr-2g is used. AC_CHECK_MEMBER is executed before the CPPFLAGS are manipulated. This causes no issues if the headers are properly installed to /usr/local/include, but does not work when --with-octsdr-2g is used. This commit moves the AC_CHECK_MEMBER command into the section where the manipulated CPPFLAGS are valid in order to fix the problem described above See also commit: f5494e84e898f947190466d30d5f932bac0fadf9 Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/77/1277/2 diff --git a/configure.ac b/configure.ac index 1e8a4ec..3fd6b8a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,12 +70,12 @@ AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then - AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [[#include ]]) oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], [#include ]) + AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [#include ]) CPPFLAGS=$oldCPPFLAGS fi -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:27:20 2016 From: gerrit-no-reply at lists.osmocom.org (sivasankari) Date: Fri, 25 Nov 2016 14:27:20 +0000 Subject: [PATCH] osmo-pcu[master]: Add new BTS level counters Message-ID: Review at https://gerrit.osmocom.org/1278 Add new BTS level counters Adds counters for Immediate Assignment Reject, Packet Access Reject, Channel Request Description and Final Block resend. Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7 --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf_dl.cpp 4 files changed, 26 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/78/1278/1 diff --git a/src/bts.cpp b/src/bts.cpp index fe3368d..603da56 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -66,6 +66,7 @@ { "rlc.restarted", "RLC Restarted "}, { "rlc.stalled", "RLC Stalled "}, { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, { "rlc.ass.timedout", "RLC Assign Timeout "}, { "rlc.ass.failed", "RLC Assign Failed "}, { "rlc.ack.timedout", "RLC Ack Timeout "}, @@ -90,8 +91,11 @@ { "rach.requests", "RACH requests "}, { "11bit_rach.requests", "11BIT_RACH requests "}, { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, { "pkt.dl_assignment", "Packet DL Assignment "}, { "ul.control", "UL control Block "}, { "ul.assignment_poll_timeout", "UL Assign Timeout "}, @@ -600,10 +604,12 @@ "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); - if (failure) + if (failure) { plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); + immediate_assignment_reject(); + } else { LOGP(DRLCMAC, LOGL_DEBUG, " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", @@ -1126,6 +1132,8 @@ /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { + bts()->channel_request_description(); + /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), tbf->trx->trx_no, @@ -1235,6 +1243,8 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { + bts()->channel_request_description(); + /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), tbf->trx->trx_no, diff --git a/src/bts.h b/src/bts.h index 33f5483..ac870d5 100644 --- a/src/bts.h +++ b/src/bts.h @@ -243,6 +243,7 @@ CTR_RLC_RESTARTED, CTR_RLC_STALLED, CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, CTR_RLC_ASS_TIMEDOUT, CTR_RLC_ASS_FAILED, CTR_RLC_ACK_TIMEDOUT, @@ -267,8 +268,11 @@ CTR_RACH_REQUESTS, CTR_11BIT_RACH_REQUESTS, CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, CTR_PKT_DL_ASSIGNMENT, CTR_RLC_RECV_CONTROL, CTR_PUA_POLL_TIMEDOUT, @@ -370,6 +374,7 @@ void rlc_restarted(); void rlc_stalled(); void rlc_nacked(); + void rlc_final_block_resent(); void rlc_ass_timedout(); void rlc_ass_failed(); void rlc_ack_timedout(); @@ -394,8 +399,11 @@ void rach_frame(); void rach_frame_11bit(); void immediate_assignment_ul_tbf(); + void immediate_assignment_reject(); void immediate_assignment_dl_tbf(); + void channel_request_description(); void pkt_ul_assignment(); + void pkt_access_reject(); void pkt_dl_assignemnt(); void rlc_rcvd_control(); void pua_poll_timedout(); @@ -563,6 +571,7 @@ CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); @@ -587,8 +596,11 @@ CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); diff --git a/src/tbf.cpp b/src/tbf.cpp index 072d0af..25209e4 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1037,6 +1037,8 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); + bts->pkt_access_reject(); + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); bitvec_free(packet_access_rej); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 185521d..c6f3945 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -454,6 +454,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); + bts->rlc_final_block_resent(); bts->rlc_resent(); } -- To view, visit https://gerrit.osmocom.org/1278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: sivasankari From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:31:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:31:47 +0000 Subject: openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Patch Set 4: Code-Review-1 (2 comments) https://gerrit.osmocom.org/#/c/1268/4/openbsc/contrib/twisted_ipa.py File openbsc/contrib/twisted_ipa.py: Line 36: def ack(self): ping, pong and ACK are part of the CCM protocol, which is one user of the IPA multiplex. I don't think it belongs into the core class for the IPA multiplexer. Line 45: def ctrl_SET(self, data, op, v): control intreface functions/methods are specific to the control interface, which are again a completely different user of the IPA multiplex. Please separete out in an osmocom control protocol specific class. -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 4 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:33:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:33:39 +0000 Subject: openbsc[master]: bsc_control.py: style corrections In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1269 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib79fd4317d40ee4fd87b090b9faf8ebaf4bfca64 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:38:23 2016 From: gerrit-no-reply at lists.osmocom.org (dexter) Date: Fri, 25 Nov 2016 14:38:23 +0000 Subject: [PATCH] openbsc[master]: sndcp: fixup for coverity scan defect CID 149097 Message-ID: Review at https://gerrit.osmocom.org/1279 sndcp: fixup for coverity scan defect CID 149097 Coverity scan detects a Null pointer deref (FORWARD_NULL) in gprs_sndcp_comp.c: 67 in gprs_sndcp_comp_create(). The reason for this is that gprs_sndcp_dcomp_init() and also gprs_sndcp_pcomp_init() rely on the comp_entity->algo algo flag. If the program logic is correct a null pointer deref should never occur. This commit adds OSMO_ASSERT() statements to ensure a null pointer deref is catched if if the ...comp_init() functions are used with incorrect parameters. Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1 --- M openbsc/src/gprs/gprs_sndcp_dcomp.c M openbsc/src/gprs/gprs_sndcp_pcomp.c 2 files changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/79/1279/1 diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/openbsc/src/gprs/gprs_sndcp_dcomp.c index 489106b..b0f95b4 100644 --- a/openbsc/src/gprs/gprs_sndcp_dcomp.c +++ b/openbsc/src/gprs/gprs_sndcp_dcomp.c @@ -84,6 +84,7 @@ if (comp_entity->compclass == SNDCP_XID_DATA_COMPRESSION && comp_entity->algo == V42BIS) { + OSMO_ASSERT(comp_field->v42bis_params); comp_entity->state = v42bis_init(ctx, NULL, comp_field->v42bis_params->p0, comp_field->v42bis_params->p1, diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/openbsc/src/gprs/gprs_sndcp_pcomp.c index 493b263..a2236c3 100644 --- a/openbsc/src/gprs/gprs_sndcp_pcomp.c +++ b/openbsc/src/gprs/gprs_sndcp_pcomp.c @@ -54,6 +54,7 @@ if (comp_entity->compclass == SNDCP_XID_PROTOCOL_COMPRESSION && comp_entity->algo == RFC_1144) { + OSMO_ASSERT(comp_field->rfc1144_params); comp_entity->state = slhc_init(ctx, comp_field->rfc1144_params->s01 + 1, comp_field->rfc1144_params->s01 + 1); -- To view, visit https://gerrit.osmocom.org/1279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:42:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:42:26 +0000 Subject: openbsc[master]: move to libcommon-cs: factor out gen of USSD notify and rele... In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+1 (2 comments) https://gerrit.osmocom.org/#/c/1129/6/openbsc/src/libcommon-cs/common_cs.c File openbsc/src/libcommon-cs/common_cs.c: Line 117: struct msgb *gsm0480_gen_ussdNotify(int level, const char *text) these functions could actually even be part of libosmocore, as they don't reference any gsm_data structures but simply genreate a msgb with something that's specified in gsm 04.80. Line 130: gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); pre-pending the L3 heder seems something shared with other functions, at least with gen_releaseComplete below, so a function with argument for msg_type would make sense. -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:42:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:42:42 +0000 Subject: openbsc[master]: factor out & introduce struct gsm_encr, in common_cs.h In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1130 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I94015fb9dd511c37c1e3058a0963c780b3f700ac Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:43:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:43:29 +0000 Subject: openbsc[master]: sms_next_rp_msg_ref(): use direct pointer to next_rp_ref cou... In-Reply-To: References: Message-ID: Patch Set 6: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:45:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:45:57 +0000 Subject: openbsc[master]: sndcp: fixup for coverity scan defect CID 149097 In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:46:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:46:56 +0000 Subject: osmo-pcu[master]: Add new BTS level counters In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: sivasankari Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 14:47:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 14:47:24 +0000 Subject: osmo-bts[master]: octphy: multi-trx support: fix AC_CHECK order In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Fri Nov 25 16:05:21 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 16:05:21 +0000 Subject: [PATCH] osmo-bts[master]: TRX: prevent segfault upon phy init In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1276 to look at the new patch set (#2). TRX: prevent segfault upon phy init Previously if multiply phy instances were configured but not used osmo-bts-trx would segfault. Terminate with clear error message instead so user can correct configuration. Example configuration which caused problem: ... phy 0 instance 0 instance 1 ... trx 0 phy 0 instance 0 Note the 2nd instance of phy 0 which is not used in trx later on. Change-Id: Id979506731ea92401458f1060e87aeb690901539 --- M src/common/scheduler.c M src/osmo-bts-trx/l1_if.c 2 files changed, 13 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/76/1276/2 diff --git a/src/common/scheduler.c b/src/common/scheduler.c index db1f977..fd5c584 100644 --- a/src/common/scheduler.c +++ b/src/common/scheduler.c @@ -166,6 +166,9 @@ uint8_t tn; unsigned int i; + if (!trx) + return -EINVAL; + l1t->trx = trx; LOGP(DL1C, LOGL_NOTICE, "Init scheduler for trx=%u\n", l1t->trx->nr); diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c index ea2088b..96e2622 100644 --- a/src/osmo-bts-trx/l1_if.c +++ b/src/osmo-bts-trx/l1_if.c @@ -71,19 +71,22 @@ return NULL; l1h->phy_inst = pinst; - trx_sched_init(&l1h->l1s, pinst->trx); + rc = trx_sched_init(&l1h->l1s, pinst->trx); + if (rc < 0) { + LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler for phy " + "instance %d\n", pinst->num); + return NULL; + } rc = trx_if_open(l1h); if (rc < 0) { - LOGP(DL1C, LOGL_FATAL, "Cannot initialize scheduler\n"); - goto err; + LOGP(DL1C, LOGL_FATAL, "Cannot open TRX interface for phy " + "instance %d\n", pinst->num); + l1if_close(l1h); + return NULL; } return l1h; - -err: - l1if_close(l1h); - return NULL; } void l1if_close(struct trx_l1h *l1h) -- To view, visit https://gerrit.osmocom.org/1276 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Id979506731ea92401458f1060e87aeb690901539 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 16:36:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 16:36:18 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplexor In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#5). Add IPA multiplexor Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 271 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/5 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..9259190 --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,271 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.1" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + else: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + (dlen, proto) = struct.unpack(">HB", data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + return dlen, proto, None, data[3:] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def del_header(self, data): + """ + Strip CTRL protocol header while correctly checking and removing extension + Returns data length and the data without header (or None if parsing failed) + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return dlen, None + return dlen, d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val = None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 16:36:18 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 16:36:18 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#5). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 346 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/5 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..d998fba --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,346 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def osmo_CTRL(self, data): + """ + OSMO CTRL protocol + Placeholder, see corresponding derived class + """ + pass + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Placeholder, see corresponding derived class + """ + pass + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class CCM(IPACommon): + """ + Implementation of CCM protocol for IPA multiplex + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + +class CTRL(IPACommon): + """ + Implementation of Osmocom control protocol for IPA multiplex + """ + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + +class IPAServer(CCM): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from CCM + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CCM + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(CTRL): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from CTRL + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CTRL + Send TRAP upon connection + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA app with IPA v%s loaded." % IPA.version) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + #reactor.connectTCP('localhost', 4249, IPAFactory(debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 5 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 16:49:53 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 16:49:53 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#6). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 346 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/6 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..7f1e2d5 --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,346 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def osmo_CTRL(self, data): + """ + OSMO CTRL protocol + Placeholder, see corresponding derived class + """ + pass + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Placeholder, see corresponding derived class + """ + pass + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class CCM(IPACommon): + """ + Implementation of CCM protocol for IPA multiplex + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + +class CTRL(IPACommon): + """ + Implementation of Osmocom control protocol for IPA multiplex + """ + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + +class IPAServer(CCM): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from CCM + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CCM + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(CTRL): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from CTRL + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CTRL + Send TRAP upon connection + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA app with IPA v%s loaded." % IPA.version) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + #reactor.connectTCP('localhost', 4249, IPAFactory(debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(CCM, debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(CCM, debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 17:02:33 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 17:02:33 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplex In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#7). Add IPA multiplex Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 271 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/7 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..060a01c --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,271 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.2" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + return struct.pack(">HB", len(data) + 1, proto) + data + else: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + + def del_header(self, data): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length, IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + (dlen, proto) = struct.unpack(">HB", data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: + return struct.unpack(">HBB", data[:4]) + (data[4:], ) + return dlen, proto, None, data[3:] + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING']) + + def pong(self): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG']) + + def id_ack(self): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK']) + + def id_get(self): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET']) + + def id_resp(self, data): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP']) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL']) + + def del_header(self, data): + """ + Strip CTRL protocol header while correctly checking and removing extension + Returns data length and the data without header (or None if parsing failed) + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return dlen, None + return dlen, d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val)) + + def cmd(self, var, val = None): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val)) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var)) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Fri Nov 25 17:02:33 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Fri, 25 Nov 2016 17:02:33 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#7). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 346 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/7 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..05f1c14 --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,346 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def osmo_CTRL(self, data): + """ + OSMO CTRL protocol + Placeholder, see corresponding derived class + """ + pass + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Placeholder, see corresponding derived class + """ + pass + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class CCM(IPACommon): + """ + Implementation of CCM protocol for IPA multiplex + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + +class CTRL(IPACommon): + """ + Implementation of Osmocom control protocol for IPA multiplex + """ + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + +class IPAServer(CCM): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from CCM + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CCM + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(CTRL): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from CTRL + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CTRL + Send TRAP upon connection + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA %s app with IPA v%s loaded." % ('v0.1', IPA.version)) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + #reactor.connectTCP('localhost', 4249, IPAFactory(debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(CCM, debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(CCM, debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Fri Nov 25 22:51:02 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 22:51:02 +0000 Subject: [PATCH] osmo-bts[master]: vty: Ensure to not use negative (error) sapi value Message-ID: Review at https://gerrit.osmocom.org/1280 vty: Ensure to not use negative (error) sapi value Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4 Fixes: Coverity CID 57617 Fixes: Coverity CID 57618 --- M src/common/vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/80/1280/1 diff --git a/src/common/vty.c b/src/common/vty.c index 85c67a2..607b231 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -869,6 +869,7 @@ int sapi; sapi = get_string_value(gsmtap_sapi_names, argv[0]); + OSMO_ASSERT(sapi >= 0); if (sapi == GSMTAP_CHANNEL_ACCH) gsmtap_sapi_acch = 1; @@ -884,6 +885,7 @@ int sapi; sapi = get_string_value(gsmtap_sapi_names, argv[0]); + OSMO_ASSERT(sapi >= 0); if (sapi == GSMTAP_CHANNEL_ACCH) gsmtap_sapi_acch = 0; -- To view, visit https://gerrit.osmocom.org/1280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 25 23:04:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 23:04:51 +0000 Subject: [PATCH] osmo-iuh[master]: ue_context_alloc(): Avoid ue->imsi without NULL termination Message-ID: Review at https://gerrit.osmocom.org/1281 ue_context_alloc(): Avoid ue->imsi without NULL termination Change-Id: I152e84206e0b2b80fa79956f5adbbe84ff10b4ab Fixes: Coverity CID 57625 --- M src/hnbgw.c 1 file changed, 3 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/81/1281/1 diff --git a/src/hnbgw.c b/src/hnbgw.c index acca643..9984927 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -163,9 +163,10 @@ return NULL; ue->hnb = hnb; - if (imsi) + if (imsi) { strncpy(ue->imsi, imsi, sizeof(ue->imsi)); - else + ue->imsi[sizeof(ue->imsi)-1] = '\0'; + } else ue->imsi[0] = '\0'; ue->tmsi = tmsi; ue->context_id = get_next_ue_ctx_id(hnb->gw); -- To view, visit https://gerrit.osmocom.org/1281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I152e84206e0b2b80fa79956f5adbbe84ff10b4ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 25 23:12:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 23:12:50 +0000 Subject: [PATCH] libosmocore[master]: Fix unchecked return valueof osmo_fd_register() Message-ID: Review at https://gerrit.osmocom.org/1282 Fix unchecked return valueof osmo_fd_register() Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Fixes: Coverity CID 57636 --- M src/gsmtap_util.c 1 file changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/82/1282/1 diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 7a63771..66abdf1 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -333,7 +333,7 @@ */ int gsmtap_source_add_sink(struct gsmtap_inst *gti) { - int fd; + int fd, rc; fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd(gti)); if (fd < 0) @@ -347,7 +347,11 @@ sink_ofd->when = BSC_FD_READ; sink_ofd->cb = gsmtap_sink_fd_cb; - osmo_fd_register(sink_ofd); + rc = osmo_fd_register(sink_ofd); + if (rc < 0) { + close(fd); + return rc; + } } return fd; @@ -368,7 +372,7 @@ int ofd_wq_mode) { struct gsmtap_inst *gti; - int fd; + int fd, rc; fd = gsmtap_source_init_fd(host, port); if (fd < 0) @@ -383,7 +387,11 @@ osmo_wqueue_init(>i->wq, 64); gti->wq.write_cb = &gsmtap_wq_w_cb; - osmo_fd_register(>i->wq.bfd); + rc = osmo_fd_register(>i->wq.bfd); + if (rc < 0) { + close(fd); + return NULL; + } } return gti; -- To view, visit https://gerrit.osmocom.org/1282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Fri Nov 25 23:12:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Fri, 25 Nov 2016 23:12:50 +0000 Subject: [PATCH] libosmocore[master]: telnet_interface: Handle osmo_fd_register() eror return code Message-ID: Review at https://gerrit.osmocom.org/1283 telnet_interface: Handle osmo_fd_register() eror return code Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Fixes: Coverity 57637 --- M src/vty/telnet_interface.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/1283/1 diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index e86a6b1..218f9ab 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -145,6 +145,7 @@ struct sockaddr_in sockaddr; socklen_t len = sizeof(sockaddr); int new_connection = accept(fd->fd, (struct sockaddr*)&sockaddr, &len); + int rc; if (new_connection < 0) { LOGP(0, LOGL_ERROR, "telnet accept failed\n"); @@ -157,7 +158,11 @@ connection->fd.fd = new_connection; connection->fd.when = BSC_FD_READ; connection->fd.cb = client_data; - osmo_fd_register(&connection->fd); + rc = osmo_fd_register(&connection->fd); + if (rc < 0) { + talloc_free(connection); + return rc; + } llist_add_tail(&connection->entry, &active_connections); connection->vty = vty_create(new_connection, connection); -- To view, visit https://gerrit.osmocom.org/1283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 08:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 08:51:24 +0000 Subject: [PATCH] libosmo-abis[master]: input/ipaccess.c: Check return value of osmo_fd_register() Message-ID: Review at https://gerrit.osmocom.org/1284 input/ipaccess.c: Check return value of osmo_fd_register() Change-Id: I81659e0533ceb5d43292d97a63300b500044add7 Fixes: Coverity CID 57630 --- M src/input/ipaccess.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/84/1284/1 diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 1cb541e..35465e3 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -196,7 +196,12 @@ newbfd->priv_nr = E1INP_SIGN_RSL + unit_data.trx_id; osmo_fd_unregister(bfd); bfd->fd = -1; - osmo_fd_register(newbfd); + ret = osmo_fd_register(newbfd); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, + "could not register FD\n"); + goto err; + } /* now we can release the dummy RSL line. */ e1inp_line_put(line); } -- To view, visit https://gerrit.osmocom.org/1284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I81659e0533ceb5d43292d97a63300b500044add7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 08:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 08:51:24 +0000 Subject: [PATCH] libosmo-abis[master]: osmo_rtp_socket_fdreg(): Check return value of osmo_fd_regis... Message-ID: Review at https://gerrit.osmocom.org/1285 osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register() Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Fixes: Coverity CID 57631 --- M src/trau/osmo_ortp.c 1 file changed, 11 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/85/1285/1 diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index e7c6fc4..51829d1 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -211,6 +211,8 @@ static int osmo_rtp_socket_fdreg(struct osmo_rtp_socket *rs) { + int rc; + rs->rtp_bfd.fd = rtp_session_get_rtp_socket(rs->sess); rs->rtcp_bfd.fd = rtp_session_get_rtcp_socket(rs->sess); rs->rtp_bfd.when = rs->rtcp_bfd.when = BSC_FD_READ; @@ -218,8 +220,15 @@ rs->rtp_bfd.cb = osmo_rtp_fd_cb; rs->rtcp_bfd.cb = osmo_rtcp_fd_cb; - osmo_fd_register(&rs->rtp_bfd); - osmo_fd_register(&rs->rtcp_bfd); + rc = osmo_fd_register(&rs->rtp_bfd); + if (rc < 0) + return rc; + + rc = osmo_fd_register(&rs->rtcp_bfd); + if (rc < 0) { + osmo_fd_unregister(&rs->rtp_bfd); + return rc; + } return 0; } -- To view, visit https://gerrit.osmocom.org/1285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 08:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 08:51:24 +0000 Subject: [PATCH] libosmo-abis[master]: fix signed/unsigned bug in ipa_client_conn_open() Message-ID: Review at https://gerrit.osmocom.org/1286 fix signed/unsigned bug in ipa_client_conn_open() If osmo_sock_init() would ever return a negative FD together with errno == EINPROGRESS, we would have attempted to register that negative FD with the select() main loop handling, whihc of course doesn't work. EINPROGRESS for a non-blocking connecting socket is handled inside osmo_sock_init() and would result in it returning a positive FD, so the above case is of theoretical significance only. Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35 Fixes: Coverity CID 57856 --- M src/input/ipa.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/86/1286/1 diff --git a/src/input/ipa.c b/src/input/ipa.c index f90d62c..ce155ce 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -213,10 +213,8 @@ ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, link->addr, link->port, OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_NONBLOCK); - if (ret < 0) { - if (errno != EINPROGRESS) - return ret; - } + if (ret < 0) + return ret; link->ofd->fd = ret; link->ofd->when |= BSC_FD_WRITE; if (osmo_fd_register(link->ofd) < 0) { -- To view, visit https://gerrit.osmocom.org/1286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 08:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 08:51:24 +0000 Subject: [PATCH] libosmo-abis[master]: call strerror() not on negative value Message-ID: Review at https://gerrit.osmocom.org/1287 call strerror() not on negative value Change-Id: I0ba1eab49f93d9b34d162682f2528d106b56d6d6 Fixes: Coverity CID 57857 --- M src/input/misdn.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/87/1287/1 diff --git a/src/input/misdn.c b/src/input/misdn.c index f72b496..9315e23 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -691,7 +691,7 @@ ret = osmo_fd_register(bfd); if (ret < 0) { fprintf(stderr, "could not register FD: %s\n", - strerror(ret)); + strerror(-ret)); return ret; } } -- To view, visit https://gerrit.osmocom.org/1287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0ba1eab49f93d9b34d162682f2528d106b56d6d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 08:51:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 08:51:24 +0000 Subject: [PATCH] libosmo-abis[master]: don't pass negative error to strerror() Message-ID: Review at https://gerrit.osmocom.org/1288 don't pass negative error to strerror() Change-Id: I48c25c78148d1fe9ce4e4a88cdfe5cf74dc95b17 Fixes: Coverity CID 57858 --- M src/input/rs232.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-abis refs/changes/88/1288/1 diff --git a/src/input/rs232.c b/src/input/rs232.c index 2fd2a09..9da01a3 100644 --- a/src/input/rs232.c +++ b/src/input/rs232.c @@ -270,7 +270,7 @@ if (rc < 0) { close(bfd->fd); LOGP(DLMI, LOGL_ERROR, "rs232: could not register FD: %s\n", - strerror(rc)); + strerror(-rc)); return rc; } -- To view, visit https://gerrit.osmocom.org/1288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I48c25c78148d1fe9ce4e4a88cdfe5cf74dc95b17 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:18 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:18 +0000 Subject: libosmo-abis[master]: input/ipaccess.c: Check return value of osmo_fd_register() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I81659e0533ceb5d43292d97a63300b500044add7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:26 +0000 Subject: libosmo-abis[master]: osmo_rtp_socket_fdreg(): Check return value of osmo_fd_regis... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:28 +0000 Subject: libosmo-abis[master]: fix signed/unsigned bug in ipa_client_conn_open() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:30 +0000 Subject: libosmo-abis[master]: call strerror() not on negative value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0ba1eab49f93d9b34d162682f2528d106b56d6d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:33 +0000 Subject: libosmo-abis[master]: don't pass negative error to strerror() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I48c25c78148d1fe9ce4e4a88cdfe5cf74dc95b17 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:37 +0000 Subject: [MERGED] libosmo-abis[master]: don't pass negative error to strerror() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: don't pass negative error to strerror() ...................................................................... don't pass negative error to strerror() Change-Id: I48c25c78148d1fe9ce4e4a88cdfe5cf74dc95b17 Fixes: Coverity CID 57858 --- M src/input/rs232.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/rs232.c b/src/input/rs232.c index 2fd2a09..9da01a3 100644 --- a/src/input/rs232.c +++ b/src/input/rs232.c @@ -270,7 +270,7 @@ if (rc < 0) { close(bfd->fd); LOGP(DLMI, LOGL_ERROR, "rs232: could not register FD: %s\n", - strerror(rc)); + strerror(-rc)); return rc; } -- To view, visit https://gerrit.osmocom.org/1288 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I48c25c78148d1fe9ce4e4a88cdfe5cf74dc95b17 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:37 +0000 Subject: [MERGED] libosmo-abis[master]: call strerror() not on negative value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: call strerror() not on negative value ...................................................................... call strerror() not on negative value Change-Id: I0ba1eab49f93d9b34d162682f2528d106b56d6d6 Fixes: Coverity CID 57857 --- M src/input/misdn.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/misdn.c b/src/input/misdn.c index f72b496..9315e23 100644 --- a/src/input/misdn.c +++ b/src/input/misdn.c @@ -691,7 +691,7 @@ ret = osmo_fd_register(bfd); if (ret < 0) { fprintf(stderr, "could not register FD: %s\n", - strerror(ret)); + strerror(-ret)); return ret; } } -- To view, visit https://gerrit.osmocom.org/1287 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0ba1eab49f93d9b34d162682f2528d106b56d6d6 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:38 +0000 Subject: [MERGED] libosmo-abis[master]: fix signed/unsigned bug in ipa_client_conn_open() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix signed/unsigned bug in ipa_client_conn_open() ...................................................................... fix signed/unsigned bug in ipa_client_conn_open() If osmo_sock_init() would ever return a negative FD together with errno == EINPROGRESS, we would have attempted to register that negative FD with the select() main loop handling, whihc of course doesn't work. EINPROGRESS for a non-blocking connecting socket is handled inside osmo_sock_init() and would result in it returning a positive FD, so the above case is of theoretical significance only. Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35 Fixes: Coverity CID 57856 --- M src/input/ipa.c 1 file changed, 2 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/ipa.c b/src/input/ipa.c index f90d62c..ce155ce 100644 --- a/src/input/ipa.c +++ b/src/input/ipa.c @@ -213,10 +213,8 @@ ret = osmo_sock_init(AF_INET, SOCK_STREAM, IPPROTO_TCP, link->addr, link->port, OSMO_SOCK_F_CONNECT|OSMO_SOCK_F_NONBLOCK); - if (ret < 0) { - if (errno != EINPROGRESS) - return ret; - } + if (ret < 0) + return ret; link->ofd->fd = ret; link->ofd->when |= BSC_FD_WRITE; if (osmo_fd_register(link->ofd) < 0) { -- To view, visit https://gerrit.osmocom.org/1286 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Id01eb0d48eea6cab1fbc720c52361101b8ea4e35 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:38 +0000 Subject: [MERGED] libosmo-abis[master]: osmo_rtp_socket_fdreg(): Check return value of osmo_fd_regis... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register() ...................................................................... osmo_rtp_socket_fdreg(): Check return value of osmo_fd_register() Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Fixes: Coverity CID 57631 --- M src/trau/osmo_ortp.c 1 file changed, 11 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/trau/osmo_ortp.c b/src/trau/osmo_ortp.c index e7c6fc4..51829d1 100644 --- a/src/trau/osmo_ortp.c +++ b/src/trau/osmo_ortp.c @@ -211,6 +211,8 @@ static int osmo_rtp_socket_fdreg(struct osmo_rtp_socket *rs) { + int rc; + rs->rtp_bfd.fd = rtp_session_get_rtp_socket(rs->sess); rs->rtcp_bfd.fd = rtp_session_get_rtcp_socket(rs->sess); rs->rtp_bfd.when = rs->rtcp_bfd.when = BSC_FD_READ; @@ -218,8 +220,15 @@ rs->rtp_bfd.cb = osmo_rtp_fd_cb; rs->rtcp_bfd.cb = osmo_rtcp_fd_cb; - osmo_fd_register(&rs->rtp_bfd); - osmo_fd_register(&rs->rtcp_bfd); + rc = osmo_fd_register(&rs->rtp_bfd); + if (rc < 0) + return rc; + + rc = osmo_fd_register(&rs->rtcp_bfd); + if (rc < 0) { + osmo_fd_unregister(&rs->rtp_bfd); + return rc; + } return 0; } -- To view, visit https://gerrit.osmocom.org/1285 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4969e0a9e7109d426066e6c2b80ed44c396b65b5 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:38 +0000 Subject: [MERGED] libosmo-abis[master]: input/ipaccess.c: Check return value of osmo_fd_register() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: input/ipaccess.c: Check return value of osmo_fd_register() ...................................................................... input/ipaccess.c: Check return value of osmo_fd_register() Change-Id: I81659e0533ceb5d43292d97a63300b500044add7 Fixes: Coverity CID 57630 --- M src/input/ipaccess.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c index 1cb541e..35465e3 100644 --- a/src/input/ipaccess.c +++ b/src/input/ipaccess.c @@ -196,7 +196,12 @@ newbfd->priv_nr = E1INP_SIGN_RSL + unit_data.trx_id; osmo_fd_unregister(bfd); bfd->fd = -1; - osmo_fd_register(newbfd); + ret = osmo_fd_register(newbfd); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, + "could not register FD\n"); + goto err; + } /* now we can release the dummy RSL line. */ e1inp_line_put(line); } -- To view, visit https://gerrit.osmocom.org/1284 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I81659e0533ceb5d43292d97a63300b500044add7 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-abis Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:50 +0000 Subject: libosmocore[master]: telnet_interface: Handle osmo_fd_register() eror return code In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:52 +0000 Subject: libosmocore[master]: Fix unchecked return valueof osmo_fd_register() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:08:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:08:58 +0000 Subject: [MERGED] libosmocore[master]: Fix unchecked return valueof osmo_fd_register() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix unchecked return valueof osmo_fd_register() ...................................................................... Fix unchecked return valueof osmo_fd_register() Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Fixes: Coverity CID 57636 --- M src/gsmtap_util.c 1 file changed, 12 insertions(+), 4 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsmtap_util.c b/src/gsmtap_util.c index 7a63771..66abdf1 100644 --- a/src/gsmtap_util.c +++ b/src/gsmtap_util.c @@ -333,7 +333,7 @@ */ int gsmtap_source_add_sink(struct gsmtap_inst *gti) { - int fd; + int fd, rc; fd = gsmtap_source_add_sink_fd(gsmtap_inst_fd(gti)); if (fd < 0) @@ -347,7 +347,11 @@ sink_ofd->when = BSC_FD_READ; sink_ofd->cb = gsmtap_sink_fd_cb; - osmo_fd_register(sink_ofd); + rc = osmo_fd_register(sink_ofd); + if (rc < 0) { + close(fd); + return rc; + } } return fd; @@ -368,7 +372,7 @@ int ofd_wq_mode) { struct gsmtap_inst *gti; - int fd; + int fd, rc; fd = gsmtap_source_init_fd(host, port); if (fd < 0) @@ -383,7 +387,11 @@ osmo_wqueue_init(>i->wq, 64); gti->wq.write_cb = &gsmtap_wq_w_cb; - osmo_fd_register(>i->wq.bfd); + rc = osmo_fd_register(>i->wq.bfd); + if (rc < 0) { + close(fd); + return NULL; + } } return gti; -- To view, visit https://gerrit.osmocom.org/1282 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib040a7f94eb1bbec8270b66fd4c2aedef9d5346a Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:21 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:21 +0000 Subject: [PATCH] libosmocore[master]: osmo_sock_init(): Fix memory leak in error path Message-ID: Review at https://gerrit.osmocom.org/1297 osmo_sock_init(): Fix memory leak in error path We forgot to call freeaddrinfo() in an error path. Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Fixes: Coverity CID 135217 --- M src/socket.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/97/1297/1 diff --git a/src/socket.c b/src/socket.c index 19c513a..cdafadd 100644 --- a/src/socket.c +++ b/src/socket.c @@ -118,6 +118,7 @@ " %s:%u: %s\n", host, port, strerror(errno)); close(sfd); + freeaddrinfo(result); return -EINVAL; } } -- To view, visit https://gerrit.osmocom.org/1297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:22 +0000 Subject: [PATCH] libosmocore[master]: vty/vty.c: Check return value of tc{get, set}attr() calls Message-ID: Review at https://gerrit.osmocom.org/1298 vty/vty.c: Check return value of tc{get,set}attr() calls Change-Id: I488ebf882ea12d5f9136563234c0da1018ea2ccd Fixes: Coverity CID 57638 --- M src/vty/vty.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/98/1298/1 diff --git a/src/vty/vty.c b/src/vty/vty.c index 88ed937..31e0a17 100644 --- a/src/vty/vty.c +++ b/src/vty/vty.c @@ -1489,10 +1489,15 @@ struct vty *vty; struct termios t; + int rc; - tcgetattr(vty_sock, &t); + rc = tcgetattr(vty_sock, &t); + if (rc < 0) + return NULL; cfmakeraw(&t); tcsetattr(vty_sock, TCSANOW, &t); + if (rc < 0) + return NULL; /* Allocate new vty structure and set up default values. */ vty = vty_new (); -- To view, visit https://gerrit.osmocom.org/1298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I488ebf882ea12d5f9136563234c0da1018ea2ccd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:22 +0000 Subject: [PATCH] libosmocore[master]: osmo-sim-test.c: Fix rmsg check Message-ID: Review at https://gerrit.osmocom.org/1299 osmo-sim-test.c: Fix rmsg check we wanted to check for !rmsg, but used to check for !msg, missing error returns from read_record_nr(). Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Fixes: Coverity CID 57672 --- M utils/osmo-sim-test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/99/1299/1 diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index e861748..7b79c58 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -334,7 +334,7 @@ case EF_TYPE_RECORD_FIXED: for (i = 0; i < ffdd.num_rec; i++) { rmsg = read_record_nr(chan, i+1, ffdd.rec_len); - if (!msg) + if (!rmsg) return -EIO; printf("SW: %s\n", osim_print_sw(chan->card, msgb_apdu_sw(msg))); printf("Rec %03u: %s\n", i+1, -- To view, visit https://gerrit.osmocom.org/1299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:22 +0000 Subject: [PATCH] libosmocore[master]: ctrl_cmd_parse: Make coverity FORWARD_NULL happy Message-ID: Review at https://gerrit.osmocom.org/1300 ctrl_cmd_parse: Make coverity FORWARD_NULL happy The 'strtok_r' function requires passing a NULL as the first parameter on subsequent calls in order to ensure the code picks up where it left off on a previous call. However, Coverity doesn't quite realize this and points out that if a NULL was passed in as the third argument it would result in a possible NULL deref because the strtok_r function will assign the third argument to the first in the call is NULL. Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Fixes: Coverity CID 135186 --- M src/ctrl/control_cmd.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/00/1300/1 diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 3dbcf8f..2cf66cf 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -299,6 +299,7 @@ msgb_put_u8(msg, 0); str = (char *) msg->l2h; + OSMO_ASSERT(str); tmp = strtok_r(str, " ", &saveptr); if (!tmp) { cmd->type = CTRL_TYPE_ERROR; -- To view, visit https://gerrit.osmocom.org/1300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:22 +0000 Subject: [PATCH] libosmocore[master]: osmo_gsup_encode(): Make coverity happy by invariant checking Message-ID: Review at https://gerrit.osmocom.org/1301 osmo_gsup_encode(): Make coverity happy by invariant checking gsm48_encode_bcd_number() can theoretically return a length in excess of the size of the bcd_buf, but only in case an overly-long IMSI is passed into the function (which would be illegal in the first place). Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Fixes: Coverity CID 135216 --- M src/gsm/gsup.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/01/1301/1 diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index d6b4975..c90244a 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -442,6 +442,7 @@ gsup_msg->imsi); OSMO_ASSERT(bcd_len > 1); + OSMO_ASSERT(bcd_len <= sizeof(bcd_buf)); /* Note that gsm48_encode_bcd_number puts the length into the first * octet. Since msgb_tlv_put will add this length byte, we'll have to -- To view, visit https://gerrit.osmocom.org/1301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:24:54 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:24:54 +0000 Subject: osmo-iuh[master]: ue_context_alloc(): Avoid ue->imsi without NULL termination In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I152e84206e0b2b80fa79956f5adbbe84ff10b4ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:12 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:12 +0000 Subject: osmo-bts[master]: vty: Ensure to not use negative (error) sapi value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:28 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:28 +0000 Subject: libosmocore[master]: osmo_sock_init(): Fix memory leak in error path In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:36 +0000 Subject: libosmocore[master]: vty/vty.c: Check return value of tc{get, set}attr() calls In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1298 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I488ebf882ea12d5f9136563234c0da1018ea2ccd Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:40 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:40 +0000 Subject: libosmocore[master]: osmo-sim-test.c: Fix rmsg check In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:43 +0000 Subject: libosmocore[master]: ctrl_cmd_parse: Make coverity FORWARD_NULL happy In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:25:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:25:47 +0000 Subject: libosmocore[master]: osmo_gsup_encode(): Make coverity happy by invariant checking In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:45:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:45:24 +0000 Subject: [PATCH] libosmocore[master]: Introudce osmo_strlcpy() function so we can stop using strnc... Message-ID: Review at https://gerrit.osmocom.org/1302 Introudce osmo_strlcpy() function so we can stop using strncpy() I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/1302/1 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 01d5520..3c6fc98 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -82,4 +82,6 @@ uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); +size_t osmo_strlcpy(char *dst, const char *src, size_t siz); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 4a54802..1bb2be8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -339,3 +339,25 @@ return buf; } /*! @} */ + +/*! \brief Copy a C-string into a sized buffer + * \param[in] src source string + * \param[out] dst destination string + * \param[in] siz size of the \a dst string + * \returns length of source string + * + * Copies up to \a siz characters from \a src to \a dst, but ensures + * that the last character of \a dst is always a NUL character. May + * truncate \a src to do achieve this. + */ +size_t osmo_strlcpy(char *dst, const char *src, size_t siz) +{ + size_t ret = strlen(src); + + if (siz) { + size_t len = (ret >= siz) ? siz - 1 : ret; + memcpy(dst, src, len); + dst[len] = '\0'; + } + return ret; +} -- To view, visit https://gerrit.osmocom.org/1302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:48:25 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:48:25 +0000 Subject: [MERGED] libosmocore[master]: osmo_sock_init(): Fix memory leak in error path In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_sock_init(): Fix memory leak in error path ...................................................................... osmo_sock_init(): Fix memory leak in error path We forgot to call freeaddrinfo() in an error path. Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Fixes: Coverity CID 135217 --- M src/socket.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/socket.c b/src/socket.c index 19c513a..cdafadd 100644 --- a/src/socket.c +++ b/src/socket.c @@ -118,6 +118,7 @@ " %s:%u: %s\n", host, port, strerror(errno)); close(sfd); + freeaddrinfo(result); return -EINVAL; } } -- To view, visit https://gerrit.osmocom.org/1297 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iccbd3beef4c4a70dc443131b909c45e650d8c6a2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 09:48:26 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 09:48:26 +0000 Subject: [MERGED] libosmocore[master]: telnet_interface: Handle osmo_fd_register() eror return code In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: telnet_interface: Handle osmo_fd_register() eror return code ...................................................................... telnet_interface: Handle osmo_fd_register() eror return code Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Fixes: Coverity 57637 --- M src/vty/telnet_interface.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/vty/telnet_interface.c b/src/vty/telnet_interface.c index e86a6b1..218f9ab 100644 --- a/src/vty/telnet_interface.c +++ b/src/vty/telnet_interface.c @@ -145,6 +145,7 @@ struct sockaddr_in sockaddr; socklen_t len = sizeof(sockaddr); int new_connection = accept(fd->fd, (struct sockaddr*)&sockaddr, &len); + int rc; if (new_connection < 0) { LOGP(0, LOGL_ERROR, "telnet accept failed\n"); @@ -157,7 +158,11 @@ connection->fd.fd = new_connection; connection->fd.when = BSC_FD_READ; connection->fd.cb = client_data; - osmo_fd_register(&connection->fd); + rc = osmo_fd_register(&connection->fd); + if (rc < 0) { + talloc_free(connection); + return rc; + } llist_add_tail(&connection->entry, &active_connections); connection->vty = vty_create(new_connection, connection); -- To view, visit https://gerrit.osmocom.org/1283 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5bc1c2cbb04e363d868355b5ed866b4840f16c61 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 12:02:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 12:02:15 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw_rua: reject invalid domain indicator Message-ID: Review at https://gerrit.osmocom.org/1303 hnbgw_rua: reject invalid domain indicator Fixes: CID#135226, CID#135227 Change-Id: I0c44179aac02772585214e528207e959ad168f3c --- M src/hnbgw_rua.c 1 file changed, 14 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/03/1303/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 3f245b5..ca745b1 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -347,6 +347,11 @@ case RUA_CN_DomainIndicator_ps_domain: cn = hnb->gw->cnlink_ps; break; + default: + LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n", + ies.cN_DomainIndicator); + rc = -1; + goto error_free; } if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { @@ -356,6 +361,8 @@ rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT, context_id, scu_cause, ranap_data, ranap_len); + +error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_disconnecties(&ies); @@ -386,11 +393,18 @@ case RUA_CN_DomainIndicator_ps_domain: cn = hnb->gw->cnlink_ps; break; + default: + LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n", + ies.cN_DomainIndicator); + rc = -1; + goto error_free; } rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DATA, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); + +error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_directtransferies(&ies); -- To view, visit https://gerrit.osmocom.org/1303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I0c44179aac02772585214e528207e959ad168f3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 12:02:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 12:02:15 +0000 Subject: [PATCH] osmo-iuh[master]: fix error rc in various ASN.1 decoding functions Message-ID: Review at https://gerrit.osmocom.org/1304 fix error rc in various ASN.1 decoding functions Fixes: CID#57945, CID#57946, CID#57947, CID#57948, CID#57950, CID#57951 Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898 --- M src/hnbgw_cn.c M src/hnbgw_hnbap.c M src/hnbgw_ranap.c M src/hnbgw_rua.c M src/ranap_common_cn.c 5 files changed, 6 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/04/1304/1 diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index f97f627..0e993e2 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -235,7 +235,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } rc = _cn_ranap_rx(cnlink, pdu, data, len); diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 59150c9..0473482 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -568,7 +568,7 @@ msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DHNBAP, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_hnbap_rx(hnb, pdu); diff --git a/src/hnbgw_ranap.c b/src/hnbgw_ranap.c index 7a505a5..7fd6d0a 100644 --- a/src/hnbgw_ranap.c +++ b/src/hnbgw_ranap.c @@ -218,7 +218,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_ranap_rx(msg->dst, pdu); diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index ca745b1..2c34421 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -537,7 +537,7 @@ msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRUA, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_rua_rx(msg, pdu); diff --git a/src/ranap_common_cn.c b/src/ranap_common_cn.c index 3736dce..d02eb37 100644 --- a/src/ranap_common_cn.c +++ b/src/ranap_common_cn.c @@ -296,7 +296,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } message.direction = pdu->present; @@ -525,7 +525,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } message.direction = pdu->present; -- To view, visit https://gerrit.osmocom.org/1304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 12:02:16 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 12:02:16 +0000 Subject: [PATCH] osmo-iuh[master]: hnbgw: rua rx: fix rc and log unhandled Private Msg Message-ID: Review at https://gerrit.osmocom.org/1305 hnbgw: rua rx: fix rc and log unhandled Private Msg Fixes: CID#57949 Change-Id: I822888a3cf450e2787fc352e0352aed92236ddb7 --- M src/hnbgw_rua.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/05/1305/1 diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 2c34421..0ca64d3 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -475,6 +475,9 @@ rc = rua_rx_init_err_ind(msg, &imsg->value); break; case RUA_ProcedureCode_id_privateMessage: + LOGP(DRUA, LOGL_NOTICE, + "Unhandled: RUA Initiating Msg: Private Msg\n"); + rc = 0; break; default: LOGP(DRUA, LOGL_NOTICE, "Unknown RUA Procedure %u\n", -- To view, visit https://gerrit.osmocom.org/1305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I822888a3cf450e2787fc352e0352aed92236ddb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 12:51:03 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 12:51:03 +0000 Subject: [PATCH] openbsc[master]: IuPS: properly update ra_id on GMM Attach Request Message-ID: Review at https://gerrit.osmocom.org/1306 IuPS: properly update ra_id on GMM Attach Request For new MM contexts, the ra_id was correctly obtained from the ue_ctx, but in case an MM ctx is re-used and the ra_id changed, the new ra_id was not copied to the MM context; instead, the ra_id was overwritten with uninitialized data. Always initialize the local ra_id variable from the ue_ctx->ra_id for Iu connections; it is used further below to update the ctx->ra_id. For the case of a brand new Iu MM ctx, the ctx->ra_id then gets initialized a second time. We could technically drop the init in sgsn_mm_ctx_alloc_iu(), but it doesn't hurt either way. Fixes: CID#57936 Change-Id: Ia06458758362e76925690b1757d8ced95e9609e4 --- M openbsc/src/gprs/gprs_gmm.c 1 file changed, 2 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/06/1306/1 diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c index 1fc2784..363b457 100644 --- a/openbsc/src/gprs/gprs_gmm.c +++ b/openbsc/src/gprs/gprs_gmm.c @@ -65,10 +65,7 @@ #include #include #include - -#ifdef BUILD_IU #include -#endif #include @@ -1076,7 +1073,8 @@ if (!msg->dst) { /* Gb mode */ cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); - } + } else + ra_id = ((struct ue_conn_ctx*)msg->dst)->ra_id; /* MS network capability 10.5.5.12 */ msnc_len = *cur++; -- To view, visit https://gerrit.osmocom.org/1306 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia06458758362e76925690b1757d8ced95e9609e4 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 12:57:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 12:57:14 +0000 Subject: [PATCH] libosmo-netif[master]: examples/stream-server.c: use read() rc instead of strlen() Message-ID: Review at https://gerrit.osmocom.org/1307 examples/stream-server.c: use read() rc instead of strlen() Fixes: CID#57922 Change-Id: Ibaafdd49d9446a12fe7d0e2f5b2039da3ffc7ea9 --- M examples/stream-server.c 1 file changed, 4 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/07/1307/1 diff --git a/examples/stream-server.c b/examples/stream-server.c index 82fb20a..c1bfd66 100644 --- a/examples/stream-server.c +++ b/examples/stream-server.c @@ -93,6 +93,8 @@ int ret; ret = read(STDIN_FILENO, buf, sizeof(buf)); + if (ret < 1) + return 0; LOGP(DSTREAMTEST, LOGL_NOTICE, "read %d byte from keyboard\n", ret); @@ -106,8 +108,8 @@ LOGP(DSTREAMTEST, LOGL_ERROR, "cannot allocate message\n"); return 0; } - ptr = msgb_put(msg, strlen(buf)); - memcpy(ptr, buf, strlen(buf)); + ptr = msgb_put(msg, ret); + memcpy(ptr, buf, ret); osmo_stream_srv_send(conn, msg); LOGP(DSTREAMTEST, LOGL_NOTICE, "message of %d bytes sent\n", msg->len); -- To view, visit https://gerrit.osmocom.org/1307 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibaafdd49d9446a12fe7d0e2f5b2039da3ffc7ea9 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:03:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:03:19 +0000 Subject: [PATCH] libosmocore[master]: Introduce osmo_strlcpy() function so we can stop using strnc... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1302 to look at the new patch set (#2). Introduce osmo_strlcpy() function so we can stop using strncpy() I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 24 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/02/1302/2 diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 01d5520..3c6fc98 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -82,4 +82,6 @@ uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); +size_t osmo_strlcpy(char *dst, const char *src, size_t siz); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 4a54802..1bb2be8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -339,3 +339,25 @@ return buf; } /*! @} */ + +/*! \brief Copy a C-string into a sized buffer + * \param[in] src source string + * \param[out] dst destination string + * \param[in] siz size of the \a dst string + * \returns length of source string + * + * Copies up to \a siz characters from \a src to \a dst, but ensures + * that the last character of \a dst is always a NUL character. May + * truncate \a src to do achieve this. + */ +size_t osmo_strlcpy(char *dst, const char *src, size_t siz) +{ + size_t ret = strlen(src); + + if (siz) { + size_t len = (ret >= siz) ? siz - 1 : ret; + memcpy(dst, src, len); + dst[len] = '\0'; + } + return ret; +} -- To view, visit https://gerrit.osmocom.org/1302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:03:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:03:31 +0000 Subject: [MERGED] osmo-iuh[master]: ue_context_alloc(): Avoid ue->imsi without NULL termination In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ue_context_alloc(): Avoid ue->imsi without NULL termination ...................................................................... ue_context_alloc(): Avoid ue->imsi without NULL termination Change-Id: I152e84206e0b2b80fa79956f5adbbe84ff10b4ab Fixes: Coverity CID 57625 --- M src/hnbgw.c 1 file changed, 3 insertions(+), 2 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw.c b/src/hnbgw.c index acca643..9984927 100644 --- a/src/hnbgw.c +++ b/src/hnbgw.c @@ -163,9 +163,10 @@ return NULL; ue->hnb = hnb; - if (imsi) + if (imsi) { strncpy(ue->imsi, imsi, sizeof(ue->imsi)); - else + ue->imsi[sizeof(ue->imsi)-1] = '\0'; + } else ue->imsi[0] = '\0'; ue->tmsi = tmsi; ue->context_id = get_next_ue_ctx_id(hnb->gw); -- To view, visit https://gerrit.osmocom.org/1281 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I152e84206e0b2b80fa79956f5adbbe84ff10b4ab Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:03:39 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:03:39 +0000 Subject: [MERGED] osmo-bts[master]: vty: Ensure to not use negative (error) sapi value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: vty: Ensure to not use negative (error) sapi value ...................................................................... vty: Ensure to not use negative (error) sapi value Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4 Fixes: Coverity CID 57617 Fixes: Coverity CID 57618 --- M src/common/vty.c 1 file changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/common/vty.c b/src/common/vty.c index 85c67a2..607b231 100644 --- a/src/common/vty.c +++ b/src/common/vty.c @@ -869,6 +869,7 @@ int sapi; sapi = get_string_value(gsmtap_sapi_names, argv[0]); + OSMO_ASSERT(sapi >= 0); if (sapi == GSMTAP_CHANNEL_ACCH) gsmtap_sapi_acch = 1; @@ -884,6 +885,7 @@ int sapi; sapi = get_string_value(gsmtap_sapi_names, argv[0]); + OSMO_ASSERT(sapi >= 0); if (sapi == GSMTAP_CHANNEL_ACCH) gsmtap_sapi_acch = 0; -- To view, visit https://gerrit.osmocom.org/1280 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:35 +0000 Subject: [PATCH] openbsc[master]: abis_nm: Fix possible not-null-terminated buffer Message-ID: Review at https://gerrit.osmocom.org/1308 abis_nm: Fix possible not-null-terminated buffer Unrealistic case with file name of 4096 bytes length. Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Fixes: Coverity CID 57619 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/08/1308/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 3289b3c..fb6a957 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2305,6 +2305,7 @@ bs11_sw->forced = forced; strncpy(bs11_sw->swl_fname, fname, sizeof(bs11_sw->swl_fname)); + bs11_sw->swl_fname[sizeof(bs11_sw->swl_fname)-1] = '\0'; rc = bs11_read_swl_file(bs11_sw); if (rc < 0) return rc; -- To view, visit https://gerrit.osmocom.org/1308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: abis_nm: Fix non-null terminated buffer Message-ID: Review at https://gerrit.osmocom.org/1309 abis_nm: Fix non-null terminated buffer Unrealistic case (filename of 4096 bytes) Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Fixes: Coverity CID 57620 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/09/1309/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index fb6a957..c9b2aac 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2234,6 +2234,7 @@ /* construct new filename */ strncpy(dir, bs11_sw->swl_fname, sizeof(dir)); + dir[sizeof(dir)-1] = '\0'; strncat(fle->fname, dirname(dir), sizeof(fle->fname) - 1); strcat(fle->fname, "/"); strncat(fle->fname, file_id, sizeof(fle->fname) - 1 -strlen(fle->fname)); -- To view, visit https://gerrit.osmocom.org/1309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: libmsc/db: avoid subscr->name without terminating NULL char Message-ID: Review at https://gerrit.osmocom.org/1310 libmsc/db: avoid subscr->name without terminating NULL char Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Fixes: Coverity CID 57621 --- M openbsc/src/libmsc/db.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/10/1310/1 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 68eba3e..5cccb32 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -831,8 +831,10 @@ subscr->tmsi = tmsi_from_string(string); string = dbi_result_get_string(result, "name"); - if (string) + if (string) { strncpy(subscr->name, string, GSM_NAME_LENGTH); + subscr->name[sizeof(subscr->name)-1] = '\0'; + } string = dbi_result_get_string(result, "extension"); if (string) -- To view, visit https://gerrit.osmocom.org/1310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: libmsc/db: Prevent subscr->extension without NULL termination Message-ID: Review at https://gerrit.osmocom.org/1311 libmsc/db: Prevent subscr->extension without NULL termination Change-Id: Ic1ae7b2d9dde8dab8f7795e5baa8918424f5f393 Fixes: Coverity CID 57622 --- M openbsc/src/libmsc/db.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/11/1311/1 diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 5cccb32..c212fcd 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -837,8 +837,10 @@ } string = dbi_result_get_string(result, "extension"); - if (string) + if (string) { strncpy(subscr->extension, string, GSM_EXTENSION_LENGTH); + subscr->extension[sizeof(subscr->extension)-1] = '\0'; + } subscr->lac = dbi_result_get_ulonglong(result, "lac"); -- To view, visit https://gerrit.osmocom.org/1311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ic1ae7b2d9dde8dab8f7795e5baa8918424f5f393 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: Fix possible non-null-terminated buffer Message-ID: Review at https://gerrit.osmocom.org/1312 Fix possible non-null-terminated buffer Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca Fixes: Coverity CID 57623 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/12/1312/1 diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 6f0006c..0b360b8 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -568,6 +568,7 @@ } strncpy(subscr->name, name, sizeof(subscr->name)); + subscr->name[sizeof(subscr->name)-1] = '\0'; talloc_free(name); db_sync_subscriber(subscr); -- To view, visit https://gerrit.osmocom.org/1312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: ipaccess-config: Handle setsockopt return value Message-ID: Review at https://gerrit.osmocom.org/1313 ipaccess-config: Handle setsockopt return value Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Fixes: Coverity CID 57640 --- M openbsc/src/ipaccess/ipaccess-config.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/13/1313/1 diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 3c2d6cc..150a1a0 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -108,7 +108,12 @@ return -EIO; } - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, "could not set socket option\n"); + close(bfd->fd); + return -EIO; + } ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/1313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:36 +0000 Subject: [PATCH] openbsc[master]: ipaccess-proxy: Check setsockopt() return value Message-ID: Review at https://gerrit.osmocom.org/1314 ipaccess-proxy: Check setsockopt() return value Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Fixes: Coverity CID 57642 --- M openbsc/src/ipaccess/ipaccess-proxy.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/14/1314/1 diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index 52e77e8..9e8ec88 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -1023,7 +1023,13 @@ return NULL; } - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, "Could not set socket option\n"); + close(bfd->fd); + talloc_free(ipc); + return NULL; + } ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/1314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:37 +0000 Subject: [PATCH] openbsc[master]: abis_nm: ceck fseek() return code in is_last_line() Message-ID: Review at https://gerrit.osmocom.org/1315 abis_nm: ceck fseek() return code in is_last_line() Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Fixes: Coverity CID 57643 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 3 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/15/1315/1 diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index c9b2aac..0c723e8 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -838,7 +838,9 @@ return 1; if (!fgets(next_seg_buf, sizeof(next_seg_buf)-2, stream)) { - fseek(stream, pos, SEEK_SET); + int rc = fseek(stream, pos, SEEK_SET); + if (rc < 0) + return rc; return 1; } -- To view, visit https://gerrit.osmocom.org/1315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:37 +0000 Subject: [PATCH] openbsc[master]: bsc_msc.c: Check setsockopt() return value Message-ID: Review at https://gerrit.osmocom.org/1316 bsc_msc.c: Check setsockopt() return value Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Fixes: Coverity CID 57644 --- M openbsc/src/libbsc/bsc_msc.c 1 file changed, 7 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/16/1316/1 diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index 829ee2b..e373679 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -158,6 +158,9 @@ return -1; } + /* TODO: Why are we not using the libosmocore soecket + * abstraction, or libosmo-netif? */ + /* move to the next connection */ dest = (struct bsc_msc_dest *) con->dests->next; llist_del(&dest->list); @@ -197,7 +200,10 @@ sin.sin_port = htons(dest->port); inet_aton(dest->ip, &sin.sin_addr); - setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret != 0) + LOGP(DMSC, LOGL_ERROR, + "Failed to set SO_REUSEADDR socket option\n"); ret = connect(fd->fd, (struct sockaddr *) &sin, sizeof(sin)); if (ret == -1 && errno == EINPROGRESS) { -- To view, visit https://gerrit.osmocom.org/1316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:37 +0000 Subject: [PATCH] openbsc[master]: Replace local make_sock() function with libosmocore osmo_fd_... Message-ID: Review at https://gerrit.osmocom.org/1317 Replace local make_sock() function with libosmocore osmo_fd_init_ofd() The local 'make_sock()' function should have been deprecated since 2011, when we started to have general socket related utility functions in libosmocore. Fixes: Coverity CID 57645 Change-Id: I2329da82d2b6612e281086ca67c7836b97e03d3d --- M openbsc/include/openbsc/Makefile.am D openbsc/include/openbsc/socket.h M openbsc/src/ipaccess/ipaccess-proxy.c M openbsc/src/libcommon/Makefile.am D openbsc/src/libcommon/socket.c M openbsc/src/osmo-bsc_nat/bsc_nat.c M openbsc/src/osmo-bsc_nat/bsc_ussd.c 7 files changed, 40 insertions(+), 147 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/17/1317/1 diff --git a/openbsc/include/openbsc/Makefile.am b/openbsc/include/openbsc/Makefile.am index 5737a4b..45a9650 100644 --- a/openbsc/include/openbsc/Makefile.am +++ b/openbsc/include/openbsc/Makefile.am @@ -72,7 +72,6 @@ slhc.h \ smpp.h \ sms_queue.h \ - socket.h \ system_information.h \ token_auth.h \ transaction.h \ diff --git a/openbsc/include/openbsc/socket.h b/openbsc/include/openbsc/socket.h deleted file mode 100644 index 0fd85f1..0000000 --- a/openbsc/include/openbsc/socket.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef _BSC_SOCKET_H -#define _BSC_SOCKET_H - -#include - -#ifndef IPPROTO_GRE -#define IPPROTO_GRE 47 -#endif - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data); - -#endif /* _BSC_SOCKET_H */ diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index 9e8ec88..bb52a48 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include @@ -47,7 +48,6 @@ #include #include #include -#include #include /* one instance of an ip.access protocol proxy */ @@ -369,8 +369,12 @@ /* Create UDP socket for BTS packet injection */ udp_port = 10000 + (site_id % 1000)*100 + (bts_id % 100); - ret = make_sock(&ipbc->udp_bts_fd, IPPROTO_UDP, INADDR_ANY, udp_port, - UDP_TO_BTS, udp_fd_cb, ipbc); + ipbc->udp_bts_fd.cb = udp_fd_cb; + ipbc->udp_bts_fd.data = ipbc; + ipbc->udp_bts_fd.priv_nr = UDP_TO_BTS; + ret = osmo_sock_init_ofd(&ipbc->udp_bts_fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, "0.0.0.0", udp_port, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) goto err_udp_bts; DEBUGP(DLINP, "(%u/%u/%u) Created UDP socket for injection " @@ -378,8 +382,12 @@ /* Create UDP socket for BSC packet injection */ udp_port = 20000 + (site_id % 1000)*100 + (bts_id % 100); - ret = make_sock(&ipbc->udp_bsc_fd, IPPROTO_UDP, INADDR_ANY, udp_port, - UDP_TO_BSC, udp_fd_cb, ipbc); + ipbc->udp_bsc_fd.cb = udp_fd_cb; + ipbc->udp_bsc_fd.data = ipbc; + ipbc->udp_bsc_fd.priv_nr = UDP_TO_BSC; + ret = osmo_sock_init_ofd(&ipbc->udp_bsc_fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, "0.0.0.0", udp_port, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) goto err_udp_bsc; DEBUGP(DLINP, "(%u/%u/%u) Created UDP socket for injection " @@ -391,12 +399,14 @@ struct sockaddr_in sock; socklen_t len = sizeof(sock); struct in_addr addr; - uint32_t ip; inet_aton(listen_ipaddr, &addr); - ip = ntohl(addr.s_addr); /* make_sock() needs host byte order */ - ret = make_sock(&ipbc->gprs_ns_fd, IPPROTO_UDP, ip, 0, 0, - gprs_ns_cb, ipbc); + + ipbc->gprs_ns_fd.cb = gprs_ns_cb; + ipbc->gprs_ns_fd.data = ipbc; + ret = osmo_sock_init_ofd(&ipbc->gprs_ns_fd, AF_INET, SOCK_DGRAM, + IPPROTO_UDP, inet_ntoa(addr), 0, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) { LOGP(DLINP, LOGL_ERROR, "Creating the GPRS socket failed.\n"); goto err_udp_bsc; @@ -1063,15 +1073,20 @@ ipp->reconn_timer.data = ipp; /* Listen for OML connections */ - ret = make_sock(&ipp->oml_listen_fd, IPPROTO_TCP, INADDR_ANY, - IPA_TCP_PORT_OML, OML_FROM_BTS, listen_fd_cb, NULL); + ipp->oml_listen_fd.cb = listen_fd_cb; + ipp->oml_listen_fd.priv_nr = OML_FROM_BTS; + ret = osmo_sock_init_ofd(&ipp->oml_listen_fd, AF_INET, SOCK_STREAM, + IPPROTO_TCP, "0.0.0.0", IPA_TCP_PORT_OML, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) return ret; /* Listen for RSL connections */ - ret = make_sock(&ipp->rsl_listen_fd, IPPROTO_TCP, INADDR_ANY, - IPA_TCP_PORT_RSL, RSL_FROM_BTS, listen_fd_cb, NULL); - + ipp->rsl_listen_fd.cb =listen_fd_cb; + ipp->rsl_listen_fd.priv_nr = RSL_FROM_BTS; + ret = osmo_sock_init_ofd(&ipp->rsl_listen_fd, AF_INET, SOCK_STREAM, + IPPROTO_TCP, "0.0.0.0", IPA_TCP_PORT_RSL, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (ret < 0) return ret; diff --git a/openbsc/src/libcommon/Makefile.am b/openbsc/src/libcommon/Makefile.am index 6cfebc2..93b188d 100644 --- a/openbsc/src/libcommon/Makefile.am +++ b/openbsc/src/libcommon/Makefile.am @@ -23,7 +23,6 @@ debug.c \ gsm_data.c \ gsm_data_shared.c \ - socket.c \ talloc_ctx.c \ gsm_subscriber_base.c \ $(NULL) diff --git a/openbsc/src/libcommon/socket.c b/openbsc/src/libcommon/socket.c deleted file mode 100644 index 2a64767..0000000 --- a/openbsc/src/libcommon/socket.c +++ /dev/null @@ -1,111 +0,0 @@ -/* OpenBSC sokcet code, taken from Abis input driver for ip.access */ - -/* (C) 2009 by Harald Welte - * (C) 2010 by Holger Hans Peter Freyther - * (C) 2010 by On-Waves - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include - -int make_sock(struct osmo_fd *bfd, int proto, - uint32_t ip, uint16_t port, int priv_nr, - int (*cb)(struct osmo_fd *fd, unsigned int what), void *data) -{ - struct sockaddr_in addr; - int ret, on = 1; - int type = SOCK_STREAM; - - switch (proto) { - case IPPROTO_TCP: - type = SOCK_STREAM; - break; - case IPPROTO_UDP: - type = SOCK_DGRAM; - break; -#ifdef IPPROTO_GRE - case IPPROTO_GRE: - type = SOCK_RAW; - break; -#endif - default: - return -EINVAL; - } - - bfd->fd = socket(AF_INET, type, proto); - bfd->cb = cb; - bfd->when = BSC_FD_READ; - bfd->data = data; - bfd->priv_nr = priv_nr; - - if (bfd->fd < 0) { - LOGP(DLINP, LOGL_ERROR, "could not create socket.\n"); - return -EIO; - } - - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - if (ip != INADDR_ANY) - addr.sin_addr.s_addr = htonl(ip); - else - addr.sin_addr.s_addr = INADDR_ANY; - - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - - ret = bind(bfd->fd, (struct sockaddr *) &addr, sizeof(addr)); - if (ret < 0) { - LOGP(DLINP, LOGL_ERROR, "could not bind socket %s\n", - strerror(errno)); - close(bfd->fd); - return -EIO; - } - - if (proto == IPPROTO_TCP) { - ret = listen(bfd->fd, 1); - if (ret < 0) { - perror("listen"); - close(bfd->fd); - return ret; - } - } - - ret = osmo_fd_register(bfd); - if (ret < 0) { - perror("register_listen_fd"); - close(bfd->fd); - return ret; - } - return 0; -} diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat.c b/openbsc/src/osmo-bsc_nat/bsc_nat.c index a4dd679..933cfeb 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include @@ -59,6 +58,7 @@ #include #include #include +#include #include #include @@ -1684,8 +1684,11 @@ bsc_msc_connect(nat->msc_con); /* wait for the BSC */ - rc = make_sock(&bsc_listen, IPPROTO_TCP, ntohl(local_addr.s_addr), - 5000, 0, ipaccess_listen_bsc_cb, nat); + bsc_listen.cb = ipaccess_listen_bsc_cb; + bsc_listen.data = nat; + rc = osmo_sock_init_ofd(&bsc_listen, AF_INET, SOCK_STREAM, IPPROTO_TCP, + inet_ntoa(local_addr), 5000, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); if (rc != 0) { fprintf(stderr, "Failed to listen for BSC.\n"); exit(1); diff --git a/openbsc/src/osmo-bsc_nat/bsc_ussd.c b/openbsc/src/osmo-bsc_nat/bsc_ussd.c index 2f68381..b052eb8 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_ussd.c +++ b/openbsc/src/osmo-bsc_nat/bsc_ussd.c @@ -24,10 +24,10 @@ #include #include #include -#include #include #include +#include #include #include #include @@ -287,8 +287,10 @@ inet_aton(nat->ussd_local, &addr); nat->ussd_listen.data = nat; - return make_sock(&nat->ussd_listen, IPPROTO_TCP, - ntohl(addr.s_addr), 5001, 0, ussd_listen_cb, nat); + nat->ussd_listen.cb = ussd_listen_cb; + return osmo_sock_init_ofd(&nat->ussd_listen, AF_INET, SOCK_STREAM, + IPPROTO_TCP, inet_ntoa(addr), 5001, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); } static int forward_ussd_simple(struct nat_sccp_connection *con, struct msgb *input) -- To view, visit https://gerrit.osmocom.org/1317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2329da82d2b6612e281086ca67c7836b97e03d3d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:44:37 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:44:37 +0000 Subject: [PATCH] openbsc[master]: mgcp_network.c: Use libosmocore socket functions Message-ID: Review at https://gerrit.osmocom.org/1318 mgcp_network.c: Use libosmocore socket functions Use libosmocore osmo_sock_init_ofd() in mgcp_create_bind(), rather than using a hand-coded version using OS socket functions. The locally implemented verison of the code didn't check setsockopt() return value. Change-Id: I1de4de12245847a6d30d1bf7c91dc813d2178dee Fixes: Coverity CID 57646 --- M openbsc/src/libmgcp/mgcp_network.c 1 file changed, 4 insertions(+), 23 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/18/1318/1 diff --git a/openbsc/src/libmgcp/mgcp_network.c b/openbsc/src/libmgcp/mgcp_network.c index abce6e4..a98a60f 100644 --- a/openbsc/src/libmgcp/mgcp_network.c +++ b/openbsc/src/libmgcp/mgcp_network.c @@ -28,10 +28,10 @@ #include #include -#include #include #include +#include #include #include @@ -884,28 +884,9 @@ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port) { - struct sockaddr_in addr; - int on = 1; - - fd->fd = socket(AF_INET, SOCK_DGRAM, 0); - if (fd->fd < 0) { - LOGP(DMGCP, LOGL_ERROR, "Failed to create UDP port.\n"); - return -1; - } - - setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); - memset(&addr, 0, sizeof(addr)); - addr.sin_family = AF_INET; - addr.sin_port = htons(port); - inet_aton(source_addr, &addr.sin_addr); - - if (bind(fd->fd, (struct sockaddr *) &addr, sizeof(addr)) < 0) { - close(fd->fd); - fd->fd = -1; - return -1; - } - - return 0; + return osmo_sock_init_ofd(fd, AF_INET, SOCK_DGRAM, IPPROTO_UDP, + source_addr, port, + OSMO_SOCK_F_BIND|OSMO_SOCK_F_NONBLOCK); } int mgcp_set_ip_tos(int fd, int tos) -- To view, visit https://gerrit.osmocom.org/1318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1de4de12245847a6d30d1bf7c91dc813d2178dee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:46:27 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:46:27 +0000 Subject: libosmocore[master]: Introduce osmo_strlcpy() function so we can stop using strnc... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:46:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:46:52 +0000 Subject: [MERGED] libosmocore[master]: osmo-sim-test.c: Fix rmsg check In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo-sim-test.c: Fix rmsg check ...................................................................... osmo-sim-test.c: Fix rmsg check we wanted to check for !rmsg, but used to check for !msg, missing error returns from read_record_nr(). Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Fixes: Coverity CID 57672 --- M utils/osmo-sim-test.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/utils/osmo-sim-test.c b/utils/osmo-sim-test.c index e861748..7b79c58 100644 --- a/utils/osmo-sim-test.c +++ b/utils/osmo-sim-test.c @@ -334,7 +334,7 @@ case EF_TYPE_RECORD_FIXED: for (i = 0; i < ffdd.num_rec; i++) { rmsg = read_record_nr(chan, i+1, ffdd.rec_len); - if (!msg) + if (!rmsg) return -EIO; printf("SW: %s\n", osim_print_sw(chan->card, msgb_apdu_sw(msg))); printf("Rec %03u: %s\n", i+1, -- To view, visit https://gerrit.osmocom.org/1299 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79b6a94b1aa947c8329317b0626865c3cd4159c1 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:47:51 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:47:51 +0000 Subject: openbsc[master]: abis_nm: Fix possible not-null-terminated buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:47:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:47:55 +0000 Subject: openbsc[master]: abis_nm: Fix non-null terminated buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:00 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:00 +0000 Subject: openbsc[master]: libmsc/db: avoid subscr->name without terminating NULL char In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:04 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:04 +0000 Subject: openbsc[master]: libmsc/db: Prevent subscr->extension without NULL termination In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1311 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ic1ae7b2d9dde8dab8f7795e5baa8918424f5f393 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:09 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:09 +0000 Subject: openbsc[master]: Fix possible non-null-terminated buffer In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:17 +0000 Subject: openbsc[master]: ipaccess-config: Handle setsockopt return value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:22 +0000 Subject: openbsc[master]: ipaccess-proxy: Check setsockopt() return value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:29 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:29 +0000 Subject: openbsc[master]: abis_nm: ceck fseek() return code in is_last_line() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:34 +0000 Subject: openbsc[master]: bsc_msc.c: Check setsockopt() return value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:42 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:42 +0000 Subject: openbsc[master]: Replace local make_sock() function with libosmocore osmo_fd_... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1317 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2329da82d2b6612e281086ca67c7836b97e03d3d Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:48:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 13:48:47 +0000 Subject: openbsc[master]: mgcp_network.c: Use libosmocore socket functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1318 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1de4de12245847a6d30d1bf7c91dc813d2178dee Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:57:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 13:57:20 +0000 Subject: [PATCH] libosmo-netif[master]: osmo_stream_srv_fd_cb(): don't leak socket FDs on errors Message-ID: Review at https://gerrit.osmocom.org/1320 osmo_stream_srv_fd_cb(): don't leak socket FDs on errors So far we seem to assume that the accept_cb does all handling of socket fd cleanup. However, there are cases where there is no accept_cb set, the accept_cb returns error, or an earlier sctp_sock_activate_events() fails. For those cases, close the socket and return an error code. Fixes: CID#57915 Change-Id: I3a3ce9194ab7ca5c1921fc79c2a1c9e10a552cf0 --- M src/stream.c 1 file changed, 18 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/20/1320/1 diff --git a/src/stream.c b/src/stream.c index 7d40df2..baede42 100644 --- a/src/stream.c +++ b/src/stream.c @@ -391,6 +391,7 @@ static int osmo_stream_srv_fd_cb(struct osmo_fd *ofd, unsigned int what) { int ret; + int sock_fd; struct sockaddr_in sa; socklen_t sa_len = sizeof(sa); struct osmo_stream_srv_link *link = ofd->data; @@ -403,14 +404,27 @@ } LOGP(DLINP, LOGL_DEBUG, "accept()ed new link from %s to port %u\n", inet_ntoa(sa.sin_addr), link->port); + sock_fd = ret; - if (link->proto == IPPROTO_SCTP) - sctp_sock_activate_events(ret); + if (link->proto == IPPROTO_SCTP) { + ret = sctp_sock_activate_events(sock_fd); + if (ret < 0) + goto error_close_socket; + } - if (link->accept_cb) - link->accept_cb(link, ret); + if (!link->accept_cb) { + ret = -ENOTSUP; + goto error_close_socket; + } + ret = link->accept_cb(link, sock_fd); + if (ret) + goto error_close_socket; return 0; + +error_close_socket: + close(sock_fd); + return ret; } struct osmo_stream_srv_link *osmo_stream_srv_link_create(void *ctx) -- To view, visit https://gerrit.osmocom.org/1320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I3a3ce9194ab7ca5c1921fc79c2a1c9e10a552cf0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Sat Nov 26 13:58:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 13:58:58 +0000 Subject: libosmo-netif[master]: osmo_stream_srv_fd_cb(): don't leak socket FDs on errors In-Reply-To: References: Message-ID: Patch Set 1: Verified-1 setting V-1 because I still want to test this patch. In the meantime, plausibility reviews are welcome. -- To view, visit https://gerrit.osmocom.org/1320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a3ce9194ab7ca5c1921fc79c2a1c9e10a552cf0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:06:43 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Sat, 26 Nov 2016 14:06:43 +0000 Subject: openbsc[master]: move to libcommon-cs: factor out gen of USSD notify and rele... In-Reply-To: References: Message-ID: Patch Set 6: Code-Review-1 makes a lot of sense, I'll add the gen functions to libosmocore -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 6 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:46 +0000 Subject: [PATCH] openbsc[master]: abisip-find: check bsc_fd_register() result Message-ID: Review at https://gerrit.osmocom.org/1321 abisip-find: check bsc_fd_register() result Change-Id: I72d713725d287d32ec90506099751aeb9b15ef15 Fixes: Coverity CID 70462 --- M openbsc/src/ipaccess/abisip-find.c 1 file changed, 5 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/21/1321/1 diff --git a/openbsc/src/ipaccess/abisip-find.c b/openbsc/src/ipaccess/abisip-find.c index 9fe7df6..5b36272 100644 --- a/openbsc/src/ipaccess/abisip-find.c +++ b/openbsc/src/ipaccess/abisip-find.c @@ -194,7 +194,11 @@ exit(1); } - osmo_fd_register(&bfd); + rc = osmo_fd_register(&bfd); + if (rc < 0) { + fprintf(stderr, "Cannot register FD\n"); + exit(1); + } timer.cb = timer_cb; timer.data = &bfd; -- To view, visit https://gerrit.osmocom.org/1321 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I72d713725d287d32ec90506099751aeb9b15ef15 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:47 +0000 Subject: [PATCH] openbsc[master]: sgsn_test: Fix missing = in == type check Message-ID: Review at https://gerrit.osmocom.org/1322 sgsn_test: Fix missing = in == type check Change-Id: I696a7d25d2f4d19922e05a7e83c4aeec5c44fb07 Fixes: Coverity CID 135156 --- M openbsc/tests/sgsn/sgsn_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/22/1322/1 diff --git a/openbsc/tests/sgsn/sgsn_test.c b/openbsc/tests/sgsn/sgsn_test.c index 789817c..e7b7458 100644 --- a/openbsc/tests/sgsn/sgsn_test.c +++ b/openbsc/tests/sgsn/sgsn_test.c @@ -627,7 +627,7 @@ /* Inject InsertSubscrData GSUP message */ last_updated_subscr = NULL; rc = rx_gsup_message(insert_data_req, sizeof(insert_data_req)); - OSMO_ASSERT(rc = -ENOTSUP); /* not connected */ + OSMO_ASSERT(rc == -ENOTSUP); /* not connected */ OSMO_ASSERT(last_updated_subscr == s1); /* Inject DeleteSubscrData GSUP message */ -- To view, visit https://gerrit.osmocom.org/1322 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I696a7d25d2f4d19922e05a7e83c4aeec5c44fb07 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:47 +0000 Subject: [PATCH] openbsc[master]: bsc_ctrl: Ensure we don't pass NULL string into strtok_r() Message-ID: Review at https://gerrit.osmocom.org/1323 bsc_ctrl: Ensure we don't pass NULL string into strtok_r() Change-Id: I03bea132377c0136b55b6fdad99a5d92da12e692 Fixes: Coverity CID 135180 --- M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/23/1323/1 diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 3010b55..78647d3 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -612,6 +612,7 @@ char *saveptr = NULL; char *inp, *cic, *alert, *text; + OSMO_ASSERT(cmd); inp = talloc_strdup(cmd, value); cic = strtok_r(inp, ",", &saveptr); -- To view, visit https://gerrit.osmocom.org/1323 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I03bea132377c0136b55b6fdad99a5d92da12e692 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:47 +0000 Subject: [PATCH] openbsc[master]: mgcp_protocol: Ensure we don't call strtok_r with NULL data Message-ID: Review at https://gerrit.osmocom.org/1324 mgcp_protocol: Ensure we don't call strtok_r with NULL data Change-Id: I1dce4df6a49fe95db592b0598194e3a8b8b1b994 Fixes: Coverity CID 135181 --- M openbsc/src/libmgcp/mgcp_protocol.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/24/1324/1 diff --git a/openbsc/src/libmgcp/mgcp_protocol.c b/openbsc/src/libmgcp/mgcp_protocol.c index 2e728cb..18398fc 100644 --- a/openbsc/src/libmgcp/mgcp_protocol.c +++ b/openbsc/src/libmgcp/mgcp_protocol.c @@ -447,6 +447,7 @@ int i = 0; char *elem, *save = NULL; + OSMO_ASSERT(data); pdata->trans = "000000"; for (elem = strtok_r(data, " ", &save); elem; -- To view, visit https://gerrit.osmocom.org/1324 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1dce4df6a49fe95db592b0598194e3a8b8b1b994 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:47 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:47 +0000 Subject: [PATCH] openbsc[master]: cfg_bts_si2quater_neigh_add(): Don't call strerror() on nega... Message-ID: Review at https://gerrit.osmocom.org/1325 cfg_bts_si2quater_neigh_add(): Don't call strerror() on negative value Change-Id: I1300eede3f22df812b7e83902327ce4cde21aa35 Fixes: Coverity CID 135185 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/25/1325/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 9ed19aa..0076591 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -2995,7 +2995,7 @@ r = osmo_earfcn_add(e, arfcn, meas); if (r < 0) { - vty_out(vty, "Unable to add arfcn %u: %s%s", arfcn, strerror(r), + vty_out(vty, "Unable to add arfcn %u: %s%s", arfcn, strerror(-r), VTY_NEWLINE); return CMD_WARNING; } -- To view, visit https://gerrit.osmocom.org/1325 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1300eede3f22df812b7e83902327ce4cde21aa35 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:48 +0000 Subject: [PATCH] openbsc[master]: bsc_vty: Fix missing break statements in switch() Message-ID: Review at https://gerrit.osmocom.org/1326 bsc_vty: Fix missing break statements in switch() Change-Id: Ifd48e8d56c845603d320748144b4d7c3c24022a0 Fixes: Coverity CID 135188 Fixes: Coverity CID 135190 --- M openbsc/src/libbsc/bsc_vty.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/26/1326/1 diff --git a/openbsc/src/libbsc/bsc_vty.c b/openbsc/src/libbsc/bsc_vty.c index 0076591..9da8a70 100644 --- a/openbsc/src/libbsc/bsc_vty.c +++ b/openbsc/src/libbsc/bsc_vty.c @@ -3049,9 +3049,11 @@ case -ENOMEM: vty_out(vty, "Unable to add arfcn: max number of UARFCNs (%u) " "reached%s", MAX_EARFCN_LIST, VTY_NEWLINE); + return CMD_WARNING; case -ENOSPC: vty_out(vty, "Warning: not enough space in si2quater for a " "given arfcn%s", VTY_NEWLINE); + return CMD_WARNING; case -EADDRINUSE: vty_out(vty, "Unable to add arfcn: (%u, %u) is already added%s", arfcn, scramble, VTY_NEWLINE); -- To view, visit https://gerrit.osmocom.org/1326 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ifd48e8d56c845603d320748144b4d7c3c24022a0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:08:48 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:08:48 +0000 Subject: [PATCH] openbsc[master]: gsm0408_test.c: Don't pass negative value to strerror() Message-ID: Review at https://gerrit.osmocom.org/1327 gsm0408_test.c: Don't pass negative value to strerror() Change-Id: I4fcf24ec1bc974a3189486d2372b9713d7fdab70 Fixes: Coverity CID 135192 --- M openbsc/tests/gsm0408/gsm0408_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/27/1327/1 diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index e81394f..8e2f30d 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -88,7 +88,7 @@ { int r = osmo_earfcn_add(e, earfcn, bw); if (r) - printf("failed to add EARFCN %u: %s\n", earfcn, strerror(r)); + printf("failed to add EARFCN %u: %s\n", earfcn, strerror(-r)); else printf("added EARFCN %u - ", earfcn); } -- To view, visit https://gerrit.osmocom.org/1327 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4fcf24ec1bc974a3189486d2372b9713d7fdab70 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:20:50 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:20:50 +0000 Subject: [PATCH] openbsc[master]: channel_mode_from_lchan(): Add missing break statement Message-ID: Review at https://gerrit.osmocom.org/1328 channel_mode_from_lchan(): Add missing break statement GSM48_CMODE_DATA_6k0 was not properly terminated and thus resulted in a bug. Change-Id: I4000f06d0b49c4afb0446beddd150521c4ba3cf0 Fixes: Coverity CID 148207 --- M openbsc/src/libbsc/abis_rsl.c 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/28/1328/1 diff --git a/openbsc/src/libbsc/abis_rsl.c b/openbsc/src/libbsc/abis_rsl.c index b7f7a75..3a676c0 100644 --- a/openbsc/src/libbsc/abis_rsl.c +++ b/openbsc/src/libbsc/abis_rsl.c @@ -453,6 +453,7 @@ lchan->csd_mode); return -EINVAL; } + break; default: LOGP(DRSL, LOGL_ERROR, "unsupported lchan->tch_mode %u\n", -- To view, visit https://gerrit.osmocom.org/1328 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4000f06d0b49c4afb0446beddd150521c4ba3cf0 Gerrit-PatchSet: 1 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:31:34 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:31:34 +0000 Subject: [PATCH] osmo-pcu[master]: struct pcu_l1_meas_ts: initialize ms_i_level Message-ID: Review at https://gerrit.osmocom.org/1329 struct pcu_l1_meas_ts: initialize ms_i_level Change-Id: I93de7589d746b91ba26b1b36bf2690f125277cd0 Fixes: Coverity CID 57953 --- M src/pcu_l1_if.h 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/29/1329/1 diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h index d9d970d..9ab46a8 100644 --- a/src/pcu_l1_if.h +++ b/src/pcu_l1_if.h @@ -57,7 +57,8 @@ } pcu_l1_meas_ts() : - have_ms_i_level(0) + have_ms_i_level(0), + ms_i_level(0) {} #endif }; -- To view, visit https://gerrit.osmocom.org/1329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I93de7589d746b91ba26b1b36bf2690f125277cd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:31:36 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:31:36 +0000 Subject: [PATCH] osmo-pcu[master]: Fix uninitialized members in pcu_l1_meas() Message-ID: Review at https://gerrit.osmocom.org/1330 Fix uninitialized members in pcu_l1_meas() Change-Id: I76a03c9f54be474ab9ece908ef782807d555c6ac Fixes: Coverity CID 57952 --- M src/pcu_l1_if.h 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/1330/1 diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h index 9ab46a8..eaa0143 100644 --- a/src/pcu_l1_if.h +++ b/src/pcu_l1_if.h @@ -110,7 +110,14 @@ have_ms_rx_qual(0), have_ms_c_value(0), have_ms_sign_var(0), - have_ms_i_level(0) + have_ms_i_level(0), + rssi(0), + ber(0), + bto(0), + link_qual(0), + ms_rx_qual(0), + ms_c_value(0), + ms_sign_var(0) {} #endif }; -- To view, visit https://gerrit.osmocom.org/1330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I76a03c9f54be474ab9ece908ef782807d555c6ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:45:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:45:31 +0000 Subject: [PATCH] libosmo-netif[master]: rs232-write: Check return value of osmo_fd_register() Message-ID: Review at https://gerrit.osmocom.org/1331 rs232-write: Check return value of osmo_fd_register() Change-Id: If40e85600ca1dfbda5975d7aa92cccdb11f9c34d Fixes: Coverity CID 57632 --- M examples/rs232-write.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/31/1331/1 diff --git a/examples/rs232-write.c b/examples/rs232-write.c index 11498f3..d5aee68 100644 --- a/examples/rs232-write.c +++ b/examples/rs232-write.c @@ -347,6 +347,7 @@ int main(void) { struct osmo_fd *kbd_ofd; + int rc; tall_test = talloc_named_const(NULL, 1, "osmo_rs232_test"); @@ -379,7 +380,11 @@ kbd_ofd->when = BSC_FD_READ; kbd_ofd->data = NULL; kbd_ofd->cb = kbd_cb; - osmo_fd_register(kbd_ofd); + rc = osmo_fd_register(kbd_ofd); + if (rc < 0) { + LOGP(DRS232TEST, LOGL_ERROR, "FD Register\n"); + exit(EXIT_FAILURE); + } while(1) { osmo_select_main(0); -- To view, visit https://gerrit.osmocom.org/1331 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If40e85600ca1dfbda5975d7aa92cccdb11f9c34d Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:45:31 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:45:31 +0000 Subject: [PATCH] libosmo-netif[master]: stream-client: Check for osmo_fd_register() return value Message-ID: Review at https://gerrit.osmocom.org/1332 stream-client: Check for osmo_fd_register() return value Change-Id: I1b5fa97d14e69ff502b6deba0fd898a01e53420f Fixes: Coverity CID 57633 --- M examples/stream-client.c 1 file changed, 6 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/32/1332/1 diff --git a/examples/stream-client.c b/examples/stream-client.c index 112d78b..c54db02 100644 --- a/examples/stream-client.c +++ b/examples/stream-client.c @@ -93,6 +93,7 @@ int main(void) { struct osmo_fd *kbd_ofd; + int rc; tall_test = talloc_named_const(NULL, 1, "osmo_stream_cli_test"); @@ -127,7 +128,11 @@ kbd_ofd->when = BSC_FD_READ; kbd_ofd->data = conn; kbd_ofd->cb = kbd_cb; - osmo_fd_register(kbd_ofd); + rc = osmo_fd_register(kbd_ofd); + if (rc < 0) { + LOGP(DSTREAMTEST, LOGL_ERROR, "FD Register\n"); + exit(EXIT_FAILURE); + } LOGP(DSTREAMTEST, LOGL_NOTICE, "Entering main loop\n"); -- To view, visit https://gerrit.osmocom.org/1332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1b5fa97d14e69ff502b6deba0fd898a01e53420f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:45:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:45:32 +0000 Subject: [PATCH] libosmo-netif[master]: sctp_sock_activate_events(): Print error message on error Message-ID: Review at https://gerrit.osmocom.org/1333 sctp_sock_activate_events(): Print error message on error When the setsockopt() in sctp_sock_activate_events() indicates an error, let's print an error message in the log about this. Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Fixes: Coverity CID 57634 --- M src/stream.c 1 file changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/33/1333/1 diff --git a/src/stream.c b/src/stream.c index 7d40df2..0ef54c6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -45,6 +45,9 @@ rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, sizeof(event)); + if (rc < 0) + LOGP(DLINP, LOGL_ERROR, "coudldn't activate SCTP events " + "on FD %u\n", fd); return rc; #else return -1; -- To view, visit https://gerrit.osmocom.org/1333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:55:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:55:55 +0000 Subject: [PATCH] libosmo-netif[master]: stream-client: check read() return value before using it as ... Message-ID: Review at https://gerrit.osmocom.org/1334 stream-client: check read() return value before using it as length input to memcpy Change-Id: Id962821c71b3a1c4c01c1131eb809b8ec8eaa062 Fixes: Coverity CID 57859 --- M examples/stream-client.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/34/1334/1 diff --git a/examples/stream-client.c b/examples/stream-client.c index c54db02..b0aea5e 100644 --- a/examples/stream-client.c +++ b/examples/stream-client.c @@ -72,8 +72,9 @@ int ret; ret = read(STDIN_FILENO, buf, sizeof(buf)); - LOGP(DSTREAMTEST, LOGL_NOTICE, "read %d byte from keyboard\n", ret); + if (ret < 0) + return ret; msg = msgb_alloc(1024, "STREAMCLIENT/test"); if (msg == NULL) { -- To view, visit https://gerrit.osmocom.org/1334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id962821c71b3a1c4c01c1131eb809b8ec8eaa062 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:55:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:55:55 +0000 Subject: [PATCH] libosmo-netif[master]: rs232: Don't pass negative number to strerror() Message-ID: Review at https://gerrit.osmocom.org/1335 rs232: Don't pass negative number to strerror() Change-Id: Ia777221cd0472cd1e7aa79e5146b07048a545dd8 Fixes: Coverity CID 57860 --- M src/rs232.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/35/1335/1 diff --git a/src/rs232.c b/src/rs232.c index 14b2d6e..798bf72 100644 --- a/src/rs232.c +++ b/src/rs232.c @@ -230,7 +230,7 @@ if (rc < 0) { close(bfd->fd); LOGP(DLINP, LOGL_ERROR, "rs232: could not register FD: %s\n", - strerror(rc)); + strerror(-rc)); return rc; } -- To view, visit https://gerrit.osmocom.org/1335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia777221cd0472cd1e7aa79e5146b07048a545dd8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 14:55:55 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 14:55:55 +0000 Subject: [PATCH] libosmo-netif[master]: osmo_stream_cli_open2(): Fix bogus EINPROGRESS handling Message-ID: Review at https://gerrit.osmocom.org/1336 osmo_stream_cli_open2(): Fix bogus EINPROGRESS handling osmo_sock_init() never returns -1 + errno EINPROGRESS. It will return a positive fd in case the connect operation is in progress. Therefore, the related code in osmo_stream_cli_open2() was impossible to execute. Change-Id: Id3483d1d1d4d2eabba94729ea29e5c93b33abff0 Fixes: Coverity CID 57861 --- M src/stream.c 1 file changed, 3 insertions(+), 10 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/36/1336/1 diff --git a/src/stream.c b/src/stream.c index 0ef54c6..a30fd04 100644 --- a/src/stream.c +++ b/src/stream.c @@ -308,16 +308,9 @@ ret = osmo_sock_init(AF_INET, SOCK_STREAM, cli->proto, cli->addr, cli->port, OSMO_SOCK_F_CONNECT); - if (ret < 0) { - if (errno != EINPROGRESS) { - if (reconnect) { - osmo_timer_schedule(&cli->timer, cli->reconnect_timeout, 0); - cli->state = STREAM_CLI_STATE_CONNECTING; - return 0; - } else - return ret; - } - } + if (ret < 0) + return ret; + cli->ofd.fd = ret; if (osmo_fd_register(&cli->ofd) < 0) { close(ret); -- To view, visit https://gerrit.osmocom.org/1336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Id3483d1d1d4d2eabba94729ea29e5c93b33abff0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:07:35 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:07:35 +0000 Subject: [MERGED] libosmocore[master]: osmo_gsup_encode(): Make coverity happy by invariant checking In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: osmo_gsup_encode(): Make coverity happy by invariant checking ...................................................................... osmo_gsup_encode(): Make coverity happy by invariant checking gsm48_encode_bcd_number() can theoretically return a length in excess of the size of the bcd_buf, but only in case an overly-long IMSI is passed into the function (which would be illegal in the first place). Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Fixes: Coverity CID 135216 --- M src/gsm/gsup.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/gsm/gsup.c b/src/gsm/gsup.c index d6b4975..c90244a 100644 --- a/src/gsm/gsup.c +++ b/src/gsm/gsup.c @@ -442,6 +442,7 @@ gsup_msg->imsi); OSMO_ASSERT(bcd_len > 1); + OSMO_ASSERT(bcd_len <= sizeof(bcd_buf)); /* Note that gsm48_encode_bcd_number puts the length into the first * octet. Since msgb_tlv_put will add this length byte, we'll have to -- To view, visit https://gerrit.osmocom.org/1301 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: If3dc68ee13ff784b487bbc686b777cec9057d537 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:08:38 +0000 Subject: [MERGED] openbsc[master]: abis_nm: Fix non-null terminated buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abis_nm: Fix non-null terminated buffer ...................................................................... abis_nm: Fix non-null terminated buffer Unrealistic case (filename of 4096 bytes) Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Fixes: Coverity CID 57620 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index fb6a957..c9b2aac 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2234,6 +2234,7 @@ /* construct new filename */ strncpy(dir, bs11_sw->swl_fname, sizeof(dir)); + dir[sizeof(dir)-1] = '\0'; strncat(fle->fname, dirname(dir), sizeof(fle->fname) - 1); strcat(fle->fname, "/"); strncat(fle->fname, file_id, sizeof(fle->fname) - 1 -strlen(fle->fname)); -- To view, visit https://gerrit.osmocom.org/1309 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Icf7b835f9edaf66976556fce1e9e0f66aa2010bc Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:08:38 +0000 Subject: [MERGED] openbsc[master]: libmsc/db: avoid subscr->name without terminating NULL char In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: libmsc/db: avoid subscr->name without terminating NULL char ...................................................................... libmsc/db: avoid subscr->name without terminating NULL char Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Fixes: Coverity CID 57621 --- M openbsc/src/libmsc/db.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/db.c b/openbsc/src/libmsc/db.c index 68eba3e..5cccb32 100644 --- a/openbsc/src/libmsc/db.c +++ b/openbsc/src/libmsc/db.c @@ -831,8 +831,10 @@ subscr->tmsi = tmsi_from_string(string); string = dbi_result_get_string(result, "name"); - if (string) + if (string) { strncpy(subscr->name, string, GSM_NAME_LENGTH); + subscr->name[sizeof(subscr->name)-1] = '\0'; + } string = dbi_result_get_string(result, "extension"); if (string) -- To view, visit https://gerrit.osmocom.org/1310 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ic8944ac4c5e940c9d835c52f1701461f274238db Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:08:38 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:08:38 +0000 Subject: [MERGED] openbsc[master]: abis_nm: Fix possible not-null-terminated buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abis_nm: Fix possible not-null-terminated buffer ...................................................................... abis_nm: Fix possible not-null-terminated buffer Unrealistic case with file name of 4096 bytes length. Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Fixes: Coverity CID 57619 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index 3289b3c..fb6a957 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -2305,6 +2305,7 @@ bs11_sw->forced = forced; strncpy(bs11_sw->swl_fname, fname, sizeof(bs11_sw->swl_fname)); + bs11_sw->swl_fname[sizeof(bs11_sw->swl_fname)-1] = '\0'; rc = bs11_read_swl_file(bs11_sw); if (rc < 0) return rc; -- To view, visit https://gerrit.osmocom.org/1308 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:38:46 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:38:46 +0000 Subject: libosmo-netif[master]: stream-client: Check for osmo_fd_register() return value In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1332 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I1b5fa97d14e69ff502b6deba0fd898a01e53420f Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:40:14 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:40:14 +0000 Subject: libosmo-netif[master]: stream-client: check read() return value before using it as ... In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1334 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id962821c71b3a1c4c01c1131eb809b8ec8eaa062 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:40:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:40:17 +0000 Subject: libosmo-netif[master]: rs232: Don't pass negative number to strerror() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1335 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia777221cd0472cd1e7aa79e5146b07048a545dd8 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:40:20 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:40:20 +0000 Subject: libosmo-netif[master]: osmo_stream_cli_open2(): Fix bogus EINPROGRESS handling In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1336 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Id3483d1d1d4d2eabba94729ea29e5c93b33abff0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:41:15 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:41:15 +0000 Subject: osmo-pcu[master]: Fix uninitialized members in pcu_l1_meas() In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1330 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I76a03c9f54be474ab9ece908ef782807d555c6ac Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:41:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:41:19 +0000 Subject: osmo-pcu[master]: struct pcu_l1_meas_ts: initialize ms_i_level In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1329 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I93de7589d746b91ba26b1b36bf2690f125277cd0 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 16:42:17 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 16:42:17 +0000 Subject: [MERGED] libosmocore[master]: Introduce osmo_strlcpy() function so we can stop using strnc... In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Introduce osmo_strlcpy() function so we can stop using strncpy() ...................................................................... Introduce osmo_strlcpy() function so we can stop using strncpy() I'm aware of the existing criticism on stlrcpy(), but I think it is still better than what we have now: stnrcpy(), sometimes with Coverity warnings and sometimes with a manual setting of the termination byte. The implementation follows the linux kernel strlcpy() which is claimed to be BSD compatible. We could of course link against libbsd on Linux instead, but I think it's reasonably small and simple to provide our own implementation. Future versions of libosmocore could use some autoconf magic and preprocessor macros to use the system-provided strlcpy() if it exists. Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 --- M include/osmocom/core/utils.h M src/utils.c 2 files changed, 24 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h index 01d5520..3c6fc98 100644 --- a/include/osmocom/core/utils.h +++ b/include/osmocom/core/utils.h @@ -82,4 +82,6 @@ uint64_t osmo_decode_big_endian(const uint8_t *data, size_t data_len); uint8_t *osmo_encode_big_endian(uint64_t value, size_t data_len); +size_t osmo_strlcpy(char *dst, const char *src, size_t siz); + /*! @} */ diff --git a/src/utils.c b/src/utils.c index 4a54802..1bb2be8 100644 --- a/src/utils.c +++ b/src/utils.c @@ -339,3 +339,25 @@ return buf; } /*! @} */ + +/*! \brief Copy a C-string into a sized buffer + * \param[in] src source string + * \param[out] dst destination string + * \param[in] siz size of the \a dst string + * \returns length of source string + * + * Copies up to \a siz characters from \a src to \a dst, but ensures + * that the last character of \a dst is always a NUL character. May + * truncate \a src to do achieve this. + */ +size_t osmo_strlcpy(char *dst, const char *src, size_t siz) +{ + size_t ret = strlen(src); + + if (siz) { + size_t len = (ret >= siz) ? siz - 1 : ret; + memcpy(dst, src, len); + dst[len] = '\0'; + } + return ret; +} -- To view, visit https://gerrit.osmocom.org/1302 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifdc99b0e3b8631f1e771e58acaf9efb00a9cd493 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:37:23 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:37:23 +0000 Subject: libosmo-netif[master]: sctp_sock_activate_events(): Print error message on error In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:37:32 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:37:32 +0000 Subject: [MERGED] libosmo-netif[master]: sctp_sock_activate_events(): Print error message on error In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sctp_sock_activate_events(): Print error message on error ...................................................................... sctp_sock_activate_events(): Print error message on error When the setsockopt() in sctp_sock_activate_events() indicates an error, let's print an error message in the log about this. Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Fixes: Coverity CID 57634 --- M src/stream.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/stream.c b/src/stream.c index 7d40df2..0ef54c6 100644 --- a/src/stream.c +++ b/src/stream.c @@ -45,6 +45,9 @@ rc = setsockopt(fd, IPPROTO_SCTP, SCTP_EVENTS, &event, sizeof(event)); + if (rc < 0) + LOGP(DLINP, LOGL_ERROR, "coudldn't activate SCTP events " + "on FD %u\n", fd); return rc; #else return -1; -- To view, visit https://gerrit.osmocom.org/1333 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I5920154e23debe6d01eaa156005db0842f1a18cc Gerrit-PatchSet: 2 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:37:57 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:37:57 +0000 Subject: [MERGED] libosmocore[master]: ctrl_cmd_parse: Make coverity FORWARD_NULL happy In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ctrl_cmd_parse: Make coverity FORWARD_NULL happy ...................................................................... ctrl_cmd_parse: Make coverity FORWARD_NULL happy The 'strtok_r' function requires passing a NULL as the first parameter on subsequent calls in order to ensure the code picks up where it left off on a previous call. However, Coverity doesn't quite realize this and points out that if a NULL was passed in as the third argument it would result in a possible NULL deref because the strtok_r function will assign the third argument to the first in the call is NULL. Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Fixes: Coverity CID 135186 --- M src/ctrl/control_cmd.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/ctrl/control_cmd.c b/src/ctrl/control_cmd.c index 3dbcf8f..2cf66cf 100644 --- a/src/ctrl/control_cmd.c +++ b/src/ctrl/control_cmd.c @@ -299,6 +299,7 @@ msgb_put_u8(msg, 0); str = (char *) msg->l2h; + OSMO_ASSERT(str); tmp = strtok_r(str, " ", &saveptr); if (!tmp) { cmd->type = CTRL_TYPE_ERROR; -- To view, visit https://gerrit.osmocom.org/1300 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7a9d08d0d4eae76a5207d285e32a25d1b384a57f Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:39:52 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:39:52 +0000 Subject: [MERGED] openbsc[master]: Fix possible non-null-terminated buffer In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: Fix possible non-null-terminated buffer ...................................................................... Fix possible non-null-terminated buffer Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca Fixes: Coverity CID 57623 --- M openbsc/src/libmsc/vty_interface_layer3.c 1 file changed, 1 insertion(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 6f0006c..0b360b8 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -568,6 +568,7 @@ } strncpy(subscr->name, name, sizeof(subscr->name)); + subscr->name[sizeof(subscr->name)-1] = '\0'; talloc_free(name); db_sync_subscriber(subscr); -- To view, visit https://gerrit.osmocom.org/1312 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I22100c260856991b9a836135b3650e5b8c5449ca Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:39:56 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:39:56 +0000 Subject: [MERGED] openbsc[master]: ipaccess-config: Handle setsockopt return value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ipaccess-config: Handle setsockopt return value ...................................................................... ipaccess-config: Handle setsockopt return value Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Fixes: Coverity CID 57640 --- M openbsc/src/ipaccess/ipaccess-config.c 1 file changed, 6 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 1ef8e3e..0a9dfc8 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -108,7 +108,12 @@ return -EIO; } - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, "could not set socket option\n"); + close(bfd->fd); + return -EIO; + } ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/1313 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8c2082f9a9c865cc663ad2abb63ee0f70914dabe Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:39:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:39:58 +0000 Subject: [MERGED] openbsc[master]: ipaccess-proxy: Check setsockopt() return value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: ipaccess-proxy: Check setsockopt() return value ...................................................................... ipaccess-proxy: Check setsockopt() return value Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Fixes: Coverity CID 57642 --- M openbsc/src/ipaccess/ipaccess-proxy.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/ipaccess/ipaccess-proxy.c b/openbsc/src/ipaccess/ipaccess-proxy.c index 52e77e8..9e8ec88 100644 --- a/openbsc/src/ipaccess/ipaccess-proxy.c +++ b/openbsc/src/ipaccess/ipaccess-proxy.c @@ -1023,7 +1023,13 @@ return NULL; } - setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(bfd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret < 0) { + LOGP(DLINP, LOGL_ERROR, "Could not set socket option\n"); + close(bfd->fd); + talloc_free(ipc); + return NULL; + } ret = connect(bfd->fd, (struct sockaddr *) sa, sizeof(*sa)); if (ret < 0) { -- To view, visit https://gerrit.osmocom.org/1314 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I34b082907b6f0b25fe2779f3a1f0a642a9002664 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:40:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:40:07 +0000 Subject: [MERGED] openbsc[master]: bsc_msc.c: Check setsockopt() return value In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: bsc_msc.c: Check setsockopt() return value ...................................................................... bsc_msc.c: Check setsockopt() return value Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Fixes: Coverity CID 57644 --- M openbsc/src/libbsc/bsc_msc.c 1 file changed, 7 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/bsc_msc.c b/openbsc/src/libbsc/bsc_msc.c index 829ee2b..e373679 100644 --- a/openbsc/src/libbsc/bsc_msc.c +++ b/openbsc/src/libbsc/bsc_msc.c @@ -158,6 +158,9 @@ return -1; } + /* TODO: Why are we not using the libosmocore soecket + * abstraction, or libosmo-netif? */ + /* move to the next connection */ dest = (struct bsc_msc_dest *) con->dests->next; llist_del(&dest->list); @@ -197,7 +200,10 @@ sin.sin_port = htons(dest->port); inet_aton(dest->ip, &sin.sin_addr); - setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + ret = setsockopt(fd->fd, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(on)); + if (ret != 0) + LOGP(DMSC, LOGL_ERROR, + "Failed to set SO_REUSEADDR socket option\n"); ret = connect(fd->fd, (struct sockaddr *) &sin, sizeof(sin)); if (ret == -1 && errno == EINPROGRESS) { -- To view, visit https://gerrit.osmocom.org/1316 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I79a8fe9c025772e51560503504f517485b0ace34 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 18:40:07 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sat, 26 Nov 2016 18:40:07 +0000 Subject: [MERGED] openbsc[master]: abis_nm: ceck fseek() return code in is_last_line() In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: abis_nm: ceck fseek() return code in is_last_line() ...................................................................... abis_nm: ceck fseek() return code in is_last_line() Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Fixes: Coverity CID 57643 --- M openbsc/src/libbsc/abis_nm.c 1 file changed, 3 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c index c9b2aac..0c723e8 100644 --- a/openbsc/src/libbsc/abis_nm.c +++ b/openbsc/src/libbsc/abis_nm.c @@ -838,7 +838,9 @@ return 1; if (!fgets(next_seg_buf, sizeof(next_seg_buf)-2, stream)) { - fseek(stream, pos, SEEK_SET); + int rc = fseek(stream, pos, SEEK_SET); + if (rc < 0) + return rc; return 1; } -- To view, visit https://gerrit.osmocom.org/1315 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I8ed4e703625c9da959e0938cd1eb3f0c73a2d4d0 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 21:29:34 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 26 Nov 2016 21:29:34 +0000 Subject: [PATCH] libosmocore[master]: core/conv: add optimized Viterbi decoding Message-ID: Review at https://gerrit.osmocom.org/1337 core/conv: add optimized Viterbi decoding Add a separate, faster convolution decoding implementation for rates up to N=4 and constraint lengths of K=5 and K=7, which covers the most GSM code uses. The decoding algorithm exploits the symmetric structure of the Viterbi add-compare-select (ACS) operation - commonly known as the ACS butterfly. This shift-register optimization can be found in the well-known text by Dave Forney. Forney, G.D., "The Viterbi Algorithm," Proc. of the IEEE, March 1973. Implementation is non-architecture specific and improves performance on x86 as well as ARM processors. Existing API is unchanged with optimized code being called internally for supported codes. Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 --- M src/Makefile.am M src/conv.c A src/viterbi.c A src/viterbi_gen.c 4 files changed, 796 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/1337/1 diff --git a/src/Makefile.am b/src/Makefile.am index 74bdb21..e40c049 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,8 @@ gsmtap_util.c crc16.c panic.c backtrace.c \ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ - macaddr.c stat_item.c stats.c stats_statsd.c prim.c + macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ + viterbi.c viterbi_gen.c BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c diff --git a/src/conv.c b/src/conv.c index f13deef..79b3a7c 100644 --- a/src/conv.c +++ b/src/conv.c @@ -238,6 +238,11 @@ #define MAX_AE 0x00ffffff +/* Forward declaration for accerlated decoding with certain codes */ +int +osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output); + void osmo_conv_decode_init(struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state) @@ -606,6 +611,10 @@ struct osmo_conv_decoder decoder; int rv, l; + /* Use accelerated implementation for supported codes */ + if ((code->N <= 4) && ((code->K == 5) || (code->K == 7))) + return osmo_conv_decode_acc(code, input, output); + osmo_conv_decode_init(&decoder, code, 0, 0); if (code->term == CONV_TERM_TAIL_BITING) { diff --git a/src/viterbi.c b/src/viterbi.c new file mode 100644 index 0000000..e00be82 --- /dev/null +++ b/src/viterbi.c @@ -0,0 +1,602 @@ +/* + * Viterbi decoder + * + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include +#include + +#include +#include "config.h" + +#define BIT2NRZ(REG,N) (((REG >> N) & 0x01) * 2 - 1) * -1 +#define NUM_STATES(K) (K == 7 ? 64 : 16) +#define SSE_ALIGN 16 + +/* Forward Metric Units */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); + +/* Trellis State + * state - Internal lshift register value + * prev - Register values of previous 0 and 1 states + */ +struct vstate { + unsigned state; + unsigned prev[2]; +}; + +/* Trellis Object + * num_states - Number of states in the trellis + * sums - Accumulated path metrics + * outputs - Trellis output values + * vals - Input value that led to each state + */ +struct vtrellis { + int num_states; + int16_t *sums; + int16_t *outputs; + uint8_t *vals; +}; + +/* Viterbi Decoder + * n - Code order + * k - Constraint length + * len - Horizontal length of trellis + * recursive - Set to '1' if the code is recursive + * intrvl - Normalization interval + * trellis - Trellis object + * punc - Puncturing sequence + * paths - Trellis paths + */ +struct vdecoder { + int n; + int k; + int len; + int recursive; + int intrvl; + struct vtrellis *trellis; + int *punc; + int16_t **paths; + + void (*metric_func)(const int8_t *, const int16_t *, + int16_t *, int16_t *, int); +}; + +/* Aligned Memory Allocator + * SSE requires 16-byte memory alignment. We store relevant trellis values + * (accumulated sums, outputs, and path decisions) as 16 bit signed integers + * so the allocated memory is casted as such. + */ +static int16_t *vdec_malloc(size_t n) +{ +#ifdef HAVE_SSE3 + return (int16_t *) memalign(SSE_ALIGN, sizeof(int16_t) * n); +#else + return (int16_t *) malloc(sizeof(int16_t) * n); +#endif +} + +/* Accessor calls */ +inline int conv_code_recursive(const struct osmo_conv_code *code) +{ + return code->next_term_output ? 1 : 0; +} + +/* Left shift and mask for finding the previous state */ +static unsigned vstate_lshift(unsigned reg, int k, int val) +{ + unsigned mask; + + if (k == 5) + mask = 0x0e; + else if (k == 7) + mask = 0x3e; + else + mask = 0; + + return ((reg << 1) & mask) | val; +} + +/* Bit endian manipulators */ +inline unsigned bitswap2(unsigned v) +{ + return ((v & 0x02) >> 1) | ((v & 0x01) << 1); +} + +inline unsigned bitswap3(unsigned v) +{ + return ((v & 0x04) >> 2) | ((v & 0x02) >> 0) | + ((v & 0x01) << 2); +} + +inline unsigned bitswap4(unsigned v) +{ + return ((v & 0x08) >> 3) | ((v & 0x04) >> 1) | + ((v & 0x02) << 1) | ((v & 0x01) << 3); +} + +inline unsigned bitswap5(unsigned v) +{ + return ((v & 0x10) >> 4) | ((v & 0x08) >> 2) | ((v & 0x04) >> 0) | + ((v & 0x02) << 2) | ((v & 0x01) << 4); +} + +inline unsigned bitswap6(unsigned v) +{ + return ((v & 0x20) >> 5) | ((v & 0x10) >> 3) | ((v & 0x08) >> 1) | + ((v & 0x04) << 1) | ((v & 0x02) << 3) | ((v & 0x01) << 5); +} + +static unsigned bitswap(unsigned v, unsigned n) +{ + switch (n) { + case 1: + return v; + case 2: + return bitswap2(v); + case 3: + return bitswap3(v); + case 4: + return bitswap4(v); + case 5: + return bitswap5(v); + case 6: + return bitswap6(v); + default: + return 0; + } +} + +/* Generate non-recursive state output from generator state table + * Note that the shift register moves right (i.e. the most recent bit is + * shifted into the register at k-1 bit of the register), which is typical + * textbook representation. The API transition table expects the most recent + * bit in the low order bit, or left shift. A bitswap operation is required + * to accommodate the difference. + */ +static unsigned gen_output(struct vstate *state, int val, + const struct osmo_conv_code *code) +{ + unsigned out, prev; + + prev = bitswap(state->prev[0], code->K - 1); + out = code->next_output[prev][val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate non-recursive trellis state + * For a given state defined by the k-1 length shift register, find the + * value of the input bit that drove the trellis to that state. Also + * generate the N outputs of the generator polynomial at that state. + */ +static int gen_state_info(uint8_t *val, unsigned reg, + int16_t *output, const struct osmo_conv_code *code) +{ + int i; + unsigned out; + struct vstate state; + + /* Previous '0' state */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + *val = (reg >> (code->K - 2)) & 0x01; + + /* Transition output */ + out = gen_output(&state, *val, code); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Generate recursive state output from generator state table */ +static unsigned gen_recursive_output(struct vstate *state, + uint8_t *val, unsigned reg, + const struct osmo_conv_code *code, int pos) +{ + int val0, val1; + unsigned out, prev; + + /* Previous '0' state */ + prev = vstate_lshift(reg, code->K, 0); + prev = bitswap(prev, code->K - 1); + + /* Input value */ + val0 = (reg >> (code->K - 2)) & 0x01; + val1 = (code->next_term_output[prev] >> pos) & 0x01; + *val = val0 == val1 ? 0 : 1; + + /* Wrapper for osmocom state access */ + prev = bitswap(state->prev[0], code->K - 1); + + /* Compute the transition output */ + out = code->next_output[prev][*val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate recursive trellis state + * The bit position of the systematic bit is not explicitly marked by the + * API, so it must be extracted from the generator table. Otherwise, + * populate the trellis similar to the non-recursive version. + * Non-systematic recursive codes are not supported. + */ +static int gen_recursive_state_info(uint8_t *val, + unsigned reg, int16_t *output, const struct osmo_conv_code *code) +{ + int i, j, pos = -1; + int ns = NUM_STATES(code->K); + unsigned out; + struct vstate state; + + /* Previous '0' and '1' states */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + /* Find recursive bit location */ + for (i = 0; i < code->N; i++) { + for (j = 0; j < ns; j++) { + if ((code->next_output[j][0] >> i) & 0x01) + break; + } + + if (j == ns) { + pos = i; + break; + } + } + + /* Non-systematic recursive code not supported */ + if (pos < 0) + return -EPROTO; + + /* Transition output */ + out = gen_recursive_output(&state, val, reg, code, pos); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Release the trellis */ +static void free_trellis(struct vtrellis *trellis) +{ + if (!trellis) + return; + + free(trellis->vals); + free(trellis->outputs); + free(trellis->sums); + free(trellis); +} + +/* Allocate and initialize the trellis object + * Initialization consists of generating the outputs and output value of a + * given state. Due to trellis symmetry and anti-symmetry, only one of the + * transition paths is utilized by the butterfly operation in the forward + * recursion, so only one set of N outputs is required per state variable. + */ +static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +{ + int i, rc = -1; + struct vtrellis *trellis; + int16_t *outputs; + + int ns = NUM_STATES(code->K); + int recursive = conv_code_recursive(code); + int olen = (code->N == 2) ? 2 : 4; + + trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + trellis->num_states = ns; + trellis->sums = vdec_malloc(ns); + trellis->outputs = vdec_malloc(ns * olen); + trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); + + if (!trellis->sums || !trellis->outputs) + goto fail; + + /* Populate the trellis state objects */ + for (i = 0; i < ns; i++) { + outputs = &trellis->outputs[olen * i]; + if (recursive) { + rc = gen_recursive_state_info(&trellis->vals[i], + i, outputs, code); + } else { + rc = gen_state_info(&trellis->vals[i], + i, outputs, code); + } + } + + if (rc < 0) + goto fail; + + return trellis; + +fail: + free_trellis(trellis); + return NULL; +} + +/* Reset decoder + * Set accumulated path metrics to zero. For termination other than + * tail-biting, initialize the zero state as the encoder starting state. + * Initialize with the maximum accumulated sum at length equal to the + * constraint length. + */ +static void reset_decoder(struct vdecoder *dec, int term) +{ + int ns = dec->trellis->num_states; + + memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); + + if (term != CONV_TERM_TAIL_BITING) + dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; +} + +static void _traceback(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +static void _traceback_rec(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = path ^ dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +/* Traceback and generate decoded output + * Find the largest accumulated path metric at the final state except for + * the zero terminated case, where we assume the final state is always zero. + */ +static int traceback(struct vdecoder *dec, uint8_t *out, int term, int len) +{ + int i, sum, max = -1; + unsigned path, state = 0; + + if (term != CONV_TERM_FLUSH) { + for (i = 0; i < dec->trellis->num_states; i++) { + sum = dec->trellis->sums[i]; + if (sum > max) { + max = sum; + state = i; + } + } + + if (max < 0) + return -EPROTO; + } + + for (i = dec->len - 1; i >= len; i--) { + path = dec->paths[i][state] + 1; + state = vstate_lshift(state, dec->k, path); + } + + if (dec->recursive) + _traceback_rec(dec, state, out, len); + else + _traceback(dec, state, out, len); + + return 0; +} + +/* Release decoder object */ +static void free_vdec(struct vdecoder *dec) +{ + if (!dec) + return; + + free(dec->paths[0]); + free(dec->paths); + free_trellis(dec->trellis); + free(dec); +} + +/* Allocate decoder object + * Subtract the constraint length K on the normalization interval to + * accommodate the initialization path metric at state zero. + */ +static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +{ + int i, ns; + struct vdecoder *dec; + + ns = NUM_STATES(code->K); + + dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); + dec->n = code->N; + dec->k = code->K; + dec->recursive = conv_code_recursive(code); + dec->intrvl = INT16_MAX / (dec->n * INT8_MAX) - dec->k; + + if (dec->k == 5) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k5_n2; + break; + case 3: + dec->metric_func = gen_metrics_k5_n3; + break; + case 4: + dec->metric_func = gen_metrics_k5_n4; + break; + default: + goto fail; + } + } else if (dec->k == 7) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k7_n2; + break; + case 3: + dec->metric_func = gen_metrics_k7_n3; + break; + case 4: + dec->metric_func = gen_metrics_k7_n4; + break; + default: + goto fail; + } + } else { + goto fail; + } + + if (code->term == CONV_TERM_FLUSH) + dec->len = code->len + code->K - 1; + else + dec->len = code->len; + + dec->trellis = generate_trellis(code); + if (!dec->trellis) + goto fail; + + dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + dec->paths[0] = vdec_malloc(ns * dec->len); + for (i = 1; i < dec->len; i++) + dec->paths[i] = &dec->paths[0][i * ns]; + + return dec; + +fail: + free_vdec(dec); + return NULL; +} + +/* Depuncture sequence with nagative value terminated puncturing matrix */ +static int depuncture(const int8_t *in, const int *punc, int8_t *out, int len) +{ + int i, n = 0, m = 0; + + for (i = 0; i < len; i++) { + if (i == punc[n]) { + out[i] = 0; + n++; + continue; + } + + out[i] = in[m++]; + } + + return 0; +} + +/* Forward trellis recursion + * Generate branch metrics and path metrics with a combined function. Only + * accumulated path metric sums and path selections are stored. Normalize on + * the interval specified by the decoder. + */ +static void _conv_decode(struct vdecoder *dec, const int8_t *seq, int _cnt) +{ + int i, len = dec->len; + struct vtrellis *trellis = dec->trellis; + + for (i = 0; i < len; i++) { + dec->metric_func(&seq[dec->n * i], + trellis->outputs, + trellis->sums, + dec->paths[i], + !(i % dec->intrvl)); + } +} + +/* Convolutional decode with a decoder object + * Initial puncturing run if necessary followed by the forward recursion. + * For tail-biting perform a second pass before running the backward + * traceback operation. + */ +static int conv_decode(struct vdecoder *dec, const int8_t *seq, + const int *punc, uint8_t *out, int len, int term) +{ + int cnt = 0; + int8_t depunc[dec->len * dec->n]; + + reset_decoder(dec, term); + + if (punc) { + depuncture(seq, punc, depunc, dec->len * dec->n); + seq = depunc; + } + + /* Propagate through the trellis with interval normalization */ + _conv_decode(dec, seq, cnt); + + if (term == CONV_TERM_TAIL_BITING) + _conv_decode(dec, seq, cnt); + + return traceback(dec, out, term, len); +} + +/* All-in-one Viterbi decoding */ +int osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output) +{ + int rc; + struct vdecoder *vdec; + + if ((code->N < 2) || (code->N > 4) || (code->len < 1) || + ((code->K != 5) && (code->K != 7))) + return -EINVAL; + + vdec = alloc_vdec(code); + if (!vdec) + return -EFAULT; + + rc = conv_decode(vdec, input, code->puncture, + output, code->len, code->term); + + free_vdec(vdec); + + return rc; +} diff --git a/src/viterbi_gen.c b/src/viterbi_gen.c new file mode 100644 index 0000000..340931f --- /dev/null +++ b/src/viterbi_gen.c @@ -0,0 +1,183 @@ +/* + * Viterbi decoder + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +/* Add-Compare-Select (ACS-Butterfly) + * Compute 4 accumulated path metrics and 4 path selections. Note that path + * selections are store as -1 and 0 rather than 0 and 1. This is to match + * the output format of the SSE packed compare instruction 'pmaxuw'. + */ +void acs_butterfly(int state, int num_states, + int16_t metric, int16_t *sum, + int16_t *new_sum, int16_t *path) +{ + int state0, state1; + int sum0, sum1, sum2, sum3; + + state0 = *(sum + (2 * state + 0)); + state1 = *(sum + (2 * state + 1)); + + sum0 = state0 + metric; + sum1 = state1 - metric; + sum2 = state0 - metric; + sum3 = state1 + metric; + + if (sum0 > sum1) { + *new_sum = sum0; + *path = -1; + } else { + *new_sum = sum1; + *path = 0; + } + + if (sum2 > sum3) { + *(new_sum + num_states / 2) = sum2; + *(path + num_states / 2) = -1; + } else { + *(new_sum + num_states / 2) = sum3; + *(path + num_states / 2) = 0; + } +} + +/* Branch metrics unit N=2 */ +void _gen_branch_metrics_n2(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[2 * i + 0] + + seq[1] * out[2 * i + 1]; + } +} + +/* Branch metrics unit N=3 */ +void _gen_branch_metrics_n3(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2]; + } +} + +/* Branch metrics unit N=4 */ +void _gen_branch_metrics_n4(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2] + + seq[3] * out[4 * i + 3]; + } +} + +/* Path metric unit */ +void _gen_path_metrics(int num_states, int16_t *sums, + int16_t *metrics, int16_t *paths, int norm) +{ + int i; + int16_t min; + int16_t new_sums[num_states]; + + for (i = 0; i < num_states / 2; i++) + acs_butterfly(i, num_states, metrics[i], + sums, &new_sums[i], &paths[i]); + + if (norm) { + min = new_sums[0]; + + for (i = 1; i < num_states; i++) + if (new_sums[i] < min) + min = new_sums[i]; + + for (i = 0; i < num_states; i++) + new_sums[i] -= min; + } + + memcpy(sums, new_sums, num_states * sizeof(int16_t)); +} + +/* 16-state branch-path metrics units (K=5) */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n2(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); +} + +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n3(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n4(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +/* 64-state branch-path metrics units (K=7) */ +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n2(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n3(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n4(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); +} -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy From gerrit-no-reply at lists.osmocom.org Sat Nov 26 21:34:18 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 26 Nov 2016 21:34:18 +0000 Subject: [PATCH] libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1337 to look at the new patch set (#2). core/conv: add optimized Viterbi decoding Add a separate, faster convolution decoding implementation for rates up to N=4 and constraint lengths of K=5 and K=7, which covers the most GSM code uses. The decoding algorithm exploits the symmetric structure of the Viterbi add-compare-select (ACS) operation - commonly known as the ACS butterfly. This shift-register optimization can be found in the well-known text by Dave Forney. Forney, G.D., "The Viterbi Algorithm," Proc. of the IEEE, March 1973. Implementation is non-architecture specific and improves performance on x86 as well as ARM processors. Existing API is unchanged with optimized code being called internally for supported codes. Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 --- M src/Makefile.am M src/conv.c A src/viterbi.c A src/viterbi_gen.c 4 files changed, 795 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/1337/2 diff --git a/src/Makefile.am b/src/Makefile.am index 74bdb21..e40c049 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,8 @@ gsmtap_util.c crc16.c panic.c backtrace.c \ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ - macaddr.c stat_item.c stats.c stats_statsd.c prim.c + macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ + viterbi.c viterbi_gen.c BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c diff --git a/src/conv.c b/src/conv.c index f13deef..79b3a7c 100644 --- a/src/conv.c +++ b/src/conv.c @@ -238,6 +238,11 @@ #define MAX_AE 0x00ffffff +/* Forward declaration for accerlated decoding with certain codes */ +int +osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output); + void osmo_conv_decode_init(struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state) @@ -606,6 +611,10 @@ struct osmo_conv_decoder decoder; int rv, l; + /* Use accelerated implementation for supported codes */ + if ((code->N <= 4) && ((code->K == 5) || (code->K == 7))) + return osmo_conv_decode_acc(code, input, output); + osmo_conv_decode_init(&decoder, code, 0, 0); if (code->term == CONV_TERM_TAIL_BITING) { diff --git a/src/viterbi.c b/src/viterbi.c new file mode 100644 index 0000000..b7b44a4 --- /dev/null +++ b/src/viterbi.c @@ -0,0 +1,601 @@ +/* + * Viterbi decoder + * + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include +#include "config.h" + +#define BIT2NRZ(REG,N) (((REG >> N) & 0x01) * 2 - 1) * -1 +#define NUM_STATES(K) (K == 7 ? 64 : 16) +#define SSE_ALIGN 16 + +/* Forward Metric Units */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); + +/* Trellis State + * state - Internal lshift register value + * prev - Register values of previous 0 and 1 states + */ +struct vstate { + unsigned state; + unsigned prev[2]; +}; + +/* Trellis Object + * num_states - Number of states in the trellis + * sums - Accumulated path metrics + * outputs - Trellis output values + * vals - Input value that led to each state + */ +struct vtrellis { + int num_states; + int16_t *sums; + int16_t *outputs; + uint8_t *vals; +}; + +/* Viterbi Decoder + * n - Code order + * k - Constraint length + * len - Horizontal length of trellis + * recursive - Set to '1' if the code is recursive + * intrvl - Normalization interval + * trellis - Trellis object + * punc - Puncturing sequence + * paths - Trellis paths + */ +struct vdecoder { + int n; + int k; + int len; + int recursive; + int intrvl; + struct vtrellis *trellis; + int *punc; + int16_t **paths; + + void (*metric_func)(const int8_t *, const int16_t *, + int16_t *, int16_t *, int); +}; + +/* Aligned Memory Allocator + * SSE requires 16-byte memory alignment. We store relevant trellis values + * (accumulated sums, outputs, and path decisions) as 16 bit signed integers + * so the allocated memory is casted as such. + */ +static int16_t *vdec_malloc(size_t n) +{ +#ifdef HAVE_SSE3 + return (int16_t *) memalign(SSE_ALIGN, sizeof(int16_t) * n); +#else + return (int16_t *) malloc(sizeof(int16_t) * n); +#endif +} + +/* Accessor calls */ +inline int conv_code_recursive(const struct osmo_conv_code *code) +{ + return code->next_term_output ? 1 : 0; +} + +/* Left shift and mask for finding the previous state */ +static unsigned vstate_lshift(unsigned reg, int k, int val) +{ + unsigned mask; + + if (k == 5) + mask = 0x0e; + else if (k == 7) + mask = 0x3e; + else + mask = 0; + + return ((reg << 1) & mask) | val; +} + +/* Bit endian manipulators */ +inline unsigned bitswap2(unsigned v) +{ + return ((v & 0x02) >> 1) | ((v & 0x01) << 1); +} + +inline unsigned bitswap3(unsigned v) +{ + return ((v & 0x04) >> 2) | ((v & 0x02) >> 0) | + ((v & 0x01) << 2); +} + +inline unsigned bitswap4(unsigned v) +{ + return ((v & 0x08) >> 3) | ((v & 0x04) >> 1) | + ((v & 0x02) << 1) | ((v & 0x01) << 3); +} + +inline unsigned bitswap5(unsigned v) +{ + return ((v & 0x10) >> 4) | ((v & 0x08) >> 2) | ((v & 0x04) >> 0) | + ((v & 0x02) << 2) | ((v & 0x01) << 4); +} + +inline unsigned bitswap6(unsigned v) +{ + return ((v & 0x20) >> 5) | ((v & 0x10) >> 3) | ((v & 0x08) >> 1) | + ((v & 0x04) << 1) | ((v & 0x02) << 3) | ((v & 0x01) << 5); +} + +static unsigned bitswap(unsigned v, unsigned n) +{ + switch (n) { + case 1: + return v; + case 2: + return bitswap2(v); + case 3: + return bitswap3(v); + case 4: + return bitswap4(v); + case 5: + return bitswap5(v); + case 6: + return bitswap6(v); + default: + return 0; + } +} + +/* Generate non-recursive state output from generator state table + * Note that the shift register moves right (i.e. the most recent bit is + * shifted into the register at k-1 bit of the register), which is typical + * textbook representation. The API transition table expects the most recent + * bit in the low order bit, or left shift. A bitswap operation is required + * to accommodate the difference. + */ +static unsigned gen_output(struct vstate *state, int val, + const struct osmo_conv_code *code) +{ + unsigned out, prev; + + prev = bitswap(state->prev[0], code->K - 1); + out = code->next_output[prev][val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate non-recursive trellis state + * For a given state defined by the k-1 length shift register, find the + * value of the input bit that drove the trellis to that state. Also + * generate the N outputs of the generator polynomial at that state. + */ +static int gen_state_info(uint8_t *val, unsigned reg, + int16_t *output, const struct osmo_conv_code *code) +{ + int i; + unsigned out; + struct vstate state; + + /* Previous '0' state */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + *val = (reg >> (code->K - 2)) & 0x01; + + /* Transition output */ + out = gen_output(&state, *val, code); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Generate recursive state output from generator state table */ +static unsigned gen_recursive_output(struct vstate *state, + uint8_t *val, unsigned reg, + const struct osmo_conv_code *code, int pos) +{ + int val0, val1; + unsigned out, prev; + + /* Previous '0' state */ + prev = vstate_lshift(reg, code->K, 0); + prev = bitswap(prev, code->K - 1); + + /* Input value */ + val0 = (reg >> (code->K - 2)) & 0x01; + val1 = (code->next_term_output[prev] >> pos) & 0x01; + *val = val0 == val1 ? 0 : 1; + + /* Wrapper for osmocom state access */ + prev = bitswap(state->prev[0], code->K - 1); + + /* Compute the transition output */ + out = code->next_output[prev][*val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate recursive trellis state + * The bit position of the systematic bit is not explicitly marked by the + * API, so it must be extracted from the generator table. Otherwise, + * populate the trellis similar to the non-recursive version. + * Non-systematic recursive codes are not supported. + */ +static int gen_recursive_state_info(uint8_t *val, + unsigned reg, int16_t *output, const struct osmo_conv_code *code) +{ + int i, j, pos = -1; + int ns = NUM_STATES(code->K); + unsigned out; + struct vstate state; + + /* Previous '0' and '1' states */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + /* Find recursive bit location */ + for (i = 0; i < code->N; i++) { + for (j = 0; j < ns; j++) { + if ((code->next_output[j][0] >> i) & 0x01) + break; + } + + if (j == ns) { + pos = i; + break; + } + } + + /* Non-systematic recursive code not supported */ + if (pos < 0) + return -EPROTO; + + /* Transition output */ + out = gen_recursive_output(&state, val, reg, code, pos); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Release the trellis */ +static void free_trellis(struct vtrellis *trellis) +{ + if (!trellis) + return; + + free(trellis->vals); + free(trellis->outputs); + free(trellis->sums); + free(trellis); +} + +/* Allocate and initialize the trellis object + * Initialization consists of generating the outputs and output value of a + * given state. Due to trellis symmetry and anti-symmetry, only one of the + * transition paths is utilized by the butterfly operation in the forward + * recursion, so only one set of N outputs is required per state variable. + */ +static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +{ + int i, rc = -1; + struct vtrellis *trellis; + int16_t *outputs; + + int ns = NUM_STATES(code->K); + int recursive = conv_code_recursive(code); + int olen = (code->N == 2) ? 2 : 4; + + trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + trellis->num_states = ns; + trellis->sums = vdec_malloc(ns); + trellis->outputs = vdec_malloc(ns * olen); + trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); + + if (!trellis->sums || !trellis->outputs) + goto fail; + + /* Populate the trellis state objects */ + for (i = 0; i < ns; i++) { + outputs = &trellis->outputs[olen * i]; + if (recursive) { + rc = gen_recursive_state_info(&trellis->vals[i], + i, outputs, code); + } else { + rc = gen_state_info(&trellis->vals[i], + i, outputs, code); + } + } + + if (rc < 0) + goto fail; + + return trellis; + +fail: + free_trellis(trellis); + return NULL; +} + +/* Reset decoder + * Set accumulated path metrics to zero. For termination other than + * tail-biting, initialize the zero state as the encoder starting state. + * Initialize with the maximum accumulated sum at length equal to the + * constraint length. + */ +static void reset_decoder(struct vdecoder *dec, int term) +{ + int ns = dec->trellis->num_states; + + memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); + + if (term != CONV_TERM_TAIL_BITING) + dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; +} + +static void _traceback(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +static void _traceback_rec(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = path ^ dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +/* Traceback and generate decoded output + * Find the largest accumulated path metric at the final state except for + * the zero terminated case, where we assume the final state is always zero. + */ +static int traceback(struct vdecoder *dec, uint8_t *out, int term, int len) +{ + int i, sum, max = -1; + unsigned path, state = 0; + + if (term != CONV_TERM_FLUSH) { + for (i = 0; i < dec->trellis->num_states; i++) { + sum = dec->trellis->sums[i]; + if (sum > max) { + max = sum; + state = i; + } + } + + if (max < 0) + return -EPROTO; + } + + for (i = dec->len - 1; i >= len; i--) { + path = dec->paths[i][state] + 1; + state = vstate_lshift(state, dec->k, path); + } + + if (dec->recursive) + _traceback_rec(dec, state, out, len); + else + _traceback(dec, state, out, len); + + return 0; +} + +/* Release decoder object */ +static void free_vdec(struct vdecoder *dec) +{ + if (!dec) + return; + + free(dec->paths[0]); + free(dec->paths); + free_trellis(dec->trellis); + free(dec); +} + +/* Allocate decoder object + * Subtract the constraint length K on the normalization interval to + * accommodate the initialization path metric at state zero. + */ +static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +{ + int i, ns; + struct vdecoder *dec; + + ns = NUM_STATES(code->K); + + dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); + dec->n = code->N; + dec->k = code->K; + dec->recursive = conv_code_recursive(code); + dec->intrvl = INT16_MAX / (dec->n * INT8_MAX) - dec->k; + + if (dec->k == 5) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k5_n2; + break; + case 3: + dec->metric_func = gen_metrics_k5_n3; + break; + case 4: + dec->metric_func = gen_metrics_k5_n4; + break; + default: + goto fail; + } + } else if (dec->k == 7) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k7_n2; + break; + case 3: + dec->metric_func = gen_metrics_k7_n3; + break; + case 4: + dec->metric_func = gen_metrics_k7_n4; + break; + default: + goto fail; + } + } else { + goto fail; + } + + if (code->term == CONV_TERM_FLUSH) + dec->len = code->len + code->K - 1; + else + dec->len = code->len; + + dec->trellis = generate_trellis(code); + if (!dec->trellis) + goto fail; + + dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + dec->paths[0] = vdec_malloc(ns * dec->len); + for (i = 1; i < dec->len; i++) + dec->paths[i] = &dec->paths[0][i * ns]; + + return dec; + +fail: + free_vdec(dec); + return NULL; +} + +/* Depuncture sequence with nagative value terminated puncturing matrix */ +static int depuncture(const int8_t *in, const int *punc, int8_t *out, int len) +{ + int i, n = 0, m = 0; + + for (i = 0; i < len; i++) { + if (i == punc[n]) { + out[i] = 0; + n++; + continue; + } + + out[i] = in[m++]; + } + + return 0; +} + +/* Forward trellis recursion + * Generate branch metrics and path metrics with a combined function. Only + * accumulated path metric sums and path selections are stored. Normalize on + * the interval specified by the decoder. + */ +static void _conv_decode(struct vdecoder *dec, const int8_t *seq, int _cnt) +{ + int i, len = dec->len; + struct vtrellis *trellis = dec->trellis; + + for (i = 0; i < len; i++) { + dec->metric_func(&seq[dec->n * i], + trellis->outputs, + trellis->sums, + dec->paths[i], + !(i % dec->intrvl)); + } +} + +/* Convolutional decode with a decoder object + * Initial puncturing run if necessary followed by the forward recursion. + * For tail-biting perform a second pass before running the backward + * traceback operation. + */ +static int conv_decode(struct vdecoder *dec, const int8_t *seq, + const int *punc, uint8_t *out, int len, int term) +{ + int cnt = 0; + int8_t depunc[dec->len * dec->n]; + + reset_decoder(dec, term); + + if (punc) { + depuncture(seq, punc, depunc, dec->len * dec->n); + seq = depunc; + } + + /* Propagate through the trellis with interval normalization */ + _conv_decode(dec, seq, cnt); + + if (term == CONV_TERM_TAIL_BITING) + _conv_decode(dec, seq, cnt); + + return traceback(dec, out, term, len); +} + +/* All-in-one Viterbi decoding */ +int osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output) +{ + int rc; + struct vdecoder *vdec; + + if ((code->N < 2) || (code->N > 4) || (code->len < 1) || + ((code->K != 5) && (code->K != 7))) + return -EINVAL; + + vdec = alloc_vdec(code); + if (!vdec) + return -EFAULT; + + rc = conv_decode(vdec, input, code->puncture, + output, code->len, code->term); + + free_vdec(vdec); + + return rc; +} diff --git a/src/viterbi_gen.c b/src/viterbi_gen.c new file mode 100644 index 0000000..340931f --- /dev/null +++ b/src/viterbi_gen.c @@ -0,0 +1,183 @@ +/* + * Viterbi decoder + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +/* Add-Compare-Select (ACS-Butterfly) + * Compute 4 accumulated path metrics and 4 path selections. Note that path + * selections are store as -1 and 0 rather than 0 and 1. This is to match + * the output format of the SSE packed compare instruction 'pmaxuw'. + */ +void acs_butterfly(int state, int num_states, + int16_t metric, int16_t *sum, + int16_t *new_sum, int16_t *path) +{ + int state0, state1; + int sum0, sum1, sum2, sum3; + + state0 = *(sum + (2 * state + 0)); + state1 = *(sum + (2 * state + 1)); + + sum0 = state0 + metric; + sum1 = state1 - metric; + sum2 = state0 - metric; + sum3 = state1 + metric; + + if (sum0 > sum1) { + *new_sum = sum0; + *path = -1; + } else { + *new_sum = sum1; + *path = 0; + } + + if (sum2 > sum3) { + *(new_sum + num_states / 2) = sum2; + *(path + num_states / 2) = -1; + } else { + *(new_sum + num_states / 2) = sum3; + *(path + num_states / 2) = 0; + } +} + +/* Branch metrics unit N=2 */ +void _gen_branch_metrics_n2(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[2 * i + 0] + + seq[1] * out[2 * i + 1]; + } +} + +/* Branch metrics unit N=3 */ +void _gen_branch_metrics_n3(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2]; + } +} + +/* Branch metrics unit N=4 */ +void _gen_branch_metrics_n4(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2] + + seq[3] * out[4 * i + 3]; + } +} + +/* Path metric unit */ +void _gen_path_metrics(int num_states, int16_t *sums, + int16_t *metrics, int16_t *paths, int norm) +{ + int i; + int16_t min; + int16_t new_sums[num_states]; + + for (i = 0; i < num_states / 2; i++) + acs_butterfly(i, num_states, metrics[i], + sums, &new_sums[i], &paths[i]); + + if (norm) { + min = new_sums[0]; + + for (i = 1; i < num_states; i++) + if (new_sums[i] < min) + min = new_sums[i]; + + for (i = 0; i < num_states; i++) + new_sums[i] -= min; + } + + memcpy(sums, new_sums, num_states * sizeof(int16_t)); +} + +/* 16-state branch-path metrics units (K=5) */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n2(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); +} + +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n3(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n4(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +/* 64-state branch-path metrics units (K=7) */ +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n2(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n3(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n4(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); +} -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sat Nov 26 21:37:40 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sat, 26 Nov 2016 21:37:40 +0000 Subject: [PATCH] libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1337 to look at the new patch set (#3). core/conv: add optimized Viterbi decoding Add a separate, faster convolution decoding implementation for rates up to N=4 and constraint lengths of K=5 and K=7, which covers the most GSM code uses. The decoding algorithm exploits the symmetric structure of the Viterbi add-compare-select (ACS) operation - commonly known as the ACS butterfly. This shift-register optimization can be found in the well-known text by Dave Forney. Forney, G.D., "The Viterbi Algorithm," Proc. of the IEEE, March 1973. Implementation is non-architecture specific and improves performance on x86 as well as ARM processors. Existing API is unchanged with optimized code being called internally for supported codes. Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 --- M src/Makefile.am M src/conv.c A src/viterbi.c A src/viterbi_gen.c 4 files changed, 795 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/1337/3 diff --git a/src/Makefile.am b/src/Makefile.am index 74bdb21..e40c049 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,8 @@ gsmtap_util.c crc16.c panic.c backtrace.c \ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ - macaddr.c stat_item.c stats.c stats_statsd.c prim.c + macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ + viterbi.c viterbi_gen.c BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c diff --git a/src/conv.c b/src/conv.c index f13deef..79b3a7c 100644 --- a/src/conv.c +++ b/src/conv.c @@ -238,6 +238,11 @@ #define MAX_AE 0x00ffffff +/* Forward declaration for accerlated decoding with certain codes */ +int +osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output); + void osmo_conv_decode_init(struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state) @@ -606,6 +611,10 @@ struct osmo_conv_decoder decoder; int rv, l; + /* Use accelerated implementation for supported codes */ + if ((code->N <= 4) && ((code->K == 5) || (code->K == 7))) + return osmo_conv_decode_acc(code, input, output); + osmo_conv_decode_init(&decoder, code, 0, 0); if (code->term == CONV_TERM_TAIL_BITING) { diff --git a/src/viterbi.c b/src/viterbi.c new file mode 100644 index 0000000..c0a2a1c --- /dev/null +++ b/src/viterbi.c @@ -0,0 +1,601 @@ +/* + * Viterbi decoder + * + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include +#include "config.h" + +#define BIT2NRZ(REG,N) (((REG >> N) & 0x01) * 2 - 1) * -1 +#define NUM_STATES(K) (K == 7 ? 64 : 16) +#define SSE_ALIGN 16 + +/* Forward Metric Units */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); + +/* Trellis State + * state - Internal lshift register value + * prev - Register values of previous 0 and 1 states + */ +struct vstate { + unsigned state; + unsigned prev[2]; +}; + +/* Trellis Object + * num_states - Number of states in the trellis + * sums - Accumulated path metrics + * outputs - Trellis output values + * vals - Input value that led to each state + */ +struct vtrellis { + int num_states; + int16_t *sums; + int16_t *outputs; + uint8_t *vals; +}; + +/* Viterbi Decoder + * n - Code order + * k - Constraint length + * len - Horizontal length of trellis + * recursive - Set to '1' if the code is recursive + * intrvl - Normalization interval + * trellis - Trellis object + * punc - Puncturing sequence + * paths - Trellis paths + */ +struct vdecoder { + int n; + int k; + int len; + int recursive; + int intrvl; + struct vtrellis *trellis; + int *punc; + int16_t **paths; + + void (*metric_func)(const int8_t *, const int16_t *, + int16_t *, int16_t *, int); +}; + +/* Aligned Memory Allocator + * SSE requires 16-byte memory alignment. We store relevant trellis values + * (accumulated sums, outputs, and path decisions) as 16 bit signed integers + * so the allocated memory is casted as such. + */ +static int16_t *vdec_malloc(size_t n) +{ +#ifdef HAVE_SSE3 + return (int16_t *) memalign(SSE_ALIGN, sizeof(int16_t) * n); +#else + return (int16_t *) malloc(sizeof(int16_t) * n); +#endif +} + +/* Accessor calls */ +inline int conv_code_recursive(const struct osmo_conv_code *code) +{ + return code->next_term_output ? 1 : 0; +} + +/* Left shift and mask for finding the previous state */ +static unsigned vstate_lshift(unsigned reg, int k, int val) +{ + unsigned mask; + + if (k == 5) + mask = 0x0e; + else if (k == 7) + mask = 0x3e; + else + mask = 0; + + return ((reg << 1) & mask) | val; +} + +/* Bit endian manipulators */ +inline unsigned bitswap2(unsigned v) +{ + return ((v & 0x02) >> 1) | ((v & 0x01) << 1); +} + +inline unsigned bitswap3(unsigned v) +{ + return ((v & 0x04) >> 2) | ((v & 0x02) >> 0) | + ((v & 0x01) << 2); +} + +inline unsigned bitswap4(unsigned v) +{ + return ((v & 0x08) >> 3) | ((v & 0x04) >> 1) | + ((v & 0x02) << 1) | ((v & 0x01) << 3); +} + +inline unsigned bitswap5(unsigned v) +{ + return ((v & 0x10) >> 4) | ((v & 0x08) >> 2) | ((v & 0x04) >> 0) | + ((v & 0x02) << 2) | ((v & 0x01) << 4); +} + +inline unsigned bitswap6(unsigned v) +{ + return ((v & 0x20) >> 5) | ((v & 0x10) >> 3) | ((v & 0x08) >> 1) | + ((v & 0x04) << 1) | ((v & 0x02) << 3) | ((v & 0x01) << 5); +} + +static unsigned bitswap(unsigned v, unsigned n) +{ + switch (n) { + case 1: + return v; + case 2: + return bitswap2(v); + case 3: + return bitswap3(v); + case 4: + return bitswap4(v); + case 5: + return bitswap5(v); + case 6: + return bitswap6(v); + default: + return 0; + } +} + +/* Generate non-recursive state output from generator state table + * Note that the shift register moves right (i.e. the most recent bit is + * shifted into the register at k-1 bit of the register), which is typical + * textbook representation. The API transition table expects the most recent + * bit in the low order bit, or left shift. A bitswap operation is required + * to accommodate the difference. + */ +static unsigned gen_output(struct vstate *state, int val, + const struct osmo_conv_code *code) +{ + unsigned out, prev; + + prev = bitswap(state->prev[0], code->K - 1); + out = code->next_output[prev][val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate non-recursive trellis state + * For a given state defined by the k-1 length shift register, find the + * value of the input bit that drove the trellis to that state. Also + * generate the N outputs of the generator polynomial at that state. + */ +static int gen_state_info(uint8_t *val, unsigned reg, + int16_t *output, const struct osmo_conv_code *code) +{ + int i; + unsigned out; + struct vstate state; + + /* Previous '0' state */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + *val = (reg >> (code->K - 2)) & 0x01; + + /* Transition output */ + out = gen_output(&state, *val, code); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Generate recursive state output from generator state table */ +static unsigned gen_recursive_output(struct vstate *state, + uint8_t *val, unsigned reg, + const struct osmo_conv_code *code, int pos) +{ + int val0, val1; + unsigned out, prev; + + /* Previous '0' state */ + prev = vstate_lshift(reg, code->K, 0); + prev = bitswap(prev, code->K - 1); + + /* Input value */ + val0 = (reg >> (code->K - 2)) & 0x01; + val1 = (code->next_term_output[prev] >> pos) & 0x01; + *val = val0 == val1 ? 0 : 1; + + /* Wrapper for osmocom state access */ + prev = bitswap(state->prev[0], code->K - 1); + + /* Compute the transition output */ + out = code->next_output[prev][*val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate recursive trellis state + * The bit position of the systematic bit is not explicitly marked by the + * API, so it must be extracted from the generator table. Otherwise, + * populate the trellis similar to the non-recursive version. + * Non-systematic recursive codes are not supported. + */ +static int gen_recursive_state_info(uint8_t *val, + unsigned reg, int16_t *output, const struct osmo_conv_code *code) +{ + int i, j, pos = -1; + int ns = NUM_STATES(code->K); + unsigned out; + struct vstate state; + + /* Previous '0' and '1' states */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + /* Find recursive bit location */ + for (i = 0; i < code->N; i++) { + for (j = 0; j < ns; j++) { + if ((code->next_output[j][0] >> i) & 0x01) + break; + } + + if (j == ns) { + pos = i; + break; + } + } + + /* Non-systematic recursive code not supported */ + if (pos < 0) + return -EPROTO; + + /* Transition output */ + out = gen_recursive_output(&state, val, reg, code, pos); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Release the trellis */ +static void free_trellis(struct vtrellis *trellis) +{ + if (!trellis) + return; + + free(trellis->vals); + free(trellis->outputs); + free(trellis->sums); + free(trellis); +} + +/* Allocate and initialize the trellis object + * Initialization consists of generating the outputs and output value of a + * given state. Due to trellis symmetry and anti-symmetry, only one of the + * transition paths is utilized by the butterfly operation in the forward + * recursion, so only one set of N outputs is required per state variable. + */ +static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +{ + int i, rc = -1; + struct vtrellis *trellis; + int16_t *outputs; + + int ns = NUM_STATES(code->K); + int recursive = conv_code_recursive(code); + int olen = (code->N == 2) ? 2 : 4; + + trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + trellis->num_states = ns; + trellis->sums = vdec_malloc(ns); + trellis->outputs = vdec_malloc(ns * olen); + trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); + + if (!trellis->sums || !trellis->outputs) + goto fail; + + /* Populate the trellis state objects */ + for (i = 0; i < ns; i++) { + outputs = &trellis->outputs[olen * i]; + if (recursive) { + rc = gen_recursive_state_info(&trellis->vals[i], + i, outputs, code); + } else { + rc = gen_state_info(&trellis->vals[i], + i, outputs, code); + } + } + + if (rc < 0) + goto fail; + + return trellis; + +fail: + free_trellis(trellis); + return NULL; +} + +/* Reset decoder + * Set accumulated path metrics to zero. For termination other than + * tail-biting, initialize the zero state as the encoder starting state. + * Initialize with the maximum accumulated sum at length equal to the + * constraint length. + */ +static void reset_decoder(struct vdecoder *dec, int term) +{ + int ns = dec->trellis->num_states; + + memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); + + if (term != CONV_TERM_TAIL_BITING) + dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; +} + +static void _traceback(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +static void _traceback_rec(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = path ^ dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +/* Traceback and generate decoded output + * Find the largest accumulated path metric at the final state except for + * the zero terminated case, where we assume the final state is always zero. + */ +static int traceback(struct vdecoder *dec, uint8_t *out, int term, int len) +{ + int i, sum, max = -1; + unsigned path, state = 0; + + if (term != CONV_TERM_FLUSH) { + for (i = 0; i < dec->trellis->num_states; i++) { + sum = dec->trellis->sums[i]; + if (sum > max) { + max = sum; + state = i; + } + } + + if (max < 0) + return -EPROTO; + } + + for (i = dec->len - 1; i >= len; i--) { + path = dec->paths[i][state] + 1; + state = vstate_lshift(state, dec->k, path); + } + + if (dec->recursive) + _traceback_rec(dec, state, out, len); + else + _traceback(dec, state, out, len); + + return 0; +} + +/* Release decoder object */ +static void free_vdec(struct vdecoder *dec) +{ + if (!dec) + return; + + free(dec->paths[0]); + free(dec->paths); + free_trellis(dec->trellis); + free(dec); +} + +/* Allocate decoder object + * Subtract the constraint length K on the normalization interval to + * accommodate the initialization path metric at state zero. + */ +static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +{ + int i, ns; + struct vdecoder *dec; + + ns = NUM_STATES(code->K); + + dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); + dec->n = code->N; + dec->k = code->K; + dec->recursive = conv_code_recursive(code); + dec->intrvl = INT16_MAX / (dec->n * INT8_MAX) - dec->k; + + if (dec->k == 5) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k5_n2; + break; + case 3: + dec->metric_func = gen_metrics_k5_n3; + break; + case 4: + dec->metric_func = gen_metrics_k5_n4; + break; + default: + goto fail; + } + } else if (dec->k == 7) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k7_n2; + break; + case 3: + dec->metric_func = gen_metrics_k7_n3; + break; + case 4: + dec->metric_func = gen_metrics_k7_n4; + break; + default: + goto fail; + } + } else { + goto fail; + } + + if (code->term == CONV_TERM_FLUSH) + dec->len = code->len + code->K - 1; + else + dec->len = code->len; + + dec->trellis = generate_trellis(code); + if (!dec->trellis) + goto fail; + + dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + dec->paths[0] = vdec_malloc(ns * dec->len); + for (i = 1; i < dec->len; i++) + dec->paths[i] = &dec->paths[0][i * ns]; + + return dec; + +fail: + free_vdec(dec); + return NULL; +} + +/* Depuncture sequence with nagative value terminated puncturing matrix */ +static int depuncture(const int8_t *in, const int *punc, int8_t *out, int len) +{ + int i, n = 0, m = 0; + + for (i = 0; i < len; i++) { + if (i == punc[n]) { + out[i] = 0; + n++; + continue; + } + + out[i] = in[m++]; + } + + return 0; +} + +/* Forward trellis recursion + * Generate branch metrics and path metrics with a combined function. Only + * accumulated path metric sums and path selections are stored. Normalize on + * the interval specified by the decoder. + */ +static void _conv_decode(struct vdecoder *dec, const int8_t *seq, int _cnt) +{ + int i, len = dec->len; + struct vtrellis *trellis = dec->trellis; + + for (i = 0; i < len; i++) { + dec->metric_func(&seq[dec->n * i], + trellis->outputs, + trellis->sums, + dec->paths[i], + !(i % dec->intrvl)); + } +} + +/* Convolutional decode with a decoder object + * Initial puncturing run if necessary followed by the forward recursion. + * For tail-biting perform a second pass before running the backward + * traceback operation. + */ +static int conv_decode(struct vdecoder *dec, const int8_t *seq, + const int *punc, uint8_t *out, int len, int term) +{ + int cnt = 0; + int8_t depunc[dec->len * dec->n]; + + reset_decoder(dec, term); + + if (punc) { + depuncture(seq, punc, depunc, dec->len * dec->n); + seq = depunc; + } + + /* Propagate through the trellis with interval normalization */ + _conv_decode(dec, seq, cnt); + + if (term == CONV_TERM_TAIL_BITING) + _conv_decode(dec, seq, cnt); + + return traceback(dec, out, term, len); +} + +/* All-in-one Viterbi decoding */ +int osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output) +{ + int rc; + struct vdecoder *vdec; + + if ((code->N < 2) || (code->N > 4) || (code->len < 1) || + ((code->K != 5) && (code->K != 7))) + return -EINVAL; + + vdec = alloc_vdec(code); + if (!vdec) + return -EFAULT; + + rc = conv_decode(vdec, input, code->puncture, + output, code->len, code->term); + + free_vdec(vdec); + + return rc; +} diff --git a/src/viterbi_gen.c b/src/viterbi_gen.c new file mode 100644 index 0000000..340931f --- /dev/null +++ b/src/viterbi_gen.c @@ -0,0 +1,183 @@ +/* + * Viterbi decoder + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +/* Add-Compare-Select (ACS-Butterfly) + * Compute 4 accumulated path metrics and 4 path selections. Note that path + * selections are store as -1 and 0 rather than 0 and 1. This is to match + * the output format of the SSE packed compare instruction 'pmaxuw'. + */ +void acs_butterfly(int state, int num_states, + int16_t metric, int16_t *sum, + int16_t *new_sum, int16_t *path) +{ + int state0, state1; + int sum0, sum1, sum2, sum3; + + state0 = *(sum + (2 * state + 0)); + state1 = *(sum + (2 * state + 1)); + + sum0 = state0 + metric; + sum1 = state1 - metric; + sum2 = state0 - metric; + sum3 = state1 + metric; + + if (sum0 > sum1) { + *new_sum = sum0; + *path = -1; + } else { + *new_sum = sum1; + *path = 0; + } + + if (sum2 > sum3) { + *(new_sum + num_states / 2) = sum2; + *(path + num_states / 2) = -1; + } else { + *(new_sum + num_states / 2) = sum3; + *(path + num_states / 2) = 0; + } +} + +/* Branch metrics unit N=2 */ +void _gen_branch_metrics_n2(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[2 * i + 0] + + seq[1] * out[2 * i + 1]; + } +} + +/* Branch metrics unit N=3 */ +void _gen_branch_metrics_n3(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2]; + } +} + +/* Branch metrics unit N=4 */ +void _gen_branch_metrics_n4(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2] + + seq[3] * out[4 * i + 3]; + } +} + +/* Path metric unit */ +void _gen_path_metrics(int num_states, int16_t *sums, + int16_t *metrics, int16_t *paths, int norm) +{ + int i; + int16_t min; + int16_t new_sums[num_states]; + + for (i = 0; i < num_states / 2; i++) + acs_butterfly(i, num_states, metrics[i], + sums, &new_sums[i], &paths[i]); + + if (norm) { + min = new_sums[0]; + + for (i = 1; i < num_states; i++) + if (new_sums[i] < min) + min = new_sums[i]; + + for (i = 0; i < num_states; i++) + new_sums[i] -= min; + } + + memcpy(sums, new_sums, num_states * sizeof(int16_t)); +} + +/* 16-state branch-path metrics units (K=5) */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n2(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); +} + +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n3(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n4(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +/* 64-state branch-path metrics units (K=7) */ +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n2(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n3(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n4(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); +} -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 27 05:51:18 2016 From: gerrit-no-reply at lists.osmocom.org (Alexander Chemeris) Date: Sun, 27 Nov 2016 05:51:18 +0000 Subject: libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 I think Thomas should be mentioned as the original author of the patch either in the commit message or as Author of the patch. -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 3 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 09:30:08 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 27 Nov 2016 09:30:08 +0000 Subject: [PATCH] libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Hello Alexander Chemeris, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1337 to look at the new patch set (#4). core/conv: add optimized Viterbi decoding Add a separate, faster convolution decoding implementation for rates up to N=4 and constraint lengths of K=5 and K=7, which covers the most GSM code uses. The decoding algorithm exploits the symmetric structure of the Viterbi add-compare-select (ACS) operation - commonly known as the ACS butterfly. This shift-register optimization can be found in the well-known text by Dave Forney. Forney, G.D., "The Viterbi Algorithm," Proc. of the IEEE, March 1973. Implementation is non-architecture specific and improves performance on x86 as well as ARM processors. Existing API is unchanged with optimized code being called internally for supported codes. Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 --- M src/Makefile.am M src/conv.c A src/viterbi.c A src/viterbi_gen.c 4 files changed, 795 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/37/1337/4 diff --git a/src/Makefile.am b/src/Makefile.am index 74bdb21..e40c049 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -15,7 +15,8 @@ gsmtap_util.c crc16.c panic.c backtrace.c \ conv.c application.c rbtree.c strrb.c \ loggingrb.c crc8gen.c crc16gen.c crc32gen.c crc64gen.c \ - macaddr.c stat_item.c stats.c stats_statsd.c prim.c + macaddr.c stat_item.c stats.c stats_statsd.c prim.c \ + viterbi.c viterbi_gen.c BUILT_SOURCES = crc8gen.c crc16gen.c crc32gen.c crc64gen.c diff --git a/src/conv.c b/src/conv.c index f13deef..79b3a7c 100644 --- a/src/conv.c +++ b/src/conv.c @@ -238,6 +238,11 @@ #define MAX_AE 0x00ffffff +/* Forward declaration for accerlated decoding with certain codes */ +int +osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output); + void osmo_conv_decode_init(struct osmo_conv_decoder *decoder, const struct osmo_conv_code *code, int len, int start_state) @@ -606,6 +611,10 @@ struct osmo_conv_decoder decoder; int rv, l; + /* Use accelerated implementation for supported codes */ + if ((code->N <= 4) && ((code->K == 5) || (code->K == 7))) + return osmo_conv_decode_acc(code, input, output); + osmo_conv_decode_init(&decoder, code, 0, 0); if (code->term == CONV_TERM_TAIL_BITING) { diff --git a/src/viterbi.c b/src/viterbi.c new file mode 100644 index 0000000..c0a2a1c --- /dev/null +++ b/src/viterbi.c @@ -0,0 +1,601 @@ +/* + * Viterbi decoder + * + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include +#include + +#include +#include "config.h" + +#define BIT2NRZ(REG,N) (((REG >> N) & 0x01) * 2 - 1) * -1 +#define NUM_STATES(K) (K == 7 ? 64 : 16) +#define SSE_ALIGN 16 + +/* Forward Metric Units */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm); + +/* Trellis State + * state - Internal lshift register value + * prev - Register values of previous 0 and 1 states + */ +struct vstate { + unsigned state; + unsigned prev[2]; +}; + +/* Trellis Object + * num_states - Number of states in the trellis + * sums - Accumulated path metrics + * outputs - Trellis output values + * vals - Input value that led to each state + */ +struct vtrellis { + int num_states; + int16_t *sums; + int16_t *outputs; + uint8_t *vals; +}; + +/* Viterbi Decoder + * n - Code order + * k - Constraint length + * len - Horizontal length of trellis + * recursive - Set to '1' if the code is recursive + * intrvl - Normalization interval + * trellis - Trellis object + * punc - Puncturing sequence + * paths - Trellis paths + */ +struct vdecoder { + int n; + int k; + int len; + int recursive; + int intrvl; + struct vtrellis *trellis; + int *punc; + int16_t **paths; + + void (*metric_func)(const int8_t *, const int16_t *, + int16_t *, int16_t *, int); +}; + +/* Aligned Memory Allocator + * SSE requires 16-byte memory alignment. We store relevant trellis values + * (accumulated sums, outputs, and path decisions) as 16 bit signed integers + * so the allocated memory is casted as such. + */ +static int16_t *vdec_malloc(size_t n) +{ +#ifdef HAVE_SSE3 + return (int16_t *) memalign(SSE_ALIGN, sizeof(int16_t) * n); +#else + return (int16_t *) malloc(sizeof(int16_t) * n); +#endif +} + +/* Accessor calls */ +inline int conv_code_recursive(const struct osmo_conv_code *code) +{ + return code->next_term_output ? 1 : 0; +} + +/* Left shift and mask for finding the previous state */ +static unsigned vstate_lshift(unsigned reg, int k, int val) +{ + unsigned mask; + + if (k == 5) + mask = 0x0e; + else if (k == 7) + mask = 0x3e; + else + mask = 0; + + return ((reg << 1) & mask) | val; +} + +/* Bit endian manipulators */ +inline unsigned bitswap2(unsigned v) +{ + return ((v & 0x02) >> 1) | ((v & 0x01) << 1); +} + +inline unsigned bitswap3(unsigned v) +{ + return ((v & 0x04) >> 2) | ((v & 0x02) >> 0) | + ((v & 0x01) << 2); +} + +inline unsigned bitswap4(unsigned v) +{ + return ((v & 0x08) >> 3) | ((v & 0x04) >> 1) | + ((v & 0x02) << 1) | ((v & 0x01) << 3); +} + +inline unsigned bitswap5(unsigned v) +{ + return ((v & 0x10) >> 4) | ((v & 0x08) >> 2) | ((v & 0x04) >> 0) | + ((v & 0x02) << 2) | ((v & 0x01) << 4); +} + +inline unsigned bitswap6(unsigned v) +{ + return ((v & 0x20) >> 5) | ((v & 0x10) >> 3) | ((v & 0x08) >> 1) | + ((v & 0x04) << 1) | ((v & 0x02) << 3) | ((v & 0x01) << 5); +} + +static unsigned bitswap(unsigned v, unsigned n) +{ + switch (n) { + case 1: + return v; + case 2: + return bitswap2(v); + case 3: + return bitswap3(v); + case 4: + return bitswap4(v); + case 5: + return bitswap5(v); + case 6: + return bitswap6(v); + default: + return 0; + } +} + +/* Generate non-recursive state output from generator state table + * Note that the shift register moves right (i.e. the most recent bit is + * shifted into the register at k-1 bit of the register), which is typical + * textbook representation. The API transition table expects the most recent + * bit in the low order bit, or left shift. A bitswap operation is required + * to accommodate the difference. + */ +static unsigned gen_output(struct vstate *state, int val, + const struct osmo_conv_code *code) +{ + unsigned out, prev; + + prev = bitswap(state->prev[0], code->K - 1); + out = code->next_output[prev][val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate non-recursive trellis state + * For a given state defined by the k-1 length shift register, find the + * value of the input bit that drove the trellis to that state. Also + * generate the N outputs of the generator polynomial at that state. + */ +static int gen_state_info(uint8_t *val, unsigned reg, + int16_t *output, const struct osmo_conv_code *code) +{ + int i; + unsigned out; + struct vstate state; + + /* Previous '0' state */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + *val = (reg >> (code->K - 2)) & 0x01; + + /* Transition output */ + out = gen_output(&state, *val, code); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Generate recursive state output from generator state table */ +static unsigned gen_recursive_output(struct vstate *state, + uint8_t *val, unsigned reg, + const struct osmo_conv_code *code, int pos) +{ + int val0, val1; + unsigned out, prev; + + /* Previous '0' state */ + prev = vstate_lshift(reg, code->K, 0); + prev = bitswap(prev, code->K - 1); + + /* Input value */ + val0 = (reg >> (code->K - 2)) & 0x01; + val1 = (code->next_term_output[prev] >> pos) & 0x01; + *val = val0 == val1 ? 0 : 1; + + /* Wrapper for osmocom state access */ + prev = bitswap(state->prev[0], code->K - 1); + + /* Compute the transition output */ + out = code->next_output[prev][*val]; + out = bitswap(out, code->N); + + return out; +} + +/* Populate recursive trellis state + * The bit position of the systematic bit is not explicitly marked by the + * API, so it must be extracted from the generator table. Otherwise, + * populate the trellis similar to the non-recursive version. + * Non-systematic recursive codes are not supported. + */ +static int gen_recursive_state_info(uint8_t *val, + unsigned reg, int16_t *output, const struct osmo_conv_code *code) +{ + int i, j, pos = -1; + int ns = NUM_STATES(code->K); + unsigned out; + struct vstate state; + + /* Previous '0' and '1' states */ + state.state = reg; + state.prev[0] = vstate_lshift(reg, code->K, 0); + state.prev[1] = vstate_lshift(reg, code->K, 1); + + /* Find recursive bit location */ + for (i = 0; i < code->N; i++) { + for (j = 0; j < ns; j++) { + if ((code->next_output[j][0] >> i) & 0x01) + break; + } + + if (j == ns) { + pos = i; + break; + } + } + + /* Non-systematic recursive code not supported */ + if (pos < 0) + return -EPROTO; + + /* Transition output */ + out = gen_recursive_output(&state, val, reg, code, pos); + + /* Unpack to NRZ */ + for (i = 0; i < code->N; i++) + output[i] = BIT2NRZ(out, i); + + return 0; +} + +/* Release the trellis */ +static void free_trellis(struct vtrellis *trellis) +{ + if (!trellis) + return; + + free(trellis->vals); + free(trellis->outputs); + free(trellis->sums); + free(trellis); +} + +/* Allocate and initialize the trellis object + * Initialization consists of generating the outputs and output value of a + * given state. Due to trellis symmetry and anti-symmetry, only one of the + * transition paths is utilized by the butterfly operation in the forward + * recursion, so only one set of N outputs is required per state variable. + */ +static struct vtrellis *generate_trellis(const struct osmo_conv_code *code) +{ + int i, rc = -1; + struct vtrellis *trellis; + int16_t *outputs; + + int ns = NUM_STATES(code->K); + int recursive = conv_code_recursive(code); + int olen = (code->N == 2) ? 2 : 4; + + trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); + trellis->num_states = ns; + trellis->sums = vdec_malloc(ns); + trellis->outputs = vdec_malloc(ns * olen); + trellis->vals = (uint8_t *) malloc(ns * sizeof(uint8_t)); + + if (!trellis->sums || !trellis->outputs) + goto fail; + + /* Populate the trellis state objects */ + for (i = 0; i < ns; i++) { + outputs = &trellis->outputs[olen * i]; + if (recursive) { + rc = gen_recursive_state_info(&trellis->vals[i], + i, outputs, code); + } else { + rc = gen_state_info(&trellis->vals[i], + i, outputs, code); + } + } + + if (rc < 0) + goto fail; + + return trellis; + +fail: + free_trellis(trellis); + return NULL; +} + +/* Reset decoder + * Set accumulated path metrics to zero. For termination other than + * tail-biting, initialize the zero state as the encoder starting state. + * Initialize with the maximum accumulated sum at length equal to the + * constraint length. + */ +static void reset_decoder(struct vdecoder *dec, int term) +{ + int ns = dec->trellis->num_states; + + memset(dec->trellis->sums, 0, sizeof(int16_t) * ns); + + if (term != CONV_TERM_TAIL_BITING) + dec->trellis->sums[0] = INT8_MAX * dec->n * dec->k; +} + +static void _traceback(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +static void _traceback_rec(struct vdecoder *dec, + unsigned state, uint8_t *out, int len) +{ + int i; + unsigned path; + + for (i = len - 1; i >= 0; i--) { + path = dec->paths[i][state] + 1; + out[i] = path ^ dec->trellis->vals[state]; + state = vstate_lshift(state, dec->k, path); + } +} + +/* Traceback and generate decoded output + * Find the largest accumulated path metric at the final state except for + * the zero terminated case, where we assume the final state is always zero. + */ +static int traceback(struct vdecoder *dec, uint8_t *out, int term, int len) +{ + int i, sum, max = -1; + unsigned path, state = 0; + + if (term != CONV_TERM_FLUSH) { + for (i = 0; i < dec->trellis->num_states; i++) { + sum = dec->trellis->sums[i]; + if (sum > max) { + max = sum; + state = i; + } + } + + if (max < 0) + return -EPROTO; + } + + for (i = dec->len - 1; i >= len; i--) { + path = dec->paths[i][state] + 1; + state = vstate_lshift(state, dec->k, path); + } + + if (dec->recursive) + _traceback_rec(dec, state, out, len); + else + _traceback(dec, state, out, len); + + return 0; +} + +/* Release decoder object */ +static void free_vdec(struct vdecoder *dec) +{ + if (!dec) + return; + + free(dec->paths[0]); + free(dec->paths); + free_trellis(dec->trellis); + free(dec); +} + +/* Allocate decoder object + * Subtract the constraint length K on the normalization interval to + * accommodate the initialization path metric at state zero. + */ +static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) +{ + int i, ns; + struct vdecoder *dec; + + ns = NUM_STATES(code->K); + + dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); + dec->n = code->N; + dec->k = code->K; + dec->recursive = conv_code_recursive(code); + dec->intrvl = INT16_MAX / (dec->n * INT8_MAX) - dec->k; + + if (dec->k == 5) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k5_n2; + break; + case 3: + dec->metric_func = gen_metrics_k5_n3; + break; + case 4: + dec->metric_func = gen_metrics_k5_n4; + break; + default: + goto fail; + } + } else if (dec->k == 7) { + switch (dec->n) { + case 2: + dec->metric_func = gen_metrics_k7_n2; + break; + case 3: + dec->metric_func = gen_metrics_k7_n3; + break; + case 4: + dec->metric_func = gen_metrics_k7_n4; + break; + default: + goto fail; + } + } else { + goto fail; + } + + if (code->term == CONV_TERM_FLUSH) + dec->len = code->len + code->K - 1; + else + dec->len = code->len; + + dec->trellis = generate_trellis(code); + if (!dec->trellis) + goto fail; + + dec->paths = (int16_t **) malloc(sizeof(int16_t *) * dec->len); + dec->paths[0] = vdec_malloc(ns * dec->len); + for (i = 1; i < dec->len; i++) + dec->paths[i] = &dec->paths[0][i * ns]; + + return dec; + +fail: + free_vdec(dec); + return NULL; +} + +/* Depuncture sequence with nagative value terminated puncturing matrix */ +static int depuncture(const int8_t *in, const int *punc, int8_t *out, int len) +{ + int i, n = 0, m = 0; + + for (i = 0; i < len; i++) { + if (i == punc[n]) { + out[i] = 0; + n++; + continue; + } + + out[i] = in[m++]; + } + + return 0; +} + +/* Forward trellis recursion + * Generate branch metrics and path metrics with a combined function. Only + * accumulated path metric sums and path selections are stored. Normalize on + * the interval specified by the decoder. + */ +static void _conv_decode(struct vdecoder *dec, const int8_t *seq, int _cnt) +{ + int i, len = dec->len; + struct vtrellis *trellis = dec->trellis; + + for (i = 0; i < len; i++) { + dec->metric_func(&seq[dec->n * i], + trellis->outputs, + trellis->sums, + dec->paths[i], + !(i % dec->intrvl)); + } +} + +/* Convolutional decode with a decoder object + * Initial puncturing run if necessary followed by the forward recursion. + * For tail-biting perform a second pass before running the backward + * traceback operation. + */ +static int conv_decode(struct vdecoder *dec, const int8_t *seq, + const int *punc, uint8_t *out, int len, int term) +{ + int cnt = 0; + int8_t depunc[dec->len * dec->n]; + + reset_decoder(dec, term); + + if (punc) { + depuncture(seq, punc, depunc, dec->len * dec->n); + seq = depunc; + } + + /* Propagate through the trellis with interval normalization */ + _conv_decode(dec, seq, cnt); + + if (term == CONV_TERM_TAIL_BITING) + _conv_decode(dec, seq, cnt); + + return traceback(dec, out, term, len); +} + +/* All-in-one Viterbi decoding */ +int osmo_conv_decode_acc(const struct osmo_conv_code *code, + const sbit_t *input, ubit_t *output) +{ + int rc; + struct vdecoder *vdec; + + if ((code->N < 2) || (code->N > 4) || (code->len < 1) || + ((code->K != 5) && (code->K != 7))) + return -EINVAL; + + vdec = alloc_vdec(code); + if (!vdec) + return -EFAULT; + + rc = conv_decode(vdec, input, code->puncture, + output, code->len, code->term); + + free_vdec(vdec); + + return rc; +} diff --git a/src/viterbi_gen.c b/src/viterbi_gen.c new file mode 100644 index 0000000..340931f --- /dev/null +++ b/src/viterbi_gen.c @@ -0,0 +1,183 @@ +/* + * Viterbi decoder + * Copyright (C) 2013, 2014 Thomas Tsou + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + */ + +#include +#include + +/* Add-Compare-Select (ACS-Butterfly) + * Compute 4 accumulated path metrics and 4 path selections. Note that path + * selections are store as -1 and 0 rather than 0 and 1. This is to match + * the output format of the SSE packed compare instruction 'pmaxuw'. + */ +void acs_butterfly(int state, int num_states, + int16_t metric, int16_t *sum, + int16_t *new_sum, int16_t *path) +{ + int state0, state1; + int sum0, sum1, sum2, sum3; + + state0 = *(sum + (2 * state + 0)); + state1 = *(sum + (2 * state + 1)); + + sum0 = state0 + metric; + sum1 = state1 - metric; + sum2 = state0 - metric; + sum3 = state1 + metric; + + if (sum0 > sum1) { + *new_sum = sum0; + *path = -1; + } else { + *new_sum = sum1; + *path = 0; + } + + if (sum2 > sum3) { + *(new_sum + num_states / 2) = sum2; + *(path + num_states / 2) = -1; + } else { + *(new_sum + num_states / 2) = sum3; + *(path + num_states / 2) = 0; + } +} + +/* Branch metrics unit N=2 */ +void _gen_branch_metrics_n2(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[2 * i + 0] + + seq[1] * out[2 * i + 1]; + } +} + +/* Branch metrics unit N=3 */ +void _gen_branch_metrics_n3(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2]; + } +} + +/* Branch metrics unit N=4 */ +void _gen_branch_metrics_n4(int num_states, const int8_t *seq, + const int16_t *out, int16_t *metrics) +{ + int i; + + for (i = 0; i < num_states / 2; i++) { + metrics[i] = seq[0] * out[4 * i + 0] + + seq[1] * out[4 * i + 1] + + seq[2] * out[4 * i + 2] + + seq[3] * out[4 * i + 3]; + } +} + +/* Path metric unit */ +void _gen_path_metrics(int num_states, int16_t *sums, + int16_t *metrics, int16_t *paths, int norm) +{ + int i; + int16_t min; + int16_t new_sums[num_states]; + + for (i = 0; i < num_states / 2; i++) + acs_butterfly(i, num_states, metrics[i], + sums, &new_sums[i], &paths[i]); + + if (norm) { + min = new_sums[0]; + + for (i = 1; i < num_states; i++) + if (new_sums[i] < min) + min = new_sums[i]; + + for (i = 0; i < num_states; i++) + new_sums[i] -= min; + } + + memcpy(sums, new_sums, num_states * sizeof(int16_t)); +} + +/* 16-state branch-path metrics units (K=5) */ +void gen_metrics_k5_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n2(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); +} + +void gen_metrics_k5_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n3(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +void gen_metrics_k5_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[8]; + + _gen_branch_metrics_n4(16, seq, out, metrics); + _gen_path_metrics(16, sums, metrics, paths, norm); + +} + +/* 64-state branch-path metrics units (K=7) */ +void gen_metrics_k7_n2(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n2(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n3(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n3(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); + +} + +void gen_metrics_k7_n4(const int8_t *seq, const int16_t *out, + int16_t *sums, int16_t *paths, int norm) +{ + int16_t metrics[32]; + + _gen_branch_metrics_n4(64, seq, out, metrics); + _gen_path_metrics(64, sums, metrics, paths, norm); +} -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou From gerrit-no-reply at lists.osmocom.org Sun Nov 27 09:31:47 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 27 Nov 2016 09:31:47 +0000 Subject: libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Patch Set 4: > I think Thomas should be mentioned as the original author of the > patch either in the commit message or as Author of the patch. Done, Thanks! -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 09:35:54 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 27 Nov 2016 09:35:54 +0000 Subject: libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Patch Set 4: This is not the final version. There are some questions I would like to discuss here. -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 10:19:50 2016 From: gerrit-no-reply at lists.osmocom.org (Vadim Yanitskiy) Date: Sun, 27 Nov 2016 10:19:50 +0000 Subject: libosmocore[master]: core/conv: add optimized Viterbi decoding In-Reply-To: References: Message-ID: Patch Set 4: (7 comments) The global question: should we use talloc here? As I know, a little performance leak takes place in case of talloc. https://gerrit.osmocom.org/#/c/1337/4/src/viterbi.c File src/viterbi.c: Line 14: * Lesser General Public License for more details. Does this license compatible with libosmocore? Line 326: trellis = (struct vtrellis *) calloc(1, sizeof(struct vtrellis)); Here we can use the static allocation too. PS4, Line 426: if (dec->recursive) : _traceback_rec(dec, state, out, len); : else : _traceback(dec, state, out, len); What to do with "_"? Line 450: static struct vdecoder *alloc_vdec(const struct osmo_conv_code *code) In case of static memory allocation, a better name for this function is "init_vdec". Line 457: dec = (struct vdecoder *) calloc(1, sizeof(struct vdecoder)); I suggest to use static memory allocation here. One can be declared inside the scope of this file. BTW: do we need to fill the structure by 0x00 here? Line 539: static void _conv_decode(struct vdecoder *dec, const int8_t *seq, int _cnt) Is there a more specific function name? Line 564: reset_decoder(dec, term); Maybe we could do it inside the init_vdec (current name: alloc_vdec)? -- To view, visit https://gerrit.osmocom.org/1337 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I74d355274b4176a7d924f91ef3c96912ce338fb2 Gerrit-PatchSet: 4 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Vadim Yanitskiy Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-Reviewer: Vadim Yanitskiy Gerrit-Reviewer: tnt Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:26:43 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:26:43 +0000 Subject: osmo-iuh[master]: hnbgw_rua: reject invalid domain indicator In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I0c44179aac02772585214e528207e959ad168f3c Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:19 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:19 +0000 Subject: osmo-iuh[master]: fix error rc in various ASN.1 decoding functions In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:30 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:30 +0000 Subject: osmo-iuh[master]: hnbgw: rua rx: fix rc and log unhandled Private Msg In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I822888a3cf450e2787fc352e0352aed92236ddb7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:33 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw: rua rx: fix rc and log unhandled Private Msg In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw: rua rx: fix rc and log unhandled Private Msg ...................................................................... hnbgw: rua rx: fix rc and log unhandled Private Msg Fixes: CID#57949 Change-Id: I822888a3cf450e2787fc352e0352aed92236ddb7 --- M src/hnbgw_rua.c 1 file changed, 3 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 2c34421..0ca64d3 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -475,6 +475,9 @@ rc = rua_rx_init_err_ind(msg, &imsg->value); break; case RUA_ProcedureCode_id_privateMessage: + LOGP(DRUA, LOGL_NOTICE, + "Unhandled: RUA Initiating Msg: Private Msg\n"); + rc = 0; break; default: LOGP(DRUA, LOGL_NOTICE, "Unknown RUA Procedure %u\n", -- To view, visit https://gerrit.osmocom.org/1305 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I822888a3cf450e2787fc352e0352aed92236ddb7 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:33 +0000 Subject: [MERGED] osmo-iuh[master]: fix error rc in various ASN.1 decoding functions In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: fix error rc in various ASN.1 decoding functions ...................................................................... fix error rc in various ASN.1 decoding functions Fixes: CID#57945, CID#57946, CID#57947, CID#57948, CID#57950, CID#57951 Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898 --- M src/hnbgw_cn.c M src/hnbgw_hnbap.c M src/hnbgw_ranap.c M src/hnbgw_rua.c M src/ranap_common_cn.c 5 files changed, 6 insertions(+), 6 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c index f97f627..0e993e2 100644 --- a/src/hnbgw_cn.c +++ b/src/hnbgw_cn.c @@ -235,7 +235,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } rc = _cn_ranap_rx(cnlink, pdu, data, len); diff --git a/src/hnbgw_hnbap.c b/src/hnbgw_hnbap.c index 59150c9..0473482 100644 --- a/src/hnbgw_hnbap.c +++ b/src/hnbgw_hnbap.c @@ -568,7 +568,7 @@ msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DHNBAP, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_hnbap_rx(hnb, pdu); diff --git a/src/hnbgw_ranap.c b/src/hnbgw_ranap.c index 7a505a5..7fd6d0a 100644 --- a/src/hnbgw_ranap.c +++ b/src/hnbgw_ranap.c @@ -218,7 +218,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_ranap_rx(msg->dst, pdu); diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index ca745b1..2c34421 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -537,7 +537,7 @@ msg->data, msgb_length(msg), 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRUA, LOGL_ERROR, "Error in ASN.1 decode\n"); - return rc; + return -1; } rc = _hnbgw_rua_rx(msg, pdu); diff --git a/src/ranap_common_cn.c b/src/ranap_common_cn.c index 3736dce..d02eb37 100644 --- a/src/ranap_common_cn.c +++ b/src/ranap_common_cn.c @@ -296,7 +296,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } message.direction = pdu->present; @@ -525,7 +525,7 @@ data, len, 0, 0); if (dec_ret.code != RC_OK) { LOGP(DRANAP, LOGL_ERROR, "Error in RANAP ASN.1 decode\n"); - return rc; + return -1; } message.direction = pdu->present; -- To view, visit https://gerrit.osmocom.org/1304 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I2d9ee1aa79959c5973041393f4769faa13720898 Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:33 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:33 +0000 Subject: [MERGED] osmo-iuh[master]: hnbgw_rua: reject invalid domain indicator In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: hnbgw_rua: reject invalid domain indicator ...................................................................... hnbgw_rua: reject invalid domain indicator Fixes: CID#135226, CID#135227 Change-Id: I0c44179aac02772585214e528207e959ad168f3c --- M src/hnbgw_rua.c 1 file changed, 14 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/hnbgw_rua.c b/src/hnbgw_rua.c index 3f245b5..ca745b1 100644 --- a/src/hnbgw_rua.c +++ b/src/hnbgw_rua.c @@ -347,6 +347,11 @@ case RUA_CN_DomainIndicator_ps_domain: cn = hnb->gw->cnlink_ps; break; + default: + LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n", + ies.cN_DomainIndicator); + rc = -1; + goto error_free; } if (ies.presenceMask & DISCONNECTIES_RUA_RANAP_MESSAGE_PRESENT) { @@ -356,6 +361,8 @@ rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DISCONNECT, context_id, scu_cause, ranap_data, ranap_len); + +error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_disconnecties(&ies); @@ -386,11 +393,18 @@ case RUA_CN_DomainIndicator_ps_domain: cn = hnb->gw->cnlink_ps; break; + default: + LOGP(DRUA, LOGL_ERROR, "Invalid CN_DomainIndicator: %u\n", + ies.cN_DomainIndicator); + rc = -1; + goto error_free; } rc = rua_to_scu(hnb, cn, OSMO_SCU_PRIM_N_DATA, context_id, 0, ies.ranaP_Message.buf, ies.ranaP_Message.size); + +error_free: /* FIXME: what to do with the asn1c-allocated memory */ rua_free_directtransferies(&ies); -- To view, visit https://gerrit.osmocom.org/1303 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I0c44179aac02772585214e528207e959ad168f3c Gerrit-PatchSet: 2 Gerrit-Project: osmo-iuh Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:27:58 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:27:58 +0000 Subject: [MERGED] openbsc[master]: sndcp: fixup for coverity scan defect CID 149097 In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: sndcp: fixup for coverity scan defect CID 149097 ...................................................................... sndcp: fixup for coverity scan defect CID 149097 Coverity scan detects a Null pointer deref (FORWARD_NULL) in gprs_sndcp_comp.c: 67 in gprs_sndcp_comp_create(). The reason for this is that gprs_sndcp_dcomp_init() and also gprs_sndcp_pcomp_init() rely on the comp_entity->algo algo flag. If the program logic is correct a null pointer deref should never occur. This commit adds OSMO_ASSERT() statements to ensure a null pointer deref is catched if if the ...comp_init() functions are used with incorrect parameters. Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1 --- M openbsc/src/gprs/gprs_sndcp_dcomp.c M openbsc/src/gprs/gprs_sndcp_pcomp.c 2 files changed, 2 insertions(+), 0 deletions(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/openbsc/src/gprs/gprs_sndcp_dcomp.c b/openbsc/src/gprs/gprs_sndcp_dcomp.c index 489106b..b0f95b4 100644 --- a/openbsc/src/gprs/gprs_sndcp_dcomp.c +++ b/openbsc/src/gprs/gprs_sndcp_dcomp.c @@ -84,6 +84,7 @@ if (comp_entity->compclass == SNDCP_XID_DATA_COMPRESSION && comp_entity->algo == V42BIS) { + OSMO_ASSERT(comp_field->v42bis_params); comp_entity->state = v42bis_init(ctx, NULL, comp_field->v42bis_params->p0, comp_field->v42bis_params->p1, diff --git a/openbsc/src/gprs/gprs_sndcp_pcomp.c b/openbsc/src/gprs/gprs_sndcp_pcomp.c index 493b263..a2236c3 100644 --- a/openbsc/src/gprs/gprs_sndcp_pcomp.c +++ b/openbsc/src/gprs/gprs_sndcp_pcomp.c @@ -54,6 +54,7 @@ if (comp_entity->compclass == SNDCP_XID_PROTOCOL_COMPRESSION && comp_entity->algo == RFC_1144) { + OSMO_ASSERT(comp_field->rfc1144_params); comp_entity->state = slhc_init(ctx, comp_field->rfc1144_params->s01 + 1, comp_field->rfc1144_params->s01 + 1); -- To view, visit https://gerrit.osmocom.org/1279 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7748f06d1739a697edad5100a031e5aa1ef11ed1 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:28:22 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:28:22 +0000 Subject: osmo-bts[master]: octphy: multi-trx support: fix AC_CHECK order In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Sun Nov 27 18:28:24 2016 From: gerrit-no-reply at lists.osmocom.org (Harald Welte) Date: Sun, 27 Nov 2016 18:28:24 +0000 Subject: [MERGED] osmo-bts[master]: octphy: multi-trx support: fix AC_CHECK order In-Reply-To: References: Message-ID: Harald Welte has submitted this change and it was merged. Change subject: octphy: multi-trx support: fix AC_CHECK order ...................................................................... octphy: multi-trx support: fix AC_CHECK order The header file octphy/octvc1/gsm/octvc1_gsm_default.h is not visible to the configure script when the octphy header files are referenced via --with-octsdr-2g instead having them installed in /usr/local/include. This results in a failed AC_CHECK_MEMBER check for tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn, even if header files with multi-trx support are used. The configure.ac script manipulates the CPPFLAGS in order to make the octphy include files visible to AC_CHECK_ and restores the original CPPFLAGS when done. This is required when --with-octsdr-2g is used. AC_CHECK_MEMBER is executed before the CPPFLAGS are manipulated. This causes no issues if the headers are properly installed to /usr/local/include, but does not work when --with-octsdr-2g is used. This commit moves the AC_CHECK_MEMBER command into the section where the manipulated CPPFLAGS are valid in order to fix the problem described above See also commit: f5494e84e898f947190466d30d5f932bac0fadf9 Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 --- M configure.ac 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/configure.ac b/configure.ac index 1e8a4ec..3fd6b8a 100644 --- a/configure.ac +++ b/configure.ac @@ -70,12 +70,12 @@ AC_MSG_RESULT([$enable_octphy]) AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes") if test "$enable_octphy" = "yes" ; then - AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [[#include ]]) oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS" AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[], [AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])], [#include ]) + AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn], AC_DEFINE([OCTPHY_MULTI_TRX], [1], [Define to 1 if your octphy header files support multi-trx]), [], [#include ]) CPPFLAGS=$oldCPPFLAGS fi -- To view, visit https://gerrit.osmocom.org/1277 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: dexter Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 06:30:25 2016 From: gerrit-no-reply at lists.osmocom.org (arvind.sirsikar) Date: Mon, 28 Nov 2016 06:30:25 +0000 Subject: [MERGED] osmo-pcu[master]: Add new BTS level counters In-Reply-To: References: Message-ID: arvind.sirsikar has submitted this change and it was merged. Change subject: Add new BTS level counters ...................................................................... Add new BTS level counters Adds counters for Immediate Assignment Reject, Packet Access Reject, Channel Request Description and Final Block resend. Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7 --- M src/bts.cpp M src/bts.h M src/tbf.cpp M src/tbf_dl.cpp 4 files changed, 26 insertions(+), 1 deletion(-) Approvals: Harald Welte: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/bts.cpp b/src/bts.cpp index fe3368d..603da56 100644 --- a/src/bts.cpp +++ b/src/bts.cpp @@ -66,6 +66,7 @@ { "rlc.restarted", "RLC Restarted "}, { "rlc.stalled", "RLC Stalled "}, { "rlc.nacked", "RLC Nacked "}, + { "rlc.final_block_resent", "RLC Final Blk resent "}, { "rlc.ass.timedout", "RLC Assign Timeout "}, { "rlc.ass.failed", "RLC Assign Failed "}, { "rlc.ack.timedout", "RLC Ack Timeout "}, @@ -90,8 +91,11 @@ { "rach.requests", "RACH requests "}, { "11bit_rach.requests", "11BIT_RACH requests "}, { "immediate.assignment_UL", "Immediate Assign UL "}, + { "immediate.assignment_rej", "Immediate Assign Rej "}, { "immediate.assignment_DL", "Immediate Assign DL "}, + { "channel.request_description","Channel Request Desc "}, { "pkt.ul_assignment", "Packet UL Assignment "}, + { "pkt.access_reject", "Packet Access Reject "}, { "pkt.dl_assignment", "Packet DL Assignment "}, { "ul.control", "UL control Block "}, { "ul.assignment_poll_timeout", "UL Assign Timeout "}, @@ -600,10 +604,12 @@ "2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b2b"); - if (failure) + if (failure) { plen = Encoding::write_immediate_assignment_reject( immediate_assignment, ra, Fn, burst_type); + immediate_assignment_reject(); + } else { LOGP(DRLCMAC, LOGL_DEBUG, " - TRX=%d (%d) TS=%d TA=%d TSC=%d TFI=%d USF=%d\n", @@ -1126,6 +1132,8 @@ /* check for channel request */ if (ack_nack->Exist_Channel_Request_Description) { + bts()->channel_request_description(); + /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), tbf->trx->trx_no, @@ -1235,6 +1243,8 @@ /* check for channel request */ if (ack_nack->Exist_ChannelRequestDescription) { + bts()->channel_request_description(); + /* This call will register the new TBF with the MS on success */ gprs_rlcmac_ul_tbf *ul_tbf = tbf_alloc_ul(bts_data(), tbf->trx->trx_no, diff --git a/src/bts.h b/src/bts.h index 33f5483..ac870d5 100644 --- a/src/bts.h +++ b/src/bts.h @@ -243,6 +243,7 @@ CTR_RLC_RESTARTED, CTR_RLC_STALLED, CTR_RLC_NACKED, + CTR_RLC_FINAL_BLOCK_RESENT, CTR_RLC_ASS_TIMEDOUT, CTR_RLC_ASS_FAILED, CTR_RLC_ACK_TIMEDOUT, @@ -267,8 +268,11 @@ CTR_RACH_REQUESTS, CTR_11BIT_RACH_REQUESTS, CTR_IMMEDIATE_ASSIGN_UL_TBF, + CTR_IMMEDIATE_ASSIGN_REJ, CTR_IMMEDIATE_ASSIGN_DL_TBF, + CTR_CHANNEL_REQUEST_DESCRIPTION, CTR_PKT_UL_ASSIGNMENT, + CTR_PKT_ACCESS_REJ, CTR_PKT_DL_ASSIGNMENT, CTR_RLC_RECV_CONTROL, CTR_PUA_POLL_TIMEDOUT, @@ -370,6 +374,7 @@ void rlc_restarted(); void rlc_stalled(); void rlc_nacked(); + void rlc_final_block_resent(); void rlc_ass_timedout(); void rlc_ass_failed(); void rlc_ack_timedout(); @@ -394,8 +399,11 @@ void rach_frame(); void rach_frame_11bit(); void immediate_assignment_ul_tbf(); + void immediate_assignment_reject(); void immediate_assignment_dl_tbf(); + void channel_request_description(); void pkt_ul_assignment(); + void pkt_access_reject(); void pkt_dl_assignemnt(); void rlc_rcvd_control(); void pua_poll_timedout(); @@ -563,6 +571,7 @@ CREATE_COUNT_INLINE(rlc_restarted, CTR_RLC_RESTARTED) CREATE_COUNT_INLINE(rlc_stalled, CTR_RLC_STALLED) CREATE_COUNT_INLINE(rlc_nacked, CTR_RLC_NACKED) +CREATE_COUNT_INLINE(rlc_final_block_resent, CTR_RLC_FINAL_BLOCK_RESENT); CREATE_COUNT_INLINE(rlc_ass_timedout, CTR_RLC_ASS_TIMEDOUT); CREATE_COUNT_INLINE(rlc_ass_failed, CTR_RLC_ASS_FAILED); CREATE_COUNT_INLINE(rlc_ack_timedout, CTR_RLC_ACK_TIMEDOUT); @@ -587,8 +596,11 @@ CREATE_COUNT_INLINE(rach_frame, CTR_RACH_REQUESTS); CREATE_COUNT_INLINE(rach_frame_11bit, CTR_11BIT_RACH_REQUESTS); CREATE_COUNT_INLINE(immediate_assignment_ul_tbf, CTR_IMMEDIATE_ASSIGN_UL_TBF); +CREATE_COUNT_INLINE(immediate_assignment_reject, CTR_IMMEDIATE_ASSIGN_REJ); CREATE_COUNT_INLINE(immediate_assignment_dl_tbf, CTR_IMMEDIATE_ASSIGN_DL_TBF); +CREATE_COUNT_INLINE(channel_request_description, CTR_CHANNEL_REQUEST_DESCRIPTION); CREATE_COUNT_INLINE(pkt_ul_assignment, CTR_PKT_UL_ASSIGNMENT); +CREATE_COUNT_INLINE(pkt_access_reject, CTR_PKT_ACCESS_REJ); CREATE_COUNT_INLINE(pkt_dl_assignemnt, CTR_PKT_DL_ASSIGNMENT); CREATE_COUNT_INLINE(rlc_rcvd_control, CTR_RLC_RECV_CONTROL); CREATE_COUNT_INLINE(pua_poll_timedout, CTR_PUA_POLL_TIMEDOUT); diff --git a/src/tbf.cpp b/src/tbf.cpp index 072d0af..25209e4 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -1037,6 +1037,8 @@ Encoding::write_packet_access_reject( packet_access_rej, tlli()); + bts->pkt_access_reject(); + bitvec_pack(packet_access_rej, msgb_put(msg, 23)); bitvec_free(packet_access_rej); diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index 185521d..c6f3945 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -454,6 +454,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- Nothing else to send, Re-transmit final block!\n"); bsn = m_window.v_s_mod(-1); + bts->rlc_final_block_resent(); bts->rlc_resent(); } -- To view, visit https://gerrit.osmocom.org/1278 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I23e326d4ea489aa4967e452fe02773b44ab146f7 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: sivasankari Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: arvind.sirsikar From gerrit-no-reply at lists.osmocom.org Mon Nov 28 10:53:13 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Nov 2016 10:53:13 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#8). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 346 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/8 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..fb24452 --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,346 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def osmo_CTRL(self, data): + """ + OSMO CTRL protocol + Placeholder, see corresponding derived class + """ + pass + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Placeholder, see corresponding derived class + """ + pass + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def dataReceived(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data) + if self.factory.debug: + print('IPA received %s::%s %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class CCM(IPACommon): + """ + Implementation of CCM protocol for IPA multiplex + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + +class CTRL(IPACommon): + """ + Implementation of Osmocom control protocol for IPA multiplex + """ + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + +class IPAServer(CCM): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from CCM + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CCM + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(CTRL): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from CTRL + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CTRL + Send TRAP upon connection + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA %s app with IPA v%s loaded." % ('v0.1', IPA.version)) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + reactor.connectTCP('localhost', 4250, IPAFactory(CTRL, debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + #reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(CCM, debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(CCM, debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Nov 28 11:06:38 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 11:06:38 +0000 Subject: [PATCH] osmo-bts[master]: bursts test: test_pdtch: pre-init result mem Message-ID: Review at https://gerrit.osmocom.org/1338 bursts test: test_pdtch: pre-init result mem Fixes: CID#57943 Change-Id: I4547f47c4150759d5c4ab790e34e91b784b03b39 --- M tests/bursts/bursts_test.c 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/38/1338/1 diff --git a/tests/bursts/bursts_test.c b/tests/bursts/bursts_test.c index 43764ab..d4bb3e0 100644 --- a/tests/bursts/bursts_test.c +++ b/tests/bursts/bursts_test.c @@ -349,6 +349,8 @@ int n_errors, n_bits_total; int rc; + memset(result, 0xff, len); + /* zero the not coded tail bits */ switch (len) { case 34: -- To view, visit https://gerrit.osmocom.org/1338 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4547f47c4150759d5c4ab790e34e91b784b03b39 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 13:39:35 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 13:39:35 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: code dup: introduce and use gsm0480_l3hdr_push() Message-ID: Review at https://gerrit.osmocom.org/1339 gsm0480: code dup: introduce and use gsm0480_l3hdr_push() Add function gsm0480_l3hdr_push() to push a struct gsm48_hdr to the start of a msgb. Use in gsm0480.c and gsm0411_utils.c. Further callers of the new function will follow in openbsc as well as another libosmocore patch for ussd. Change-Id: I54fce6053ab8362015686fe22dbcd38bf1366700 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0411_utils.c M src/gsm/gsm0480.c 3 files changed, 19 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/39/1339/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index deac322..f49ca6b 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -35,3 +35,6 @@ int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); int gsm0480_wrap_facility(struct msgb *msg); + +struct gsm48_hdr *gsm0480_l3hdr_push(struct msgb *msg, uint8_t proto_discr, + uint8_t msg_type); diff --git a/src/gsm/gsm0411_utils.c b/src/gsm/gsm0411_utils.c index af57963..5d18b12 100644 --- a/src/gsm/gsm0411_utils.c +++ b/src/gsm/gsm0411_utils.c @@ -315,12 +315,7 @@ int gsm411_push_cp_header(struct msgb *msg, uint8_t proto, uint8_t trans, uint8_t msg_type) { - struct gsm48_hdr *gh; - - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - /* Outgoing needs the highest bit set */ - gh->proto_discr = proto | (trans << 4); - gh->msg_type = msg_type; - + /* Outgoing proto_discr needs the highest bit set */ + gsm0480_l3hdr_push(msg, proto | (trans << 4), msg_type); return 0; } diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index d628d92..cab4d01 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -486,7 +486,6 @@ struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text) { struct msgb *msg; - struct gsm48_hdr *gh; uint8_t *ptr8; int response_len; @@ -525,10 +524,19 @@ msgb_wrap_with_TL(msg, GSM0480_IE_FACILITY); /* And finally pre-pend the L3 header */ - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - gh->proto_discr = GSM48_PDISC_NC_SS | trans_id - | (1<<7); /* TI direction = 1 */ - gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE; - + gsm0480_l3hdr_push(msg, + GSM48_PDISC_NC_SS | trans_id + | (1<<7) /* TI direction = 1 */, + GSM0480_MTYPE_RELEASE_COMPLETE); return msg; } + +struct gsm48_hdr *gsm0480_l3hdr_push(struct msgb *msg, uint8_t proto_discr, + uint8_t msg_type) +{ + struct gsm48_hdr *gh; + gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); + gh->proto_discr = proto_discr; + gh->msg_type = msg_type; + return gh; +} -- To view, visit https://gerrit.osmocom.org/1339 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I54fce6053ab8362015686fe22dbcd38bf1366700 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 13:39:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 13:39:36 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: add gsm0480_create_ussd_notify() and *_release_comp... Message-ID: Review at https://gerrit.osmocom.org/1340 gsm0480: add gsm0480_create_ussd_notify() and *_release_complete() Add two functions to create USSD messages. Moves and generalizes code from openbsc. Pending: use the new functions in openbsc. It looks like _release_complete() should also set trans_id and direction flag; but since this is moving code from openbsc that is apparently working, just place a fixme comment and don't change the functionality. Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c 2 files changed, 31 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/1340/1 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index f49ca6b..6ca23e9 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -32,6 +32,8 @@ struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); struct msgb *gsm0480_create_notifySS(const char *text); +struct msgb *gsm0480_create_ussd_notify(int level, const char *text); +struct msgb *gsm0480_create_ussd_release_complete(void); int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); int gsm0480_wrap_facility(struct msgb *msg); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index cab4d01..3c23f6f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -540,3 +540,32 @@ gh->msg_type = msg_type; return gh; } + +struct msgb *gsm0480_create_ussd_notify(int level, const char *text) +{ + struct msgb *msg; + + msg = gsm0480_create_unstructuredSS_Notify(level, text); + if (!msg) + return NULL; + + gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0); + gsm0480_wrap_facility(msg); + + gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS, GSM0480_MTYPE_REGISTER); + return msg; +} + +struct msgb *gsm0480_create_ussd_release_complete(void) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(1024, 128, "GSM 04.80 USSD REL COMPL"); + if (!msg) + return NULL; + + /* FIXME: should this set trans_id and TI direction flag? */ + gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS, + GSM0480_MTYPE_RELEASE_COMPLETE); + return msg; +} -- To view, visit https://gerrit.osmocom.org/1340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 13:39:36 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 13:39:36 +0000 Subject: [PATCH] libosmocore[master]: gsm0480.c: code dup: have common msgb alloc functions Message-ID: Review at https://gerrit.osmocom.org/1341 gsm0480.c: code dup: have common msgb alloc functions One with an explicit msgb name, another with fixed name. Change-Id: I029551dd74410ad6f326ce52eb7a75d912d3b875 --- M src/gsm/gsm0480.c 1 file changed, 14 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/41/1341/1 diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index 3c23f6f..bbf6e3f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -32,6 +32,16 @@ #include +static inline struct msgb *gsm0480_msgb_alloc_name(const char *name) +{ + return msgb_alloc_headroom(1024, 128, name); +} + +static inline struct msgb *gsm0480_msgb_alloc(void) +{ + return gsm0480_msgb_alloc_name("GSM 04.80"); +} + static inline unsigned char *msgb_wrap_with_TL(struct msgb *msgb, uint8_t tag) { uint8_t *data = msgb_push(msgb, 2); @@ -87,7 +97,7 @@ uint8_t *seq_len_ptr, *ussd_len_ptr, *data; int len; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80"); + msg = gsm0480_msgb_alloc(); if (!msg) return NULL; @@ -133,7 +143,7 @@ if (len < 1 || len > 160) return NULL; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80"); + msg = gsm0480_msgb_alloc(); if (!msg) return NULL; @@ -489,7 +499,7 @@ uint8_t *ptr8; int response_len; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80"); + msg = gsm0480_msgb_alloc(); if (!msg) return NULL; @@ -560,7 +570,7 @@ { struct msgb *msg; - msg = msgb_alloc_headroom(1024, 128, "GSM 04.80 USSD REL COMPL"); + msg = gsm0480_msgb_alloc_name("GSM 04.80 USSD REL COMPL"); if (!msg) return NULL; -- To view, visit https://gerrit.osmocom.org/1341 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I029551dd74410ad6f326ce52eb7a75d912d3b875 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 13:40:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 13:40:20 +0000 Subject: libosmocore[master]: gsm0480: add gsm0480_create_ussd_notify() and *_release_comp... In-Reply-To: References: Message-ID: Patch Set 1: needed by #1129 -- To view, visit https://gerrit.osmocom.org/1340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:11:25 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 14:11:25 +0000 Subject: [PATCH] libosmocore[master]: gsm0480: add gsm0480_create_ussd_notify() and *_release_comp... In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1340 to look at the new patch set (#2). gsm0480: add gsm0480_create_ussd_notify() and *_release_complete() Add two functions to create USSD messages. Moves and generalizes code from openbsc. Pending: use the new functions in openbsc. It looks like _release_complete() should also set trans_id and direction flag; but since this is moving code from openbsc that is apparently working, just place a fixme comment and don't change the functionality. Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 --- M include/osmocom/gsm/gsm0480.h M src/gsm/gsm0480.c M src/gsm/libosmogsm.map 3 files changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/40/1340/2 diff --git a/include/osmocom/gsm/gsm0480.h b/include/osmocom/gsm/gsm0480.h index f49ca6b..6ca23e9 100644 --- a/include/osmocom/gsm/gsm0480.h +++ b/include/osmocom/gsm/gsm0480.h @@ -32,6 +32,8 @@ struct msgb *gsm0480_create_ussd_resp(uint8_t invoke_id, uint8_t trans_id, const char *text); struct msgb *gsm0480_create_unstructuredSS_Notify(int alertPattern, const char *text); struct msgb *gsm0480_create_notifySS(const char *text); +struct msgb *gsm0480_create_ussd_notify(int level, const char *text); +struct msgb *gsm0480_create_ussd_release_complete(void); int gsm0480_wrap_invoke(struct msgb *msg, int op, int link_id); int gsm0480_wrap_facility(struct msgb *msg); diff --git a/src/gsm/gsm0480.c b/src/gsm/gsm0480.c index cab4d01..3c23f6f 100644 --- a/src/gsm/gsm0480.c +++ b/src/gsm/gsm0480.c @@ -540,3 +540,32 @@ gh->msg_type = msg_type; return gh; } + +struct msgb *gsm0480_create_ussd_notify(int level, const char *text) +{ + struct msgb *msg; + + msg = gsm0480_create_unstructuredSS_Notify(level, text); + if (!msg) + return NULL; + + gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0); + gsm0480_wrap_facility(msg); + + gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS, GSM0480_MTYPE_REGISTER); + return msg; +} + +struct msgb *gsm0480_create_ussd_release_complete(void) +{ + struct msgb *msg; + + msg = msgb_alloc_headroom(1024, 128, "GSM 04.80 USSD REL COMPL"); + if (!msg) + return NULL; + + /* FIXME: should this set trans_id and TI direction flag? */ + gsm0480_l3hdr_push(msg, GSM48_PDISC_NC_SS, + GSM0480_MTYPE_RELEASE_COMPLETE); + return msg; +} diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index f0baa21..3e7333c 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -63,6 +63,8 @@ gsm0480_create_notifySS; gsm0480_create_unstructuredSS_Notify; gsm0480_create_ussd_resp; +gsm0480_create_ussd_notify; +gsm0480_create_ussd_release_complete; gsm0480_decode_ussd_request; gsm0480_decode_ss_request; gsm0480_wrap_facility; -- To view, visit https://gerrit.osmocom.org/1340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:17:35 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 28 Nov 2016 14:17:35 +0000 Subject: [PATCH] openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1262 to look at the new patch set (#2). Support Deactivate PDP Context Request from network This commit will enable trigger of Deactivate PDP context Request message based on the IMSI of the subscriber. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c 2 files changed, 27 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/1262/2 diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index 24e286c..c72171a 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -369,6 +369,8 @@ * ottherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn); +void drop_pdp_for_ms(const char *imsi); + char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); /* diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index e5a54d9..d30f401 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -667,6 +667,31 @@ } } +/* High-level function to be called for PDP deactivation initiated from SGSN */ +void drop_pdp_for_ms(const char *imsi) +{ + OSMO_ASSERT(imsi != NULL); + struct sgsn_mm_ctx *mm; + struct sgsn_pdp_ctx *pdp; + + LOGP(DGPRS, LOGL_NOTICE, "SGSN intiated Deactivate PDP for IMSI: %s\n",imsi); + /* Search the PDP for this subscriber */ + mm = sgsn_mm_ctx_by_imsi(imsi); + if (mm) { + if (llist_empty(&mm->pdp_list)) { + gsm0408_gprs_access_cancelled(mm, GMM_CAUSE_GPRS_NOTALLOWED); + LOGP(DGPRS, LOGL_NOTICE, "No pdp context for this IMSI\n"); + } else { + + llist_for_each_entry(pdp, &mm->pdp_list, list) { + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_DEACT_REGULAR); + LOGPDPCTXP(LOGL_NOTICE, pdp, "PDP Deactivation Successful\n"); + } + } + } else + LOGP(DGPRS, LOGL_NOTICE, "No mm context for this IMSI\n"); +} + /* High-level function to be called in case a GGSN has disappeared or * otherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn) -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:19:42 2016 From: gerrit-no-reply at lists.osmocom.org (mrinal) Date: Mon, 28 Nov 2016 14:19:42 +0000 Subject: [PATCH] osmo-pcu[master]: Add debugging log for RLC data block decoding Message-ID: Review at https://gerrit.osmocom.org/1342 Add debugging log for RLC data block decoding Added debugging log for RLC UL Data Block decoding for both GPRS/EGPRS cases. Change-Id: I8c197bdc4cd1330cbab0adfd188336d27682cec4 --- M src/decoding.cpp M tests/tbf/TbfTest.err 2 files changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/1342/1 diff --git a/src/decoding.cpp b/src/decoding.cpp index 6ae4b16..0dbb10a 100644 --- a/src/decoding.cpp +++ b/src/decoding.cpp @@ -76,6 +76,9 @@ } else if (li->li == 127 && li->e == 1) { /* TS 44.060, table 10.4.14a.1, row 3 & 5 */ /* only filling bytes left */ + LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA LI contains " + "only filling bytes with extention octet: LI=%d, E=%d, count=%d\n", + li->li, li->e, num_chunks); break; } else if (li->li > 0) { /* TS 44.060, table 10.4.14a.1, row 1 & 2b */ @@ -88,6 +91,9 @@ return -EINVAL; } + LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA LI contains " + "extention octet: LI=%d, E=%d, count=%d\n", + li->li, li->e, num_chunks); num_chunks += 1; if (e == 1) { @@ -161,6 +167,9 @@ chunks[num_chunks].is_complete = li->li || is_last_block; + LOGP(DRLCMACUL, LOGL_DEBUG, "UL DATA LI contains " + "extention octet: LI=%d, M=%d, E=%d, count=%d\n", + li->li, li->m, li->e, num_chunks); num_chunks += 1; if (e == 1 && m == 1) { diff --git a/tests/tbf/TbfTest.err b/tests/tbf/TbfTest.err index a680812..2647551 100644 --- a/tests/tbf/TbfTest.err +++ b/tests/tbf/TbfTest.err @@ -6460,6 +6460,7 @@ - Raising V(R) to 2 - Taking block 1 out, raising V(Q) to 2 - Assembling frames: (len=44) +UL DATA LI contains extention octet: LI=0, E=1, count=0 TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) complete UL frame len=44 LLC [PCU -> SGSN] TBF(TFI=0 TLLI=0xf1223344 DIR=UL STATE=FLOW EGPRS) len=44 No bctx -- To view, visit https://gerrit.osmocom.org/1342 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I8c197bdc4cd1330cbab0adfd188336d27682cec4 Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: mrinal From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:25:13 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Mon, 28 Nov 2016 14:25:13 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 2: Code-Review-1 (1 comment) * Log message not carrying enough information be helpful when debugging an issue * My previous comment was the missing NULL check but now there is a NULL check but other cases as well. The commit message doesn't explain why you are doing it. The added code doesn't match the name of the method either. https://gerrit.osmocom.org/#/c/1262/2/openbsc/src/gprs/gprs_sgsn.c File openbsc/src/gprs/gprs_sgsn.c: Line 692: LOGP(DGPRS, LOGL_NOTICE, "No mm context for this IMSI\n"); The SGSN might have 1000 or 10000 subscribers. If you add a notice log then make it carry meaningful information... At tleast two cases in this routine. -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 2 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:45:41 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 28 Nov 2016 14:45:41 +0000 Subject: [PATCH] libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Hello Harald Welte, arvind.sirsikar, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/415 to look at the new patch set (#10). Add function to get uninterrupted bit run Function bitvec_rl_curbit added to get number of uninterrupted bits run in vector starting from the current bit till max number of bits. Test case is added to check bitvec_rl_curbit. Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 --- M include/osmocom/core/bitvec.h M src/bitvec.c M tests/bitvec/bitvec_test.c M tests/bitvec/bitvec_test.ok 4 files changed, 89 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/15/415/10 diff --git a/include/osmocom/core/bitvec.h b/include/osmocom/core/bitvec.h index 19e2af8..0e17ba7 100644 --- a/include/osmocom/core/bitvec.h +++ b/include/osmocom/core/bitvec.h @@ -89,6 +89,7 @@ void bitvec_to_string_r(const struct bitvec *bv, char *str); void bitvec_zero(struct bitvec *bv); unsigned bitvec_rl(const struct bitvec *bv, bool b); +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits); void bitvec_shiftl(struct bitvec *bv, unsigned int n); int16_t bitvec_get_int16_msb(const struct bitvec *bv, unsigned int num_bits); unsigned int bitvec_add_array(struct bitvec *bv, const uint32_t *array, diff --git a/src/bitvec.c b/src/bitvec.c index 38148ac..c895cff 100644 --- a/src/bitvec.c +++ b/src/bitvec.c @@ -575,6 +575,51 @@ return bv->cur_bit; } +/*! \brief Return number (bits) of uninterrupted bit run in vector + * starting from the current bit + * \param[in] bv The boolean vector to work on + * \param[in] b The boolean, sequence of 1's or 0's to be checked + * \param[in] max_bits Total Number of Uncmopresed bits + * \returns Number of consecutive bits of \p b in \p bv and cur_bit will + * \go to cur_bit + number of consecutive bit + */ +unsigned bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits) +{ + unsigned i = 0; + unsigned j = 8; + int temp_res = 0; + int count = 0; + unsigned readIndex = bv->cur_bit; + unsigned remaining_bits = max_bits % 8; + unsigned remaining_bytes = max_bits / 8; + unsigned byte_mask = 0xFF; + + if (readIndex % 8) { + for (j -= (readIndex % 8) ; j > 0 ; j--) { + if (readIndex < max_bits && bitvec_read_field(bv, &readIndex, 1) == b) + temp_res++; + else { + bv->cur_bit--; + return temp_res; + } + } + } + for (i = (readIndex / 8); + i < (remaining_bits ? remaining_bytes + 1 : remaining_bytes); + i++, count++) { + if ((b ? byte_mask : 0) != bv->data[i]) { + bv->cur_bit = (count * 8 + + leading_bits(bv->data[i], b) + readIndex); + return count * 8 + + leading_bits(bv->data[i], b) + temp_res; + } + } + bv->cur_bit = (temp_res + (count * 8)) + readIndex; + if (bv->cur_bit > max_bits) + bv->cur_bit = max_bits; + return (bv->cur_bit - readIndex + temp_res); +} + /*! \brief Shifts bitvec to the left, n MSB bits lost */ void bitvec_shiftl(struct bitvec *bv, unsigned n) { diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index a98a91c..4219c4f 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -150,6 +150,18 @@ } } +static inline void test_bitvec_rl_curbit(struct bitvec *bv, bool b, int max_bits, + int result ) +{ + int num = 0; + int readIndex = bv->cur_bit; + OSMO_ASSERT (bv->cur_bit < max_bits); + num = bitvec_rl_curbit(bv, b, max_bits); + readIndex += num; + OSMO_ASSERT (bv->cur_bit == readIndex); + OSMO_ASSERT (num == result); +} + static void test_array() { struct bitvec b; @@ -245,7 +257,35 @@ test_array(); - printf("\nbitvec ok.\n"); + printf("\nbitvec_runlength....\n"); + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xff, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 8; + test_bitvec_rl_curbit(&bv, 1, 64, 6); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 0, 52, 52); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0xfc, 8); + bv.cur_bit -= 2; + test_bitvec_rl_curbit(&bv, 0, 64, 58); + + bitvec_zero(&bv); + bitvec_set_uint(&bv, 0x07, 8); + bitvec_set_uint(&bv, 0xf8, 8); + bv.cur_bit -= 11; + test_bitvec_rl_curbit(&bv, 1, 64, 8); + + bitvec_zero(&bv); + test_bitvec_rl_curbit(&bv, 1, 64, 0); + + printf("\nbitvec ok.\n"); return 0; } diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index e256108..6281973 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -166,4 +166,6 @@ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ ........ +bitvec_runlength.... + bitvec ok. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 10 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin From gerrit-no-reply at lists.osmocom.org Mon Nov 28 14:47:44 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Mon, 28 Nov 2016 14:47:44 +0000 Subject: libosmocore[master]: Add function to get uninterrupted bit run In-Reply-To: References: Message-ID: Patch Set 9: OSMO_ASSERT(num == result) is required for test completion process so,retrieving it. -- To view, visit https://gerrit.osmocom.org/415 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Iae153d3639ea6b891c1fc10d7801a435c9492e26 Gerrit-PatchSet: 9 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: prasadkg Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: arvind.sirsikar Gerrit-Reviewer: prasadkg Gerrit-Reviewer: pravin Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 28 15:59:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 15:59:30 +0000 Subject: [PATCH] openbsc[master]: factor out gen of USSD notify and release complete to libosm... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1129 to look at the new patch set (#7). factor out gen of USSD notify and release complete to libosmocore Both libmsc and libbsc will need distinct gsm0480_send_ussdNotify() and gsm0480_send_releaseComplete() functions, since there will be distinct subscriber connection structs. Rename to msc_send_ussd_notify() and msc_send_ussd_release_complete(), and add the same in libbsc with bsc_ prefix in new file gsm_04_80_utils.c. In preparation of this patch, the message generation part of these functions has been added to libosmocore as gsm0480_create_ussd_notify() and gsm0480_create_ussd_release_complete(). Use these. Adjust all libmsc and libbsc callers according to use the msc_* or bsc_* implementation, respectively. Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 --- M openbsc/include/openbsc/gsm_04_80.h M openbsc/src/libbsc/Makefile.am A openbsc/src/libbsc/gsm_04_80_utils.c M openbsc/src/libmsc/gsm_04_80.c M openbsc/src/libmsc/vty_interface_layer3.c M openbsc/src/osmo-bsc/osmo_bsc_api.c M openbsc/src/osmo-bsc/osmo_bsc_ctrl.c M openbsc/src/osmo-bsc/osmo_bsc_filter.c M openbsc/src/osmo-bsc/osmo_bsc_grace.c M openbsc/src/osmo-bsc/osmo_bsc_sccp.c 10 files changed, 64 insertions(+), 38 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/29/1129/7 diff --git a/openbsc/include/openbsc/gsm_04_80.h b/openbsc/include/openbsc/gsm_04_80.h index 74701ac..d65f640 100644 --- a/openbsc/include/openbsc/gsm_04_80.h +++ b/openbsc/include/openbsc/gsm_04_80.h @@ -14,7 +14,12 @@ const struct msgb *msg, const struct ss_request *request); -int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text); -int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn); +int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, + const char *text); +int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); + +int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, + const char *text); +int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn); #endif diff --git a/openbsc/src/libbsc/Makefile.am b/openbsc/src/libbsc/Makefile.am index 8c53817..b8e77e6 100644 --- a/openbsc/src/libbsc/Makefile.am +++ b/openbsc/src/libbsc/Makefile.am @@ -41,6 +41,7 @@ bsc_api.c \ bsc_msc.c bsc_vty.c \ gsm_04_08_utils.c \ + gsm_04_80_utils.c \ bsc_init.c \ bts_init.c \ bsc_rf_ctrl.c \ diff --git a/openbsc/src/libbsc/gsm_04_80_utils.c b/openbsc/src/libbsc/gsm_04_80_utils.c new file mode 100644 index 0000000..e0db81e --- /dev/null +++ b/openbsc/src/libbsc/gsm_04_80_utils.c @@ -0,0 +1,40 @@ +/* OpenBSC utility functions for 3GPP TS 04.80 */ + +/* (C) 2016 by sysmocom s.m.f.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + * + */ + +#include +#include + +int bsc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, + const char *text) +{ + struct msgb *msg = gsm0480_create_ussd_notify(level, text); + if (!msg) + return -1; + return gsm0808_submit_dtap(conn, msg, 0, 0); +} + +int bsc_send_ussd_release_complete(struct gsm_subscriber_connection *conn) +{ + struct msgb *msg = gsm0480_create_ussd_release_complete(); + if (!msg) + return -1; + return gsm0808_submit_dtap(conn, msg, 0, 0); +} diff --git a/openbsc/src/libmsc/gsm_04_80.c b/openbsc/src/libmsc/gsm_04_80.c index 1744455..479d6fb 100644 --- a/openbsc/src/libmsc/gsm_04_80.c +++ b/openbsc/src/libmsc/gsm_04_80.c @@ -138,38 +138,18 @@ return gsm0808_submit_dtap(conn, msg, 0, 0); } -int gsm0480_send_ussdNotify(struct gsm_subscriber_connection *conn, int level, const char *text) +int msc_send_ussd_notify(struct gsm_subscriber_connection *conn, int level, const char *text) { - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm0480_create_unstructuredSS_Notify(level, text); + struct msgb *msg = gsm0480_create_ussd_notify(level, text); if (!msg) return -1; - - gsm0480_wrap_invoke(msg, GSM0480_OP_CODE_USS_NOTIFY, 0); - gsm0480_wrap_facility(msg); - - /* And finally pre-pend the L3 header */ - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - gh->proto_discr = GSM48_PDISC_NC_SS; - gh->msg_type = GSM0480_MTYPE_REGISTER; - return gsm0808_submit_dtap(conn, msg, 0, 0); } -int gsm0480_send_releaseComplete(struct gsm_subscriber_connection *conn) +int msc_send_ussd_release_complete(struct gsm_subscriber_connection *conn) { - struct gsm48_hdr *gh; - struct msgb *msg; - - msg = gsm48_msgb_alloc_name("GSM 04.08 USSD REL COMPL"); + struct msgb *msg = gsm0480_create_ussd_release_complete(); if (!msg) return -1; - - gh = (struct gsm48_hdr *) msgb_push(msg, sizeof(*gh)); - gh->proto_discr = GSM48_PDISC_NC_SS; - gh->msg_type = GSM0480_MTYPE_RELEASE_COMPLETE; - return gsm0808_submit_dtap(conn, msg, 0, 0); } diff --git a/openbsc/src/libmsc/vty_interface_layer3.c b/openbsc/src/libmsc/vty_interface_layer3.c index 0b360b8..edece51 100644 --- a/openbsc/src/libmsc/vty_interface_layer3.c +++ b/openbsc/src/libmsc/vty_interface_layer3.c @@ -473,8 +473,8 @@ return CMD_WARNING; } - gsm0480_send_ussdNotify(conn, level, text); - gsm0480_send_releaseComplete(conn); + msc_send_ussd_notify(conn, level, text); + msc_send_ussd_release_complete(conn); subscr_put(subscr); talloc_free(text); diff --git a/openbsc/src/osmo-bsc/osmo_bsc_api.c b/openbsc/src/osmo-bsc/osmo_bsc_api.c index d31e6c1..7a3ef70 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_api.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_api.c @@ -205,8 +205,8 @@ gsm48_tx_mm_serv_ack(conn); LOGP(DMSC, LOGL_INFO, "Sending USSD message: '%s'\n", text); - gsm0480_send_ussdNotify(conn, 1, text); - gsm0480_send_releaseComplete(conn); + bsc_send_ussd_notify(conn, 1, text); + bsc_send_ussd_release_complete(conn); } /* diff --git a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c index 3010b55..40e1960 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_ctrl.c @@ -598,8 +598,8 @@ * the release complete when we get a returnResultLast * for this invoke id. */ - gsm0480_send_releaseComplete(conn); - gsm0480_send_ussdNotify(conn, alert, text_str); + bsc_send_ussd_release_complete(conn); + bsc_send_ussd_notify(conn, alert, text_str); cmd->reply = "Found a connection"; break; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_filter.c b/openbsc/src/osmo-bsc/osmo_bsc_filter.c index 14e0b71..66c6406 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_filter.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_filter.c @@ -246,8 +246,8 @@ int bsc_send_welcome_ussd(struct gsm_subscriber_connection *conn) { - gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt); - gsm0480_send_releaseComplete(conn); + bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_welcome_txt); + bsc_send_ussd_release_complete(conn); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_grace.c b/openbsc/src/osmo-bsc/osmo_bsc_grace.c index e6194ab..6409a3a 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_grace.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_grace.c @@ -112,8 +112,8 @@ if (lchan->state != LCHAN_S_ACTIVE) return -1; - gsm0480_send_ussdNotify(conn, 0, text); - gsm0480_send_releaseComplete(conn); + bsc_send_ussd_notify(conn, 0, text); + bsc_send_ussd_release_complete(conn); return 0; } diff --git a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c index 86b27be..2fafed6 100644 --- a/openbsc/src/osmo-bsc/osmo_bsc_sccp.c +++ b/openbsc/src/osmo-bsc/osmo_bsc_sccp.c @@ -285,8 +285,8 @@ return; /* send USSD notification */ - gsm0480_send_ussdNotify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt); - gsm0480_send_releaseComplete(conn); + bsc_send_ussd_notify(conn, 1, conn->sccp_con->msc->ussd_msc_lost_txt); + bsc_send_ussd_release_complete(conn); } static void bsc_notify_and_close_conns(struct bsc_msc_connection *msc_con) -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Mon Nov 28 15:59:30 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 15:59:30 +0000 Subject: [PATCH] openbsc[master]: sms_next_rp_msg_ref(): use direct pointer to next_rp_ref cou... In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1131 to look at the new patch set (#7). sms_next_rp_msg_ref(): use direct pointer to next_rp_ref counter libbsc and libmsc will have separate subscriber connection structs. Hence don't rely on gsm_subscriber_connection, but work on a direct pointer to the counter for the next RP reference. The only very thin function in gsm_04_11_helper.c thus becomes obsolete: drop the entire file. Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 --- M openbsc/include/openbsc/gsm_04_11.h M openbsc/src/libcommon-cs/common_cs.c M openbsc/src/libmsc/Makefile.am M openbsc/src/libmsc/gsm_04_11.c D openbsc/src/libmsc/gsm_04_11_helper.c M openbsc/tests/gsm0408/gsm0408_test.c 6 files changed, 20 insertions(+), 43 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/31/1131/7 diff --git a/openbsc/include/openbsc/gsm_04_11.h b/openbsc/include/openbsc/gsm_04_11.h index 00c3a19..149de90 100644 --- a/openbsc/include/openbsc/gsm_04_11.h +++ b/openbsc/include/openbsc/gsm_04_11.h @@ -38,5 +38,5 @@ struct gsm_sms *sms); void gsm411_sapi_n_reject(struct gsm_subscriber_connection *conn); -uint8_t sms_next_rp_msg_ref(struct gsm_subscriber_connection *conn); +uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref); #endif diff --git a/openbsc/src/libcommon-cs/common_cs.c b/openbsc/src/libcommon-cs/common_cs.c index 8d09b7e..3149580 100644 --- a/openbsc/src/libcommon-cs/common_cs.c +++ b/openbsc/src/libcommon-cs/common_cs.c @@ -27,6 +27,8 @@ #include #include #include +#include +#include /* Warning: if bsc_network_init() is not called, some of the members of * gsm_network are not initialized properly and must not be used! (In @@ -113,3 +115,16 @@ gh->data[0] = cause; return msg; } + +uint8_t sms_next_rp_msg_ref(uint8_t *next_rp_ref) +{ + const uint8_t rp_msg_ref = *next_rp_ref; + /* + * This should wrap as the valid range is 0 to 255. We only + * transfer one SMS at a time so we don't need to check if + * the id has been already assigned. + */ + *next_rp_ref += 1; + + return rp_msg_ref; +} diff --git a/openbsc/src/libmsc/Makefile.am b/openbsc/src/libmsc/Makefile.am index d236d3a..9d966db 100644 --- a/openbsc/src/libmsc/Makefile.am +++ b/openbsc/src/libmsc/Makefile.am @@ -27,7 +27,6 @@ db.c \ gsm_04_08.c \ gsm_04_11.c \ - gsm_04_11_helper.c \ gsm_04_80.c \ gsm_subscriber.c \ mncc.c \ diff --git a/openbsc/src/libmsc/gsm_04_11.c b/openbsc/src/libmsc/gsm_04_11.c index 3a2effe..48a87e0 100644 --- a/openbsc/src/libmsc/gsm_04_11.c +++ b/openbsc/src/libmsc/gsm_04_11.c @@ -873,7 +873,7 @@ struct msgb *msg = gsm411_msgb_alloc(); struct gsm_trans *trans; uint8_t *data, *rp_ud_len; - uint8_t msg_ref = sms_next_rp_msg_ref(conn); + uint8_t msg_ref = sms_next_rp_msg_ref(&conn->next_rp_ref); int transaction_id; int rc; diff --git a/openbsc/src/libmsc/gsm_04_11_helper.c b/openbsc/src/libmsc/gsm_04_11_helper.c deleted file mode 100644 index f48c6de..0000000 --- a/openbsc/src/libmsc/gsm_04_11_helper.c +++ /dev/null @@ -1,37 +0,0 @@ -/* Helpers for SMS/GSM 04.11 */ -/* - * (C) 2014 by Holger Hans Peter Freyther - * - * All Rights Reserved - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation; either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - * - */ - -#include -#include - -uint8_t sms_next_rp_msg_ref(struct gsm_subscriber_connection *conn) -{ - const uint8_t rp_msg_ref = conn->next_rp_ref; - /* - * This should wrap as the valid range is 0 to 255. We only - * transfer one SMS at a time so we don't need to check if - * the id has been already assigned. - */ - conn->next_rp_ref += 1; - - return rp_msg_ref; -} - diff --git a/openbsc/tests/gsm0408/gsm0408_test.c b/openbsc/tests/gsm0408/gsm0408_test.c index 0c7b5ce..9e7babb 100644 --- a/openbsc/tests/gsm0408/gsm0408_test.c +++ b/openbsc/tests/gsm0408/gsm0408_test.c @@ -563,15 +563,15 @@ memset(&conn, 0, sizeof(conn)); conn.next_rp_ref = 255; - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 255); - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 0); - res = sms_next_rp_msg_ref(&conn); + res = sms_next_rp_msg_ref(&conn.next_rp_ref); printf("Allocated reference: %d\n", res); OSMO_ASSERT(res == 1); } -- To view, visit https://gerrit.osmocom.org/1131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Mon Nov 28 16:01:05 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 16:01:05 +0000 Subject: openbsc[master]: sms_next_rp_msg_ref(): use direct pointer to next_rp_ref cou... In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+2 reinstate +2, lost due to resolved merge conflict from a change in #1129 -- To view, visit https://gerrit.osmocom.org/1131 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I2a2e9ba6a981a385d1f8f07acbe03536ffed0072 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 28 16:04:13 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Mon, 28 Nov 2016 16:04:13 +0000 Subject: libosmo-netif[master]: osmo_stream_srv_fd_cb(): don't leak socket FDs on errors In-Reply-To: References: Message-ID: Patch Set 1: related: https://lists.osmocom.org/pipermail/openbsc/2016-November/009892.html -- To view, visit https://gerrit.osmocom.org/1320 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I3a3ce9194ab7ca5c1921fc79c2a1c9e10a552cf0 Gerrit-PatchSet: 1 Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Mon Nov 28 16:55:04 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Mon, 28 Nov 2016 16:55:04 +0000 Subject: [PATCH] osmo-bts[master]: Save seq. num. of RTP in Control Buffer Message-ID: Review at https://gerrit.osmocom.org/1343 Save seq. num. of RTP in Control Buffer Having this information is useful for debugging - save it alongside with Marker bit from RTP header. Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997 --- M include/osmo-bts/msg_utils.h M src/common/l1sap.c 2 files changed, 9 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/43/1343/1 diff --git a/include/osmo-bts/msg_utils.h b/include/osmo-bts/msg_utils.h index 4f9868c..dcc122f 100644 --- a/include/osmo-bts/msg_utils.h +++ b/include/osmo-bts/msg_utils.h @@ -16,6 +16,9 @@ /* Access 1st byte of msgb control buffer */ #define rtpmsg_marker_bit(x) ((x)->cb[0]) +/* Access 2nd and 3rd bytes of msgb control buffer as uint16_t */ +#define rtpmsg_seq(x) (&(x)->cb[1]) + /** * Classification of OML message. ETSI for plain GSM 12.21 * messages and IPA/Osmo for manufacturer messages. diff --git a/src/common/l1sap.c b/src/common/l1sap.c index 553011f..b0475ed 100644 --- a/src/common/l1sap.c +++ b/src/common/l1sap.c @@ -662,6 +662,7 @@ struct gsm_time g_time; struct gsm_lchan *lchan; uint8_t chan_nr, marker = 0; + uint16_t seq; uint32_t fn; chan_nr = rts_ind->chan_nr; @@ -695,6 +696,8 @@ } else { /* Obtain RTP header Marker bit from control buffer */ marker = rtpmsg_marker_bit(resp_msg); + /* Obtain RTP header Sequence Number from control buffer */ + seq = osmo_load16le(rtpmsg_seq(resp_msg)); resp_msg->l2h = resp_msg->data; msgb_push(resp_msg, sizeof(*resp_l1sap)); @@ -1075,8 +1078,10 @@ /* Store RTP header Marker bit in control buffer */ rtpmsg_marker_bit(msg) = marker; + /* Store RTP header Sequence Number in control buffer */ + osmo_store16le(seq_number, rtpmsg_seq(msg)); - /* make sure the queue doesn't get too long */ + /* make sure the queue doesn't get too long */ llist_for_each_entry(tmp, &lchan->dl_tch_queue, list) count++; while (count >= 2) { -- To view, visit https://gerrit.osmocom.org/1343 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Max From gerrit-no-reply at lists.osmocom.org Mon Nov 28 22:23:18 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Mon, 28 Nov 2016 22:23:18 +0000 Subject: [PATCH] libosmocore[master]: timer: only call the callback if not NULL Message-ID: Review at https://gerrit.osmocom.org/1344 timer: only call the callback if not NULL Fix a crash in osmo-sgsn. Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e --- M src/timer.c 1 file changed, 2 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/44/1344/1 diff --git a/src/timer.c b/src/timer.c index 10a0b95..cc6d5cc 100644 --- a/src/timer.c +++ b/src/timer.c @@ -241,7 +241,8 @@ restart: llist_for_each_entry(this, &timer_eviction_list, list) { osmo_timer_del(this); - this->cb(this->data); + if (this->cb) + this->cb(this->data); work = 1; goto restart; } -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Nov 29 06:15:47 2016 From: gerrit-no-reply at lists.osmocom.org (sivasankari) Date: Tue, 29 Nov 2016 06:15:47 +0000 Subject: [PATCH] osmo-pcu[master]: Add statistics in the ms and tbf level. Message-ID: Review at https://gerrit.osmocom.org/1345 Add statistics in the ms and tbf level. Adds DL throughput in show ms imsi . Adds the number of coding schemes counter and rlc nacked counter at TBf level. Change-Id: Ia95b0404989b00db0e7ba416bc40d09ef41fde1c --- M src/gprs_rlcmac_meas.cpp M src/pcu_vty_functions.cpp M src/rlc.cpp M src/rlc.h M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp M tests/types/TypesTest.cpp 8 files changed, 95 insertions(+), 7 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/45/1345/1 diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index 5a2e38e..d6bbc19 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -179,6 +179,8 @@ if (elapsed < 128) return 0; + tbf->m_bw.dl_throughput = (tbf->m_bw.dl_bw_octets/elapsed); + LOGP(DRLCMACMEAS, LOGL_INFO, "DL Bandwitdh of IMSI=%s / TLLI=0x%08x: " "%d KBits/s\n", tbf->imsi(), tbf->tlli(), tbf->m_bw.dl_bw_octets / elapsed); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index ca7f7ad..416a074 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -76,6 +76,27 @@ vty_out(vty, " V(A)=%d V(S)=%d nBSN=%d%s", win->v_a(), win->v_s(), win->resend_needed(), win->window_stalled() ? " STALLED" : ""); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, " RLC Nacked=%d", dl_tbf->m_rlc_nacked); + if (tbf->ms()->mode() == GprsCodingScheme::GPRS) { + vty_out(vty, " CS1=%d CS2=%d CS3=%d CS4=%d", + dl_tbf->statistics.cs1, + dl_tbf->statistics.cs2, + dl_tbf->statistics.cs3, + dl_tbf->statistics.cs4); + } else { + vty_out(vty, " MCS1=%d MCS2=%d MCS3=%d MCS4=%d MCS5=%d", + dl_tbf->statistics.mcs1, + dl_tbf->statistics.mcs2, + dl_tbf->statistics.mcs3, + dl_tbf->statistics.mcs4, + dl_tbf->statistics.mcs5); + vty_out(vty, " MCS6=%d MCS7=%d MCS8=%d MCS9=%d", + dl_tbf->statistics.mcs6, + dl_tbf->statistics.mcs7, + dl_tbf->statistics.mcs8, + dl_tbf->statistics.mcs9); + } } vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE); } @@ -176,11 +197,15 @@ ms->ul_tbf()->tfi(), ms->ul_tbf()->state_name(), VTY_NEWLINE); - if (ms->dl_tbf()) + if (ms->dl_tbf()) { vty_out(vty, " Downlink TBF: TFI=%d, state=%s%s", ms->dl_tbf()->tfi(), ms->dl_tbf()->state_name(), VTY_NEWLINE); + vty_out(vty, " Current DL Throughput: %d Kbits/sec %s", + ms->dl_tbf()->m_bw.dl_throughput, + VTY_NEWLINE); + } llist_for_each(i_tbf, &ms->old_tbfs()) vty_out(vty, " Old %-19s TFI=%d, state=%s%s", diff --git a/src/rlc.cpp b/src/rlc.cpp index 2bffccb..5059e23 100644 --- a/src/rlc.cpp +++ b/src/rlc.cpp @@ -129,6 +129,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); bts->rlc_nacked(); + dl_tbf.m_rlc_nacked++; *lost += 1; } } @@ -153,6 +154,7 @@ LOGP(DRLCMACDL, LOGL_DEBUG, "- got NACK for BSN=%d\n", bsn); m_v_b.mark_nacked(bsn); bts->rlc_nacked(); + dl_tbf.m_rlc_nacked++; *lost += 1; } } diff --git a/src/rlc.h b/src/rlc.h index b2fcd95..14b8bbb 100644 --- a/src/rlc.h +++ b/src/rlc.h @@ -37,6 +37,7 @@ struct BTS; struct gprs_rlc_v_n; +struct gprs_rlcmac_dl_tbf; /* The state of a BSN in the send/receive window */ enum gprs_rlc_ul_bsn_state { @@ -318,8 +319,9 @@ uint16_t m_v_a; /* ack state */ gprs_rlc_v_b m_v_b; + gprs_rlcmac_dl_tbf &dl_tbf; - gprs_rlc_dl_window(); + gprs_rlc_dl_window(gprs_rlcmac_dl_tbf &tbf); }; struct gprs_rlc_v_n { @@ -498,9 +500,10 @@ return bsn & mod_sns(); } -inline gprs_rlc_dl_window::gprs_rlc_dl_window() +inline gprs_rlc_dl_window::gprs_rlc_dl_window(gprs_rlcmac_dl_tbf &tbf) : m_v_s(0) , m_v_a(0) + , dl_tbf(tbf) { } diff --git a/src/tbf.cpp b/src/tbf.cpp index 25209e4..46f8268 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -49,6 +49,23 @@ timerclear(&rssi_tv); } +gprs_rlcmac_tbf::Statistics::Statistics() : + cs1(0), + cs2(0), + cs3(0), + cs4(0), + mcs1(0), + mcs2(0), + mcs3(0), + mcs4(0), + mcs5(0), + mcs6(0), + mcs7(0), + mcs8(0), + mcs9(0) +{ +} + gprs_rlcmac_tbf::gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir) : state_flags(0), direction(dir), @@ -732,7 +749,8 @@ gprs_rlcmac_dl_tbf::BandWidth::BandWidth() : dl_bw_octets(0), dl_loss_lost(0), - dl_loss_received(0) + dl_loss_received(0), + dl_throughput(0) { timerclear(&dl_bw_tv); timerclear(&dl_loss_tv); @@ -744,7 +762,8 @@ m_wait_confirm(0), m_dl_ack_requested(false), m_last_dl_poll_fn(0), - m_last_dl_drained_fn(0) + m_last_dl_drained_fn(0), + m_window(*this) { memset(&m_llc_timer, 0, sizeof(m_llc_timer)); } diff --git a/src/tbf.h b/src/tbf.h index 1e98a24..97bad1d 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -225,6 +225,24 @@ uint8_t m_tfi; time_t m_created_ts; + struct Statistics { + uint32_t cs1; + uint32_t cs2; + uint32_t cs3; + uint32_t cs4; + uint32_t mcs1; + uint32_t mcs2; + uint32_t mcs3; + uint32_t mcs4; + uint32_t mcs5; + uint32_t mcs6; + uint32_t mcs7; + uint32_t mcs8; + uint32_t mcs9; + + Statistics(); + } statistics; + protected: gprs_rlcmac_bts *bts_data() const; @@ -395,10 +413,12 @@ bool m_dl_ack_requested; int32_t m_last_dl_poll_fn; int32_t m_last_dl_drained_fn; + int32_t m_rlc_nacked; struct BandWidth { struct timeval dl_bw_tv; /* timestamp for dl bw calculation */ uint32_t dl_bw_octets; /* number of octets since bw_tv */ + uint32_t dl_throughput; /* throughput to be displayed in stats */ struct timeval dl_loss_tv; /* timestamp for loss calculation */ uint16_t dl_loss_lost; /* sum of lost packets */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index c6f3945..9dfffa3 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -1342,45 +1342,58 @@ switch (coding_scheme) { case GprsCodingScheme::CS1 : bts->gprs_dl_cs1(); + statistics.cs1++; break; case GprsCodingScheme::CS2 : bts->gprs_dl_cs2(); + statistics.cs2++; break; case GprsCodingScheme::CS3 : bts->gprs_dl_cs3(); + statistics.cs3++; break; case GprsCodingScheme::CS4 : bts->gprs_dl_cs4(); + statistics.cs4++; break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : bts->egprs_dl_mcs1(); + statistics.mcs1++; break; case GprsCodingScheme::MCS2 : bts->egprs_dl_mcs2(); + statistics.mcs2++; break; case GprsCodingScheme::MCS3 : bts->egprs_dl_mcs3(); + statistics.mcs3++; break; case GprsCodingScheme::MCS4 : bts->egprs_dl_mcs4(); + statistics.mcs4++; break; case GprsCodingScheme::MCS5 : bts->egprs_dl_mcs5(); + statistics.mcs5++; break; case GprsCodingScheme::MCS6 : bts->egprs_dl_mcs6(); + statistics.mcs6++; break; case GprsCodingScheme::MCS7 : bts->egprs_dl_mcs7(); + statistics.mcs7++; break; case GprsCodingScheme::MCS8 : bts->egprs_dl_mcs8(); + statistics.mcs8++; break; case GprsCodingScheme::MCS9 : bts->egprs_dl_mcs9(); + statistics.mcs9++; break; } } diff --git a/tests/types/TypesTest.cpp b/tests/types/TypesTest.cpp index ee1c817..58ecc60 100644 --- a/tests/types/TypesTest.cpp +++ b/tests/types/TypesTest.cpp @@ -21,6 +21,7 @@ */ #include "bts.h" #include "tbf.h" +#include "rlc.h" #include "gprs_debug.h" #include "encoding.h" #include "decoding.h" @@ -147,7 +148,9 @@ static void test_rlc_dl_ul_basic() { { - gprs_rlc_dl_window dl_win; + struct BTS BTS; + gprs_rlcmac_dl_tbf dl_tbf(&BTS); + gprs_rlc_dl_window dl_win(dl_tbf); OSMO_ASSERT(dl_win.window_empty()); OSMO_ASSERT(!dl_win.window_stalled()); OSMO_ASSERT(dl_win.distance() == 0); @@ -346,7 +349,8 @@ char show_rbb[65]; uint8_t bits_data[8]; BTS dummy_bts; - gprs_rlc_dl_window dl_win; + gprs_rlcmac_dl_tbf dl_tbf(&dummy_bts); + gprs_rlc_dl_window dl_win(dl_tbf); bitvec bits; int bsn_begin, bsn_end, num_blocks; Ack_Nack_Description_t desc; -- To view, visit https://gerrit.osmocom.org/1345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia95b0404989b00db0e7ba416bc40d09ef41fde1c Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: sivasankari From gerrit-no-reply at lists.osmocom.org Tue Nov 29 09:13:27 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Nov 2016 09:13:27 +0000 Subject: libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 11:13:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 11:13:53 +0000 Subject: openbsc[master]: factor out gen of USSD notify and release complete to libosm... In-Reply-To: References: Message-ID: Patch Set 7: build failure because this depends on libosmocore #1339 + #1340 -- To view, visit https://gerrit.osmocom.org/1129 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I33a84e3c28576ced91d2ea24103123431f551173 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 11:45:13 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Tue, 29 Nov 2016 11:45:13 +0000 Subject: [PATCH] libosmocore[master]: gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ... Message-ID: Review at https://gerrit.osmocom.org/1346 gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ_T_PDCH_TWO_PHASE For BSC-located pcu the BSC must understand the PDCH chan request. Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784 --- M include/osmocom/gsm/protocol/gsm_04_08.h 1 file changed, 2 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/1346/1 diff --git a/include/osmocom/gsm/protocol/gsm_04_08.h b/include/osmocom/gsm/protocol/gsm_04_08.h index 767aa3d..c05b62e 100644 --- a/include/osmocom/gsm/protocol/gsm_04_08.h +++ b/include/osmocom/gsm/protocol/gsm_04_08.h @@ -1456,6 +1456,8 @@ CHREQ_T_PAG_R_TCH_F, CHREQ_T_PAG_R_TCH_FH, CHREQ_T_LMU, + CHREQ_T_PDCH_ONE_PHASE, + CHREQ_T_PDCH_TWO_PHASE, CHREQ_T_RESERVED_SDCCH, CHREQ_T_RESERVED_IGNORE, }; -- To view, visit https://gerrit.osmocom.org/1346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus From gerrit-no-reply at lists.osmocom.org Tue Nov 29 12:04:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 12:04:14 +0000 Subject: libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 12:04:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 12:04:17 +0000 Subject: [MERGED] libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: timer: only call the callback if not NULL ...................................................................... timer: only call the callback if not NULL Fix a crash in osmo-sgsn. Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e --- M src/timer.c 1 file changed, 2 insertions(+), 1 deletion(-) Approvals: Max: Looks good to me, but someone else must approve Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/timer.c b/src/timer.c index 10a0b95..cc6d5cc 100644 --- a/src/timer.c +++ b/src/timer.c @@ -241,7 +241,8 @@ restart: llist_for_each_entry(this, &timer_eviction_list, list) { osmo_timer_del(this); - this->cb(this->data); + if (this->cb) + this->cb(this->data); work = 1; goto restart; } -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 29 12:30:12 2016 From: gerrit-no-reply at lists.osmocom.org (sivasankari) Date: Tue, 29 Nov 2016 12:30:12 +0000 Subject: [PATCH] osmo-pcu[master]: Add statistics in the ms and tbf level. In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1345 to look at the new patch set (#2). Add statistics in the ms and tbf level. Adds DL throughput in show ms imsi . Adds the number of coding schemes counter and rlc nacked counter at TBf level. Change-Id: Ia95b0404989b00db0e7ba416bc40d09ef41fde1c --- M src/gprs_rlcmac_meas.cpp M src/pcu_vty_functions.cpp M src/tbf.cpp M src/tbf.h M src/tbf_dl.cpp 5 files changed, 84 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/45/1345/2 diff --git a/src/gprs_rlcmac_meas.cpp b/src/gprs_rlcmac_meas.cpp index 5a2e38e..d6bbc19 100644 --- a/src/gprs_rlcmac_meas.cpp +++ b/src/gprs_rlcmac_meas.cpp @@ -179,6 +179,8 @@ if (elapsed < 128) return 0; + tbf->m_bw.dl_throughput = (tbf->m_bw.dl_bw_octets/elapsed); + LOGP(DRLCMACMEAS, LOGL_INFO, "DL Bandwitdh of IMSI=%s / TLLI=0x%08x: " "%d KBits/s\n", tbf->imsi(), tbf->tlli(), tbf->m_bw.dl_bw_octets / elapsed); diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp index ca7f7ad..8fe7999 100644 --- a/src/pcu_vty_functions.cpp +++ b/src/pcu_vty_functions.cpp @@ -76,6 +76,27 @@ vty_out(vty, " V(A)=%d V(S)=%d nBSN=%d%s", win->v_a(), win->v_s(), win->resend_needed(), win->window_stalled() ? " STALLED" : ""); + vty_out(vty, "%s", VTY_NEWLINE); + vty_out(vty, " RLC Nacked=%d", dl_tbf->m_rlc_nacked); + if (tbf->ms()->mode() == GprsCodingScheme::GPRS) { + vty_out(vty, " CS1=%d CS2=%d CS3=%d CS4=%d", + dl_tbf->statistics.cs1, + dl_tbf->statistics.cs2, + dl_tbf->statistics.cs3, + dl_tbf->statistics.cs4); + } else { + vty_out(vty, " MCS1=%d MCS2=%d MCS3=%d MCS4=%d MCS5=%d", + dl_tbf->statistics.mcs1, + dl_tbf->statistics.mcs2, + dl_tbf->statistics.mcs3, + dl_tbf->statistics.mcs4, + dl_tbf->statistics.mcs5); + vty_out(vty, " MCS6=%d MCS7=%d MCS8=%d MCS9=%d", + dl_tbf->statistics.mcs6, + dl_tbf->statistics.mcs7, + dl_tbf->statistics.mcs8, + dl_tbf->statistics.mcs9); + } } vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE); } @@ -176,11 +197,15 @@ ms->ul_tbf()->tfi(), ms->ul_tbf()->state_name(), VTY_NEWLINE); - if (ms->dl_tbf()) + if (ms->dl_tbf()) { vty_out(vty, " Downlink TBF: TFI=%d, state=%s%s", ms->dl_tbf()->tfi(), ms->dl_tbf()->state_name(), VTY_NEWLINE); + vty_out(vty, " Current DL Throughput: %d Kbps %s", + ms->dl_tbf()->m_bw.dl_throughput, + VTY_NEWLINE); + } llist_for_each(i_tbf, &ms->old_tbfs()) vty_out(vty, " Old %-19s TFI=%d, state=%s%s", diff --git a/src/tbf.cpp b/src/tbf.cpp index 25209e4..b75e682 100644 --- a/src/tbf.cpp +++ b/src/tbf.cpp @@ -49,6 +49,23 @@ timerclear(&rssi_tv); } +gprs_rlcmac_tbf::Statistics::Statistics() : + cs1(0), + cs2(0), + cs3(0), + cs4(0), + mcs1(0), + mcs2(0), + mcs3(0), + mcs4(0), + mcs5(0), + mcs6(0), + mcs7(0), + mcs8(0), + mcs9(0) +{ +} + gprs_rlcmac_tbf::gprs_rlcmac_tbf(BTS *bts_, gprs_rlcmac_tbf_direction dir) : state_flags(0), direction(dir), @@ -732,7 +749,8 @@ gprs_rlcmac_dl_tbf::BandWidth::BandWidth() : dl_bw_octets(0), dl_loss_lost(0), - dl_loss_received(0) + dl_loss_received(0), + dl_throughput(0) { timerclear(&dl_bw_tv); timerclear(&dl_loss_tv); @@ -744,7 +762,8 @@ m_wait_confirm(0), m_dl_ack_requested(false), m_last_dl_poll_fn(0), - m_last_dl_drained_fn(0) + m_last_dl_drained_fn(0), + m_rlc_nacked(0) { memset(&m_llc_timer, 0, sizeof(m_llc_timer)); } diff --git a/src/tbf.h b/src/tbf.h index 1e98a24..97bad1d 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -225,6 +225,24 @@ uint8_t m_tfi; time_t m_created_ts; + struct Statistics { + uint32_t cs1; + uint32_t cs2; + uint32_t cs3; + uint32_t cs4; + uint32_t mcs1; + uint32_t mcs2; + uint32_t mcs3; + uint32_t mcs4; + uint32_t mcs5; + uint32_t mcs6; + uint32_t mcs7; + uint32_t mcs8; + uint32_t mcs9; + + Statistics(); + } statistics; + protected: gprs_rlcmac_bts *bts_data() const; @@ -395,10 +413,12 @@ bool m_dl_ack_requested; int32_t m_last_dl_poll_fn; int32_t m_last_dl_drained_fn; + int32_t m_rlc_nacked; struct BandWidth { struct timeval dl_bw_tv; /* timestamp for dl bw calculation */ uint32_t dl_bw_octets; /* number of octets since bw_tv */ + uint32_t dl_throughput; /* throughput to be displayed in stats */ struct timeval dl_loss_tv; /* timestamp for loss calculation */ uint16_t dl_loss_lost; /* sum of lost packets */ diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp index c6f3945..96262b2 100644 --- a/src/tbf_dl.cpp +++ b/src/tbf_dl.cpp @@ -949,6 +949,7 @@ ms()->update_error_rate(this, error_rate); m_window.update(bts, rbb, first_bsn, &lost, &received); + m_rlc_nacked += lost; /* report lost and received packets */ gprs_rlcmac_received_lost(this, received, lost); @@ -1007,6 +1008,7 @@ m_window.update(bts, show_rbb, ssn, &lost, &received); + m_rlc_nacked += lost; /* report lost and received packets */ gprs_rlcmac_received_lost(this, received, lost); @@ -1342,45 +1344,58 @@ switch (coding_scheme) { case GprsCodingScheme::CS1 : bts->gprs_dl_cs1(); + statistics.cs1++; break; case GprsCodingScheme::CS2 : bts->gprs_dl_cs2(); + statistics.cs2++; break; case GprsCodingScheme::CS3 : bts->gprs_dl_cs3(); + statistics.cs3++; break; case GprsCodingScheme::CS4 : bts->gprs_dl_cs4(); + statistics.cs4++; break; } } else { switch (coding_scheme) { case GprsCodingScheme::MCS1 : bts->egprs_dl_mcs1(); + statistics.mcs1++; break; case GprsCodingScheme::MCS2 : bts->egprs_dl_mcs2(); + statistics.mcs2++; break; case GprsCodingScheme::MCS3 : bts->egprs_dl_mcs3(); + statistics.mcs3++; break; case GprsCodingScheme::MCS4 : bts->egprs_dl_mcs4(); + statistics.mcs4++; break; case GprsCodingScheme::MCS5 : bts->egprs_dl_mcs5(); + statistics.mcs5++; break; case GprsCodingScheme::MCS6 : bts->egprs_dl_mcs6(); + statistics.mcs6++; break; case GprsCodingScheme::MCS7 : bts->egprs_dl_mcs7(); + statistics.mcs7++; break; case GprsCodingScheme::MCS8 : bts->egprs_dl_mcs8(); + statistics.mcs8++; break; case GprsCodingScheme::MCS9 : bts->egprs_dl_mcs9(); + statistics.mcs9++; break; } } -- To view, visit https://gerrit.osmocom.org/1345 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia95b0404989b00db0e7ba416bc40d09ef41fde1c Gerrit-PatchSet: 2 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: sivasankari Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 29 13:20:22 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Nov 2016 13:20:22 +0000 Subject: libosmocore[master]: gsm0408: add chreq_type for CHREQ_T_PDCH_ONE_PHASE and CHREQ... In-Reply-To: References: Message-ID: Patch Set 1: Can we use it in standalone osmopcu too? -- To view, visit https://gerrit.osmocom.org/1346 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ice44dcaaf798f93af3652a96c567f8e16a6cf784 Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 18:06:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Nov 2016 18:06:39 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplex In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#8). Add IPA multiplex Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 283 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/8 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..d518827 --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,283 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.3" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None, hlen = True): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + if hlen: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">B", proto) + data + else: + if hlen: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + return struct.pack(">BB", proto, ext) + data + + def del_header(self, data, short = False): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length (if short = False, otherwise length is already stripped by the caller), IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + if short: + (proto, ) = struct.unpack('>B', data[:1]) # no length prefix + else: + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + if short: + return (None, ) + struct.unpack('>BB', data[:2]) + (data[2:], ) # _, protocol, extension, data + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + if short: + return None, proto, None, data[3:] # _, protocol, _, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self, hlen = True): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING'], hlen) + + def pong(self, hlen = True): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG'], hlen) + + def id_ack(self, hlen = True): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK'], hlen) + + def id_get(self, hlen = True): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET'], hlen) + + def id_resp(self, data, hlen = True): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP'], hlen) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data, hlen = True): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL'], hlen) + + def del_header(self, data, short = False): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data, short) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val, hlen = True): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val), hlen) + + def cmd(self, var, val = None, hlen = True): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxint) + if val != None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val), hlen) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var), hlen) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 8 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 29 18:06:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Nov 2016 18:06:39 +0000 Subject: [PATCH] openbsc[master]: bsc_control.py: use ipa.py module In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1266 to look at the new patch set (#7). bsc_control.py: use ipa.py module Simplify code by using Ctrl implementation from ipa.py Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 --- M openbsc/contrib/bsc_control.py 1 file changed, 14 insertions(+), 58 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/66/1266/7 diff --git a/openbsc/contrib/bsc_control.py b/openbsc/contrib/bsc_control.py index ba86947..c631f02 100755 --- a/openbsc/contrib/bsc_control.py +++ b/openbsc/contrib/bsc_control.py @@ -1,29 +1,12 @@ #!/usr/bin/python # -*- mode: python-mode; py-indent-tabs-mode: nil -*- -import sys,os, random +import random from optparse import OptionParser +from ipa import Ctrl import socket -import struct verbose = False - -def prefix_ipa_ctrl_header(data): - return struct.pack(">HBB", len(data)+1, 0xee, 0) + data - -def ipa_ctrl_header(header): - (plen, ipa_proto, osmo_proto) = struct.unpack(">HBB", header) - return None if (ipa_proto != 0xee or osmo_proto != 0) else plen - -def remove_ipa_ctrl_header(data): - if (len(data) < 4): - raise BaseException("Answer too short!") - plen = ipa_ctrl_header(data[:4]) - if (None == plen): - raise BaseException("Wrong protocol in answer!") - if (plen + 3 > len(data)): - print "Warning: Wrong payload length (expected %i, got %i)" % (plen, len(data) - 3) - return data[4:plen+3], data[plen+3:] def connect(host, port): if verbose: @@ -34,39 +17,18 @@ sck.connect((host, port)) return sck -def send(sck, data): - if verbose: - print "Sending \"%s\"" %(data) - data = prefix_ipa_ctrl_header(data) - sck.send(data) - -def do_set(var, value, op_id, sck): - setmsg = "SET %s %s %s" %(op_id, var, value) - send(sck, setmsg) - -def do_get(var, op_id, sck): - getmsg = "GET %s %s" %(op_id, var) - send(sck, getmsg) - def do_set_get(sck, var, value = None): - r = random.randint(1, sys.maxint) - if (value != None): - s = 'SET_REPLY' - do_set(var, value, r, sck) - else: - s = 'GET_REPLY' - do_get(var, r, sck) - (answer, data) = remove_ipa_ctrl_header(sck.recv(4096)) - x = answer.split() - if (s == x[0] and str(r) == x[1] and var == x[2]): - return None if ('SET_REPLY' == s and value != x[3]) else x[3] - return None + (r, c) = Ctrl().cmd(var, value) + sck.send(c) + answer = Ctrl().del_header(sck.recv(4096)) + return (answer,) + Ctrl().verify(answer, r, var, value) def set_var(sck, var, val): - return do_set_get(sck, var, val) + do_set_get(sck, var, val) def get_var(sck, var): - return do_set_get(sck, var) + (_, _, v) = do_set_get(sck, var) + return v if __name__ == '__main__': random.seed() @@ -105,17 +67,14 @@ if options.cmd_set: if len(args) < 2: parser.error("Set requires var and value arguments") - do_set(args[0], ' '.join(args[1:]), options.op_id, sock) + (a, _, _) = do_set_get(sock, args[0], ' '.join(args[1:])) + print "Got message:", a if options.cmd_get: if len(args) != 1: parser.error("Get requires the var argument") - do_get(args[0], options.op_id, sock) - - data = sock.recv(1024) - while (len(data)>0): - (answer, data) = remove_ipa_ctrl_header(data) - print "Got message:", answer + (a, _, _) = do_set_get(sock, args[0]) + print "Got message:", a if options.monitor: while True: @@ -123,9 +82,6 @@ if len(data) == 0: print "Connection is gone." break - - while len(data) > 0: - (answer, data) = remove_ipa_ctrl_header(data) - print "Got message:", answer + print "Got message:", Ctrl().del_header(data) sock.close() -- To view, visit https://gerrit.osmocom.org/1266 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I25fd7cd4b42126354b72abd60a3837be5d13e159 Gerrit-PatchSet: 7 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 29 18:06:39 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Tue, 29 Nov 2016 18:06:39 +0000 Subject: [PATCH] openbsc[master]: Add twisted-based IPA multiplex In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1268 to look at the new patch set (#9). Add twisted-based IPA multiplex Add sample applications using twisted framework for IPA and CTRL multiplex. Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Related: SYS#3028 --- A openbsc/contrib/twisted_ipa.py 1 file changed, 359 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/68/1268/9 diff --git a/openbsc/contrib/twisted_ipa.py b/openbsc/contrib/twisted_ipa.py new file mode 100755 index 0000000..1ce72a7 --- /dev/null +++ b/openbsc/contrib/twisted_ipa.py @@ -0,0 +1,359 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +from ipa import Ctrl, IPA +from twisted.internet.protocol import ReconnectingClientFactory +from twisted.internet import reactor, protocol +from twisted.protocols import basic + + +class IPACommon(basic.Int16StringReceiver): + """ + Generic IPA protocol handler: include some routines for simpler subprotocols + It's not intended as full implementation of all subprotocols, rather common ground and example code + """ + def osmo_CTRL(self, data): + """ + OSMO CTRL protocol + Placeholder, see corresponding derived class + """ + pass + + def osmo_MGCP(self, data): + """ + OSMO MGCP extension + """ + if self.factory.debug: + print('OSMO MGCP received %s' % data) + + def osmo_LAC(self, data): + """ + OSMO LAC extension + """ + if self.factory.debug: + print('OSMO LAC received %s' % data) + + def osmo_SMSC(self, data): + """ + OSMO SMSC extension + """ + if self.factory.debug: + print('OSMO SMSC received %s' % data) + + def osmo_ORC(self, data): + """ + OSMO ORC extension + """ + if self.factory.debug: + print('OSMO ORC received %s' % data) + + def osmo_GSUP(self, data): + """ + OSMO GSUP extension + """ + if self.factory.debug: + print('OSMO GSUP received %s' % data) + + def osmo_OAP(self, data): + """ + OSMO OAP extension + """ + if self.factory.debug: + print('OSMO OAP received %s' % data) + + def osmo_UNKNOWN(self, data): + """ + OSMO defaul extension handler + """ + if self.factory.debug: + print('OSMO unknown extension received %s' % data) + + def handle_RSL(self, d, pr, ex): + """ + RSL protocol handler + """ + if self.factory.debug: + print('IPA RSL received message with attribute %s' % ex) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Placeholder, see corresponding derived class + """ + pass + + def handle_SCCP(self, d, pr, ex): + """ + SCCP protocol handler + """ + if self.factory.debug: + print('IPA SCCP received message with attribute %s' % ex) + + def handle_OML(self, d, pr, ex): + """ + OML protocol handler + """ + if self.factory.debug: + print('IPA OML received message with attribute %s' % ex) + + def handle_OSMO(self, d, pr, ex): + """ + Dispatcher point for OSMO subprotocols based on extension name, lambda default should never happen + """ + method = getattr(self, 'osmo_' + IPA().ext(ex), lambda: "extension dispatch failure") + method(d) + + def handle_MGCP(self, d, pr, ex): + """ + MGCP protocol handler + """ + if self.factory.debug: + print('IPA MGCP received message with attribute %s' % ex) + + def handle_UNKNOWN(self, d, pr, ex): + """ + Default protocol handler + """ + if self.factory.debug: + print('IPA received message for %s (%s) protocol with attribute %s' % (IPA().proto(pr), pr, ex)) + + def process_chunk(self, data): + """ + Generic message dispatcher for IPA (sub)protocols based on protocol name, lambda default should never happen + """ + (_, pr, ex, d) = IPA().del_header(data, True) + if d is not None: + if self.factory.debug: + print('IPA received %s::%s [%d/%d] %s' % (IPA().proto(pr), IPA().ext_name(pr, ex), len(data), len(d), d)) + method = getattr(self, 'handle_' + IPA().proto(pr), lambda: "protocol dispatch failure") + method(d, pr, ex) + + def dataReceived(self, data): + """ + Override for dataReceived from Int16StringReceiver because of inherently incompatible interpretation of length + If default handler is used than we would always get off-by-1 error (Int16StringReceiver use equivalent of l + 2) + """ + if len(data): + (l, pr, ex, d) = IPA().del_header(data) + self.process_chunk(data[2:(l + 3)]) + self.dataReceived(data[(l + 3):]) + + def connectionMade(self): + """ + We have to resetDelay() here to drop internal state to default values to make reconnection logic work + Make sure to call this via super() if overriding to keep reconnection logic intact + """ + if self.factory.debug: + print('IPA connection made!') + self.factory.resetDelay() + + +class CCM(IPACommon): + """ + Implementation of CCM protocol for IPA multiplex + """ + def ack(self): + self.transport.write(IPA().id_ack()) + + def ping(self): + self.transport.write(IPA().ping()) + + def pong(self): + self.transport.write(IPA().pong()) + + def handle_CCM(self, data, pr, msgt): + """ + CCM (IPA Connection Management) + Only basic logic necessary for tests is implemented (ping-pong, id ack etc) + """ + if msgt == IPA.MSGT['ID_GET']: + self.transport.getHandle().sendall(IPA().id_resp(self.factory.ccm_id)) + # if we call + # self.transport.write(IPA().id_resp(self.factory.test_id)) + # instead, than we would have to also call + # reactor.callLater(1, self.ack) + # instead of self.ack() + # otherwise the writes will be glued together - hence the necessity for ugly hack with 1s timeout + # Note: this still might work depending on the IPA implementation details on the other side + self.ack() + # schedule PING in 4s + reactor.callLater(4, self.ping) + if msgt == IPA.MSGT['PING']: + self.pong() + + +class CTRL(IPACommon): + """ + Implementation of Osmocom control protocol for IPA multiplex + """ + def ctrl_SET(self, data, op, v): + """ + Handle CTRL SET command + """ + if self.factory.debug: + print('CTRL SET [%s] %s' % (op, v)) + + def ctrl_SET_REPLY(self, data, op, v): + """ + Handle CTRL SET reply + """ + if self.factory.debug: + print('CTRL SET REPLY [%s] %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + Handle CTRL GET command + """ + if self.factory.debug: + print('CTRL GET [%s] %s' % (op, v)) + + def ctrl_GET_REPLY(self, data, op, v): + """ + Handle CTRL GET reply + """ + if self.factory.debug: + print('CTRL GET REPLY [%s] %s' % (op, v)) + + def ctrl_TRAP(self, data, op, v): + """ + Handle CTRL TRAP command + """ + if self.factory.debug: + print('CTRL TRAP [%s] %s' % (op, v)) + + def ctrl_ERROR(self, data, op, v): + """ + Handle CTRL ERROR reply + """ + if self.factory.debug: + print('CTRL ERROR [%s] %s' % (op, v)) + + def osmo_CTRL(self, data): + """ + OSMO CTRL message dispatcher, lambda default should never happen + For basic tests only, appropriate handling routines should be replaced: see CtrlServer for example + """ + if self.factory.debug: + print('OSMO CTRL received %s::%s' % Ctrl().parse(data.decode('utf-8'))) + (cmd, op, v) = data.decode('utf-8').split(' ', 2) + method = getattr(self, 'ctrl_' + cmd, lambda: "CTRL unknown command") + method(data, op, v) + + +class IPAServer(CCM): + """ + Test implementation of IPA server + Demonstrate CCM opearation by overriding necessary bits from CCM + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CCM + Initiate CCM upon connection + """ + print('IPA server connection made!') + super(IPAServer, self).connectionMade() + self.transport.write(IPA().id_get()) + + +class CtrlServer(CTRL): + """ + Test implementation of CTRL server + Demonstarte CTRL handling by overriding simpler routines from CTRL + """ + def connectionMade(self): + """ + Keep reconnection logic working by calling routine from CTRL + Send TRAP upon connection + Note: we can't use sendString() because of it's incompatibility with IPA interpretation of length prefix + """ + print('CTRL server connection made!') + super(CtrlServer, self).connectionMade() + self.transport.write(Ctrl().trap('LOL', 'what')) + self.transport.write(Ctrl().trap('rulez', 'XXX')) + + def reply(self, r): + self.transport.write(r.encode('utf-8')) + + def ctrl_SET(self, data, op, v): + """ + CTRL SET command: always succeed + """ + print('SET [%s] %s' % (op, v)) + self.reply('SET_REPLY %s %s' % (op, v)) + + def ctrl_GET(self, data, op, v): + """ + CTRL GET command: always fail + """ + print('GET [%s] %s' % (op, v)) + self.reply('ERROR %s No variable found' % op) + + +class IPAFactory(ReconnectingClientFactory): + """ + Generic IPA Client Factory which can be used to store state for various subprotocols and manage connections + Note: so far we do not really need separate Factory for acting as a server due to protocol simplicity + """ + protocol = IPACommon + debug = False + ccm_id = IPA().identity(unit = b'1515/0/1', mac = b'b0:0b:fa:ce:de:ad:be:ef', utype = b'sysmoBTS', name = b'StingRay', location = b'hell', sw = IPA.version.encode('utf-8')) + + def __init__(self, proto = None, debug = False, ccm_id = None): + if proto: + self.protocol = proto + if debug: + self.debug = debug + if ccm_id: + self.ccm_id = ccm_id + + def clientConnectionFailed(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection failed:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionFailed(self, connector, reason) + + def clientConnectionLost(self, connector, reason): + """ + Only necessayr for as debugging aid - if we can somehow set parent's class noisy attribute than we can omit this method + """ + if self.debug: + print('IPAFactory connection lost:', reason.getErrorMessage()) + ReconnectingClientFactory.clientConnectionLost(self, connector, reason) + + +if __name__ == '__main__': + print("Twisted IPA %s app with IPA v%s loaded." % ('v0.2', IPA.version)) + # test as CTRL client, for example by connecting to osmo-bsc to receive TRAP messages when osmo-bts-* connects to it: + reactor.connectTCP('localhost', 4250, IPAFactory(CTRL, debug = True)) + # test as CTRL server, for example using bsc_control.py to issue set/get commands: + #reactor.listenTCP(4249, IPAFactory(CtrlServer, debug = True)) + # test as IPA client, for example by connecting to osmo-nitb which would initiate A-bis/IP session: + #reactor.connectTCP('localhost', IPA.TCP_PORT_OML, IPAFactory(CCM, debug = True)) + #reactor.connectTCP('localhost', IPA.TCP_PORT_RSL, IPAFactory(CCM, debug = True)) + # test as IPA server, for example by running osmo-bts-* which would attempt to connect to us: + #reactor.listenTCP(IPA.TCP_PORT_RSL, IPAFactory(IPAServer, debug = True)) + #reactor.listenTCP(IPA.TCP_PORT_OML, IPAFactory(IPAServer, debug = True)) + reactor.run() -- To view, visit https://gerrit.osmocom.org/1268 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I07559df420b7fe8418f3412f45acd9a375e43bc5 Gerrit-PatchSet: 9 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Tue Nov 29 19:59:40 2016 From: gerrit-no-reply at lists.osmocom.org (Tom Tsou) Date: Tue, 29 Nov 2016 19:59:40 +0000 Subject: osmo-bts[master]: trx: Add "maxdlynb" VTY command to control max TA for Normal... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1246 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277 Gerrit-PatchSet: 2 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Alexander Chemeris Gerrit-Reviewer: Alexander Chemeris Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Tom Tsou Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 21:45:24 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 21:45:24 +0000 Subject: [PATCH] osmo-bts[master]: osmo-bts-trx: remove obsolete include of netif/rtp.h Message-ID: Review at https://gerrit.osmocom.org/1347 osmo-bts-trx: remove obsolete include of netif/rtp.h Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 0 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/47/1347/1 diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 0423e9f..d946ad5 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -32,8 +32,6 @@ #include #include -#include - #include #include #include -- To view, visit https://gerrit.osmocom.org/1347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 29 21:48:17 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 21:48:17 +0000 Subject: osmo-bts[master]: osmo-bts-trx: remove obsolete include of netif/rtp.h In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Tue Nov 29 21:48:18 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 21:48:18 +0000 Subject: [MERGED] osmo-bts[master]: osmo-bts-trx: remove obsolete include of netif/rtp.h In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: osmo-bts-trx: remove obsolete include of netif/rtp.h ...................................................................... osmo-bts-trx: remove obsolete include of netif/rtp.h Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c --- M src/osmo-bts-trx/scheduler_trx.c 1 file changed, 0 insertions(+), 2 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/src/osmo-bts-trx/scheduler_trx.c b/src/osmo-bts-trx/scheduler_trx.c index 0423e9f..d946ad5 100644 --- a/src/osmo-bts-trx/scheduler_trx.c +++ b/src/osmo-bts-trx/scheduler_trx.c @@ -32,8 +32,6 @@ #include #include -#include - #include #include #include -- To view, visit https://gerrit.osmocom.org/1347 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Tue Nov 29 23:37:50 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Tue, 29 Nov 2016 23:37:50 +0000 Subject: [PATCH] osmo-pcu[master]: debian: fix: add pcuif_proto.h to osmo-pcu.install Message-ID: Review at https://gerrit.osmocom.org/1348 debian: fix: add pcuif_proto.h to osmo-pcu.install Following 68fc12775fac03e5e26a008dfa68c92498bfb772 'Install the pcuif_proto.h header file' we need to add pcuif_proto.h to the debian install file. Change-Id: Ib8e185900826baadcc96fcde1491903dbaf85f8b --- M debian/osmo-pcu.install 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/48/1348/1 diff --git a/debian/osmo-pcu.install b/debian/osmo-pcu.install index 1f9a8e0..768719c 100644 --- a/debian/osmo-pcu.install +++ b/debian/osmo-pcu.install @@ -1,2 +1,3 @@ etc/osmocom/osmo-pcu.cfg usr/bin/osmo-pcu +usr/include/osmocom/pcu/pcuif_proto.h -- To view, visit https://gerrit.osmocom.org/1348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib8e185900826baadcc96fcde1491903dbaf85f8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:00:19 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:00:19 +0000 Subject: osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 (2 comments) the osmo-bts build job is so far unable to build the new situation; the easy way out would be to build with --disable-pcu-socket, but I think enabling would be better to catch build bugs. Taking a look at the build job now to accomodate this change... https://gerrit.osmocom.org/#/c/1258/3/configure.ac File configure.ac: Line 118: AC_HELP_STRING([--distable-pcu-socket], "distable" typo, which also causes this to not work ("configure: error: unrecognized option: `--distable-pcu-socket'") Line 119: [disable support for the PCU socket [default=yes]]), at first I interpreted "default=yes" as "default is: yes, disable the support for PCU socket"; "default=enable" would be more clear -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:15:45 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:15:45 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1258 to look at the new patch set (#4). Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Adjust jenkins build scripts: add osmo-pcu for the pcuif_proto.h header and pass --with-osmo-pcu to 'configure'. While at it, avoid dup by defining the configure options once and re-using for 'make distcheck'. Tweaked-by: nhofmeyr Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 7 files changed, 107 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/4 diff --git a/configure.ac b/configure.ac index 3fd6b8a..9ee22e4 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--disable-pcu-socket], + [disable support for the PCU socket [default=yes]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4fecd0a..150a13e 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -41,6 +41,9 @@ cd "$base" +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + set +x echo echo @@ -50,10 +53,16 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --with-octsdr-2g=$deps/layer1-api/ + --enable-octphy + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index be544a7..f1629a5 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -43,6 +43,9 @@ cd "$base" +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + set +x echo echo @@ -52,11 +55,16 @@ set -x autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --enable-sysmocom-bts + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..3e86d81 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + $(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 4 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:22:14 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:22:14 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1258 to look at the new patch set (#5). Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Adjust jenkins build scripts: add osmo-pcu for the pcuif_proto.h header and pass --with-osmo-pcu to 'configure'. While at it, avoid dup by defining the configure options once and re-using for 'make distcheck'. Tweaked-by: nhofmeyr Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 7 files changed, 109 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/5 diff --git a/configure.ac b/configure.ac index 3fd6b8a..9ee22e4 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--disable-pcu-socket], + [disable support for the PCU socket [default=yes]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4fecd0a..a796755 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -39,6 +39,10 @@ git reset --hard $FIRMWARE_VERSION fi +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -50,10 +54,16 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --with-octsdr-2g=$deps/layer1-api/ + --enable-octphy + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index be544a7..e2523d3 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -41,6 +41,10 @@ mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -52,11 +56,16 @@ set -x autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --enable-sysmocom-bts + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..3e86d81 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + $(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 5 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:37:20 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:37:20 +0000 Subject: osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Patch Set 3: (1 comment) https://gerrit.osmocom.org/#/c/1258/3/src/common/Makefile.am File src/common/Makefile.am: Line 2: $(PCU_INCDIR) ah, and a missing -I here -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 3 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:37:50 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:37:50 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1258 to look at the new patch set (#6). Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Adjust jenkins build scripts: add osmo-pcu for the pcuif_proto.h header and pass --with-osmo-pcu to 'configure'. While at it, avoid dup by defining the configure options once and re-using for 'make distcheck'. Tweaked-by: nhofmeyr Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 7 files changed, 109 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/6 diff --git a/configure.ac b/configure.ac index 3fd6b8a..9ee22e4 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--disable-pcu-socket], + [disable support for the PCU socket [default=yes]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4fecd0a..a796755 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -39,6 +39,10 @@ git reset --hard $FIRMWARE_VERSION fi +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -50,10 +54,16 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --with-octsdr-2g=$deps/layer1-api/ + --enable-octphy + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index be544a7..e2523d3 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -41,6 +41,10 @@ mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -52,11 +56,16 @@ set -x autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" +configure_flags=" + --with-openbsc=$deps/openbsc/openbsc/include + --with-osmo-pcu=$deps/osmo-pcu/include + --enable-sysmocom-bts + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..ed146dc 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + -I$(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:46:00 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:46:00 +0000 Subject: osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Patch Set 6: (1 comment) https://gerrit.osmocom.org/#/c/1258/6/contrib/jenkins_oct.sh File contrib/jenkins_oct.sh: Line 58: --with-openbsc=$deps/openbsc/openbsc/include for some reason 'make distcheck' can't deal with this $configure_flags and needs a single line or backslashes instead. -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 6 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: Yes From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:46:15 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:46:15 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1258 to look at the new patch set (#7). Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Adjust jenkins build scripts: add osmo-pcu for the pcuif_proto.h header and pass --with-osmo-pcu to 'configure'. While at it, avoid dup by defining the configure options once and re-using for 'make distcheck'. Tweaked-by: nhofmeyr Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 7 files changed, 109 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/7 diff --git a/configure.ac b/configure.ac index 3fd6b8a..9ee22e4 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--disable-pcu-socket], + [disable support for the PCU socket [default=yes]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4fecd0a..8ea4b6b 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -39,6 +39,10 @@ git reset --hard $FIRMWARE_VERSION fi +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -50,10 +54,16 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --with-octsdr-2g=$deps/layer1-api/ \ + --enable-octphy \ + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index be544a7..4d35bbd 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -41,6 +41,10 @@ mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -52,11 +56,16 @@ set -x autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" +configure_flags=" \ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --enable-sysmocom-bts \ + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..ed146dc 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + -I$(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 00:49:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 00:49:09 +0000 Subject: osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Patch Set 7: Code-Review+1 phew, finally! -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 7 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 01:01:54 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 01:01:54 +0000 Subject: [PATCH] osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1258 to look at the new patch set (#8). Use system-installed pcuif_proto.h instead of local copy The pcuif_proto.h file is now maintained (and installed) by osmo-pcu, at least after Change-Id I60976c9be5488256d1ff55fdc5aa548e3705400d has been merged to osmo-pcu.git. You must either install osmo-pcu or disable the pcu socket support by using --disable-pcu-socket. Adjust jenkins build scripts: add osmo-pcu for the pcuif_proto.h header and pass --with-osmo-pcu to 'configure'. While at it, avoid dup by defining the configure options once and re-using for 'make distcheck'. Tweaked-by: nhofmeyr Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 --- M configure.ac M contrib/jenkins_oct.sh M contrib/jenkins_sysmobts.sh M include/osmo-bts/Makefile.am D include/osmo-bts/pcuif_proto.h M src/common/Makefile.am M src/common/pcu_sock.c 7 files changed, 109 insertions(+), 165 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/58/1258/8 diff --git a/configure.ac b/configure.ac index 3fd6b8a..a588a01 100644 --- a/configure.ac +++ b/configure.ac @@ -114,6 +114,26 @@ [#include ]) CPPFLAGS=$oldCPPFLAGS +AC_ARG_ENABLE([pcu-socket], + AC_HELP_STRING([--disable-pcu-socket], + [disable support for the PCU socket [default=enable]]), + [enable_pcu="no"],[enable_pcu="yes"]) +AC_ARG_WITH([osmo-pcu], + [AC_HELP_STRING([--with-osmo-pcu=INCLUDE_DIR], + [OsmoPCU include directory for osmocom/pcu/pcuif_proto.h])], + [pcu_incdir="$withval"], + [pcu_incdir="$incdir"]) +AC_SUBST([PCU_INCDIR], $pcu_incdir) + +if test "$enable_pcu" = "yes"; then + oldCPPFLAGS=$CPPFLAGS + CPPFLAGS="$CPPFLAGS -I$PCU_INCDIR $LIBOSMOCORE_CFLAGS" + AC_CHECK_HEADER([osmocom/pcu/pcuif_proto.h], + [AC_DEFINE(HAVE_PCUIF_PROTO_H, 1, [Define if pcuif_proto.h exists])], + [AC_MSG_ERROR([osmocom/pcu/pcuif_proto.h can not be found, please install osmo-pcu or use --disable-pcu-socket])]) + CPPFLAGS=$oldCPPFLAGS +fi + # Check for the sbts2050_header.h that was added after the 3.6 release oldCPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS" diff --git a/contrib/jenkins_oct.sh b/contrib/jenkins_oct.sh index 4fecd0a..8ea4b6b 100755 --- a/contrib/jenkins_oct.sh +++ b/contrib/jenkins_oct.sh @@ -39,6 +39,10 @@ git reset --hard $FIRMWARE_VERSION fi +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -50,10 +54,16 @@ set -x autoreconf --install --force -./configure --with-openbsc="$deps/openbsc/openbsc/include" --with-octsdr-2g="$deps/layer1-api/" --enable-octphy +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --with-octsdr-2g=$deps/layer1-api/ \ + --enable-octphy \ + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--with-octsdr-2g=$deps/layer1-api/ --with-openbsc=$deps/openbsc/openbsc/include --enable-octphy" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/contrib/jenkins_sysmobts.sh b/contrib/jenkins_sysmobts.sh index be544a7..4d35bbd 100755 --- a/contrib/jenkins_sysmobts.sh +++ b/contrib/jenkins_sysmobts.sh @@ -41,6 +41,10 @@ mkdir -p "$inst/include/sysmocom/femtobts" cp include/*.h "$inst/include/sysmocom/femtobts/" +# Get osmo-pcu for pcuif_proto.h +cd "$deps" +osmo-deps.sh osmo-pcu + cd "$base" set +x @@ -52,11 +56,16 @@ set -x autoreconf --install --force -./configure --enable-sysmocom-bts --with-openbsc="$deps/openbsc/openbsc/include" +configure_flags=" \ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --enable-sysmocom-bts \ + " +./configure $configure_flags $MAKE $PARALLEL_MAKE $MAKE check \ || cat-testlogs.sh -DISTCHECK_CONFIGURE_FLAGS="--enable-sysmocom-bts --with-openbsc=$deps/openbsc/openbsc/include" \ +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ $MAKE distcheck \ || cat-testlogs.sh diff --git a/include/osmo-bts/Makefile.am b/include/osmo-bts/Makefile.am index ef4165f..4c2f814 100644 --- a/include/osmo-bts/Makefile.am +++ b/include/osmo-bts/Makefile.am @@ -1,5 +1,5 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h logging.h measurement.h \ - oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \ + oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h \ handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \ power_control.h scheduler.h scheduler_backend.h phy_link.h \ dtx_dl_amr_fsm.h diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h deleted file mode 100644 index 5527238..0000000 --- a/include/osmo-bts/pcuif_proto.h +++ /dev/null @@ -1,158 +0,0 @@ -#ifndef _PCUIF_PROTO_H -#define _PCUIF_PROTO_H - -#define PCU_IF_VERSION 0x07 - -/* msg_type */ -#define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ -#define PCU_IF_MSG_DATA_CNF 0x01 /* confirm (e.g. transmission on PCH) */ -#define PCU_IF_MSG_DATA_IND 0x02 /* receive data from given channel */ -#define PCU_IF_MSG_RTS_REQ 0x10 /* ready to send request */ -#define PCU_IF_MSG_RACH_IND 0x22 /* receive RACH */ -#define PCU_IF_MSG_INFO_IND 0x32 /* retrieve BTS info */ -#define PCU_IF_MSG_ACT_REQ 0x40 /* activate/deactivate PDCH */ -#define PCU_IF_MSG_TIME_IND 0x52 /* GSM time indication */ -#define PCU_IF_MSG_PAG_REQ 0x60 /* paging request */ - -/* sapi */ -#define PCU_IF_SAPI_RACH 0x01 /* channel request on CCCH */ -#define PCU_IF_SAPI_AGCH 0x02 /* assignment on AGCH */ -#define PCU_IF_SAPI_PCH 0x03 /* paging/assignment on PCH */ -#define PCU_IF_SAPI_BCCH 0x04 /* SI on BCCH */ -#define PCU_IF_SAPI_PDTCH 0x05 /* packet data/control/ccch block */ -#define PCU_IF_SAPI_PRACH 0x06 /* packet random access channel */ -#define PCU_IF_SAPI_PTCCH 0x07 /* packet TA control channel */ - -/* flags */ -#define PCU_IF_FLAG_ACTIVE (1 << 0)/* BTS is active */ -#define PCU_IF_FLAG_SYSMO (1 << 1)/* access PDCH of sysmoBTS directly */ -#define PCU_IF_FLAG_CS1 (1 << 16) -#define PCU_IF_FLAG_CS2 (1 << 17) -#define PCU_IF_FLAG_CS3 (1 << 18) -#define PCU_IF_FLAG_CS4 (1 << 19) -#define PCU_IF_FLAG_MCS1 (1 << 20) -#define PCU_IF_FLAG_MCS2 (1 << 21) -#define PCU_IF_FLAG_MCS3 (1 << 22) -#define PCU_IF_FLAG_MCS4 (1 << 23) -#define PCU_IF_FLAG_MCS5 (1 << 24) -#define PCU_IF_FLAG_MCS6 (1 << 25) -#define PCU_IF_FLAG_MCS7 (1 << 26) -#define PCU_IF_FLAG_MCS8 (1 << 27) -#define PCU_IF_FLAG_MCS9 (1 << 28) - -struct gsm_pcu_if_data { - uint8_t sapi; - uint8_t len; - uint8_t data[162]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; - int8_t rssi; - uint16_t ber10k; /*!< \brief BER in units of 0.01% */ - int16_t ta_offs_qbits; /* !< \brief Burst TA Offset in quarter bits */ - int16_t lqual_cb; /* !< \brief Link quality in centiBel */ -} __attribute__ ((packed)); - -struct gsm_pcu_if_rts_req { - uint8_t sapi; - uint8_t spare[3]; - uint32_t fn; - uint16_t arfcn; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t block_nr; -} __attribute__ ((packed)); - -struct gsm_pcu_if_rach_ind { - uint8_t sapi; - uint16_t ra; - int16_t qta; - uint32_t fn; - uint16_t arfcn; - uint8_t is_11bit; - uint8_t burst_type; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_trx { - uint16_t arfcn; - uint8_t pdch_mask; /* PDCH channels per TS */ - uint8_t spare; - uint8_t tsc[8]; /* TSC per channel */ - uint32_t hlayer1; -} __attribute__ ((packed)); - -struct gsm_pcu_if_info_ind { - uint32_t version; - uint32_t flags; - struct gsm_pcu_if_info_trx trx[8]; /* TRX infos per BTS */ - uint8_t bsic; - /* RAI */ - uint16_t mcc, mnc, lac, rac; - /* NSE */ - uint16_t nsei; - uint8_t nse_timer[7]; - uint8_t cell_timer[11]; - /* cell */ - uint16_t cell_id; - uint16_t repeat_time; - uint8_t repeat_count; - uint16_t bvci; - uint8_t t3142; - uint8_t t3169; - uint8_t t3191; - uint8_t t3193_10ms; - uint8_t t3195; - uint8_t n3101; - uint8_t n3103; - uint8_t n3105; - uint8_t cv_countdown; - uint16_t dl_tbf_ext; - uint16_t ul_tbf_ext; - uint8_t initial_cs; - uint8_t initial_mcs; - /* NSVC */ - uint16_t nsvci[2]; - uint16_t local_port[2]; - uint16_t remote_port[2]; - uint32_t remote_ip[2]; -} __attribute__ ((packed)); - -struct gsm_pcu_if_act_req { - uint8_t activate; - uint8_t trx_nr; - uint8_t ts_nr; - uint8_t spare; -} __attribute__ ((packed)); - -struct gsm_pcu_if_time_ind { - uint32_t fn; -} __attribute__ ((packed)); - -struct gsm_pcu_if_pag_req { - uint8_t sapi; - uint8_t chan_needed; - uint8_t identity_lv[9]; -} __attribute__ ((packed)); - -struct gsm_pcu_if { - /* context based information */ - uint8_t msg_type; /* message type */ - uint8_t bts_nr; /* bts number */ - uint8_t spare[2]; - - union { - struct gsm_pcu_if_data data_req; - struct gsm_pcu_if_data data_cnf; - struct gsm_pcu_if_data data_ind; - struct gsm_pcu_if_rts_req rts_req; - struct gsm_pcu_if_rach_ind rach_ind; - struct gsm_pcu_if_info_ind info_ind; - struct gsm_pcu_if_act_req act_req; - struct gsm_pcu_if_time_ind time_ind; - struct gsm_pcu_if_pag_req pag_req; - } u; -} __attribute__ ((packed)); - -#endif /* _PCUIF_PROTO_H */ diff --git a/src/common/Makefile.am b/src/common/Makefile.am index dd368d0..ed146dc 100644 --- a/src/common/Makefile.am +++ b/src/common/Makefile.am @@ -1,4 +1,5 @@ -AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) +AM_CPPFLAGS = $(all_includes) -I$(top_srcdir)/include -I$(OPENBSC_INCDIR) \ + -I$(PCU_INCDIR) AM_CFLAGS = -Wall $(LIBOSMOCORE_CFLAGS) $(LIBOSMOTRAU_CFLAGS) $(LIBOSMOCODEC_CFLAGS) LDADD = $(LIBOSMOCORE_LIBS) $(LIBOSMOTRAU_LIBS) $(LIBOSMOCODEC_LIBS) diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 62f18a7..ff3fe73 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -33,14 +33,19 @@ #include #include #include + #include #include #include -#include #include #include #include #include + +#include "btsconfig.h" + +#if defined(HAVE_PCUIF_PROTO_H) +#include uint32_t trx_get_hlayer1(struct gsm_bts_trx *trx); @@ -916,3 +921,60 @@ return false; return true; } + +#else /* defined(HAVE_PCUIF_PROTO_H) */ + +int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed) +{ + return 0; +} + +int pcu_tx_time_ind(uint32_t fn) +{ + return 0; +} + +int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint16_t ra, uint32_t fn, + uint8_t is_11bit, enum ph_burst_type burst_type) +{ + return 0; +} + +int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi, uint16_t ber10k, int16_t bto, int16_t lqual) +{ + return 0; +} + +int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, + uint16_t arfcn, uint8_t block_nr) +{ + return 0; +} + +int pcu_tx_info_ind(void) +{ + return 0; +} + +int pcu_tx_pch_data_cnf(uint32_t fn, uint8_t *data, uint8_t len) +{ + return 0; +} + +int pcu_sock_init(const char *path) +{ + return 0; +} + +void pcu_sock_exit(void) +{ +} + +bool pcu_connected(void) +{ + return false; +} + +#endif /* defined(HAVE_PCUIF_PROTO_H) */ -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 01:02:29 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 01:02:29 +0000 Subject: osmo-bts[master]: Use system-installed pcuif_proto.h instead of local copy In-Reply-To: References: Message-ID: Patch Set 8: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1258 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I4dd2537aeef60c7d154e90f279dc4e7c2392ff76 Gerrit-PatchSet: 8 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Harald Welte Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 01:47:28 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 01:47:28 +0000 Subject: [PATCH] osmo-bts[master]: add jenkins_bts_trx.sh Message-ID: Review at https://gerrit.osmocom.org/1349 add jenkins_bts_trx.sh Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc --- A contrib/jenkins_bts_trx.sh 1 file changed, 49 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/49/1349/1 diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh new file mode 100755 index 0000000..c4f05a9 --- /dev/null +++ b/contrib/jenkins_bts_trx.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmo-abis + +cd "$deps" + +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get openbsc for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-trx ===============================" +echo +set -x + +autoreconf --install --force +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --enable-trx \ + " +./configure $configure_flags +$MAKE $PARALLEL_MAKE +$MAKE check \ + || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ + $MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/1349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:01:53 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:01:53 +0000 Subject: [PATCH] osmo-bts[master]: add jenkins_oct_and_bts_trx.sh Message-ID: Review at https://gerrit.osmocom.org/1350 add jenkins_oct_and_bts_trx.sh Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03 --- A contrib/jenkins_oct_and_bts_trx.sh 1 file changed, 65 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/50/1350/1 diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh new file mode 100755 index 0000000..0740bd0 --- /dev/null +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmo-abis + +cd "$deps" + +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get openbsc for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$deps" +if ! test -d layer1-api; +then + git clone git://git.osmocom.org/octphy-2g-headers layer1-api +fi +cd layer1-api +git fetch origin +if [ $FIRMWARE_VERSION = "master" ]; +then +git reset --hard origin/master +else +git reset --hard $FIRMWARE_VERSION +fi + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-octphy+trx ===============================" +echo +set -x + +autoreconf --install --force +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --with-octsdr-2g=$deps/layer1-api/ \ + --enable-octphy \ + --enable-trx \ + " +./configure $configure_flags +$MAKE $PARALLEL_MAKE +$MAKE check \ + || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ + $MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/1350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:23:02 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:23:02 +0000 Subject: osmo-bts[master]: add jenkins_bts_trx.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:23:06 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:23:06 +0000 Subject: osmo-bts[master]: add jenkins_oct_and_bts_trx.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:23:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:23:09 +0000 Subject: [MERGED] osmo-bts[master]: add jenkins_oct_and_bts_trx.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add jenkins_oct_and_bts_trx.sh ...................................................................... add jenkins_oct_and_bts_trx.sh Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03 --- A contrib/jenkins_oct_and_bts_trx.sh 1 file changed, 65 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_oct_and_bts_trx.sh b/contrib/jenkins_oct_and_bts_trx.sh new file mode 100755 index 0000000..0740bd0 --- /dev/null +++ b/contrib/jenkins_oct_and_bts_trx.sh @@ -0,0 +1,65 @@ +#!/usr/bin/env bash + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmo-abis + +cd "$deps" + +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get openbsc for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$deps" +if ! test -d layer1-api; +then + git clone git://git.osmocom.org/octphy-2g-headers layer1-api +fi +cd layer1-api +git fetch origin +if [ $FIRMWARE_VERSION = "master" ]; +then +git reset --hard origin/master +else +git reset --hard $FIRMWARE_VERSION +fi + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-octphy+trx ===============================" +echo +set -x + +autoreconf --install --force +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --with-octsdr-2g=$deps/layer1-api/ \ + --enable-octphy \ + --enable-trx \ + " +./configure $configure_flags +$MAKE $PARALLEL_MAKE +$MAKE check \ + || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ + $MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/1350 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03 Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:23:09 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:23:09 +0000 Subject: [MERGED] osmo-bts[master]: add jenkins_bts_trx.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: add jenkins_bts_trx.sh ...................................................................... add jenkins_bts_trx.sh Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc --- A contrib/jenkins_bts_trx.sh 1 file changed, 49 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_trx.sh b/contrib/jenkins_bts_trx.sh new file mode 100755 index 0000000..c4f05a9 --- /dev/null +++ b/contrib/jenkins_bts_trx.sh @@ -0,0 +1,49 @@ +#!/usr/bin/env bash + +set -ex + +base="$PWD" +deps="$base/deps" +inst="$deps/install" +export deps inst + +mkdir "$deps" || true +rm -rf "$inst" + +export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH" +export LD_LIBRARY_PATH="$inst/lib" + +osmo-build-dep.sh libosmocore +osmo-build-dep.sh libosmo-abis + +cd "$deps" + +# Get osmo-pcu for pcuif_proto.h +osmo-deps.sh osmo-pcu + +# Get openbsc for gsm_data_shared.* +osmo-deps.sh openbsc + +cd "$base" + +set +x +echo +echo +echo +echo " =============================== osmo-bts-trx ===============================" +echo +set -x + +autoreconf --install --force +configure_flags="\ + --with-openbsc=$deps/openbsc/openbsc/include \ + --with-osmo-pcu=$deps/osmo-pcu/include \ + --enable-trx \ + " +./configure $configure_flags +$MAKE $PARALLEL_MAKE +$MAKE check \ + || cat-testlogs.sh +DISTCHECK_CONFIGURE_FLAGS="$configure_flags" \ + $MAKE distcheck \ + || cat-testlogs.sh -- To view, visit https://gerrit.osmocom.org/1349 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 02:59:34 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 02:59:34 +0000 Subject: libosmocore[master]: gsm0480: add gsm0480_create_ussd_notify() and *_release_comp... In-Reply-To: References: Message-ID: Patch Set 2: Code-Review+1 > needed by #1129 Also, incidentally, the Coverity builds are failing until this is merged, because the sysmocom/iu branch needs this to compile. So a review here would have a profoundly positive impact. (says the guy who made everything break by depending on this patch) -- To view, visit https://gerrit.osmocom.org/1340 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia80e32c7105359915bfad3cc5621a1c09caf20f0 Gerrit-PatchSet: 2 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 03:27:04 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 03:27:04 +0000 Subject: [PATCH] osmo-bts[master]: jenkins: add jenkins_bts_model.sh Message-ID: Review at https://gerrit.osmocom.org/1351 jenkins: add jenkins_bts_model.sh Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a --- A contrib/jenkins_bts_model.sh 1 file changed, 33 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/51/1351/1 diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh new file mode 100755 index 0000000..58eac5b --- /dev/null +++ b/contrib/jenkins_bts_model.sh @@ -0,0 +1,33 @@ +#!/bin/sh +bts_model="$1" + +if [ ! -d "./contrib" ]; then + echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" + exit 1 +fi + +set -x -e + +case "$bts_model" in + + sysmo) + ./contrib/jenkins_sysmobts.sh + ;; + + oct) + ./contrib/jenkins_oct.sh + ;; + + trx) + ./contrib/jenkins_bts_trx.sh + ;; + + oct+trx) + ./contrib/jenkins_oct_and_bts_trx.sh + ;; + + *) + set +x + echo "Unknown BTS model '$bts_model'" + ;; +esac -- To view, visit https://gerrit.osmocom.org/1351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 03:29:12 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 03:29:12 +0000 Subject: osmo-bts[master]: jenkins: add jenkins_bts_model.sh In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/1351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 03:29:58 2016 From: gerrit-no-reply at lists.osmocom.org (Neels Hofmeyr) Date: Wed, 30 Nov 2016 03:29:58 +0000 Subject: [MERGED] osmo-bts[master]: jenkins: add jenkins_bts_model.sh In-Reply-To: References: Message-ID: Neels Hofmeyr has submitted this change and it was merged. Change subject: jenkins: add jenkins_bts_model.sh ...................................................................... jenkins: add jenkins_bts_model.sh Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a --- A contrib/jenkins_bts_model.sh 1 file changed, 33 insertions(+), 0 deletions(-) Approvals: Neels Hofmeyr: Looks good to me, approved Jenkins Builder: Verified diff --git a/contrib/jenkins_bts_model.sh b/contrib/jenkins_bts_model.sh new file mode 100755 index 0000000..58eac5b --- /dev/null +++ b/contrib/jenkins_bts_model.sh @@ -0,0 +1,33 @@ +#!/bin/sh +bts_model="$1" + +if [ ! -d "./contrib" ]; then + echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree" + exit 1 +fi + +set -x -e + +case "$bts_model" in + + sysmo) + ./contrib/jenkins_sysmobts.sh + ;; + + oct) + ./contrib/jenkins_oct.sh + ;; + + trx) + ./contrib/jenkins_bts_trx.sh + ;; + + oct+trx) + ./contrib/jenkins_oct_and_bts_trx.sh + ;; + + *) + set +x + echo "Unknown BTS model '$bts_model'" + ;; +esac -- To view, visit https://gerrit.osmocom.org/1351 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a Gerrit-PatchSet: 1 Gerrit-Project: osmo-bts Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 07:19:09 2016 From: gerrit-no-reply at lists.osmocom.org (pravin) Date: Wed, 30 Nov 2016 07:19:09 +0000 Subject: [PATCH] openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Hello Harald Welte, Jenkins Builder, Holger Freyther, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1262 to look at the new patch set (#3). Support Deactivate PDP Context Request from network Enable Deactivate PDP context based on the IMSI of the subscriber. When there are PDP contexts present for a MM context, PDP context will be deactivated along with GMM Detach(MM context deletion). If there are no PDP present, MM context will be deleted to avoid further PDP context request from the MS. Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 --- M openbsc/include/openbsc/gprs_sgsn.h M openbsc/src/gprs/gprs_sgsn.c 2 files changed, 40 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/1262/3 diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h index 24e286c..c72171a 100644 --- a/openbsc/include/openbsc/gprs_sgsn.h +++ b/openbsc/include/openbsc/gprs_sgsn.h @@ -369,6 +369,8 @@ * ottherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn); +void drop_pdp_for_ms(const char *imsi); + char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len); /* diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c index e5a54d9..42fb6a3 100644 --- a/openbsc/src/gprs/gprs_sgsn.c +++ b/openbsc/src/gprs/gprs_sgsn.c @@ -667,6 +667,44 @@ } } +/* + * High-level function to be called for PDP deactivation initiated from SGSN VTY. + * When there are PDP contexts present for a MM context, PDP context will be + * deactivated along with GMM Detach(MM context deletion). + * If there are no PDP present, MM context will be deleted to avoid further + * PDP context activation for that MS. + */ +void drop_pdp_for_ms(const char *imsi) +{ + OSMO_ASSERT(imsi != NULL); + struct sgsn_mm_ctx *mm; + struct sgsn_pdp_ctx *pdp; + + LOGP(DGPRS, LOGL_NOTICE, "SGSN intiated Deactivate PDP for IMSI: %s\n", + imsi); + /* Search the MM context subscriber */ + mm = sgsn_mm_ctx_by_imsi(imsi); + if (mm) { + /* Search the PDP for this subscriber */ + if (llist_empty(&mm->pdp_list)) { + /* + * Deleting mm context for the subscriber when no PDP + * context is present. + */ + gsm0408_gprs_access_cancelled(mm, GMM_CAUSE_GPRS_NOTALLOWED); + LOGP(DGPRS, LOGL_NOTICE, "No pdp context for this IMSI: %s\n", + imsi); + } else { + llist_for_each_entry(pdp, &mm->pdp_list, list) { + gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_DEACT_REGULAR); + LOGPDPCTXP(LOGL_NOTICE, pdp, "PDP Deactivation " + "Successful\n"); + } + } + } else + LOGP(DGPRS, LOGL_NOTICE, "No mm context for this IMSI: %s\n", imsi); +} + /* High-level function to be called in case a GGSN has disappeared or * otherwise lost state (recovery procedure) */ int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn) -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder From gerrit-no-reply at lists.osmocom.org Wed Nov 30 07:35:50 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 30 Nov 2016 07:35:50 +0000 Subject: openbsc[master]: Support Deactivate PDP Context Request from network In-Reply-To: References: Message-ID: Patch Set 3: Code-Review-1 * Not sure about the debug levels.Multiple lines per subscriber? * With software engineering we learned to put semantic into the function name. Your initial method is called drop pdp context.. but it would crash.. when fixing the crash you changed the semantic as well.. Nothing wrong if you think that changing the semantic is good.. but now the method name is misleading. * IIRC such MS behavior can easily be tested, Jacob wrote quite some SGSN tests, so maybe you test the three cases too? -- To view, visit https://gerrit.osmocom.org/1262 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13 Gerrit-PatchSet: 3 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: pravin Gerrit-Reviewer: Harald Welte Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 11:11:57 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Nov 2016 11:11:57 +0000 Subject: osmo-pcu[master]: debian: fix: add pcuif_proto.h to osmo-pcu.install In-Reply-To: References: Message-ID: Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/1348 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: Ib8e185900826baadcc96fcde1491903dbaf85f8b Gerrit-PatchSet: 1 Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Owner: Neels Hofmeyr Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 12:37:08 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 30 Nov 2016 12:37:08 +0000 Subject: libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Patch Set 1: I would like to see this being reverted. It doesn't make any sense for the SGSN to start a timer and then don't deal with the timeout. The commit message lacks a traceback of the crash, there is no ticket reference to the issue in the SGSN. I think we cover up a defect in the SGSN and should be fixing this one instead? -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 16:33:19 2016 From: gerrit-no-reply at lists.osmocom.org (Max) Date: Wed, 30 Nov 2016 16:33:19 +0000 Subject: [PATCH] openbsc[master]: Add IPA multiplex In-Reply-To: References: Message-ID: Hello Neels Hofmeyr, Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/1265 to look at the new patch set (#9). Add IPA multiplex Add base class and derived Ctrl class implementing ctrl-specific routines. Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Related: SYS#3028 --- A openbsc/contrib/ipa.py 1 file changed, 283 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/65/1265/9 diff --git a/openbsc/contrib/ipa.py b/openbsc/contrib/ipa.py new file mode 100755 index 0000000..c51f2f4 --- /dev/null +++ b/openbsc/contrib/ipa.py @@ -0,0 +1,283 @@ +#!/usr/bin/python3 +# -*- mode: python-mode; py-indent-tabs-mode: nil -*- +""" +/* + * Copyright (C) 2016 sysmocom s.f.m.c. GmbH + * + * All Rights Reserved + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ +""" + +import struct, random, sys + +class IPA(object): + """ + Stateless IPA protocol multiplexer: add/remove/parse (extended) header + """ + version = "0.0.4" + TCP_PORT_OML = 3002 + TCP_PORT_RSL = 3003 + # OpenBSC extensions: OSMO, MGCP_OLD + PROTO = dict(RSL = 0x00, CCM = 0xFE, SCCP = 0xFD, OML = 0xFF, OSMO = 0xEE, MGCP_OLD = 0xFC) + # ...OML Router Control, GSUP GPRS extension, Osmocom Authn Protocol + EXT = dict(CTRL = 0, MGCP = 1, LAC = 2, SMSC = 3, ORC = 4, GSUP = 5, OAP = 6) + # OpenBSC extension: SCCP_OLD + MSGT = dict(PING = 0x00, PONG = 0x01, ID_GET = 0x04, ID_RESP = 0x05, ID_ACK = 0x06, SCCP_OLD = 0xFF) + IDTAG = dict(SERNR = 0, UNITNAME = 1, LOCATION = 2, TYPE = 3, EQUIPVERS = 4, SWVERSION = 5, IPADDR = 6, MACADDR = 7, UNIT = 8) + CTRL_GET = 'GET' + CTRL_SET = 'SET' + CTRL_REP = 'REPLY' + CTRL_ERR = 'ERR' + CTRL_TRAP = 'TRAP' + + def __l(self, d, p): + """ + Reverse dictionary lookup: return key for a given value + """ + if p is None: + return 'UNKNOWN' + return list(d.keys())[list(d.values()).index(p)] + + def __tag(self, t, v): + """ + Create TAG as TLV data + """ + return struct.pack(">HB", len(v) + 1, t) + v + + def proto(self, p): + """ + Lookup protocol name + """ + return self.__l(self.PROTO, p) + + def ext(self, p): + """ + Lookup protocol extension name + """ + return self.__l(self.EXT, p) + + def msgt(self, p): + """ + Lookup message type name + """ + return self.__l(self.MSGT, p) + + def idtag(self, p): + """ + Lookup ID tag name + """ + return self.__l(self.IDTAG, p) + + def ext_name(self, proto, exten): + """ + Return proper extension byte name depending on the protocol used + """ + if self.PROTO['CCM'] == proto: + return self.msgt(exten) + if self.PROTO['OSMO'] == proto: + return self.ext(exten) + return None + + def add_header(self, data, proto, ext = None, hlen = True): + """ + Add IPA header (with extension if necessary), data must be represented as bytes + """ + if ext is None: + if hlen: + return struct.pack(">HB", len(data) + 1, proto) + data + return struct.pack(">B", proto) + data + else: + if hlen: + return struct.pack(">HBB", len(data) + 1, proto, ext) + data + return struct.pack(">BB", proto, ext) + data + + def del_header(self, data, short = False): + """ + Strip IPA protocol header correctly removing extension if present + Returns data length (if short = False, otherwise length is already stripped by the caller), IPA protocol, extension (or None if not defined for a give protocol) and the data without header + """ + if not len(data): + return None, None, None, None + if short: + (proto, ) = struct.unpack('>B', data[:1]) # no length prefix + else: + (dlen, proto) = struct.unpack('>HB', data[:3]) + if self.PROTO['OSMO'] == proto or self.PROTO['CCM'] == proto: # there's extension which we have to unpack + if short: + return (None, ) + struct.unpack('>BB', data[:2]) + (data[2:], ) # _, protocol, extension, data + return struct.unpack('>HBB', data[:4]) + (data[4:], ) # length, protocol, extension, data + if short: + return None, proto, None, data[3:] # _, protocol, _, data + return dlen, proto, None, data[3:] # length, protocol, _, data + + def tag_serial(self, data): + """ + Make TAG for serial number + """ + return self.__tag(self.IDTAG['SERNR'], data) + + def tag_name(self, data): + """ + Make TAG for unit name + """ + return self.__tag(self.IDTAG['UNITNAME'], data) + + def tag_loc(self, data): + """ + Make TAG for location + """ + return self.__tag(self.IDTAG['LOCATION'], data) + + def tag_type(self, data): + """ + Make TAG for unit type + """ + return self.__tag(self.IDTAG['TYPE'], data) + + def tag_equip(self, data): + """ + Make TAG for equipment version + """ + return self.__tag(self.IDTAG['EQUIPVERS'], data) + + def tag_sw(self, data): + """ + Make TAG for software version + """ + return self.__tag(self.IDTAG['SWVERSION'], data) + + def tag_ip(self, data): + """ + Make TAG for IP address + """ + return self.__tag(self.IDTAG['IPADDR'], data) + + def tag_mac(self, data): + """ + Make TAG for MAC address + """ + return self.__tag(self.IDTAG['MACADDR'], data) + + def tag_unit(self, data): + """ + Make TAG for unit ID + """ + return self.__tag(self.IDTAG['UNIT'], data) + + def identity(self, unit = b'', mac = b'', location = b'', utype = b'', equip = b'', sw = b'', name = b'', serial = b''): + """ + Make IPA IDENTITY tag list, by default returns empty concatenated bytes of tag list + """ + return self.tag_unit(unit) + self.tag_mac(mac) + self.tag_loc(location) + self.tag_type(utype) + self.tag_equip(equip) + self.tag_sw(sw) + self.tag_name(name) + self.tag_serial(serial) + + def ping(self, hlen = True): + """ + Make PING message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PING'], hlen) + + def pong(self, hlen = True): + """ + Make PONG message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['PONG'], hlen) + + def id_ack(self, hlen = True): + """ + Make ID_ACK CCM message + """ + return self.add_header(b'', self.PROTO['CCM'], self.MSGT['ID_ACK'], hlen) + + def id_get(self, hlen = True): + """ + Make ID_GET CCM message + """ + return self.add_header(self.identity(), self.PROTO['CCM'], self.MSGT['ID_GET'], hlen) + + def id_resp(self, data, hlen = True): + """ + Make ID_RESP CCM message + """ + return self.add_header(data, self.PROTO['CCM'], self.MSGT['ID_RESP'], hlen) + +class Ctrl(IPA): + """ + Osmocom CTRL protocol implemented on top of IPA multiplexer + """ + def __init__(self): + random.seed() + + def add_header(self, data, hlen = True): + """ + Add CTRL header + """ + return super(Ctrl, self).add_header(data.encode('utf-8'), IPA.PROTO['OSMO'], IPA.EXT['CTRL'], hlen) + + def del_header(self, data, short = False): + """ + Remove CTRL header, check for appropriate protocol and extension + """ + (dlen, proto, ext, d) = super(Ctrl, self).del_header(data, short) + if self.PROTO['OSMO'] != proto or self.EXT['CTRL'] != ext: + return None + return d + + def parse(self, data, op = None): + """ + Parse Ctrl string returning (var, value) pair + var could be None in case of ERROR message + value could be None in case of GET message + """ + (s, i, v) = data.split(' ', 2) + if s == self.CTRL_ERR: + return None, v + if s == self.CTRL_GET: + return v, None + (s, i, var, val) = data.split(' ', 3) + if s == self.CTRL_TRAP and i != '0': + return None, '%s with non-zero id %s' % (s, i) + if op is not None and i != op: + if s == self.CTRL_GET + '_' + self.CTRL_REP or s == self.CTRL_SET + '_' + self.CTRL_REP: + return None, '%s with unexpected id %s' % (s, i) + return var, val + + def trap(self, var, val, hlen = True): + """ + Make TRAP message with given (vak, val) pair + """ + return self.add_header("%s 0 %s %s" % (self.CTRL_TRAP, var, val), hlen) + + def cmd(self, var, val = None, hlen = True): + """ + Make SET/GET command message: returns (r, m) tuple where r is random operation id and m is assembled message + """ + r = random.randint(1, sys.maxsize) + if val != None: + return r, self.add_header("%s %s %s %s" % (self.CTRL_SET, r, var, val), hlen) + return r, self.add_header("%s %s %s" % (self.CTRL_GET, r, var), hlen) + + def verify(self, reply, r, var, val = None): + """ + Verify reply to SET/GET command: returns (b, v) tuple where v is True/False verification result and v is the variable value + """ + (k, v) = self.parse(reply) + if k != var or (val is not None and v != val): + return False, v + return True, v + +if __name__ == '__main__': + print("IPA multiplexer v%s loaded." % IPA.version) -- To view, visit https://gerrit.osmocom.org/1265 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: newpatchset Gerrit-Change-Id: I41e37ec143183e422c0b31af95d183bd84f0c328 Gerrit-PatchSet: 9 Gerrit-Project: openbsc Gerrit-Branch: master Gerrit-Owner: Max Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr From gerrit-no-reply at lists.osmocom.org Wed Nov 30 17:34:35 2016 From: gerrit-no-reply at lists.osmocom.org (lynxis lazus) Date: Wed, 30 Nov 2016 17:34:35 +0000 Subject: libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Patch Set 1: > I would like to see this being reverted. It doesn't make any sense > for the SGSN to start a timer and then don't deal with the timeout. > The commit message lacks a traceback of the crash, there is no > ticket reference to the issue in the SGSN. > > I think we cover up a defect in the SGSN and should be fixing this > one instead? I didn't got a good traceback, because the timer executed at a different time over the main()loop and not with the full stack. I didn't got it real reproducible nor did I took the time to found out more about the real bug. If you like it, revert it. But I still thing it's a good idea to check if timer->cb is set. Atm. I can produce this bug more likely when trying to use a EC20 with our RBS2000 + co-located pcu, which results in multiple timeouts. -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No From gerrit-no-reply at lists.osmocom.org Wed Nov 30 17:53:10 2016 From: gerrit-no-reply at lists.osmocom.org (Holger Freyther) Date: Wed, 30 Nov 2016 17:53:10 +0000 Subject: libosmocore[master]: timer: only call the callback if not NULL In-Reply-To: References: Message-ID: Patch Set 1: It would be good to see where it is crashing. * Locally add an OSMO_ASSERT when registering the timer to see if the timer cb is set * If it crashes at the dispatch we can still figure out "where" it was. The timer is embedded in a struct.. and talloc allows us to print the contexts and we should be able to figure out what happens. Also -fsanitize=address (or valgrind) might be a good way to see if recently freed memory was accessed. -- To view, visit https://gerrit.osmocom.org/1344 To unsubscribe, visit https://gerrit.osmocom.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I04d58d9580708cc0f6d0f4aa17d3e9f2c6235c8e Gerrit-PatchSet: 1 Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Owner: lynxis lazus Gerrit-Reviewer: Holger Freyther Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: Max Gerrit-Reviewer: Neels Hofmeyr Gerrit-Reviewer: lynxis lazus Gerrit-HasComments: No