diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-05-15 17:16:48 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-05-17 15:15:09 +0100 |
commit | 799bef5cf614c303df1f88c1a7c4cc46a02e8c34 (patch) | |
tree | 5f8904878d69c8c4fb1c1ecc73e99aea1d8394ce /include | |
parent | a362ee90b42898dc730ffddf3bdc1b7a6523f1b8 (diff) |
sercomm: Better integration of driver interface
We cannot assume a certain UART API like uart_baudrate() which only
exists in OsmocomBB. Rather, use generic function prototypes
(sercomm_drv_*) which are to be provided by the application /
environment to the sercomm core.
Change-Id: I01ea3067baf1791000c1a7d537ccce496a1ab1ee
Diffstat (limited to 'include')
-rw-r--r-- | include/osmocom/core/sercomm.h | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/include/osmocom/core/sercomm.h b/include/osmocom/core/sercomm.h index 32b96c53..e2630806 100644 --- a/include/osmocom/core/sercomm.h +++ b/include/osmocom/core/sercomm.h @@ -58,12 +58,6 @@ struct osmo_sercomm_inst { }; -#ifdef EMBEDDED -#include <uart.h> -/* helper functions for target */ -void osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, enum uart_baudrate bdrt); -#endif - void osmo_sercomm_init(struct osmo_sercomm_inst *sercomm); int osmo_sercomm_initialized(struct osmo_sercomm_inst *sercomm); @@ -74,11 +68,18 @@ unsigned int osmo_sercomm_tx_queue_depth(struct osmo_sercomm_inst *sercomm, uint /* User Interface: Rx */ int osmo_sercomm_register_rx_cb(struct osmo_sercomm_inst *sercomm, uint8_t dlci, dlci_cb_t cb); +int osmo_sercomm_change_speed(struct osmo_sercomm_inst *sercomm, uint32_t bdrt); + /* Driver Interface */ int osmo_sercomm_drv_pull(struct osmo_sercomm_inst *sercomm, uint8_t *ch); int osmo_sercomm_drv_rx_char(struct osmo_sercomm_inst *sercomm, uint8_t ch); +extern void sercomm_drv_lock(unsigned long *flags); +extern void sercomm_drv_unlock(unsigned long *flags); +extern void sercomm_drv_start_tx(struct osmo_sercomm_inst *sercomm); +extern int sercomm_drv_baudrate_chg(struct osmo_sercomm_inst *sercomm, uint32_t bdrt); + static inline struct msgb *osmo_sercomm_alloc_msgb(unsigned int len) { return msgb_alloc_headroom(len+4, 4, "sercomm_tx"); |