pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33957 )
Change subject: sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.req ......................................................................
sndcp: Use radio_prio assigned by SM when submitting LLC unitdata.req
Change-Id: I632329bb1f34efb4d9263241e2cda5b559f1ff59 --- M include/osmocom/gprs/sndcp/sndcp_private.h M src/sndcp/sndcp.c M src/sndcp/sndcp_prim.c 3 files changed, 28 insertions(+), 8 deletions(-)
Approvals: laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved
diff --git a/include/osmocom/gprs/sndcp/sndcp_private.h b/include/osmocom/gprs/sndcp/sndcp_private.h index 21c6a40..5630c97 100644 --- a/include/osmocom/gprs/sndcp/sndcp_private.h +++ b/include/osmocom/gprs/sndcp/sndcp_private.h @@ -151,6 +151,9 @@ /* The NSAPI we shall use on top of LLC */ uint8_t nsapi;
+ /* Radio Priority (MS only, used by LLC/RLCMAC), TS 24.008 10.5.7.2 */ + uint8_t radio_prio; + /* NPDU number for the GTP->SNDCP side */ uint16_t tx_npdu_nr; /* SNDCP eeceiver state */ diff --git a/src/sndcp/sndcp.c b/src/sndcp/sndcp.c index d71cac9..7e82b5d 100644 --- a/src/sndcp/sndcp.c +++ b/src/sndcp/sndcp.c @@ -222,6 +222,18 @@ return rc; }
+int gprs_sndcp_sne_submit_llc_ll_unitdata_req(struct gprs_sndcp_entity *sne, uint8_t *data, unsigned int len) +{ + struct osmo_gprs_llc_prim *llc_prim_tx; + int rc; + + llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, data, len); + OSMO_ASSERT(llc_prim_tx); + llc_prim_tx->ll.unitdata_req.radio_prio = sne->radio_prio; + rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + return rc; +} + int gprs_sndcp_sne_submit_sn_xid_cnf(struct gprs_sndcp_entity *sne) { struct osmo_gprs_sndcp_prim *sndcp_prim_tx; @@ -530,7 +542,6 @@ unsigned int len; uint8_t *data; int rc, more; - struct osmo_gprs_llc_prim *llc_prim_tx;
fmsg = msgb_alloc_headroom(sne->n201_u+256, 128, "SNDCP Frag"); if (!fmsg) { @@ -588,9 +599,7 @@ sch->more = more;
/* Send down the stack SNDCP->LLC as LL-UNITDATA.req: */ - llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, fmsg->data, fmsg->len); - OSMO_ASSERT(llc_prim_tx); - rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + rc = gprs_sndcp_sne_submit_llc_ll_unitdata_req(sne, fmsg->data, fmsg->len); msgb_free(fmsg); /* abort in case of error, do not advance frag_nr / next_byte */ if (rc < 0) { @@ -622,7 +631,6 @@ uint8_t dcomp = 0; int rc; struct msgb *msg = msgb_alloc_headroom(npdu_len + 256, 128, "sndcp-tx"); - struct osmo_gprs_llc_prim *llc_prim_tx;
memcpy(msgb_put(msg, npdu_len), npdu, npdu_len);
@@ -711,9 +719,7 @@ sch->nsapi = sne->nsapi;
/* Send down the stack SNDCP->LLC as LL-UNITDATA.req: */ - llc_prim_tx = osmo_gprs_llc_prim_alloc_ll_unitdata_req(sne->snme->tlli, sne->llc_sapi, msg->data, msg->len); - OSMO_ASSERT(llc_prim_tx); - rc = gprs_sndcp_prim_call_down_cb(llc_prim_tx); + rc = gprs_sndcp_sne_submit_llc_ll_unitdata_req(sne, msg->data, msg->len); free_ret: msgb_free(msg); return rc; diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c index e371416..2e2139c 100644 --- a/src/sndcp/sndcp_prim.c +++ b/src/sndcp/sndcp_prim.c @@ -661,6 +661,8 @@ if (g_sndcp_ctx->location != OSMO_GPRS_SNDCP_LOCATION_MS) return 0;
+ sne->radio_prio = sndcp_prim->snsm.activate_ind.radio_prio; + /* TODO: when supporting and using LLC ABM mode, flow should go through * LL-ESTABLISH.req, as per TS 24.007 C.6 "No LLC link exists yet, * establish a link and exchange XID"