mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-14 11:35:22 +00:00
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>
39 lines
1.0 KiB
C
39 lines
1.0 KiB
C
/*
|
|
* Copyright (c) 2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
*/
|
|
|
|
#define DLCI_CONTROL 0
|
|
|
|
#if IS_ENABLED(CONFIG_GSM_MUX)
|
|
#define DLCI_AT CONFIG_GSM_MUX_DLCI_AT
|
|
#define DLCI_PPP CONFIG_GSM_MUX_DLCI_PPP
|
|
#else
|
|
#define DLCI_AT -1
|
|
#define DLCI_PPP -1
|
|
#endif
|
|
|
|
struct gsm_mux;
|
|
struct gsm_dlci;
|
|
|
|
void gsm_mux_recv_buf(struct gsm_mux *mux, uint8_t *buf, int len);
|
|
int gsm_mux_send(struct gsm_mux *mux, uint8_t dlci_address,
|
|
const uint8_t *buf, size_t size);
|
|
struct gsm_mux *gsm_mux_create(const struct device *uart);
|
|
int gsm_mux_disconnect(struct gsm_mux *mux, k_timeout_t timeout);
|
|
void gsm_mux_init(void);
|
|
|
|
typedef void (*gsm_mux_dlci_created_cb_t)(struct gsm_dlci *dlci,
|
|
bool connected,
|
|
void *user_data);
|
|
|
|
int gsm_dlci_create(struct gsm_mux *mux,
|
|
const struct device *uart,
|
|
int dlci_address,
|
|
gsm_mux_dlci_created_cb_t dlci_created_cb,
|
|
void *user_data,
|
|
struct gsm_dlci **dlci);
|
|
int gsm_dlci_send(struct gsm_dlci *dlci, const uint8_t *buf, size_t size);
|
|
int gsm_dlci_id(struct gsm_dlci *dlci);
|