summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-04-05 22:19:49 +0800
committerHarald Welte <laforge@gnumonks.org>2010-04-05 22:19:49 +0800
commit2bfeb17e06bb3449b76529d72671e3912130f75a (patch)
tree1caf7ed019321213a647fe3d71e3dcb24c0ed6f0
parent1fa7930eea37f2ba949a1dad8354c133eb1903a0 (diff)
l1ctl protocol: Introduce multi-part message DONE flag
In case a single request from L2 triggers multiple response messages from L1, we need a way to signal via L1CTL if the response is the final or some intermediate response.
-rw-r--r--include/l1a_l23_interface.h5
-rw-r--r--src/target/firmware/layer1/l23_api.c3
-rw-r--r--src/target/firmware/layer1/sync.c2
3 files changed, 9 insertions, 1 deletions
diff --git a/include/l1a_l23_interface.h b/include/l1a_l23_interface.h
index e9def59c..690a6baa 100644
--- a/include/l1a_l23_interface.h
+++ b/include/l1a_l23_interface.h
@@ -41,9 +41,12 @@
* that it will avoid some unaligned access.
*/
+/* there are no more messages in a sequence */
+#define L1CTL_F_DONE 0x01
+
struct l1ctl_hdr {
uint8_t msg_type;
- uint8_t padding;
+ uint8_t flags;
uint8_t data[0];
} __attribute__((packed));
diff --git a/src/target/firmware/layer1/l23_api.c b/src/target/firmware/layer1/l23_api.c
index d17c8c46..a48ea9d8 100644
--- a/src/target/firmware/layer1/l23_api.c
+++ b/src/target/firmware/layer1/l23_api.c
@@ -94,6 +94,9 @@ struct msgb *l1ctl_msgb_alloc(uint8_t msg_type)
}
l1h = (struct l1ctl_hdr *) msgb_put(msg, sizeof(*l1h));
l1h->msg_type = msg_type;
+ l1h->flags = 0;
+
+ msg->l1h = l1h;
return msg;
}
diff --git a/src/target/firmware/layer1/sync.c b/src/target/firmware/layer1/sync.c
index f100ff5d..dfdf64e2 100644
--- a/src/target/firmware/layer1/sync.c
+++ b/src/target/firmware/layer1/sync.c
@@ -820,6 +820,8 @@ static int l1s_pm_resp(__unused uint8_t p1, __unused uint8_t p2,
l1s.pm.range.arfcn_next++;
} else {
/* we have finished, flush the msgb to L2 */
+ struct l1ctl_hdr *l1h = l1s.pm.msg->l1h;
+ l1h->flags |= L1CTL_F_DONE;
l1_queue_for_l2(l1s.pm.msg);
l1s.pm.msg = NULL;
}