From: Harald Welte Date: Wed, 22 Jun 2011 21:04:20 +0000 (+0200) Subject: remove l1ctl data structure form l2_ph_chan_conf() X-Git-Url: http://git.rot13.org/?a=commitdiff_plain;h=f36e4fe86c68e52e9714c0b9e9ec9a86b4a76bde;hp=4d5f74375a87169a96675feaa86b0d49874d746a;p=osmocom-bb.git remove l1ctl data structure form l2_ph_chan_conf() This brings us one step closer to de-couple LAPDm from L1CTL --- 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));