aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2013-01-16 13:44:19 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2013-01-23 18:23:58 +0100
commite210f1a864b0752f5baeb14de8ddcfc7320007a4 (patch)
tree8022a4c163cd0307e05c7a5d114d4d706f674286
parent61e739912f22a4c6e4eca5ed7852bbc0077ba93e (diff)
sysmobts: Rename the hLayer2<->lchan to hLayer<->lchan
We are using this conversion for both hLayer2 and hLayer3. Make the function name more generic to indicate that this function can be used with the hLayer3. The functions that call the methods were updated using spatch and @rule1@ expression E; expression F; @@ - l1if_hLayer2_to_lchan(E, F) + l1if_hLayer_to_lchan(E, F) @rule2@ expression E; expression F; @@ - l1if_lchan_to_hLayer2(E) + l1if_lchan_to_hLayer(E)
-rw-r--r--src/osmo-bts-sysmo/l1_if.c12
-rw-r--r--src/osmo-bts-sysmo/l1_if.h4
-rw-r--r--src/osmo-bts-sysmo/oml.c8
3 files changed, 12 insertions, 12 deletions
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 267a0c29..7b15e72e 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -306,7 +306,7 @@ get_lapdm_chan_by_hl2(struct gsm_bts_trx *trx, uint32_t hLayer2)
{
struct gsm_lchan *lchan;
- lchan = l1if_hLayer2_to_lchan(trx, hLayer2);
+ lchan = l1if_hLayer_to_lchan(trx, hLayer2);
if (!lchan)
return NULL;
@@ -383,7 +383,7 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
case GsmL1_Sapi_TchF:
case GsmL1_Sapi_TchH:
/* resolve the L2 entity using rts_ind->hLayer2 */
- lchan = l1if_hLayer2_to_lchan(trx, rts_ind->hLayer2);
+ lchan = l1if_hLayer_to_lchan(trx, rts_ind->hLayer2);
if (!lchan)
break;
@@ -456,7 +456,7 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
break;
case GsmL1_Sapi_Sacch:
/* resolve the L2 entity using rts_ind->hLayer2 */
- lchan = l1if_hLayer2_to_lchan(trx, rts_ind->hLayer2);
+ lchan = l1if_hLayer_to_lchan(trx, rts_ind->hLayer2);
le = &lchan->lapdm_ch.lapdm_acch;
rc = lapdm_phsap_dequeue_prim(le, &pp);
if (rc < 0) {
@@ -475,7 +475,7 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
break;
case GsmL1_Sapi_Sdcch:
/* resolve the L2 entity using rts_ind->hLayer2 */
- lchan = l1if_hLayer2_to_lchan(trx, rts_ind->hLayer2);
+ lchan = l1if_hLayer_to_lchan(trx, rts_ind->hLayer2);
le = &lchan->lapdm_ch.lapdm_dcch;
rc = lapdm_phsap_dequeue_prim(le, &pp);
if (rc < 0)
@@ -511,7 +511,7 @@ static int handle_ph_readytosend_ind(struct femtol1_hdl *fl1,
case GsmL1_Sapi_FacchF:
case GsmL1_Sapi_FacchH:
/* resolve the L2 entity using rts_ind->hLayer2 */
- lchan = l1if_hLayer2_to_lchan(trx, rts_ind->hLayer2);
+ lchan = l1if_hLayer_to_lchan(trx, rts_ind->hLayer2);
le = &lchan->lapdm_ch.lapdm_dcch;
rc = lapdm_phsap_dequeue_prim(le, &pp);
if (rc < 0)
@@ -640,7 +640,7 @@ static int handle_ph_data_ind(struct femtol1_hdl *fl1, GsmL1_PhDataInd_t *data_i
ul_to_gsmtap(fl1, l1p_msg);
- lchan = l1if_hLayer2_to_lchan(fl1->priv, data_ind->hLayer2);
+ lchan = l1if_hLayer_to_lchan(fl1->priv, data_ind->hLayer2);
if (!lchan) {
LOGP(DL1C, LOGL_ERROR, "unable to resolve lchan by hLayer2\n");
return -ENODEV;
diff --git a/src/osmo-bts-sysmo/l1_if.h b/src/osmo-bts-sysmo/l1_if.h
index f8970143..5ebd6ded 100644
--- a/src/osmo-bts-sysmo/l1_if.h
+++ b/src/osmo-bts-sysmo/l1_if.h
@@ -74,8 +74,8 @@ int l1if_set_txpower(struct femtol1_hdl *fl1h, float tx_power);
struct msgb *l1p_msgb_alloc(void);
struct msgb *sysp_msgb_alloc(void);
-uint32_t l1if_lchan_to_hLayer2(struct gsm_lchan *lchan);
-struct gsm_lchan *l1if_hLayer2_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer2);
+uint32_t l1if_lchan_to_hLayer(struct gsm_lchan *lchan);
+struct gsm_lchan *l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer);
/* tch.c */
int l1if_tch_rx(struct gsm_lchan *lchan, struct msgb *l1p_msg);
diff --git a/src/osmo-bts-sysmo/oml.c b/src/osmo-bts-sysmo/oml.c
index ee810fcf..2e70cc81 100644
--- a/src/osmo-bts-sysmo/oml.c
+++ b/src/osmo-bts-sysmo/oml.c
@@ -490,14 +490,14 @@ static int lchan_act_compl_cb(struct msgb *l1_msg, void *data)
return 0;
}
-uint32_t l1if_lchan_to_hLayer2(struct gsm_lchan *lchan)
+uint32_t l1if_lchan_to_hLayer(struct gsm_lchan *lchan)
{
return (lchan->nr << 8) | (lchan->ts->nr << 16) | (lchan->ts->trx->nr << 24);
}
-/* obtain a ptr to the lapdm_channel for a given hLayer2 */
+/* obtain a ptr to the lapdm_channel for a given hLayer */
struct gsm_lchan *
-l1if_hLayer2_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer2)
+l1if_hLayer_to_lchan(struct gsm_bts_trx *trx, uint32_t hLayer2)
{
uint8_t ts_nr = (hLayer2 >> 16) & 0xff;
uint8_t lchan_nr = (hLayer2 >> 8)& 0xff;
@@ -656,7 +656,7 @@ int lchan_activate(struct gsm_lchan *lchan)
act_req->subCh = lchan_to_GsmL1_SubCh_t(lchan);
act_req->dir = s4l->sapis[i].dir;
act_req->sapi = s4l->sapis[i].sapi;
- act_req->hLayer2 = l1if_lchan_to_hLayer2(lchan);
+ act_req->hLayer2 = l1if_lchan_to_hLayer(lchan);
switch (act_req->sapi) {
case GsmL1_Sapi_Sch: