[MERGED] 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/.

arvind.sirsikar gerrit-no-reply at lists.osmocom.org
Fri Sep 16 05:54:16 UTC 2016


arvind.sirsikar has submitted this change and it was merged.

Change subject: Handle EGPRS 11 bit RACH in osmo-pcu
......................................................................


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, 84 insertions(+), 11 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/bts.cpp b/src/bts.cpp
index 795baa6..015bf9f 100644
--- a/src/bts.cpp
+++ b/src/bts.cpp
@@ -480,20 +480,16 @@
 	uint8_t usf = 7;
 	uint8_t tsc;
 	uint16_t ta;
+	uint16_t ms_class = 0;
+	uint16_t priority = 0;
 
 	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_type, is_11bit, &ms_class, &priority);
+
 	if (qta < 0)
 		qta = 0;
 	if (qta > 252)
@@ -516,8 +512,16 @@
 	} 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) {
+			tbf = tbf_alloc_ul_tbf(&m_bts, NULL, -1, 0,
+				ms_class, 1);
+		} else {
+			/* 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 (!tbf) {
 			LOGP(DRLCMAC, LOGL_NOTICE, "No PDCH resource\n");
 			/* FIXME: send reject */
@@ -565,6 +569,73 @@
 	return 0;
 }
 
+uint8_t BTS::is_single_block(uint16_t ra, enum ph_burst_type burst_type,
+		uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority)
+{
+	uint8_t sb = 0, val = 0;
+
+	if (!is_11bit && (burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) {
+
+		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 (is_11bit &&
+		((burst_type == GSM_L1_BURST_TYPE_ACCESS_1) ||
+		(burst_type == GSM_L1_BURST_TYPE_ACCESS_2))) {
+
+		val = !!(ra & (1 << 10));
+
+		if (!val) {
+			if (m_bts.force_two_phase) {
+				LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH "
+					"received. MS requests single phase "
+					"access but we force two phase "
+					"access\n");
+				sb = 1;
+			} else {
+				sb = 0;
+				*ms_class = (ra & 0x3e0) >> 5;
+				*priority = (ra & 0x18) >> 3;
+			}
+
+		} else {
+			LOGP(DRLCMAC, LOGL_DEBUG, "EGPRS 11 bit RACH received."
+				"MS requests single block allocation\n");
+			sb = 1;
+		}
+
+	} else if (is_11bit &&
+		(burst_type == GSM_L1_BURST_TYPE_ACCESS_0)) {
+		LOGP(DRLCMAC, LOGL_ERROR,
+			"Error: GPRS 11 bit RACH not supported\n");
+
+	} else if (burst_type == GSM_L1_BURST_TYPE_NONE) {
+		LOGP(DRLCMAC, LOGL_DEBUG, "pcu has not received burst type "
+			"from bts \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;
+		}
+	}
+
+	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 801342d..ba6fc4d 100644
--- a/src/bts.h
+++ b/src/bts.h
@@ -290,6 +290,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_type,
+		uint8_t is_11bit, uint16_t *ms_class, uint16_t *priority);
 	int rcv_rach(uint16_t ra, uint32_t Fn, int16_t qta, uint8_t is_11bit,
 		enum ph_burst_type burst_type);
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I61d74a32f7764644ed86f7fdf97fa3c2f61503f7
Gerrit-PatchSet: 10
Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Owner: bhargava_abhyankar <Bhargava.Abhyankar at radisys.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: arvind.sirsikar <arvind.sirsikar at radisys.com>
Gerrit-Reviewer: bhargava_abhyankar <Bhargava.Abhyankar at radisys.com>



More information about the gerrit-log mailing list