pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/32590 )
(
4 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one. )Change subject: layer23: modem: gmm: Activate PDP Context of APN after GPRS attach ......................................................................
layer23: modem: gmm: Activate PDP Context of APN after GPRS attach
Change-Id: Icb667a6a3359267d2eb20e11a40eb27a8c3f7e2d --- M src/host/layer23/src/modem/gmm.c 1 file changed, 16 insertions(+), 0 deletions(-)
Approvals: osmith: Looks good to me, but someone else must approve laforge: Looks good to me, but someone else must approve fixeria: Looks good to me, approved Jenkins Builder: Verified
diff --git a/src/host/layer23/src/modem/gmm.c b/src/host/layer23/src/modem/gmm.c index 62c6d5e..f3a936a 100644 --- a/src/host/layer23/src/modem/gmm.c +++ b/src/host/layer23/src/modem/gmm.c @@ -44,12 +44,14 @@ #include <osmocom/bb/common/apn.h> #include <osmocom/bb/common/ms.h> #include <osmocom/bb/modem/gmm.h> +#include <osmocom/bb/modem/sm.h> #include <osmocom/bb/modem/modem.h>
static int modem_gmm_prim_up_cb(struct osmo_gprs_gmm_prim *gmm_prim, void *user_data) { const char *pdu_name = osmo_gprs_gmm_prim_name(gmm_prim); struct osmocom_ms *ms = user_data; + struct osmobb_apn *apn; int rc = 0;
switch (gmm_prim->oph.sap) { @@ -61,6 +63,11 @@ __func__, pdu_name, gmm_prim->gmmreg.attach_cnf.acc.allocated_ptmsi); ms->subscr.ptmsi = gmm_prim->gmmreg.attach_cnf.acc.allocated_ptmsi; app_data.modem_state = MODEM_ST_ATTACHED; + /* Activate APN if not yet already: */ + apn = llist_first_entry_or_null(&ms->gprs.apn_list, struct osmobb_apn, list); + if (!apn || apn->cfg.shutdown) + break; + modem_sm_smreg_pdp_act_req(ms, apn); } else { uint8_t cause = gmm_prim->gmmreg.attach_cnf.rej.cause; LOGP(DGMM, LOGL_ERROR, "%s(): Rx %s: Attach rejected, cause=%u (%s)\n",