[PATCH] Support of 11 bit RACH

Bhargava Abhyankar Bhargava.Abhyankar at radisys.com
Tue Mar 8 13:15:58 UTC 2016


This patch is first of series of patches to support 11 bit RACH.
This includes interface structure changes between osmo-pcu and
osmo-bts to support 11 bit RACH.Processing of 11 bit RACH for
GPRS is added in bts.cpp.
Unit test for the same shall be sent as separate patch.
EGPRS PACKET CHANNEL REQUEST is not part of this patch.Note also
that this feature requires changes in osmo-bts and versioning needs
to be addressed further.
---
 src/bts.cpp       | 36 +++++++++++++++++++++++++++---------
 src/bts.h         |  9 ++++++++-
 src/pcu_l1_if.cpp |  2 +-
 src/pcuif_proto.h |  3 ++-
 4 files changed, 38 insertions(+), 12 deletions(-)

diff --git a/src/bts.cpp b/src/bts.cpp
index 715fb51..a999c48 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -459,7 +459,7 @@ 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 rach_type)
 {
 	struct gprs_rlcmac_ul_tbf *tbf = NULL;
 	uint8_t trx_no, ts_no = 0;
@@ -475,14 +475,32 @@ int BTS::rcv_rach(uint8_t ra, uint32_t Fn, int16_t qta)
 
 	LOGP(DRLCMAC, LOGL_DEBUG, "MS requests UL TBF on RACH, so we provide "
 		"one:\n");
-	if ((ra & 0xf8) == 0x70) {
-		LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block "
-			"allocation\n");
-		sb = 1;
-	} else if (m_bts.force_two_phase) {
-		LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single phase access, "
-			"but we force two phase access\n");
-		sb = 1;
+
+	if (rach_type == GPRS_8_BIT_RACH ) {
+		if ((ra & 0xf8) == 0x70) {
+			LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single block "
+					"allocation\n");
+			sb = 1;
+		} else if (m_bts.force_two_phase) {
+			LOGP(DRLCMAC, LOGL_DEBUG, "MS requests single phase access, "
+					"but we force two phase access\n");
+			sb = 1;
+		}
+
+	} else if(rach_type == GPRS_11_BIT_RACH ) {
+		if((ra & RACH_CAUSE_SINGLE_BLOCK) == 0x0600) {
+                         LOGP(DRLCMAC, LOGL_DEBUG, "11 bit RACH received.MS requests single block "
+                                        "allocation\n");
+                        sb = 1;
+
+                } else if (m_bts.force_two_phase) {
+                        LOGP(DRLCMAC, LOGL_DEBUG, "11 bit RACHreceived.MS requests single phase access, "
+                                        "but we force two phase access\n");
+                        sb = 1;
+                }
+	} else if (rach_type == EGPRS_11_BIT_RACH) {
+		/*TODO*/
+
 	}
 	if (qta < 0)
 		qta = 0;
diff --git a/src/bts.h b/src/bts.h
index c975304..870e6f3 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -41,6 +41,7 @@ extern "C" {
 
 #define LLC_CODEL_DISABLE 0
 #define LLC_CODEL_USE_DEFAULT (-1)
+#define RACH_CAUSE_SINGLE_BLOCK ((~((~0) << 6)) << 5) /* Establish cause */
 
 struct BTS;
 struct GprsMs;
@@ -251,6 +252,12 @@ public:
 		TIMER_T3190_MSEC = 5000,
 	};
 
+        enum {
+		GPRS_8_BIT_RACH = 0,
+		GPRS_11_BIT_RACH = 1,
+		EGPRS_11_BIT_RACH = 2,
+	};
+
 	BTS();
 	~BTS();
 
@@ -275,7 +282,7 @@ 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 rach_type = 0);
 
 	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..d937d20 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -313,7 +313,7 @@ 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->rach_type);
 		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..0844183 100644
--- a/src/pcuif_proto.h
+++ b/src/pcuif_proto.h
@@ -64,10 +64,11 @@ 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		rach_type;
 } __attribute__ ((packed));
 
 struct gsm_pcu_if_info_trx {
-- 
2.5.0





More information about the osmocom-net-gprs mailing list