zephyr/drivers/console/uart_mux_internal.h
Tomasz Bursztyka e18fcbba5a device: Const-ify all device driver instance pointers
Now that device_api attribute is unmodified at runtime, as well as all
the other attributes, it is possible to switch all device driver
instance to be constant.

A coccinelle rule is used for this:

@r_const_dev_1
  disable optional_qualifier
@
@@
-struct device *
+const struct device *

@r_const_dev_2
 disable optional_qualifier
@
@@
-struct device * const
+const struct device *

Fixes #27399

Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com>
2020-09-02 13:48:13 +02:00

42 lines
935 B
C

/*
* Copyright (c) 2020 Intel Corporation
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <device.h>
#include <drivers/console/uart_mux.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Send data to real UART (the data should be muxed already)
*
* @param uart Muxed uart
* @param buf Data to send
* @param size Data length
*
* @return 0 if data was sent, <0 if error
*/
int uart_mux_send(const struct device *uart, const uint8_t *buf, size_t size);
/**
* @brief Receive unmuxed data.
*
* @param mux UART mux device structure.
* @param uart Real UART device structure.
* @param dlci_address DLCI id for the virtual muxing channel
* @param timeout Amount of time to wait for the channel creation.
*
* @retval >=0 No errors, number of bytes received
* @retval <0 Error
*/
int uart_mux_recv(const struct device *mux, struct gsm_dlci *dlci,
uint8_t *data, size_t len);
#ifdef __cplusplus
}
#endif