Change in osmocom-bb[master]: layer23/app_ccch_scan.c: clean up copy-pasted code

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/.

Vadim Yanitskiy gerrit-no-reply at lists.osmocom.org
Mon Oct 1 18:12:59 UTC 2018


Vadim Yanitskiy has uploaded this change for review. ( https://gerrit.osmocom.org/11172


Change subject: layer23/app_ccch_scan.c: clean up copy-pasted code
......................................................................

layer23/app_ccch_scan.c: clean up copy-pasted code

By definition, 'ccch_scan' application is intended to be used for
monitoring of CCCH channels on C0/TS0. There is no need to send
RACH requests, therefore there is no need to care about the
mobile allocation from SI1 message.

Most likely, this "dead" code was copy-pasted from mobile
application. Let's clean it up!

Change-Id: I7c2f47cbc825a5e5a50863d842729d3d8408b9dd
---
M src/host/layer23/src/misc/app_ccch_scan.c
1 file changed, 1 insertion(+), 47 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/72/11172/1

diff --git a/src/host/layer23/src/misc/app_ccch_scan.c b/src/host/layer23/src/misc/app_ccch_scan.c
index f92b13b..d8cb912 100644
--- a/src/host/layer23/src/misc/app_ccch_scan.c
+++ b/src/host/layer23/src/misc/app_ccch_scan.c
@@ -42,14 +42,9 @@
 #include <l1ctl_proto.h>
 
 static struct {
-	int has_si1;
 	int ccch_mode;
-	int ccch_enabled;
-	int rach_count;
-	struct gsm_sysinfo_freq cell_arfcns[1024];
 } app_state;
 
-
 static void dump_bcch(struct osmocom_ms *ms, uint8_t tc, const uint8_t *data)
 {
 	struct gsm48_system_information_type_header *si_hdr;
@@ -62,18 +57,6 @@
 		if (tc != 0)
 			LOGP(DRR, LOGL_ERROR, "SI1 on the wrong TC: %d\n", tc);
 #endif
-		if (!app_state.has_si1) {
-			struct gsm48_system_information_type_1 *si1 =
-				(struct gsm48_system_information_type_1 *)data;
-
-			gsm48_decode_freq_list(app_state.cell_arfcns,
-			                       si1->cell_channel_description,
-					       sizeof(si1->cell_channel_description),
-					       0xff, 0x01);
-
-			app_state.has_si1 = 1;
-			LOGP(DRR, LOGL_ERROR, "SI1 received.\n");
-		}
 		break;
 	case GSM48_MT_RR_SYSINFO_2:
 #ifdef BCCH_TC_CHECK
@@ -182,8 +165,6 @@
 	if (ia->page_mode & 0xf0)
 		return 0;
 
-	/* FIXME: compare RA and GSM time with when we sent RACH req */
-
 	rsl_dec_chan_nr(ia->chan_desc.chan_nr, &ch_type, &ch_subch, &ch_ts);
 
 	if (!ia->chan_desc.h0.h) {
@@ -199,9 +180,7 @@
 
 	} else {
 		/* Hopping */
-		uint8_t maio, hsn, ma_len;
-		uint16_t ma[64], arfcn;
-		int i, j, k;
+		uint8_t maio, hsn;
 
 		hsn = ia->chan_desc.h1.hsn;
 		maio = ia->chan_desc.h1.maio_low | (ia->chan_desc.h1.maio_high << 2);
@@ -210,19 +189,6 @@
 			"HSN=%u, MAIO=%u, TS=%u, SS=%u, TSC=%u) ", ia->req_ref.ra,
 			ia->chan_desc.chan_nr, hsn, maio, ch_ts, ch_subch,
 			ia->chan_desc.h1.tsc);
-
-		/* decode mobile allocation */
-		ma_len = 0;
-		for (i=1, j=0; i<=1024; i++) {
-			arfcn = i & 1023;
-			if (app_state.cell_arfcns[arfcn].mask & 0x01) {
-				k = ia->mob_alloc_len - (j>>3) - 1;
-				if (ia->mob_alloc[k] & (1 << (j&7))) {
-					ma[ma_len++] = arfcn;
-				}
-				j++;
-			}
-		}
 	}
 
 	LOGPC(DRR, LOGL_NOTICE, "\n");
@@ -449,25 +415,13 @@
 	//dump_bcch(dl->time.tc, ccch->data);
 	dump_bcch(ms, 0, msg->l3h);
 
-	/* Req channel logic */
-	if (app_state.ccch_enabled && (app_state.rach_count < 2)) {
-		l1ctl_tx_rach_req(ms, app_state.rach_count, 0,
-			app_state.ccch_mode == CCCH_MODE_COMBINED);
-		app_state.rach_count++;
-	}
-
 	return 0;
 }
 
 void layer3_app_reset(void)
 {
 	/* Reset state */
-	app_state.has_si1 = 0;
 	app_state.ccch_mode = CCCH_MODE_NONE;
-	app_state.ccch_enabled = 0;
-	app_state.rach_count = 0;
-
-	memset(&app_state.cell_arfcns, 0x00, sizeof(app_state.cell_arfcns));
 }
 
 static int signal_cb(unsigned int subsys, unsigned int signal,

-- 
To view, visit https://gerrit.osmocom.org/11172
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7c2f47cbc825a5e5a50863d842729d3d8408b9dd
Gerrit-Change-Number: 11172
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181001/bce1b8a2/attachment.htm>


More information about the gerrit-log mailing list