dexter has uploaded this change for review.

View Change

gprs_rlcmac: also use direct TLLI PCUIF for paging macblocks

In the current code we still send PAGING COMMAND macblocks via SAPI
PCU_IF_SAPI_PCH, which technically belongs to the older PCUIF version
(v.10), which we are going to deprecate soon.

To give some background information it should be noted that this bug has
its root cause in a misconception on how the receiving end should behave
when it receives PAGING COMMAND macblocks. It was not clear that PAGING
COMMAND and IMMEDIATE ASSIGNMENT (via PCH) require a confirmation by the
receiving end. Since osmo-bts uses the old V.10 PCUIF interface we get a
confirmation for both message types, but osmo-bsc, which uses the newer
V.11 interface will only confirm IMMEDIATE ASSIGNMENT messages, to
distinguish between both message types it uses SAPI PCU_IF_SAPI_PCH for
PAGING COMMAND and PCU_IF_SAPI_PCH_DT for IMMEDIATE ASSIGNMENT
(confirmed). It is not only confusing to use two different SAPIs to
access the PCH, but also wrong. In the new PCUIF interface we should
only use PCU_IF_SAPI_PCH_DT. A coresponding patch for osmo-bsc is
already submitted (see Depends).

Depends: osmo-bsc.git I82443f2b402aa2416469c8c50b1c050323ef3b8f
Related: OS##5927
Change-Id: I99cfe373fa157cfb32b74c113ad9935347653a71
---
M src/gprs_rlcmac.c
M src/pcu_l1_if.cpp
M src/pcu_l1_if.h
3 files changed, 40 insertions(+), 9 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/94/32694/1
diff --git a/src/gprs_rlcmac.c b/src/gprs_rlcmac.c
index 3163c32..07c7e25 100644
--- a/src/gprs_rlcmac.c
+++ b/src/gprs_rlcmac.c
@@ -17,6 +17,7 @@
*/

#include <osmocom/gsm/gsm48.h>
+#include <osmocom/core/bitvec.h>

#include <pcu_l1_if.h>
#include <gprs_rlcmac.h>
@@ -43,7 +44,12 @@
return -1;
}
bts_do_rate_ctr_inc(bts, CTR_PCH_REQUESTS);
- pcu_l1if_tx_pch(bts, paging_request, plen, imsi);
+
+ if (the_pcu->pcu_if_version >= 0x0b)
+ pcu_l1if_tx_pch_dt(bts, paging_request, plen, imsi, mi->tmsi);
+ else
+ pcu_l1if_tx_pch(bts, paging_request, plen, imsi);
+
bitvec_free(paging_request);

return 0;
diff --git a/src/pcu_l1_if.cpp b/src/pcu_l1_if.cpp
index 85aaddc..51c03d9 100644
--- a/src/pcu_l1_if.cpp
+++ b/src/pcu_l1_if.cpp
@@ -286,13 +286,9 @@
pcu_tx_data_req(bts, 0, 0, PCU_IF_SAPI_PCH, 0, 0, 0, data, sizeof(data));
}

-/* Send a block via the paging channel and require a confirmation by the receiving end */
-void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, const char *imsi, uint32_t tlli)
+/* Send a macblock via the paging channel (and get confirmation by the receiving end) */
+void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, struct bitvec *block, int plen, const char *imsi, uint32_t tlli)
{
- /* NOTE: This is in practice only used to transmit IMMEDIATE ASSIGNMENT messages through the paging channel and
- * it is not guaranteed to work with other message types. The prepended TLLI will be used as an identifier in
- * the confirmation message. */
-
struct gsm_pcu_if_pch_dt pch_dt = { 0 };

pch_dt.tlli = tlli;
diff --git a/src/pcu_l1_if.h b/src/pcu_l1_if.h
index f787c40..88e84c3 100644
--- a/src/pcu_l1_if.h
+++ b/src/pcu_l1_if.h
@@ -17,6 +17,7 @@
#define PCU_L1_IF_H

#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -147,8 +148,6 @@
uint32_t fn, uint8_t block_nr,
uint8_t *data, size_t data_len);
void pcu_l1if_tx_agch(struct gprs_rlcmac_bts *bts, bitvec *block, int len);
-
-void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, bitvec *block, int plen, const char *imsi, uint32_t tlli);
#endif

#ifdef __cplusplus
@@ -158,6 +157,7 @@

int pcu_tx_neigh_addr_res_req(struct gprs_rlcmac_bts *bts, const struct neigh_cache_entry_key *neigh_key);
void pcu_l1if_tx_pch(struct gprs_rlcmac_bts *bts, struct bitvec *block, int plen, const char *imsi);
+void pcu_l1if_tx_pch_dt(struct gprs_rlcmac_bts *bts, struct bitvec *block, int plen, const char *imsi, uint32_t tlli);

int pcu_rx(struct gsm_pcu_if *pcu_prim, size_t pcu_prim_length);
int pcu_l1if_open(void);

To view, visit change 32694. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I99cfe373fa157cfb32b74c113ad9935347653a71
Gerrit-Change-Number: 32694
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-MessageType: newchange