[PATCH] Change interface in osmo-pcu for 11 bit RACH

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/osmocom-net-gprs@lists.osmocom.org/.

Bhargava Abhyankar Bhargava.Abhyankar at radisys.com
Fri Apr 1 13:59:22 UTC 2016


Interface structure between osmo-bts and osmo-pcu is updated with
the parameters to differentiate the type of RACH and further
support 11 bit RACH. The function prototype and definitions are
changed accordingly. Interface version number is increased.
---
 src/bts.cpp           | 3 ++-
 src/bts.h             | 4 +++-
 src/pcu_l1_if.cpp     | 3 ++-
 src/pcuif_proto.h     | 8 ++++++--
 tests/tbf/TbfTest.cpp | 5 +++--
 5 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/src/bts.cpp b/src/bts.cpp
index 715fb51..62b00c4 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -459,7 +459,8 @@ int BTS::rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn)
 	return 0;
 }
 
-int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
+int BTS::rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
+		enum ph_burst_type burst)
 {
 	struct gprs_rlcmac_ul_tbf *tbf = NULL;
 	uint8_t trx_no, ts_no = 0;
diff --git a/src/bts.h b/src/bts.h
index c975304..f0fe970 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -28,6 +28,7 @@ extern "C" {
 #include <osmocom/core/stat_item.h>
 #include <osmocom/core/timer.h>
 #include <osmocom/core/gsmtap.h>
+#include <osmocom/gsm/l1sap.h>
 }
 
 #include "poll_controller.h"
@@ -275,7 +276,8 @@ public:
 	int tfi_find_free(enum gprs_rlcmac_tbf_direction dir, uint8_t *_trx, int8_t use_trx);
 
 	int rcv_imm_ass_cnf(const uint8_t *data, uint32_t fn);
-	int rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta);
+	int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
+		enum ph_burst_type burst);
 
 	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/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 19dda5c..dbf713c 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -313,7 +313,8 @@ static int pcu_rx_rach_ind(struct gsm_pcu_if_rach_ind *rach_ind)
 	case PCU_IF_SAPI_RACH:
 		rc = BTS::main_bts()->rcv_rach(
 			rach_ind->ra, rach_ind->fn,
-			rach_ind->qta);
+			rach_ind->qta, rach_ind->is_11bit,
+			rach_ind->burst);
 		break;
 	default:
 		LOGP(DL1IF, LOGL_ERROR, "Received PCU rach request with "
diff --git a/src/pcuif_proto.h b/src/pcuif_proto.h
index 9d740ac..eb11770 100644
--- a/src/pcuif_proto.h
+++ b/src/pcuif_proto.h
@@ -1,7 +1,9 @@
 #ifndef _PCUIF_PROTO_H
 #define _PCUIF_PROTO_H
 
-#define PCU_IF_VERSION		0x05
+#include <osmocom/gsm/l1sap.h>
+
+#define PCU_IF_VERSION		0x06
 
 /* msg_type */
 #define PCU_IF_MSG_DATA_REQ	0x00	/* send data to given channel */
@@ -64,10 +66,12 @@ struct gsm_pcu_if_rts_req {
 
 struct gsm_pcu_if_rach_ind {
 	uint8_t		sapi;
-	uint8_t		ra;
+	uint16_t	ra;
 	int16_t		qta;
 	uint32_t	fn;
 	uint16_t	arfcn;
+	uint8_t         is_11bit;
+	enum ph_burst_type burst;
 } __attribute__ ((packed));
 
 struct gsm_pcu_if_info_trx {
diff --git a/tests/tbf/TbfTest.cpp b/tests/tbf/TbfTest.cpp
index e1be844..1123ac6 100644
--- a/tests/tbf/TbfTest.cpp
+++ b/tests/tbf/TbfTest.cpp
@@ -35,6 +35,7 @@ extern "C" {
 #include <osmocom/core/talloc.h>
 #include <osmocom/core/utils.h>
 #include <osmocom/vty/vty.h>
+#include <osmocom/gsm/l1sap.h>
 }
 
 #include <errno.h>
@@ -552,7 +553,7 @@ static gprs_rlcmac_ul_tbf *establish_ul_tbf_single_phase(BTS *the_bts,
 
 	tfi = the_bts->tfi_find_free(GPRS_RLCMAC_UL_TBF, &trx_no, -1);
 
-	the_bts->rcv_rach(0x03, *fn, qta);
+	the_bts->rcv_rach(0x03, *fn, qta, 0, GSM_L1_BURST_TYPE_ACCESS_0);
 
 	ul_tbf = the_bts->ul_tbf_by_tfi(tfi, trx_no, ts_no);
 	OSMO_ASSERT(ul_tbf != NULL);
@@ -639,7 +640,7 @@ static gprs_rlcmac_ul_tbf *establish_ul_tbf_two_phase(BTS *the_bts,
 	request_dl_rlc_block(bts, trx_no, ts_no, 0, fn);
 
 	/* simulate RACH, this sends an Immediate Assignment Uplink on the AGCH */
-	the_bts->rcv_rach(0x73, rach_fn, qta);
+	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);
-- 
2.5.0





More information about the osmocom-net-gprs mailing list