From dbb588df52b24f8e3d050a051c395fa189cdf4eb Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Wed, 3 May 2023 13:05:24 +0200 Subject: [PATCH] llc: use GRR instead of BSSGP to tx XID.req in MS mode Change-Id: Ib2ada2cc7160202f9da5b177da8263076e1eef69 --- src/llc/llc.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/llc/llc.c b/src/llc/llc.c index ef52ec3..4be7a9a 100644 --- a/src/llc/llc.c +++ b/src/llc/llc.c @@ -266,7 +266,10 @@ int gprs_llc_lle_tx_xid(const struct gprs_llc_lle *lle, uint8_t *xid_payload, un gprs_llc_encode_is_cmd_as_cr(is_cmd, &pdu_dec.flags); /* LLC payload is put directly below: */ - llc_prim = gprs_llc_prim_alloc_bssgp_dl_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); + if (g_llc_ctx->location == OSMO_GPRS_LLC_LOCATION_SGSN) + llc_prim = gprs_llc_prim_alloc_bssgp_dl_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); + else + llc_prim = gprs_llc_prim_alloc_grr_unitdata_req(lle->llme->tlli, NULL, 4096 - sizeof(llc_prim)); msg = llc_prim->oph.msg; msg->l3h = msg->tail; @@ -276,10 +279,15 @@ int gprs_llc_lle_tx_xid(const struct gprs_llc_lle *lle, uint8_t *xid_payload, un msgb_free(msg); return rc; } - llc_prim->bssgp.ll_pdu = msgb_l3(msg); - llc_prim->bssgp.ll_pdu_len = msgb_l3len(msg); + if (g_llc_ctx->location == OSMO_GPRS_LLC_LOCATION_MS) { + llc_prim->bssgp.ll_pdu = msgb_l3(msg); + llc_prim->bssgp.ll_pdu_len = msgb_l3len(msg); + } else { + llc_prim->grr.ll_pdu = msgb_l3(msg); + llc_prim->grr.ll_pdu_len = msgb_l3len(msg); + } - /* Send BSSGP-DL-UNITDATA.req */ + /* Send GRR-UNITDATA.req */ gprs_llc_prim_call_down_cb(llc_prim); return 0; }