[PATCH] osmo-bts[master]: cosmetic: clarify TCH/F_PDCH related naming and comments

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

Neels Hofmeyr gerrit-no-reply at lists.osmocom.org
Mon Jul 25 12:16:54 UTC 2016


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

cosmetic: clarify TCH/F_PDCH related naming and comments

We're about to introduce a new kind of dynamic channel, which will also use
parts of the ip.access mode dyn PDCH code paths. Make sure the general parts
have general names and mark ip.access specific parts as such.

Rename dyn_pdch_ts_[dis]connected() to cb_ts_[dis]connected().
Rename dyn_pdch_complete to ipacc_dyn_pdch_complete().
>From cb_ts_[dis]connected(), factor out the current code into static
functions ipacc_dyn_pdch_[dis]connected() -- this will make sense once the
new dynamic kind is added to cb_ts_[dis]connected().

Change-Id: I7da5b7cb7b48572671f50e0dec97d9eec3083df1
---
M include/osmo-bts/rsl.h
M src/common/l1sap.c
M src/common/oml.c
M src/common/rsl.c
M src/osmo-bts-litecell15/oml.c
M src/osmo-bts-sysmo/oml.c
6 files changed, 45 insertions(+), 29 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/74/574/1

diff --git a/include/osmo-bts/rsl.h b/include/osmo-bts/rsl.h
index 173e086..f13e968 100644
--- a/include/osmo-bts/rsl.h
+++ b/include/osmo-bts/rsl.h
@@ -35,9 +35,9 @@
 
 struct gsm_lchan *rsl_lchan_lookup(struct gsm_bts_trx *trx, uint8_t chan_nr);
 
-void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts);
-void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts);
-void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc);
+void cb_ts_disconnected(struct gsm_bts_trx_ts *ts);
+void cb_ts_connected(struct gsm_bts_trx_ts *ts);
+void ipacc_dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc);
 
 #endif // _RSL_H */
 
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index d73715b..23bc66e 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -463,8 +463,10 @@
 	/* During PDCH ACT, this is where we know that the PCU is done
 	 * activating a PDCH, and PDCH switchover is complete.  See
 	 * rsl_rx_dyn_pdch() */
-	if (lchan->ts->flags & TS_F_PDCH_ACT_PENDING)
-		dyn_pdch_complete(lchan->ts, info_act_cnf->cause? -EIO : 0);
+	if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH
+	    && (lchan->ts->flags & TS_F_PDCH_ACT_PENDING))
+		ipacc_dyn_pdch_complete(lchan->ts,
+					info_act_cnf->cause? -EIO : 0);
 
 	return 0;
 }
@@ -486,7 +488,8 @@
 	/* During PDCH DEACT, this marks the deactivation of the PDTCH as
 	 * requested by the PCU. Next up, we disconnect the TS completely and
 	 * call back to dyn_pdch_ts_disconnected(). See rsl_rx_dyn_pdch(). */
-	if (lchan->ts->flags & TS_F_PDCH_DEACT_PENDING)
+	if (lchan->ts->pchan == GSM_PCHAN_TCH_F_PDCH
+	    && (lchan->ts->flags & TS_F_PDCH_DEACT_PENDING))
 		bts_model_ts_disconnect(lchan->ts);
 
 	return 0;
diff --git a/src/common/oml.c b/src/common/oml.c
index 9d3c454..38df11a 100644
--- a/src/common/oml.c
+++ b/src/common/oml.c
@@ -691,6 +691,7 @@
 	unsigned int i;
 	enum gsm_phys_chan_config pchan = ts->pchan;
 
+	/* RSL_MT_IPAC_PDCH_ACT style dyn PDCH */
 	if (pchan == GSM_PCHAN_TCH_F_PDCH)
 		pchan = ts->flags & TS_F_PDCH_ACTIVE? GSM_PCHAN_PDCH
 						    : GSM_PCHAN_TCH_F;
diff --git a/src/common/rsl.c b/src/common/rsl.c
index cdcf755..cfe11ad 100644
--- a/src/common/rsl.c
+++ b/src/common/rsl.c
@@ -1686,13 +1686,13 @@
  *
  * PDCH ACT == TCH/F -> PDCH:
  * 1. call bts_model_ts_disconnect() to disconnect TCH/F;
- * 2. dyn_pdch_ts_disconnected() is called when done;
+ * 2. cb_ts_disconnected() is called when done;
  * 3. call bts_model_ts_connect() to connect as PDTCH;
- * 4. dyn_pdch_ts_connected() is called when done;
+ * 4. cb_ts_connected() is called when done;
  * 5. instruct the PCU to enable PDTCH;
  * 6. the PCU will call back with an activation request;
- * 7. l1sap_info_act_cnf() will call dyn_pdch_complete() when SAPI activations
- *    are done;
+ * 7. l1sap_info_act_cnf() will call ipacc_dyn_pdch_complete() when SAPI
+ *    activations are done;
  * 8. send a PDCH ACT ACK.
  *
  * PDCH DEACT == PDCH -> TCH/F:
@@ -1700,11 +1700,11 @@
  * 2. the PCU will call back with a deactivation request;
  * 3. l1sap_info_rel_cnf() will call bts_model_ts_disconnect() when SAPI
  *    deactivations are done;
- * 4. dyn_pdch_ts_disconnected() is called when done;
+ * 4. cb_ts_disconnected() is called when done;
  * 5. call bts_model_ts_connect() to connect as TCH/F;
