remove l1ctl data structure form l2_ph_chan_conf()
authorHarald Welte <laforge@gnumonks.org>
Wed, 22 Jun 2011 21:04:20 +0000 (23:04 +0200)
committerHarald Welte <laforge@gnumonks.org>
Wed, 22 Jun 2011 21:04:20 +0000 (23:04 +0200)
This brings us one step closer to de-couple LAPDm from L1CTL

src/host/layer23/include/osmocom/bb/common/lapdm.h
src/host/layer23/src/common/l1ctl.c
src/host/layer23/src/common/lapdm.c

index ad5933b..7f39920 100644 (file)
@@ -6,8 +6,6 @@
 #include <osmocom/core/timer.h>
 #include <osmocom/core/msgb.h>
 
-#include <l1ctl_proto.h>
-
 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);
index 46c1ebf..f3c2b74 100644 (file)
@@ -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;
 }
index 8b5690e..c766e0b 100644 (file)
@@ -69,6 +69,8 @@
 #include <osmocom/bb/common/lapdm.h>
 #include <osmocom/bb/common/logging.h>
 
+#include <osmocom/bb/common/l1ctl.h>
+
 /* 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));