This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Vadim Yanitskiy gerrit-no-reply at lists.osmocom.orgHello Max, Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/5204
to look at the new patch set (#2).
mobile/gsm48_rr.c: fix ACCH System Information parsing
According to GSM 04.08, the System Information messages, such as
SI5, SI5ter, SI5bis and SI6 (described in sections 9.1.37-40),
have no the 'L2 Pseudo Length' (10.5.2.19) field, unlike others.
So, previously the ACCH SI messages were ignored due to an
implementation error - the gsm48_system_information_type_header
struct isn't applicable here, because it assumes the 'l2_plen'.
Since there is no (yet?) equivalent struct for the ACCH SI, this
change replaces the wrong struct by the 'gsm48_hdr', which
satisfies described requirements.
Moreover, this change cleans up some gsm48_rr_rx_sysinfo*
functions, getting rid of meaningless pionter shifting.
Change-Id: I9166996f146af7973bf02a8a1c965581dc58a4a5
---
M src/host/layer23/src/mobile/gsm48_rr.c
1 file changed, 11 insertions(+), 15 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/04/5204/2
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c
index ac27214..403e32d 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -1943,10 +1943,9 @@
/* receive "SYSTEM INFORMATION 5" message (9.1.37) */
static int gsm48_rr_rx_sysinfo5(struct osmocom_ms *ms, struct msgb *msg)
{
- /* NOTE: pseudo length is not in this structure, so we skip */
- struct gsm48_system_information_type_5 *si = msgb_l3(msg) + 1;
+ struct gsm48_system_information_type_5 *si = msgb_l3(msg);
struct gsm48_sysinfo *s = ms->cellsel.si;
- int payload_len = msgb_l3len(msg) - sizeof(*si) - 1;
+ int payload_len = msgb_l3len(msg) - sizeof(*si);
if (!s) {
LOGP(DRR, LOGL_INFO, "No cell selected, SYSTEM INFORMATION 5 "
@@ -1973,10 +1972,9 @@
/* receive "SYSTEM INFORMATION 5bis" message (9.1.38) */
static int gsm48_rr_rx_sysinfo5bis(struct osmocom_ms *ms, struct msgb *msg)
{
- /* NOTE: pseudo length is not in this structure, so we skip */
- struct gsm48_system_information_type_5bis *si = msgb_l3(msg) + 1;
+ struct gsm48_system_information_type_5bis *si = msgb_l3(msg);
struct gsm48_sysinfo *s = ms->cellsel.si;
- int payload_len = msgb_l3len(msg) - sizeof(*si) - 1;
+ int payload_len = msgb_l3len(msg) - sizeof(*si);
if (!s) {
LOGP(DRR, LOGL_INFO, "No cell selected, SYSTEM INFORMATION 5bis"
@@ -2004,10 +2002,9 @@
/* receive "SYSTEM INFORMATION 5ter" message (9.1.39) */
static int gsm48_rr_rx_sysinfo5ter(struct osmocom_ms *ms, struct msgb *msg)
{
- /* NOTE: pseudo length is not in this structure, so we skip */
- struct gsm48_system_information_type_5ter *si = msgb_l3(msg) + 1;
+ struct gsm48_system_information_type_5ter *si = msgb_l3(msg);
struct gsm48_sysinfo *s = ms->cellsel.si;
- int payload_len = msgb_l3len(msg) - sizeof(*si) - 1;
+ int payload_len = msgb_l3len(msg) - sizeof(*si);
if (!s) {
LOGP(DRR, LOGL_INFO, "No cell selected, SYSTEM INFORMATION 5ter"
@@ -2035,11 +2032,10 @@
/* receive "SYSTEM INFORMATION 6" message (9.1.39) */
static int gsm48_rr_rx_sysinfo6(struct osmocom_ms *ms, struct msgb *msg)
{
- /* NOTE: pseudo length is not in this structure, so we skip */
- struct gsm48_system_information_type_6 *si = msgb_l3(msg) + 1;
+ struct gsm48_system_information_type_6 *si = msgb_l3(msg);
struct gsm48_sysinfo *s = ms->cellsel.si;
struct rx_meas_stat *meas = &ms->meas;
- int payload_len = msgb_l3len(msg) - sizeof(*si) - 1;
+ int payload_len = msgb_l3len(msg) - sizeof(*si);
if (!s) {
LOGP(DRR, LOGL_INFO, "No cell selected, SYSTEM INFORMATION 6 "
@@ -4748,7 +4744,7 @@
struct gsm48_rrlayer *rr = &ms->rrlayer;
struct gsm_settings *set = &ms->settings;
struct abis_rsl_rll_hdr *rllh = msgb_l2(msg);
- struct gsm48_system_information_type_header *sih = msgb_l3(msg);
+ struct gsm48_hdr *sih = msgb_l3(msg);
uint8_t ind_ta, ind_tx_power;
if (msgb_l2len(msg) < sizeof(*rllh) + 2 + 2) {
@@ -4772,7 +4768,7 @@
rr->cd_now.ind_tx_power = ind_tx_power;
}
- switch (sih->system_information) {
+ switch (sih->msg_type) {
case GSM48_MT_RR_SYSINFO_5:
return gsm48_rr_rx_sysinfo5(ms, msg);
case GSM48_MT_RR_SYSINFO_5bis:
@@ -4783,7 +4779,7 @@
return gsm48_rr_rx_sysinfo6(ms, msg);
default:
LOGP(DRR, LOGL_NOTICE, "ACCH message type 0x%02x unknown.\n",
- sih->system_information);
+ sih->msg_type);
return -EINVAL;
}
}
--
To view, visit https://gerrit.osmocom.org/5204
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I9166996f146af7973bf02a8a1c965581dc58a4a5
Gerrit-PatchSet: 2
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>