[layer1] Added mf_off to shedule next RACH request.
authorAndreas.Eversberg <jolly@eversberg.eu>
Tue, 13 Jul 2010 13:58:41 +0000 (13:58 +0000)
committerAndreas.Eversberg <jolly@eversberg.eu>
Tue, 13 Jul 2010 13:58:41 +0000 (13:58 +0000)
The mf_off value defines the offset of multiframes.

src/target/firmware/include/layer1/async.h
src/target/firmware/layer1/l23_api.c
src/target/firmware/layer1/prim_rach.c

index 03e33ca..7f8f971 100644 (file)
@@ -21,7 +21,7 @@ static inline void l1a_unlock_sync(void)
 void l1a_txq_msgb_enq(struct llist_head *queue, struct msgb *msg);
 
 /* request a RACH request at the next multiframe T3 = fn51 */
-void l1a_rach_req(uint8_t fn51, uint8_t ra);
+void l1a_rach_req(uint8_t fn51, uint8_t mf_off, uint8_t ra);
 
 /* Enable a repeating multiframe task */
 void l1a_mftask_enable(enum mframe_task task);
index c1dbbb8..146242e 100644 (file)
@@ -217,9 +217,9 @@ static void l1ctl_rx_rach_req(struct msgb *msg)
        struct l1ctl_info_ul *ul = (struct l1ctl_info_ul *) l1h->data;
        struct l1ctl_rach_req *rach_req = (struct l1ctl_rach_req *) ul->payload;
 
-       printd("L1CTL_RACH_REQ (ra=0x%02x, fn51=%d)\n", rach_req->ra, rach_req->fn51);
+       printd("L1CTL_RACH_REQ (ra=0x%02x, fn51=%d, mf_off=%d)\n", rach_req->ra, rach_req->fn51, rach_req->mf_off);
 
-       l1a_rach_req(rach_req->fn51, rach_req->ra);
+       l1a_rach_req(rach_req->fn51, rach_req->mf_off, rach_req->ra);
 }
 
 /* receive a L1CTL_DATA_REQ from L23 */
index f91af3d..6f4ad6d 100644 (file)
@@ -115,7 +115,7 @@ static void l1a_rach_compl(__unused enum l1_compl c)
 }
 
 /* request a RACH request at the next multiframe T3 = fn51 */
-void l1a_rach_req(uint8_t fn51, uint8_t ra)
+void l1a_rach_req(uint8_t fn51, uint8_t mf_off, uint8_t ra)
 {
        uint32_t fn_sched;
 
@@ -123,6 +123,7 @@ void l1a_rach_req(uint8_t fn51, uint8_t ra)
        l1s.rach.ra = ra;
        /* TODO: can we wrap here? I don't think so */
        fn_sched = l1s.current_time.fn - l1s.current_time.t3;
+       fn_sched += mf_off * 51;
        fn_sched += fn51;
        sched_gsmtime(rach_sched_set_ul, fn_sched, 0);
        l1a_unlock_sync();