diff options
author | Andreas.Eversberg <jolly@eversberg.eu> | 2010-09-17 09:07:29 +0000 |
---|---|---|
committer | Andreas.Eversberg <jolly@eversberg.eu> | 2010-09-17 09:07:29 +0000 |
commit | b349e38838d6df853661ceefdfa1a007d2d5b449 (patch) | |
tree | 0a843c936061f4a0221de9e2d92a9d77f5588db2 | |
parent | 4b2db86031178bbe1f251155b4be521b0b0769e3 (diff) |
[layer23] CM service is now accepted when ciphering has started
Sylvain pointed out that CM SERVICE ACCEPT message is not requred, if
ciphering has been completed. In this case, an RR_SYNC_IND is sent
to mobility management, and treated there as CM SERVICE ACCEPT.
-rw-r--r-- | src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h | 2 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/gsm48_mm.c | 7 | ||||
-rw-r--r-- | src/host/layer23/src/mobile/gsm48_rr.c | 11 |
3 files changed, 19 insertions, 1 deletions
diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h index e8b44dc7..5ab5f4fb 100644 --- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h +++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h @@ -40,6 +40,8 @@ #define RR_REL_CAUSE_LOST_SIGNAL 7 #define RR_REL_CAUSE_LINK_FAILURE 8 +#define RR_SYNC_CAUSE_CIPHERING 1 + #define L3_ALLOC_SIZE 256 #define L3_ALLOC_HEADROOM 64 diff --git a/src/host/layer23/src/mobile/gsm48_mm.c b/src/host/layer23/src/mobile/gsm48_mm.c index dfc41d45..1b063a13 100644 --- a/src/host/layer23/src/mobile/gsm48_mm.c +++ b/src/host/layer23/src/mobile/gsm48_mm.c @@ -3117,6 +3117,13 @@ static int gsm48_mm_conn_go_dedic(struct osmocom_ms *ms) static int gsm48_mm_sync_ind_wait(struct osmocom_ms *ms, struct msgb *msg) { struct gsm48_mmlayer *mm = &ms->mmlayer; + struct gsm48_rr_hdr *rrh = (struct gsm48_rr_hdr *)msg->data; + + if (rrh->cause != RR_SYNC_CAUSE_CIPHERING) { + LOGP(DMM, LOGL_NOTICE, "Ignore sync indication, not waiting " + "for CM service\n"); + return -EINVAL; + } /* stop MM connection timer */ stop_mm_t3230(mm); diff --git a/src/host/layer23/src/mobile/gsm48_rr.c b/src/host/layer23/src/mobile/gsm48_rr.c index 3d0245bc..e2418ccf 100644 --- a/src/host/layer23/src/mobile/gsm48_rr.c +++ b/src/host/layer23/src/mobile/gsm48_rr.c @@ -800,6 +800,7 @@ static int gsm48_rr_tx_cip_mode_cpl(struct osmocom_ms *ms, uint8_t cr) struct gsm_settings *set = &ms->settings; struct msgb *nmsg; struct gsm48_hdr *gh; + struct gsm48_rr_hdr *nrrh; uint8_t buf[11], *tlv; LOGP(DRR, LOGL_INFO, "CIPHERING MODE COMPLETE (cr %d)\n", cr); @@ -821,7 +822,15 @@ static int gsm48_rr_tx_cip_mode_cpl(struct osmocom_ms *ms, uint8_t cr) memcpy(tlv, buf, 2 + buf[1]); } - return gsm48_send_rsl(ms, RSL_MT_DATA_REQ, nmsg); + gsm48_send_rsl(ms, RSL_MT_DATA_REQ, nmsg); + + /* send RR_SYNC_IND(ciphering) */ + nmsg = gsm48_rr_msgb_alloc(GSM48_RR_SYNC_IND); + if (!nmsg) + return -ENOMEM; + nrrh = (struct gsm48_rr_hdr *)nmsg->data; + nrrh->cause = RR_SYNC_CAUSE_CIPHERING; + return gsm48_rr_upmsg(ms, nmsg); } /* receive ciphering mode command */ |