2121#include <stddef.h>
2222#include <stdint.h>
2323
24- #include "isrpipe.h"
2524#include "periph/uart.h"
2625#include "mutex.h"
2726
@@ -36,22 +35,11 @@ extern "C" {
3635 */
3736#define SLIPMUX_DEV_NUM ARRAY_SIZE(slipmux_params)
3837
39- /**
40- * @brief ISR pipe to hand read bytes to stdin
41- */
42- extern isrpipe_t slipmux_stdio_isrpipe ;
43-
4438/**
4539 * @brief List of slipmux devices.
4640 */
4741extern slipmux_t slipmux_devs [SLIPMUX_DEV_NUM ];
4842
49- /**
50- * @brief Mutex to synchronize write operations to the UART between stdio,
51- * coap and net / SLIP sub-modules.
52- */
53- extern mutex_t slipmux_mutex ;
54-
5543/**
5644 * @name SLIP marker bytes
5745 * @see [RFC 1055](https://tools.ietf.org/html/rfc1055)
@@ -150,28 +138,32 @@ void slipmux_write_bytes(uart_t uart, const uint8_t *data, size_t len);
150138
151139/**
152140 * @brief Acquire exclusive access for writing
141+ * Guarded for _stdio or _coap, the idea being that if only _net is
142+ * used, you are most likely to care about performance.
153143 */
154- static inline void slipmux_lock (void )
144+ static inline void slipmux_lock (slipmux_t * dev )
155145{
156- if (IS_USED (MODULE_SLIPMUX_STDIO ) || IS_USED (MODULE_SLIPMUX_COAP )) {
157- mutex_lock (& slipmux_mutex );
158- }
146+ (void ) dev ;
147+ #if IS_USED (MODULE_SLIPMUX_STDIO ) || IS_USED (MODULE_SLIPMUX_COAP )
148+ mutex_lock (& dev -> mutex );
149+ #endif
159150}
160151
161152/**
162153 * @brief Release the exclusive access
163154 */
164- static inline void slipmux_unlock (void )
155+ static inline void slipmux_unlock (slipmux_t * dev )
165156{
166- if (IS_USED (MODULE_SLIPMUX_STDIO ) || IS_USED (MODULE_SLIPMUX_COAP )) {
167- mutex_unlock (& slipmux_mutex );
168- }
157+ (void ) dev ;
158+ #if IS_USED (MODULE_SLIPMUX_STDIO ) || IS_USED (MODULE_SLIPMUX_COAP )
159+ mutex_unlock (& dev -> mutex );
160+ #endif
169161}
170162
171163#if IS_USED (MODULE_SLIPMUX_COAP )
172164/**
173165 * @brief Initialise the CoAP handling
174- *
166+ *
175167 * @param[in] dev The Slipmux device to initialise.
176168 * @param[in] index Device number.
177169 */
@@ -188,7 +180,7 @@ void slipmux_coap_notify(slipmux_t *dev);
188180#if IS_USED (MODULE_SLIPMUX_NET )
189181/**
190182 * @brief Initialise the network handling
191- *
183+ *
192184 * @param[in] dev The Slipmux device to initialise.
193185 * @param[in] index Device number.
194186 */
0 commit comments