pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-gprs/+/33952 )
Change subject: sndcp: Initialize N201-U & N201-I to default settings ......................................................................
sndcp: Initialize N201-U & N201-I to default settings
LLC is only expected to signal new values if SNDCP XID params are received, or if the default N201 values change.
Change-Id: I68f54d329b326895ed8f010cf50f20fa30948d30 --- M src/sndcp/sndcp.c 1 file changed, 32 insertions(+), 0 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/src/sndcp/sndcp.c b/src/sndcp/sndcp.c index 5decfac..d71cac9 100644 --- a/src/sndcp/sndcp.c +++ b/src/sndcp/sndcp.c @@ -34,6 +34,23 @@
struct gprs_sndcp_ctx *g_sndcp_ctx;
+struct gprs_sndcp_llc_params { + uint16_t n201_u; + uint16_t n201_i; +}; + +/* Section 8.9.9 LLC layer parameter default values */ +static const struct gprs_sndcp_llc_params llc_default_params[GPRS_SNDCP_NUM_NSAPIS] = { + [1] = { .n201_u = 400, }, + [2] = { .n201_u = 270, }, + [3] = { .n201_u = 500, .n201_i = 1503, }, + [5] = { .n201_u = 500, .n201_i = 1503, }, + [7] = { .n201_u = 270, }, + [8] = { .n201_u = 270, }, + [9] = { .n201_u = 500, .n201_i = 1503, }, + [11] = { .n201_u = 500, .n201_i = 1503, }, +}; + int osmo_gprs_sndcp_init(enum osmo_gprs_sndcp_location location) { if (g_sndcp_ctx) @@ -126,6 +143,9 @@ sne->rx_state = GPRS_SNDCP_RX_S_FIRST; INIT_LLIST_HEAD(&sne->defrag.frag_list);
+ sne->n201_u = llc_default_params[llc_sapi].n201_u; + sne->n201_i = llc_default_params[llc_sapi].n201_i; + sne->snme = snme; gprs_sndcp_snme_attach_sne(snme, sne);