diff options
author | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-11-29 17:43:22 +0800 |
---|---|---|
committer | Holger Hans Peter Freyther <holger@moiji-mobile.com> | 2017-12-03 12:58:52 +0000 |
commit | f976ad9dc41ae14919c9923fc82ba747b1dd181c (patch) | |
tree | f58c5595b08a8d9c4fb6e6390b9f46d6d78c3ab4 /src/host/layer23/src | |
parent | 714cb53282c89d50055a17b67047d50b03d69521 (diff) |
mobile: Notify MM status changes and generate primitive op ind
Notify once the mm state has been changed. Unfortunaley one state
transition can immediately trigger more transitions (recursively).
In the mid-term it might be best to force all primitives to be
async to avoid unpredictable behavior (e.g. make a shutdown while
being a recursion down?)
Change-Id: I8e9dcf7fd9116985aa060ba027ba74107a19223a
Diffstat (limited to 'src/host/layer23/src')
-rw-r--r-- | src/host/layer23/src/mobile/gsm48_mm.c | 2 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/primitives.c | 10 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index f32d57ab..a7af1f5c 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -39,6 +39,7 @@ #include <osmocom/bb/mobile/gsm480_ss.h> #include <osmocom/bb/mobile/gsm411_sms.h> #include <osmocom/bb/mobile/app_mobile.h> +#include <osmocom/bb/mobile/primitives.h> #include <osmocom/bb/mobile/vty.h> extern void *l23_ctx; @@ -961,6 +962,7 @@ static void new_mm_state(struct gsm48_mmlayer *mm, int state, int substate) mm->state = state; mm->substate = substate; + mobile_prim_ntfy_mm_status(ms, mm->state, mm->substate, mm->mr_substate); /* resend detach event, if flag is set */ if (state == GSM48_MM_ST_MM_IDLE && mm->delay_detach) { diff --git a/src/host/layer23/src/mobile/primitives.c b/src/host/layer23/src/mobile/primitives.c index 0902139e..fd486ea2 100644 --- a/src/host/layer23/src/mobile/primitives.c +++ b/src/host/layer23/src/mobile/primitives.c @@ -144,6 +144,16 @@ void mobile_prim_ntfy_sms_status(struct osmocom_ms *ms, struct gsm_sms *sms, uin dispatch(ms, prim); } +void mobile_prim_ntfy_mm_status(struct osmocom_ms *ms, int state, int substate, int mr_substate) +{ + struct mobile_prim *prim = mobile_prim_alloc(PRIM_MOB_MM, PRIM_OP_INDICATION); + + prim->u.mm.state = state; + prim->u.mm.substate = substate; + prim->u.mm.prev_substate = mr_substate; + dispatch(ms, prim); +} + static int cancel_timer(struct mobile_prim_intf *intf, struct mobile_timer_param *param) { struct timer_closure *closure; |