Commit c283c9b9 authored by Tristan Gingold's avatar Tristan Gingold

fw/tdc: set packet length, claim only once per message.

parent 8370f746
......@@ -115,11 +115,18 @@ static inline void send_trigger (struct wrtd_trigger_entry *ent)
int ret;
if (coalesce_count == 0) {
struct trtl_fw_msg fw_msg;
ret = mq_claim(TRTL_RMQ, WRTD_IN_RMQ);
if (ret < 0) {
pr_error("RMQ full\n\r");
return;
}
mq_map_out_message(TRTL_RMQ, WRTD_IN_RMQ, &fw_msg);
fw_msg.header->msg_id = 0;
fw_msg.header->len = sizeof(struct wrtd_trigger_message) / 4;
}
msg = mq_map_out_buffer(TRTL_RMQ, WRTD_IN_RMQ);
......@@ -210,9 +217,6 @@ static inline void do_input(void)
{
int i;
/* Prepare for message transmission */
mq_claim(TRTL_RMQ, WRTD_IN_RMQ);
/* We can send up to TDC_TRIGGER_COALESCE_LIMIT triggers in a
single message - the loop will iterate up to this limit or exit
immediately if there's no more input pulses in the TDC FIFO */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment