[PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-29 Thread dexter
Hello Max, Harald Welte, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2861

to look at the new patch set (#5).

osmo-bts-litecell15: Fix missing frame number in MEAS IND

The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

change process_meas_res() to properly include the frame number into the
l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
---
M src/osmo-bts-litecell15/l1_if.c
1 file changed, 3 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/5

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 71bb833..d6cffc9 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -901,7 +901,7 @@
 }
 
 static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
-   GsmL1_MeasParam_t *m)
+   GsmL1_MeasParam_t *m, uint32_t fn)
 {
struct osmo_phsap_prim l1sap;
memset(, 0, sizeof(l1sap));
@@ -912,6 +912,7 @@
l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
+   l1sap.u.info.u.meas_ind.fn = fn;
 
/* l1sap wants to take msgb ownership.  However, as there is no
 * msg, it will msgb_free(l1sap.oph.msg == NULL) */
@@ -941,7 +942,7 @@
fn = data_ind->u32Fn;
link_id =  (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC;
 
-   process_meas_res(trx, chan_nr, _ind->measParam);
+   process_meas_res(trx, chan_nr, _ind->measParam, fn);
 
if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm
 && data_ind->msgUnitParam.u8Size != 0) {

-- 
To view, visit https://gerrit.osmocom.org/2861
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 5
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-13 Thread dexter
Hello Max, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2861

to look at the new patch set (#4).

osmo-bts-litecell15: Fix missing frame number in MEAS IND

The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

This commit changes process_meas_res() to properly include
the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
---
M src/osmo-bts-litecell15/l1_if.c
1 file changed, 15 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/4

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 5977aa9..a3e8d03 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -901,17 +901,30 @@
 }
 
 static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
-   GsmL1_MeasParam_t *m)
+   uint32_t fn, GsmL1_PhDataInd_t *data_ind)
 {
struct osmo_phsap_prim l1sap;
memset(, 0, sizeof(l1sap));
osmo_prim_init(, SAP_GSM_PH, PRIM_MPH_INFO,
PRIM_OP_INDICATION, NULL);
+   GsmL1_MeasParam_t *m = _ind->measParam;
+
l1sap.u.info.type = PRIM_INFO_MEAS;
l1sap.u.info.u.meas_ind.chan_nr = chan_nr;
l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
+
+   /* The MEAS IND data structure expects a logical frame number. On the
+* physical radio link, the uplink is delayed by 3 timeslots, we need
+* to compensate for that delay. */
+   l1sap.u.info.u.meas_ind.fn = fn + 3;
+
+   /* Align frame number with measurement period ends */
+   if (data_ind->sapi == GsmL1_Sapi_TchF)
+   l1sap.u.info.u.meas_ind.fn += 1;
+   else if (data_ind->sapi == GsmL1_Sapi_TchH && data_ind->subCh == 
GsmL1_SubCh_0)
+   l1sap.u.info.u.meas_ind.fn += 1;
 
/* l1sap wants to take msgb ownership.  However, as there is no
 * msg, it will msgb_free(l1sap.oph.msg == NULL) */
@@ -941,7 +954,7 @@
fn = data_ind->u32Fn;
link_id =  (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC;
 
-   process_meas_res(trx, chan_nr, _ind->measParam);
+   process_meas_res(trx, chan_nr, fn, data_ind);
 
if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm
 && data_ind->msgUnitParam.u8Size != 0) {

-- 
To view, visit https://gerrit.osmocom.org/2861
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 4
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max 


[PATCH] osmo-bts[master]: osmo-bts-litecell15: Fix missing frame number in MEAS IND

2017-06-09 Thread dexter
Hello Max, Jenkins Builder,

I'd like you to reexamine a change.  Please visit

https://gerrit.osmocom.org/2861

to look at the new patch set (#3).

osmo-bts-litecell15: Fix missing frame number in MEAS IND

The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

This commit changes process_meas_res() to properly include
the frame number into the l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
---
M src/osmo-bts-litecell15/l1_if.c
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/61/2861/3

diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index 5977aa9..22a33d8 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -901,7 +901,7 @@
 }
 
 static int process_meas_res(struct gsm_bts_trx *trx, uint8_t chan_nr,
-   GsmL1_MeasParam_t *m)
+   uint32_t fn, GsmL1_MeasParam_t *m)
 {
struct osmo_phsap_prim l1sap;
memset(, 0, sizeof(l1sap));
@@ -912,6 +912,10 @@
l1sap.u.info.u.meas_ind.ta_offs_qbits = m->i16BurstTiming;
l1sap.u.info.u.meas_ind.ber10k = (unsigned int) (m->fBer * 100);
l1sap.u.info.u.meas_ind.inv_rssi = (uint8_t) (m->fRssi * -1);
+   l1sap.u.info.u.meas_ind.fn = fn;
+
+   /* FIXME: The frame number most likely will require some alignment
+* in order to match the lookup tables in the higher layers. */
 
/* l1sap wants to take msgb ownership.  However, as there is no
 * msg, it will msgb_free(l1sap.oph.msg == NULL) */
@@ -941,7 +945,7 @@
fn = data_ind->u32Fn;
link_id =  (data_ind->sapi == GsmL1_Sapi_Sacch) ? LID_SACCH : LID_DEDIC;
 
-   process_meas_res(trx, chan_nr, _ind->measParam);
+   process_meas_res(trx, chan_nr, fn, _ind->measParam);
 
if (data_ind->measParam.fLinkQuality < btsb->min_qual_norm
 && data_ind->msgUnitParam.u8Size != 0) {

-- 
To view, visit https://gerrit.osmocom.org/2861
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
Gerrit-PatchSet: 3
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max