[PATCH] osmo-pcu[master]: Handle EGPRS 11 bit RACH in osmo-pcu

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/gerrit-log@lists.osmocom.org/.

bhargava_abhyankar gerrit-no-reply at lists.osmocom.org
Tue Jun 28 14:27:22 UTC 2016


Review at  https://gerrit.osmocom.org/430

Handle EGPRS 11 bit RACH in osmo-pcu

A function is_single_block is added to get request type of RACH.
EGPRS 11 bit RACH is handled.

Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7
---
M src/bts.cpp
M src/bts.h
2 files changed, 63 insertions(+), 12 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/30/430/1

diff --git a/src/bts.cpp b/src/bts.cpp
index d284c1f..08381b2 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -479,20 +479,14 @@
 	uint8_t usf = 7;
 	uint8_t tsc;
 	uint16_t ta;
+	uint16_t ms_class, priority;
 
 	rach_frame();
-
 	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;
-	}
+
+	sb = is_single_block(ra, burst, is_11bit, &ms_class, &priority);
+
 	if (qta < 0)
 		qta = 0;
 	if (qta > 252)
@@ -515,13 +509,22 @@
 	} else {
 		// Create new TBF
 		#warning "Copy and paste with other routines.."
-		/* set class to 0, since we don't know the multislot class yet */
-		tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1);
+
+		if (is_11bit == 1) {
+			tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0,
+				ms_class, 1);
+		} else {
+			/* set class to 0,as we don't know the multislot */
+			/* class yet */
+			tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0, 0, 1);
+		}
+
 		if (!tbf) {
 			LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
 			/* FIXME: send reject */
 			return -EBUSY;
 		}
+
 		tbf->set_ta(ta);
 		tbf->set_state(GPRS_RLCMAC_FLOW);
 		tbf->state_flags |= (1 << GPRS_RLCMAC_FLAG_CCCH);
@@ -564,6 +567,52 @@
 	return 0;
 }
 
+uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst,
+		uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority)
+{
+	uint8_t sb = 0;
+	uint8_t val = 0;
+
+	if ((is_11bit == 0) && (burst == GSM_L1_BURST_TYPE_ACCESS_0)) {
+
+		if ((ra & 0xf8) == 0x70) {
+			LOGP(DRLCMAC, LOGL_INFO, "MS requests single block "
+				"allocation\n");
+			sb = 1;
+		} else if (m_bts.force_two_phase) {
+			LOGP(DRLCMAC, LOGL_INFO, "MS requests single "
+				"phase access,but we force two phase access\n");
+			sb = 1;
+		}
+
+	} else if ((is_11bit == 1) && ((burst == GSM_L1_BURST_TYPE_ACCESS_1) ||
+				(burst == GSM_L1_BURST_TYPE_ACCESS_2))) {
+
+		val = !!(ra & (1 << 10));
+
+		if (val == 0) {
+			sb = 0;
+			*ms_class = (ra & 0x3e0) >> 5;
+			*priority = ((ra & 0x18) >> 3);
+		} else if (m_bts.force_two_phase) {
+			LOGP(DRLCMAC, LOGL_INFO, "EGPRS 11 bit RACH received."
+			"MS requests single phase access but we force "
+			"two phase access\n");
+			sb = 1;
+		} else {
+			LOGP(DRLCMAC, LOGL_INFO, "EGPRS 11 bit RACH received."
+				"MS requests single block allocation\n");
+			sb = 1;
+		}
+
+	} else if ((is_11bit == 1) && (burst == GSM_L1_BURST_TYPE_ACCESS_0)) {
+		LOGP(DRLCMACUL, LOGL_ERROR,
+			"Error: GPRS 11 bit RACH not supported\n");
+	}
+
+	return sb;
+}
+
 /* depending on the current TBF, we assign on PACCH or AGCH */
 void BTS::trigger_dl_ass(
 	struct gprs_rlcmac_dl_tbf *dl_tbf,
diff --git a/src/bts.h b/src/bts.h
index 0a99b21..26cd371 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -286,6 +286,8 @@
 	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);
+	uint8_t is_single_block(uint16_t ra, enum ph_burst_type burst,
+		uint8_t is_11bit, uint16_t*, uint16_t*);
 	int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
 		enum ph_burst_type burst);
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7
Gerrit-PatchSet: 1
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: bhargava_abhyankar <Bhargava.Abhyankar at radisys.com>



More information about the gerrit-log mailing list