From f36e4fe86c68e52e9714c0b9e9ec9a86b4a76bde Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Wed, 22 Jun 2011 23:04:20 +0200 Subject: [PATCH 1/1] remove l1ctl data structure form l2_ph_chan_conf() This brings us one step closer to de-couple LAPDm from L1CTL --- src/host/layer23/include/osmocom/bb/common/lapdm.h | 5 +---- src/host/layer23/src/common/l1ctl.c | 2 +- src/host/layer23/src/common/lapdm.c | 7 ++++--- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/host/layer23/include/osmocom/bb/common/lapdm.h b/src/host/layer23/include/osmocom/bb/common/lapdm.h index ad5933b..7f39920 100644 --- a/src/host/layer23/include/osmocom/bb/common/lapdm.h +++ b/src/host/layer23/include/osmocom/bb/common/lapdm.h @@ -6,8 +6,6 @@ #include #include -#include - enum lapdm_state { LAPDm_STATE_NULL = 0, LAPDm_STATE_IDLE, @@ -102,8 +100,7 @@ int l2_ph_data_ind(struct msgb *msg, struct lapdm_entity *le, uint8_t chan_nr, u int l2_ph_data_conf(struct msgb *msg, struct lapdm_entity *le); /* L1 confirms channel request */ -int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms, - struct l1ctl_info_dl *dl); +int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms, uint32_t frame_nr); /* input into layer2 (from layer 3) */ int lapdm_rslms_recvmsg(struct msgb *msg, struct lapdm_channel *lc); diff --git a/src/host/layer23/src/common/l1ctl.c b/src/host/layer23/src/common/l1ctl.c index 46c1ebf..f3c2b74 100644 --- a/src/host/layer23/src/common/l1ctl.c +++ b/src/host/layer23/src/common/l1ctl.c @@ -122,7 +122,7 @@ static int rx_l1_rach_conf(struct osmocom_ms *ms, struct msgb *msg) dl = (struct l1ctl_info_dl *) msg->l1h; - l2_ph_chan_conf(msg, ms, dl); + l2_ph_chan_conf(msg, ms, ntohl(dl->frame_nr)); return 0; } diff --git a/src/host/layer23/src/common/lapdm.c b/src/host/layer23/src/common/lapdm.c index 8b5690e..c766e0b 100644 --- a/src/host/layer23/src/common/lapdm.c +++ b/src/host/layer23/src/common/lapdm.c @@ -69,6 +69,8 @@ #include #include +#include + /* TS 04.06 Figure 4 / Section 3.2 */ #define LAPDm_LPD_NORMAL 0 #define LAPDm_LPD_SMSCB 1 @@ -2080,14 +2082,13 @@ static int rslms_rx_chan_rqd(struct lapdm_channel *lc, struct msgb *msg) } /* L1 confirms channel request */ -int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms, - struct l1ctl_info_dl *dl) +int l2_ph_chan_conf(struct msgb *msg, struct osmocom_ms *ms, uint32_t frame_nr) { struct abis_rsl_cchan_hdr *ch; struct gsm_time tm; struct gsm48_req_ref *ref; - gsm_fn2gsmtime(&tm, htonl(dl->frame_nr)); + gsm_fn2gsmtime(&tm, frame_nr); msgb_pull_l2h(msg); msg->l2h = msgb_push(msg, sizeof(*ch) + sizeof(*ref)); -- 2.20.1