unsigned long cb[5]
control buffer
Definition: msgb.h:52
void sercomm_drv_start_tx(struct osmo_sercomm_inst *sercomm)
low-level driver routine to request start of transmission The Sercomm code calls this function to inf...
int initialized
Has this instance been initialized?
Definition: sercomm.h:35
void sercomm_drv_lock(unsigned long *flags)
Osmocom message buffer.
Definition: msgb.h:35
sercomm_dlci
A low sercomm_dlci means high priority.
Definition: sercomm.h:15
struct llist_head dlci_queues[_SC_DLCI_MAX]
per-DLC queue of pending transmit msgbs
Definition: sercomm.h:42
static struct msgb * osmo_sercomm_alloc_msgb(unsigned int len)
Sercomm msgb allocator function.
Definition: sercomm.h:107
struct osmo_sercomm_inst::@19 rx
receive side
int osmo_sercomm_initialized(struct osmo_sercomm_inst *sercomm)
Determine if a given Osmocom sercomm instance has been initialized.
Definition: sercomm.c:96
void sercomm_drv_unlock(unsigned long *flags)
dlci_cb_t dlci_handler[_SC_DLCI_MAX]
per-DLC handler call-back functions
Definition: sercomm.h:54
uint8_t dlci
DLCI of currently received msgb.
Definition: sercomm.h:62
uint8_t ctrl
CTRL of currently received msgb.
Definition: sercomm.h:64
(double) linked list header structure
Definition: linuxlist.h:46
uint8_t * next_char
next to-be-transmitted char in msg
Definition: sercomm.h:48
int osmo_sercomm_register_rx_cb(struct osmo_sercomm_inst *sercomm, uint8_t dlci, dlci_cb_t cb)
Register a handler for a given DLCI.
Definition: sercomm.c:249
static struct msgb * msgb_alloc_headroom(uint16_t size, uint16_t headroom, const char *name)
Allocate message buffer with specified headroom.
Definition: msgb.h:549
int sercomm_drv_baudrate_chg(struct osmo_sercomm_inst *sercomm, uint32_t bdrt)
low-level driver routine to execute baud-rate change
struct msgb * msg
msgb currently being transmitted
Definition: sercomm.h:44
int state
transmit state
Definition: sercomm.h:46
int osmo_sercomm_drv_rx_char(struct osmo_sercomm_inst *sercomm, uint8_t ch)
the driver has received one byte, pass it into sercomm layer
Definition: sercomm.c:276
static size_t len(const char *str)
int osmo_sercomm_drv_pull(struct osmo_sercomm_inst *sercomm, uint8_t *ch)
fetch one octet of to-be-transmitted serial data
Definition: sercomm.c:183
unsigned int osmo_sercomm_tx_queue_depth(struct osmo_sercomm_inst *sercomm, uint8_t dlci)
How deep is the Tx queue for a given DLCI?
Definition: sercomm.c:130
void osmo_sercomm_init(struct osmo_sercomm_inst *sercomm)
Initialize an Osmocom sercomm instance.
Definition: sercomm.c:78
void(* dlci_cb_t)(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struct msgb *msg)
call-back function for per-DLC receive handler
Definition: sercomm.h:30
one instance of a sercomm multiplex/demultiplex
Definition: sercomm.h:33
int uart_id
UART Identifier.
Definition: sercomm.h:37
int osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, uint32_t bdrt)
wait until everything has been transmitted, then grab the lock and change the baud rate as requested ...
Definition: sercomm.c:148
unsigned int msg_size
msgb allocation size for rx msgs
Definition: sercomm.h:56
struct osmo_sercomm_inst::@18 tx
transmit side
void osmo_sercomm_sendmsg(struct osmo_sercomm_inst *sercomm, uint8_t dlci, struct msgb *msg)
User interface for transmitting messages for a given DLCI.
Definition: sercomm.c:106