diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2018-04-02 12:26:16 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2018-04-03 02:13:16 +0200 |
commit | 16c42b5fbacb93867f41f529893b6af8a1a54c5b (patch) | |
tree | fe499bd4cdca9679e1983c6c60a01e8e5a06d199 /include/osmocom/msc/gsm_data.h | |
parent | 1ba0df26dc2ff6ff71ad467a25b5828e40c9b48e (diff) |
subscr_conn: store complete_layer3_type in conn, not FSM event arg
Instead of jumping through hoops to pass the Complete Layer 3 operation that
created this conn via FSM event dispatch parameters, put it right in the
gsm_subscriber_connection struct, where it always belonged.
Move definition of the enum complete_layer3_type to gsm_data.h, where
gsm_subscriber_connection is defined.
Introduce msc_subscr_conn_update_id() to set the complete_layer3_type of the
conn as soon as a Complete Layer 3 message is received.
In msc_subscr_conn_update_id(), already include an mi_string argument to
prepare for an upcoming patch where the FSM will be allocated much earlier when
the Mobile Identity is not known yet, and we'll also update the fi->id here.
The odd logging change in the msc_vlr_tests output uncovers a wrong use of the
osmo_fsm_inst_dispatch() data argument for SUBSCR_CONN_E_CN_CLOSE events: if a
child FSM signals unsuccessful result, instead of the failure cause, it passed
the complete_layer3_type, as requested upon FSM allocation, which was then
misinterpreted as a failure cause. Now a child FSM failure will pass NULL
instead, while other SUBSCR_CONN_E_CN_CLOSE events may still pass a valid cause
value.
Related: OS#3122
Change-Id: Iae30dd57a8861c4eaaf56999f872d4e635ba97fb
Diffstat (limited to 'include/osmocom/msc/gsm_data.h')
-rw-r--r-- | include/osmocom/msc/gsm_data.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h index df15eea02..29abd5d20 100644 --- a/include/osmocom/msc/gsm_data.h +++ b/include/osmocom/msc/gsm_data.h @@ -70,6 +70,19 @@ enum integrity_protection_state { INTEGRITY_PROTECTION_IK_CK = 2, }; +enum complete_layer3_type { + COMPLETE_LAYER3_NONE, + COMPLETE_LAYER3_LU, + COMPLETE_LAYER3_CM_SERVICE_REQ, + COMPLETE_LAYER3_PAGING_RESP, +}; + +extern const struct value_string complete_layer3_type_names[]; +static inline const char *complete_layer3_type_name(enum complete_layer3_type val) +{ + return get_value_string(complete_layer3_type_names, val); +} + /* active radio connection of a mobile subscriber */ struct gsm_subscriber_connection { /* global linked list of subscriber_connections */ @@ -77,6 +90,7 @@ struct gsm_subscriber_connection { /* FSM instance to control the subscriber connection's permissions and lifetime. */ struct osmo_fsm_inst *fi; + enum complete_layer3_type complete_layer3_type; /* usage count. If this drops to zero, we start the release * towards A/Iu */ |