aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/common/l1sap.c1
-rw-r--r--src/osmo-bts-trx/l1_if.c6
2 files changed, 4 insertions, 3 deletions
diff --git a/src/common/l1sap.c b/src/common/l1sap.c
index 5a0cc516..e66a0100 100644
--- a/src/common/l1sap.c
+++ b/src/common/l1sap.c
@@ -96,6 +96,7 @@ static int check_for_ciph_cmd(struct msgb *msg, struct gsm_lchan *lchan,
/* only do this if we are in the right state */
switch (lchan->ciph_state) {
case LCHAN_CIPH_NONE:
+ case LCHAN_CIPH_RX_REQ:
break;
default:
return 0;
diff --git a/src/osmo-bts-trx/l1_if.c b/src/osmo-bts-trx/l1_if.c
index f3921f3b..e6621ccd 100644
--- a/src/osmo-bts-trx/l1_if.c
+++ b/src/osmo-bts-trx/l1_if.c
@@ -371,7 +371,7 @@ static int l1if_set_ciphering(struct trx_l1h *l1h, struct gsm_lchan *lchan,
uint8_t chan_nr, int downlink)
{
/* ciphering already enabled in both directions */
- if (lchan->ciph_state == LCHAN_CIPH_TXRX_CONF)
+ if (lchan->ciph_state == LCHAN_CIPH_RXTX_CONF)
return -EINVAL;
if (!downlink) {
@@ -388,7 +388,7 @@ static int l1if_set_ciphering(struct trx_l1h *l1h, struct gsm_lchan *lchan,
}
trx_sched_set_cipher(l1h, chan_nr, 1, lchan->encr.alg_id - 1,
lchan->encr.key, lchan->encr.key_len);
- lchan->ciph_state = LCHAN_CIPH_TXRX_CONF;
+ lchan->ciph_state = LCHAN_CIPH_RXTX_CONF;
}
return 0;
@@ -511,7 +511,7 @@ int bts_model_l1sap_down(struct gsm_bts_trx *trx, struct osmo_phsap_prim *l1sap)
l1if_set_ciphering(l1h, lchan, chan_nr, 0);
l1if_set_ciphering(l1h, lchan, chan_nr, 1);
if (lchan->encr.alg_id)
- lchan->ciph_state = LCHAN_CIPH_TXRX_CONF;
+ lchan->ciph_state = LCHAN_CIPH_RXTX_CONF;
else
lchan->ciph_state = LCHAN_CIPH_NONE;