- * 6. dyn_pdch_ts_connected() is called when done;
- * 7. directly call dyn_pdch_complete(), since no further action required for
- *    TCH/F;
+ * 6. cb_ts_connected() is called when done;
+ * 7. directly call ipacc_dyn_pdch_complete(), since no further action required
+ *    for TCH/F;
  * 8. send a PDCH DEACT ACK.
  *
  * When an error happens along the way, a PDCH DE/ACT NACK is sent.
@@ -1739,7 +1739,7 @@
 		     "%s Attempt to PDCH %s on TS that is not a TCH/F_PDCH (is %s)\n",
 		     gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT",
 		     gsm_pchan_name(ts->pchan));
-		dyn_pdch_complete(ts, -EINVAL);
+		ipacc_dyn_pdch_complete(ts, -EINVAL);
 		return;
 	}
 
@@ -1747,7 +1747,7 @@
 		LOGP(DL1C, LOGL_NOTICE,
 		     "%s Request to PDCH %s, but is already so\n",
 		     gsm_lchan_name(lchan), pdch_act? "ACT" : "DEACT");
-		dyn_pdch_complete(ts, 0);
+		ipacc_dyn_pdch_complete(ts, 0);
 		return;
 	}
 
@@ -1771,10 +1771,10 @@
 
 	/* Error? then NACK right now. */
 	if (rc)
-		dyn_pdch_complete(ts, rc);
+		ipacc_dyn_pdch_complete(ts, rc);
 }
 
-void dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts)
+static void ipacc_dyn_pdch_ts_disconnected(struct gsm_bts_trx_ts *ts)
 {
 	int rc;
 	enum gsm_phys_chan_config as_pchan;
@@ -1798,10 +1798,16 @@
 	rc = bts_model_ts_connect(ts, as_pchan);
 	/* Error? then NACK right now. */
 	if (rc)
-		dyn_pdch_complete(ts, rc);
+		ipacc_dyn_pdch_complete(ts, rc);
 }
 
-void dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts)
+void cb_ts_disconnected(struct gsm_bts_trx_ts *ts)
+{
+	if (ts->pchan == GSM_PCHAN_TCH_F_PDCH)
+		ipacc_dyn_pdch_ts_disconnected(ts);
+}
+
+static void ipacc_dyn_pdch_ts_connected(struct gsm_bts_trx_ts *ts)
 {
 	int rc;
 
@@ -1819,7 +1825,7 @@
 
 		/* During PDCH DEACT, we're done right after the TCH/F came
 		 * back up. */
-		dyn_pdch_complete(ts, 0);
+		ipacc_dyn_pdch_complete(ts, 0);
 
 	} else if (ts->flags & TS_F_PDCH_ACT_PENDING) {
 		if (ts->lchan[0].type != GSM_LCHAN_PDTCH)
@@ -1837,22 +1843,28 @@
 		 * when the PCU is not connected (yet), then there's nothing
 		 * left to do now. The PCU will catch up when it connects. */
 		if (!pcu_connected()) {
-			dyn_pdch_complete(ts, 0);
+			ipacc_dyn_pdch_complete(ts, 0);
 			return;
 		}
 
 		/* The PCU will request to activate the PDTCH SAPIs, which,
-		 * when done, will call back to dyn_pdch_complete(). */
+		 * when done, will call back to ipacc_dyn_pdch_complete(). */
 		/* TODO: timeout on channel connect / disconnect request from PCU? */
 		rc = pcu_tx_info_ind();
 
 		/* Error? then NACK right now. */
 		if (rc)
-			dyn_pdch_complete(ts, rc);
+			ipacc_dyn_pdch_complete(ts, rc);
 	}
 }
 
-void dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc)
+void cb_ts_connected(struct gsm_bts_trx_ts *ts)
+{
+	if (ts->pchan == GSM_PCHAN_TCH_F_PDCH)
+		ipacc_dyn_pdch_ts_connected(ts);
+}
+
+void ipacc_dyn_pdch_complete(struct gsm_bts_trx_ts *ts, int rc)
 {
 	bool pdch_act = ts->flags & TS_F_PDCH_ACT_PENDING;
 
diff --git a/src/osmo-bts-litecell15/oml.c b/src/osmo-bts-litecell15/oml.c
index 8f783f3..4d88ac5 100644
--- a/src/osmo-bts-litecell15/oml.c
+++ b/src/osmo-bts-litecell15/oml.c
@@ -1848,7 +1848,7 @@
 	     gsm_lchan_name(ts->lchan));
 
 	if (ts->flags & TS_F_PDCH_PENDING_MASK)
-		dyn_pdch_ts_disconnected(ts);
+		cb_ts_disconnected(ts);
 
 	return 0;
 }
@@ -1883,7 +1883,7 @@
 	       ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : "");
 
 	if (ts->flags & TS_F_PDCH_PENDING_MASK)
-		dyn_pdch_ts_connected(ts);
+		cb_ts_connected(ts);
 
 	return 0;
 }
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index 6be04fb..01425aa 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -1867,7 +1867,7 @@
 	     gsm_lchan_name(ts->lchan));
 
 	if (ts->flags & TS_F_PDCH_PENDING_MASK)
-		dyn_pdch_ts_disconnected(ts);
+		cb_ts_disconnected(ts);
 
 	return 0;
 }
@@ -1902,7 +1902,7 @@
 	       ts->flags & TS_F_PDCH_DEACT_PENDING ? "DEACT_PENDING " : "");
 
 	if (ts->flags & TS_F_PDCH_PENDING_MASK)
-		dyn_pdch_ts_connected(ts);
+		cb_ts_connected(ts);
 
 	return 0;
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7da5b7cb7b48572671f50e0dec97d9eec3083df1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>



More information about the gerrit-log mailing list