From 6a32f0499fd5e5d5779abac8902017461cf2800a Mon Sep 17 00:00:00 2001 From: Andreas Eversberg Date: Sun, 17 Mar 2013 16:33:11 +0100 Subject: Get RSSI from received uplink data and send to PCU This bumps the PCU API version and thus requires a new version of the code on the sysmoBTS side! --- include/osmo-bts/pcu_if.h | 3 ++- include/osmo-bts/pcuif_proto.h | 3 ++- src/common/pcu_sock.c | 4 +++- src/osmo-bts-sysmo/l1_if.c | 6 ++++-- 4 files changed, 11 insertions(+), 5 deletions(-) diff --git a/include/osmo-bts/pcu_if.h b/include/osmo-bts/pcu_if.h index d53fa5e8..017de48b 100644 --- a/include/osmo-bts/pcu_if.h +++ b/include/osmo-bts/pcu_if.h @@ -5,7 +5,8 @@ int pcu_tx_info_ind(void); 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); 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); + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi); int pcu_tx_rach_ind(struct gsm_bts *bts, int16_t qta, uint8_t ra, uint32_t fn); int pcu_tx_time_ind(uint32_t fn); int pcu_tx_pag_req(const uint8_t *identity_lv, uint8_t chan_needed); diff --git a/include/osmo-bts/pcuif_proto.h b/include/osmo-bts/pcuif_proto.h index c27bb7dc..9d740ac1 100644 --- a/include/osmo-bts/pcuif_proto.h +++ b/include/osmo-bts/pcuif_proto.h @@ -1,7 +1,7 @@ #ifndef _PCUIF_PROTO_H #define _PCUIF_PROTO_H -#define PCU_IF_VERSION 0x04 +#define PCU_IF_VERSION 0x05 /* msg_type */ #define PCU_IF_MSG_DATA_REQ 0x00 /* send data to given channel */ @@ -49,6 +49,7 @@ struct gsm_pcu_if_data { uint8_t trx_nr; uint8_t ts_nr; uint8_t block_nr; + int8_t rssi; } __attribute__ ((packed)); struct gsm_pcu_if_rts_req { diff --git a/src/common/pcu_sock.c b/src/common/pcu_sock.c index 27d0f39d..a90caacf 100644 --- a/src/common/pcu_sock.c +++ b/src/common/pcu_sock.c @@ -315,7 +315,8 @@ int pcu_tx_rts_req(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, } 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) + uint16_t arfcn, uint8_t block_nr, uint8_t *data, uint8_t len, + int8_t rssi) { struct msgb *msg; struct gsm_pcu_if *pcu_prim; @@ -338,6 +339,7 @@ int pcu_tx_data_ind(struct gsm_bts_trx_ts *ts, uint8_t is_ptcch, uint32_t fn, data_ind->trx_nr = ts->trx->nr; data_ind->ts_nr = ts->nr; data_ind->block_nr = block_nr; + data_ind->rssi = rssi; memcpy(data_ind->data, data, len); data_ind->len = len; diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c index bdba4c22..d2aecd5e 100644 --- a/src/osmo-bts-sysmo/l1_if.c +++ b/src/osmo-bts-sysmo/l1_if.c @@ -787,7 +787,8 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i data_ind->u32Fn, data_ind->u16Arfcn, data_ind->u8BlockNbr, data_ind->msgUnitParam.u8Buffer + 1, - data_ind->msgUnitParam.u8Size - 1); + data_ind->msgUnitParam.u8Size - 1, + (int8_t) (data_ind->measParam.fRssi)); break; case GsmL1_Sapi_Ptcch: /* PTCCH frame handling */ @@ -795,7 +796,8 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i data_ind->u32Fn, data_ind->u16Arfcn, data_ind->u8BlockNbr, data_ind->msgUnitParam.u8Buffer, - data_ind->msgUnitParam.u8Size); + data_ind->msgUnitParam.u8Size, + (int8_t) (data_ind->measParam.fRssi)); break; default: LOGP(DL1C, LOGL_NOTICE, "Rx PH-DATA.ind for unknown L1 SAPI %s\n", -- cgit v1.2.3