openbsc[master]: dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP

Submitted by gerrit-no-reply@lists.osmocom.org on June 2, 2016, 11:51 a.m.

Details

Message ID gerrit.1464868259650.I7bfc70527162c95b3d7ea853eda6376b4f1f1161@gerrit.osmocom.org
State New
Headers show

Commit Message

gerrit-no-reply@lists.osmocom.org June 2, 2016, 11:51 a.m.
Review at  https://gerrit.osmocom.org/182

dyn pdch: send PDCH ACT for each TCH/F_PDCH on TRX RSL UP

Add dyn_pdch_init() and call from inp_sig_cb() upon RSL UP.

Revert the |= TS_F_PDCH_MODE chunk from previous commit, since this flag will
now be set after dyn_pdch_init() sent out the PDCH ACT, i.e. when the PDCH ACT
ACK messages are received.

Change-Id: I7bfc70527162c95b3d7ea853eda6376b4f1f1161
---
M openbsc/src/libbsc/bsc_init.c
1 file changed, 34 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/82/182/1

Comments

gerrit-no-reply@lists.osmocom.org June 2, 2016, 11:53 a.m.
Patch Set 1:

forgot to mention: see OS#1565

Patch hide | download patch | download mbox

diff --git a/openbsc/src/libbsc/bsc_init.c b/openbsc/src/libbsc/bsc_init.c
index 110e160..02c949c 100644
--- a/openbsc/src/libbsc/bsc_init.c
+++ b/openbsc/src/libbsc/bsc_init.c
@@ -302,6 +302,36 @@ 
 		generate_ma_for_ts(&trx->ts[i]);
 }
 
+static void dyn_pdch_init(struct gsm_bts_trx *trx)
+{
+	unsigned int i;
+	struct gsm_bts_trx_ts *ts;
+	int rc;
+	unsigned int pdch_act_count = 0;
+
+	for (i = 0; i < TRX_NR_TS; i++) {
+		ts = &trx->ts[i];
+		if (ts->pchan == GSM_PCHAN_TCH_F_PDCH) {
+			rc = rsl_ipacc_pdch_activate(ts, 1);
+			if (rc != 0) {
+				LOGP(DRSL, LOGL_ERROR,
+				     "Failed to activate PDCH on"
+				     " BTS %u TRX %u TS %u: %d\n",
+				     trx->bts->nr, trx->nr, i, rc);
+				continue;
+			}
+			pdch_act_count ++;
+		}
+	}
+
+	if (pdch_act_count) {
+		LOGP(DRSL, LOGL_NOTICE,
+		     "Activated PDCH on %u dynamic TCH/F_PDCH time slots"
+		     " for BTS %u TRX %u\n",
+		     pdch_act_count, trx->bts->nr, trx->nr);
+	}
+}
+
 /* Callback function to be called every time we receive a signal from INPUT */
 static int inp_sig_cb(unsigned int subsys, unsigned int signal,
 		      void *handler_data, void *signal_data)
@@ -328,14 +358,14 @@ 
 			generate_cell_chan_list(ca, trx->bts);
 
 			llist_for_each_entry(cur_trx, &trx->bts->trx_list, list) {
-				for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++) {
+				for (i = 0; i < ARRAY_SIZE(cur_trx->ts); i++)
 					generate_ma_for_ts(&cur_trx->ts[i]);
-					cur_trx->ts[i].flags |= TS_F_PDCH_MODE;
-				}
 			}
 		}
-		if (isd->link_type == E1INP_SIGN_RSL)
+		if (isd->link_type == E1INP_SIGN_RSL) {
 			bootstrap_rsl(trx);
+			dyn_pdch_init(trx);
+		}
 		break;
 	case S_L_INP_TEI_DN:
 		LOGP(DLMI, LOGL_ERROR, "Lost some E1 TEI link: %d %p\n", isd->link_type, trx);