aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2017-07-30 16:55:00 +0200
committerHarald Welte <laforge@gnumonks.org>2017-08-09 10:03:14 +0000
commitde99be4afbc35e22f4f0263b0e9661dcecdc1ea2 (patch)
tree49d04c5f34ffad15fc293208e6a33543c1b397d6
parentd1f8001cdf7ddc4ae5e0319af5a6a021f03fdb07 (diff)
L1SAP: Use RSL_CHAN_OSMO_PDCH across L1SAP
So far, L1SAP code is hiding RSL_CHAN_OSMO_PDCH from the bts specific code below L1SAP. This is some kind of a hack/workaround, making code and debug output / logs more difficult to understand. So let's teach the lower layer how to treat RSL_CHAN_OSMO_PDCH and remove the "hiding" code from the common l1sap.c code. Change-Id: Iaaa833febe45b82166d3901f10cc5466a7591c19
-rw-r--r--include/osmo-bts/l1sap.h1
-rw-r--r--src/common/l1sap.c9
-rw-r--r--src/common/scheduler.c4
-rw-r--r--src/osmo-bts-litecell15/l1_if.c4
-rw-r--r--src/osmo-bts-octphy/l1_if.c4
-rw-r--r--src/osmo-bts-sysmo/l1_if.c4
6 files changed, 12 insertions, 14 deletions
diff --git a/include/osmo-bts/l1sap.h b/include/osmo-bts/l1sap.h
index 4e9c9e20..ad13145b 100644
--- a/include/osmo-bts/l1sap.h
+++ b/include/osmo-bts/l1sap.h
@@ -22,6 +22,7 @@
#define L1SAP_IS_CHAN_BCCH(chan_nr) ((chan_nr & 0xf8) == 0x80)
#define L1SAP_IS_CHAN_RACH(chan_nr) ((chan_nr & 0xf8) == 0x88)
#define L1SAP_IS_CHAN_AGCH_PCH(chan_nr) ((chan_nr & 0xf8) == 0x90)
+#define L1SAP_IS_CHAN_PDCH(chan_nr) ((chan_nr & 0xf8) == 0xc0)
/* rach type from ra */
#define L1SAP_IS_PACKET_RACH(ra) ((ra & 0xf0) == 0x70 && (ra & 0x0f) != 0x0f)
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 7c695619..4bf24a5d 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -263,6 +263,8 @@ static int gsmtap_ph_data(struct osmo_phsap_prim *l1sap, uint8_t *chan_type,
*chan_type = GSMTAP_CHANNEL_PCH;
else
*chan_type = GSMTAP_CHANNEL_AGCH;
+ } else if (L1SAP_IS_CHAN_PDCH(chan_nr)) {
+ *chan_type = GSMTAP_CHANNEL_PDTCH;
}
if (L1SAP_IS_LINK_SACCH(link_id))
*chan_type |= GSMTAP_CHANNEL_ACCH;
@@ -1218,7 +1220,7 @@ int l1sap_pdch_req(struct gsm_bts_trx_ts *ts, int is_ptcch, uint32_t fn,
l1sap = msgb_l1sap_prim(msg);
osmo_prim_init(&l1sap->oph, SAP_GSM_PH, PRIM_PH_DATA, PRIM_OP_REQUEST,
msg);
- l1sap->u.data.chan_nr = 0x08 | ts->nr;
+ l1sap->u.data.chan_nr = RSL_CHAN_OSMO_PDCH | ts->nr;
l1sap->u.data.link_id = 0x00;
l1sap->u.data.fn = fn;
msg->l2h = msgb_put(msg, len);
@@ -1265,11 +1267,6 @@ static int l1sap_chan_act_dact_modify(struct gsm_bts_trx *trx, uint8_t chan_nr,
{
struct osmo_phsap_prim l1sap;
- /* The caller may pass a non-standard RSL_CHAN_OSMO_PDCH, which the L1
- * doesn't understand. Use the normal TCH/F cbits instead. */
- if ((chan_nr & RSL_CHAN_NR_MASK) == RSL_CHAN_OSMO_PDCH)
- chan_nr = RSL_CHAN_Bm_ACCHs | (chan_nr & ~RSL_CHAN_NR_MASK);
-
memset(&l1sap, 0, sizeof(l1sap));
osmo_prim_init(&l1sap.oph, SAP_GSM_PH, PRIM_MPH_INFO, PRIM_OP_REQUEST,
NULL);
diff --git a/src/common/scheduler.c b/src/common/scheduler.c
index 08603d24..f6cb07e5 100644
--- a/src/common/scheduler.c
+++ b/src/common/scheduler.c
@@ -152,8 +152,8 @@ const struct trx_chan_desc trx_chan_desc[_TRX_CHAN_MAX] = {
{ 0, TRXC_SACCH8_5, 0x68, LID_SACCH, "SACCH/8(5)", rts_data_fn, tx_data_fn, rx_data_fn, 0 },
{ 0, TRXC_SACCH8_6, 0x70, LID_SACCH, "SACCH/8(6)", rts_data_fn, tx_data_fn, rx_data_fn, 0 },
{ 0, TRXC_SACCH8_7, 0x78, LID_SACCH, "SACCH/8(7)", rts_data_fn, tx_data_fn, rx_data_fn, 0 },
- { 1, TRXC_PDTCH, 0x08, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 },
- { 1, TRXC_PTCCH, 0x08, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 },
+ { 1, TRXC_PDTCH, 0xc0, LID_DEDIC, "PDTCH", rts_data_fn, tx_pdtch_fn, rx_pdtch_fn, 0 },
+ { 1, TRXC_PTCCH, 0xc0, LID_DEDIC, "PTCCH", rts_data_fn, tx_data_fn, rx_data_fn, 0 },
};
const struct value_string trx_chan_type_names[] = {
diff --git a/src/osmo-bts-litecell15/l1_if.c b/src/osmo-bts-litecell15/l1_if.c
index a3b9556b..12c24701 100644
--- a/src/osmo-bts-litecell15/l1_if.c
+++ b/src/osmo-bts-litecell15/l1_if.c
@@ -358,9 +358,9 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
lchan = get_lchan_by_chan_nr(trx, chan_nr);
if (L1SAP_IS_LINK_SACCH(link_id)) {
sapi = GsmL1_Sapi_Sacch;
- if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+ if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
subCh = l1sap_chan2ss(chan_nr);
- } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+ } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
if (ts_is_pdch(&trx->ts[u8Tn])) {
if (L1SAP_IS_PTCCH(u32Fn)) {
sapi = GsmL1_Sapi_Ptcch;
diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 20a84f8d..cb792d79 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -473,9 +473,9 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
subCh = 0xf1;
if (L1SAP_IS_LINK_SACCH(link_id)) {
sapi = cOCTVC1_GSM_SAPI_ENUM_SACCH;
- if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+ if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
subCh = l1sap_chan2ss(chan_nr);
- } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+ } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
if (trx->ts[u8Tn].pchan == GSM_PCHAN_PDCH) {
if (L1SAP_IS_PTCCH(u32Fn)) {
sapi = cOCTVC1_GSM_SAPI_ENUM_PTCCH;
diff --git a/src/osmo-bts-sysmo/l1_if.c b/src/osmo-bts-sysmo/l1_if.c
index 781900ee..8f68210e 100644
--- a/src/osmo-bts-sysmo/l1_if.c
+++ b/src/osmo-bts-sysmo/l1_if.c
@@ -354,9 +354,9 @@ static int ph_data_req(struct gsm_bts_trx *trx, struct msgb *msg,
lchan = get_lchan_by_chan_nr(trx, chan_nr);
if (L1SAP_IS_LINK_SACCH(link_id)) {
sapi = GsmL1_Sapi_Sacch;
- if (!L1SAP_IS_CHAN_TCHF(chan_nr))
+ if (!L1SAP_IS_CHAN_TCHF(chan_nr) && !L1SAP_IS_CHAN_PDCH(chan_nr))
subCh = l1sap_chan2ss(chan_nr);
- } else if (L1SAP_IS_CHAN_TCHF(chan_nr)) {
+ } else if (L1SAP_IS_CHAN_TCHF(chan_nr) || L1SAP_IS_CHAN_PDCH(chan_nr)) {
if (ts_is_pdch(&trx->ts[u8Tn])) {
if (L1SAP_IS_PTCCH(u32Fn)) {
sapi = GsmL1_Sapi_Ptcch;