l1a_l23_interface: Update DM EST REQ format
authorSylvain Munaut <tnt@246tNt.com>
Mon, 21 Jun 2010 19:59:43 +0000 (21:59 +0200)
committerHarald Welte <laforge@gnumonks.org>
Thu, 24 Jun 2010 16:57:28 +0000 (18:57 +0200)
We include all the parameters we're gonna need to support
TS!=0, hopping, TSC, ...

We also assume the upper layer have decoded the low level
bit fields and gives us neat accessible variables and a
sorted ARFCN array for the Mobile Allocation

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
include/l1a_l23_interface.h
src/host/layer23/src/l1ctl.c
src/target/firmware/layer1/l23_api.c

index 741221b..ef03689 100644 (file)
@@ -155,22 +155,19 @@ struct l1ctl_rach_req {
 } __attribute__((packed));
 
 struct l1ctl_dm_est_req {
-       uint16_t band_arfcn;
+       uint8_t tsc;
+       uint8_t h;
        union {
                struct {
-                       uint8_t maio_high:4,
-                                h:1,
-                                tsc:3;
-                       uint8_t hsn:6,
-                                maio_low:2;
-               } h1;
-               struct {
-                       uint8_t arfcn_high:2,
-                                spare:2,
-                                h:1,
-                                tsc:3;
-                       uint8_t arfcn_low;
+                       uint16_t band_arfcn;
                } h0;
+               struct {
+                       uint8_t hsn;
+                       uint8_t maio;
+                       uint8_t n;
+                       uint8_t _padding[1];
+                       uint16_t ma[64];
+               } h1;
        };
 } __attribute__((packed));
 
index 7ccb343..fb933c0 100644 (file)
@@ -330,12 +330,16 @@ int tx_ph_dm_est_req(struct osmocom_ms *ms, uint16_t band_arfcn, uint8_t chan_nr
 
        DEBUGP(DL1C, "Tx Dedic.Mode Est Req (arfcn=%u, chan_nr=0x%02x)\n",
                band_arfcn, chan_nr);
+
        ul = (struct l1ctl_info_ul *) msgb_put(msg, sizeof(*ul));
        ul->chan_nr = chan_nr;
        ul->link_id = 0;
        ul->tx_power = 0; /* FIXME: initial TX power */
+
        req = (struct l1ctl_dm_est_req *) msgb_put(msg, sizeof(*req));
-       req->band_arfcn = htons(band_arfcn);
+       req->tsc = 7; /* FIXME */
+       req->h = 0;
+       req->h0.band_arfcn = htons(band_arfcn);
 
        return osmo_send_l1(ms, msg);
 }
index 1ae139c..0edc1ad 100644 (file)
@@ -151,9 +151,9 @@ static void l1ctl_rx_dm_est_req(struct msgb *msg)
        struct l1ctl_dm_est_req *est_req = (struct l1ctl_dm_est_req *) ul->payload;
 
        printd("L1CTL_DM_EST_REQ (arfcn=%u, chan_nr=0x%02x)\n",
-               ntohs(est_req->band_arfcn), ul->chan_nr);
+               ntohs(est_req->h0.band_arfcn), ul->chan_nr);
 
-       if (ntohs(est_req->band_arfcn) != l1s.serving_cell.arfcn) {
+       if (ntohs(est_req->h0.band_arfcn) != l1s.serving_cell.arfcn) {
                /* FIXME: ARFCN */
                puts("We don't support ARFCN switches yet\n");
                return;
@@ -163,12 +163,12 @@ static void l1ctl_rx_dm_est_req(struct msgb *msg)
                puts("We don't support non-0 TS yet\n");
                return;
        }
-       if (est_req->h0.h) {
+       if (est_req->h) {
                puts("We don't support frequency hopping yet\n");
                return;
        }
 
-       /* FIXME: set TSC of ded chan according to est_req.h0.tsc */
+       /* FIXME: set TSC of ded chan according to est_req.tsc */
        /* figure out which MF tasks to enable */
        l1a_mftask_set(1 << chan_nr2mf_task(ul->chan_nr));
 }