summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/common/l1ctl.c
diff options
context:
space:
mode:
authorAndreas.Eversberg <jolly@eversberg.eu>2010-09-11 12:10:31 +0000
committerAndreas.Eversberg <jolly@eversberg.eu>2010-09-11 12:10:31 +0000
commitfa686fd4c9601a7ded99c38e2497ce2099140e98 (patch)
tree386d640684e9a2877bc0935682f5660f46c9a123 /src/host/layer23/src/common/l1ctl.c
parent09c2e5344c429362075361bfac484b2e2f4ae919 (diff)
[layer23 / layer1] Added interface for changing crypto mode of DSP
The layer23 will now set crypto mode and key when CIPHERING MODE COMMAND is received. After crypto mode has been set, CIPHERING MODE COMPLETE is sent. NOTE: Layer1 implements only the interface, there is no functionality to it yet.
Diffstat (limited to 'src/host/layer23/src/common/l1ctl.c')
-rw-r--r--src/host/layer23/src/common/l1ctl.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c
index b8e332f7..a5d61694 100644
--- a/src/host/layer23/src/common/l1ctl.c
+++ b/src/host/layer23/src/common/l1ctl.c
@@ -317,6 +317,28 @@ int l1ctl_tx_param_req(struct osmocom_ms *ms, uint8_t ta, uint8_t tx_power)
return osmo_send_l1(ms, msg);
}
+/* Transmit L1CTL_CRYPTO_REQ */
+int l1ctl_tx_crypto_req(struct osmocom_ms *ms, uint8_t algo, uint8_t *key,
+ uint8_t len)
+{
+ struct msgb *msg;
+ struct l1ctl_info_ul *ul;
+ struct l1ctl_crypto_req *req;
+
+ msg = osmo_l1_alloc(L1CTL_CRYPTO_REQ);
+ if (!msg)
+ return -1;
+
+ DEBUGP(DL1C, "CRYPTO Req. algo=%d, len=%d\n", algo, len);
+ ul = (struct l1ctl_info_ul *) msgb_put(msg, sizeof(*ul));
+ req = (struct l1ctl_crypto_req *) msgb_put(msg, sizeof(*req) + len);
+ req->algo = algo;
+ if (len)
+ memcpy(req->key, key, len);
+
+ return osmo_send_l1(ms, msg);
+}
+
/* Transmit L1CTL_RACH_REQ */
int l1ctl_tx_rach_req(struct osmocom_ms *ms, uint8_t ra, uint8_t fn51,
uint8_t mf_off)