diff options
author | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-08 11:05:45 +0200 |
---|---|---|
committer | Jacob Erlbeck <jerlbeck@sysmocom.de> | 2015-06-22 10:39:06 +0200 |
commit | 20f6fd1b63355b9a3ab1423cb24b73ca27f57243 (patch) | |
tree | 2c2c07032358dd63a34c045ac04bc3da9eecb52d /src/sysmo_l1_if.c | |
parent | b4584ff6c433551f9b633d3e0c6d00380119fa89 (diff) |
l1: Pass all L1 measurements upwards
Currently only the RSSI value is passed to the upper layers. Other
values like TA and BER which are needed for TA update respectively CS
selection are not propagated.
This commit introduces and passes a struct that contains a set of
measurement values.
Sponsored-by: On-Waves ehf
Diffstat (limited to 'src/sysmo_l1_if.c')
-rw-r--r-- | src/sysmo_l1_if.c | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/src/sysmo_l1_if.c b/src/sysmo_l1_if.c index 6e1e9e47..fc4b59b1 100644 --- a/src/sysmo_l1_if.c +++ b/src/sysmo_l1_if.c @@ -166,10 +166,23 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1h, return rc; } +static void get_meas(struct pcu_l1_meas *meas, const GsmL1_MeasParam_t *l1_meas) +{ + meas->rssi = (int8_t) (l1_meas->fRssi); + meas->have_rssi = 1; + meas->ber = (uint8_t) (l1_meas->fBer * 100); + meas->have_ber = 1; + meas->bto = (int16_t) (l1_meas->i16BurstTiming); + meas->have_bto = 1; + meas->link_qual = (int16_t) (l1_meas->fLinkQuality); + meas->have_link_qual = 1; +} + static int handle_ph_data_ind(struct femtol1_hdl *fl1h, GsmL1_PhDataInd_t *data_ind, struct msgb *l1p_msg) { int rc = 0; + struct pcu_l1_meas meas = {0}; DEBUGP(DL1IF, "Rx PH-DATA.ind %s (hL2 %08x): %s\n", get_value_string(femtobts_l1sapi_names, data_ind->sapi), @@ -190,8 +203,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1h, data_ind->u32Fn, 0, 0, data_ind->msgUnitParam.u8Buffer+1, data_ind->msgUnitParam.u8Size-1); - - + get_meas(&meas, &data_ind->measParam); switch (data_ind->sapi) { case GsmL1_Sapi_Pdtch: @@ -205,7 +217,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1h, data_ind->msgUnitParam.u8Buffer + 1, data_ind->msgUnitParam.u8Size - 1, data_ind->u32Fn, - (int8_t) (data_ind->measParam.fRssi)); + &meas); break; case GsmL1_Sapi_Ptcch: // FIXME |