blob: 14bdb4b9939b922e0c62c693f05fcf325a2841ca [file] [log] [blame]
Eric135d64b2023-04-21 13:59:56 +02001#pragma once
2/*
3 * (C) 2023 by sysmocom s.f.m.c. GmbH <info@sysmocom.de>
4 * All Rights Reserved
5 *
6 * Author: Eric Wild <ewild@sysmocom.de>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Affero General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 *
21 */
22
23#include "ms.h"
24extern "C" {
25#include <osmocom/bb/trxcon/phyif.h>
26}
27
28extern struct trxcon_inst *g_trxcon;
29struct internal_q_tx_buf {
30 trxcon_phyif_burst_req r;
31 uint8_t buf[148];
32 internal_q_tx_buf() = default;
33 internal_q_tx_buf(const internal_q_tx_buf &) = delete;
34 internal_q_tx_buf &operator=(const internal_q_tx_buf &) = default;
35 internal_q_tx_buf(const struct trxcon_phyif_burst_req *br) : r(*br)
36 {
37 memcpy(buf, (void *)br->burst, br->burst_len);
38 }
39};
Eric Wildaa820c22024-03-18 20:31:06 +010040using tx_queue_t = spsc_cond_timeout<8 * 1, internal_q_tx_buf, true, false>;
Ericd372eb22023-08-29 23:23:24 +020041using cmd_queue_t = spsc_cond_timeout<8 * 1, trxcon_phyif_cmd, true, false>;
Eric Wildaa820c22024-03-18 20:31:06 +010042using cmdr_queue_t = spsc_cond_timeout<8 * 1, trxcon_phyif_rsp, false, false>;