drivers: can: remove z prefix from public CAN API types
Remove the "z" prefix from the public CAN controller API types as this makes them appear as internal APIs. Signed-off-by: Henrik Brix Andersen <hebad@vestas.com>
This commit is contained in:
parent
d159947443
commit
13c75417ba
28 changed files with 314 additions and 320 deletions
|
@ -17,7 +17,7 @@ LOG_MODULE_REGISTER(can_common, CONFIG_CAN_LOG_LEVEL);
|
|||
/* CAN sync segment is always one time quantum */
|
||||
#define CAN_SYNC_SEG 1
|
||||
|
||||
static void can_msgq_put(const struct device *dev, struct zcan_frame *frame, void *user_data)
|
||||
static void can_msgq_put(const struct device *dev, struct can_frame *frame, void *user_data)
|
||||
{
|
||||
struct k_msgq *msgq = (struct k_msgq *)user_data;
|
||||
int ret;
|
||||
|
@ -33,7 +33,7 @@ static void can_msgq_put(const struct device *dev, struct zcan_frame *frame, voi
|
|||
}
|
||||
|
||||
int z_impl_can_add_rx_filter_msgq(const struct device *dev, struct k_msgq *msgq,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
const struct can_driver_api *api = dev->api;
|
||||
|
||||
|
|
|
@ -164,12 +164,12 @@ static inline int z_vrfy_can_set_bitrate(const struct device *dev, uint32_t bitr
|
|||
#include <syscalls/can_set_bitrate_mrsh.c>
|
||||
|
||||
static inline int z_vrfy_can_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
k_timeout_t timeout,
|
||||
can_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
struct zcan_frame frame_copy;
|
||||
struct can_frame frame_copy;
|
||||
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, send));
|
||||
Z_OOPS(z_user_from_copy(&frame_copy, frame, sizeof(frame_copy)));
|
||||
|
@ -181,9 +181,9 @@ static inline int z_vrfy_can_send(const struct device *dev,
|
|||
|
||||
static inline int z_vrfy_can_add_rx_filter_msgq(const struct device *dev,
|
||||
struct k_msgq *msgq,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct zcan_filter filter_copy;
|
||||
struct can_filter filter_copy;
|
||||
|
||||
Z_OOPS(Z_SYSCALL_DRIVER_CAN(dev, add_rx_filter));
|
||||
Z_OOPS(Z_SYSCALL_OBJ(msgq, K_OBJ_MSGQ));
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
LOG_MODULE_REGISTER(can_loopback, CONFIG_CAN_LOG_LEVEL);
|
||||
|
||||
struct can_loopback_frame {
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
can_tx_callback_t cb;
|
||||
void *cb_arg;
|
||||
struct k_sem *tx_compl;
|
||||
|
@ -28,7 +28,7 @@ struct can_loopback_frame {
|
|||
struct can_loopback_filter {
|
||||
can_rx_callback_t rx_cb;
|
||||
void *cb_arg;
|
||||
struct zcan_filter filter;
|
||||
struct can_filter filter;
|
||||
};
|
||||
|
||||
struct can_loopback_data {
|
||||
|
@ -44,10 +44,10 @@ struct can_loopback_data {
|
|||
};
|
||||
|
||||
static void dispatch_frame(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
struct can_loopback_filter *filter)
|
||||
{
|
||||
struct zcan_frame frame_tmp = *frame;
|
||||
struct can_frame frame_tmp = *frame;
|
||||
|
||||
LOG_DBG("Receiving %d bytes. Id: 0x%x, ID type: %s %s",
|
||||
frame->dlc, frame->id,
|
||||
|
@ -91,7 +91,7 @@ static void tx_thread(void *arg1, void *arg2, void *arg3)
|
|||
}
|
||||
|
||||
static int can_loopback_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
k_timeout_t timeout, can_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
|
@ -153,7 +153,7 @@ static inline int get_free_filter(struct can_loopback_filter *filters)
|
|||
}
|
||||
|
||||
static int can_loopback_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||
void *cb_arg, const struct zcan_filter *filter)
|
||||
void *cb_arg, const struct can_filter *filter)
|
||||
{
|
||||
struct can_loopback_data *data = dev->data;
|
||||
struct can_loopback_filter *loopback_filter;
|
||||
|
|
|
@ -619,7 +619,7 @@ static void can_mcan_get_message(const struct device *dev,
|
|||
{
|
||||
struct can_mcan_data *data = dev->data;
|
||||
uint32_t get_idx, filt_idx;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
can_rx_callback_t cb;
|
||||
int data_length;
|
||||
void *cb_arg;
|
||||
|
@ -781,7 +781,7 @@ int can_mcan_recover(const struct device *dev, k_timeout_t timeout)
|
|||
|
||||
|
||||
int can_mcan_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
k_timeout_t timeout,
|
||||
can_tx_callback_t callback, void *user_data)
|
||||
{
|
||||
|
@ -902,7 +902,7 @@ int can_mcan_get_max_filters(const struct device *dev, enum can_ide id_type)
|
|||
*/
|
||||
int can_mcan_add_rx_filter_std(const struct device *dev,
|
||||
can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct can_mcan_data *data = dev->data;
|
||||
struct can_mcan_msg_sram *msg_ram = data->msg_ram;
|
||||
|
@ -966,7 +966,7 @@ static int can_mcan_get_free_ext(volatile struct can_mcan_ext_filter *filters)
|
|||
|
||||
static int can_mcan_add_rx_filter_ext(const struct device *dev,
|
||||
can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct can_mcan_data *data = dev->data;
|
||||
struct can_mcan_msg_sram *msg_ram = data->msg_ram;
|
||||
|
@ -1019,7 +1019,7 @@ static int can_mcan_add_rx_filter_ext(const struct device *dev,
|
|||
|
||||
int can_mcan_add_rx_filter(const struct device *dev,
|
||||
can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
int filter_id;
|
||||
|
||||
|
|
|
@ -275,7 +275,7 @@ void can_mcan_line_1_isr(const struct device *dev);
|
|||
|
||||
int can_mcan_recover(const struct device *dev, k_timeout_t timeout);
|
||||
|
||||
int can_mcan_send(const struct device *dev, const struct zcan_frame *frame,
|
||||
int can_mcan_send(const struct device *dev, const struct can_frame *frame,
|
||||
k_timeout_t timeout, can_tx_callback_t callback,
|
||||
void *user_data);
|
||||
|
||||
|
@ -283,7 +283,7 @@ int can_mcan_get_max_filters(const struct device *dev, enum can_ide id_type);
|
|||
|
||||
int can_mcan_add_rx_filter(const struct device *dev,
|
||||
can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter);
|
||||
const struct can_filter *filter);
|
||||
|
||||
void can_mcan_remove_rx_filter(const struct device *dev, int filter_id);
|
||||
|
||||
|
|
|
@ -209,7 +209,7 @@ static int mcp2515_cmd_read_rx_buffer(const struct device *dev, uint8_t nm,
|
|||
return spi_transceive_dt(&dev_cfg->bus, &tx, &rx);
|
||||
}
|
||||
|
||||
static void mcp2515_convert_zcanframe_to_mcp2515frame(const struct zcan_frame
|
||||
static void mcp2515_convert_zcanframe_to_mcp2515frame(const struct can_frame
|
||||
*source, uint8_t *target)
|
||||
{
|
||||
uint8_t rtr;
|
||||
|
@ -241,7 +241,7 @@ static void mcp2515_convert_zcanframe_to_mcp2515frame(const struct zcan_frame
|
|||
}
|
||||
|
||||
static void mcp2515_convert_mcp2515frame_to_zcanframe(const uint8_t *source,
|
||||
struct zcan_frame *target)
|
||||
struct can_frame *target)
|
||||
{
|
||||
uint8_t data_idx = 0U;
|
||||
|
||||
|
@ -499,7 +499,7 @@ done:
|
|||
}
|
||||
|
||||
static int mcp2515_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
k_timeout_t timeout, can_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
|
@ -564,7 +564,7 @@ static int mcp2515_send(const struct device *dev,
|
|||
static int mcp2515_add_rx_filter(const struct device *dev,
|
||||
can_rx_callback_t rx_cb,
|
||||
void *cb_arg,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct mcp2515_data *dev_data = dev->data;
|
||||
int filter_id = 0;
|
||||
|
@ -616,12 +616,12 @@ static void mcp2515_set_state_change_callback(const struct device *dev,
|
|||
}
|
||||
|
||||
static void mcp2515_rx_filter(const struct device *dev,
|
||||
struct zcan_frame *frame)
|
||||
struct can_frame *frame)
|
||||
{
|
||||
struct mcp2515_data *dev_data = dev->data;
|
||||
uint8_t filter_id = 0U;
|
||||
can_rx_callback_t callback;
|
||||
struct zcan_frame tmp_frame;
|
||||
struct can_frame tmp_frame;
|
||||
|
||||
k_mutex_lock(&dev_data->mutex, K_FOREVER);
|
||||
|
||||
|
@ -649,7 +649,7 @@ static void mcp2515_rx(const struct device *dev, uint8_t rx_idx)
|
|||
{
|
||||
__ASSERT(rx_idx < MCP2515_RX_CNT, "rx_idx < MCP2515_RX_CNT");
|
||||
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
uint8_t rx_frame[MCP2515_FRAME_LEN];
|
||||
uint8_t nm;
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ struct mcp2515_data {
|
|||
uint32_t filter_usage;
|
||||
can_rx_callback_t rx_cb[CONFIG_CAN_MAX_FILTER];
|
||||
void *cb_arg[CONFIG_CAN_MAX_FILTER];
|
||||
struct zcan_filter filter[CONFIG_CAN_MAX_FILTER];
|
||||
struct can_filter filter[CONFIG_CAN_MAX_FILTER];
|
||||
can_state_change_callback_t state_change_cb;
|
||||
void *state_change_cb_data;
|
||||
|
||||
|
|
|
@ -247,7 +247,7 @@ static int mcux_flexcan_set_mode(const struct device *dev, can_mode_t mode)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void mcux_flexcan_copy_zframe_to_frame(const struct zcan_frame *src,
|
||||
static void mcux_flexcan_copy_zframe_to_frame(const struct can_frame *src,
|
||||
flexcan_frame_t *dest)
|
||||
{
|
||||
if (src->id_type == CAN_STANDARD_IDENTIFIER) {
|
||||
|
@ -270,7 +270,7 @@ static void mcux_flexcan_copy_zframe_to_frame(const struct zcan_frame *src,
|
|||
}
|
||||
|
||||
static void mcux_flexcan_copy_frame_to_zframe(const flexcan_frame_t *src,
|
||||
struct zcan_frame *dest)
|
||||
struct can_frame *dest)
|
||||
{
|
||||
if (src->format == kFLEXCAN_FrameFormatStandard) {
|
||||
dest->id_type = CAN_STANDARD_IDENTIFIER;
|
||||
|
@ -294,7 +294,7 @@ static void mcux_flexcan_copy_frame_to_zframe(const flexcan_frame_t *src,
|
|||
#endif /* CAN_RX_TIMESTAMP */
|
||||
}
|
||||
|
||||
static void mcux_flexcan_copy_zfilter_to_mbconfig(const struct zcan_filter *src,
|
||||
static void mcux_flexcan_copy_zfilter_to_mbconfig(const struct can_filter *src,
|
||||
flexcan_rx_mb_config_t *dest,
|
||||
uint32_t *mask)
|
||||
{
|
||||
|
@ -345,7 +345,7 @@ static int mcux_flexcan_get_state(const struct device *dev, enum can_state *stat
|
|||
}
|
||||
|
||||
static int mcux_flexcan_send(const struct device *dev,
|
||||
const struct zcan_frame *frame,
|
||||
const struct can_frame *frame,
|
||||
k_timeout_t timeout,
|
||||
can_tx_callback_t callback, void *user_data)
|
||||
{
|
||||
|
@ -400,7 +400,7 @@ static int mcux_flexcan_send(const struct device *dev,
|
|||
static int mcux_flexcan_add_rx_filter(const struct device *dev,
|
||||
can_rx_callback_t callback,
|
||||
void *user_data,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
const struct mcux_flexcan_config *config = dev->config;
|
||||
struct mcux_flexcan_data *data = dev->data;
|
||||
|
@ -627,7 +627,7 @@ static inline void mcux_flexcan_transfer_rx_idle(const struct device *dev,
|
|||
struct mcux_flexcan_data *data = dev->data;
|
||||
can_rx_callback_t function;
|
||||
flexcan_mb_transfer_t xfer;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
status_t status;
|
||||
void *arg;
|
||||
int alloc;
|
||||
|
|
|
@ -200,7 +200,7 @@ struct can_rcar_data {
|
|||
struct k_mutex rx_mutex;
|
||||
can_rx_callback_t rx_callback[CONFIG_CAN_RCAR_MAX_FILTER];
|
||||
void *rx_callback_arg[CONFIG_CAN_RCAR_MAX_FILTER];
|
||||
struct zcan_filter filter[CONFIG_CAN_RCAR_MAX_FILTER];
|
||||
struct can_filter filter[CONFIG_CAN_RCAR_MAX_FILTER];
|
||||
can_state_change_callback_t state_change_cb;
|
||||
void *state_change_cb_data;
|
||||
enum can_state state;
|
||||
|
@ -366,9 +366,9 @@ static void can_rcar_error(const struct device *dev)
|
|||
|
||||
static void can_rcar_rx_filter_isr(const struct device *dev,
|
||||
struct can_rcar_data *data,
|
||||
const struct zcan_frame *frame)
|
||||
const struct can_frame *frame)
|
||||
{
|
||||
struct zcan_frame tmp_frame;
|
||||
struct can_frame tmp_frame;
|
||||
uint8_t i;
|
||||
|
||||
for (i = 0; i < CONFIG_CAN_RCAR_MAX_FILTER; i++) {
|
||||
|
@ -392,7 +392,7 @@ static void can_rcar_rx_isr(const struct device *dev)
|
|||
{
|
||||
const struct can_rcar_cfg *config = dev->config;
|
||||
struct can_rcar_data *data = dev->data;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
uint32_t val;
|
||||
int i;
|
||||
|
||||
|
@ -782,7 +782,7 @@ done:
|
|||
}
|
||||
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
||||
|
||||
static int can_rcar_send(const struct device *dev, const struct zcan_frame *frame,
|
||||
static int can_rcar_send(const struct device *dev, const struct can_frame *frame,
|
||||
k_timeout_t timeout, can_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
|
@ -865,7 +865,7 @@ static int can_rcar_send(const struct device *dev, const struct zcan_frame *fram
|
|||
static inline int can_rcar_add_rx_filter_unlocked(const struct device *dev,
|
||||
can_rx_callback_t cb,
|
||||
void *cb_arg,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct can_rcar_data *data = dev->data;
|
||||
int i;
|
||||
|
@ -884,7 +884,7 @@ static inline int can_rcar_add_rx_filter_unlocked(const struct device *dev,
|
|||
}
|
||||
|
||||
static int can_rcar_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||
void *cb_arg, const struct zcan_filter *filter)
|
||||
void *cb_arg, const struct can_filter *filter)
|
||||
{
|
||||
struct can_rcar_data *data = dev->data;
|
||||
int filter_id;
|
||||
|
|
|
@ -207,7 +207,7 @@ static inline int read_data(const struct shell *sh, int pos, char **argv,
|
|||
return i;
|
||||
}
|
||||
|
||||
static void print_frame(struct zcan_frame *frame, const struct shell *sh)
|
||||
static void print_frame(struct can_frame *frame, const struct shell *sh)
|
||||
{
|
||||
shell_fprintf(sh, SHELL_NORMAL, "|0x%-8x|%s|%s|%d|",
|
||||
frame->id,
|
||||
|
@ -228,7 +228,7 @@ static void print_frame(struct zcan_frame *frame, const struct shell *sh)
|
|||
|
||||
static void msgq_triggered_work_handler(struct k_work *work)
|
||||
{
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
int ret;
|
||||
|
||||
while (k_msgq_get(&msgq, &frame, K_NO_WAIT) == 0) {
|
||||
|
@ -311,7 +311,7 @@ static int cmd_send(const struct shell *sh, size_t argc, char **argv)
|
|||
const struct device *can_dev;
|
||||
int pos = 1;
|
||||
bool rtr = false, ext = false;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
int ret;
|
||||
uint32_t id;
|
||||
|
||||
|
@ -361,7 +361,7 @@ static int cmd_add_rx_filter(const struct shell *sh, size_t argc, char **argv)
|
|||
const struct device *can_dev;
|
||||
int pos = 1;
|
||||
bool rtr = false, ext = false, rtr_mask = false;
|
||||
struct zcan_filter filter;
|
||||
struct can_filter filter;
|
||||
int ret;
|
||||
uint32_t id, mask;
|
||||
|
||||
|
|
|
@ -207,7 +207,7 @@ unlock:
|
|||
return err;
|
||||
}
|
||||
|
||||
static void can_sja1000_read_frame(const struct device *dev, struct zcan_frame *frame)
|
||||
static void can_sja1000_read_frame(const struct device *dev, struct can_frame *frame)
|
||||
{
|
||||
uint8_t info;
|
||||
int i;
|
||||
|
@ -257,7 +257,7 @@ static void can_sja1000_read_frame(const struct device *dev, struct zcan_frame *
|
|||
}
|
||||
}
|
||||
|
||||
void can_sja1000_write_frame(const struct device *dev, const struct zcan_frame *frame)
|
||||
void can_sja1000_write_frame(const struct device *dev, const struct can_frame *frame)
|
||||
{
|
||||
uint8_t info;
|
||||
int i;
|
||||
|
@ -299,7 +299,7 @@ void can_sja1000_write_frame(const struct device *dev, const struct zcan_frame *
|
|||
}
|
||||
}
|
||||
|
||||
int can_sja1000_send(const struct device *dev, const struct zcan_frame *frame, k_timeout_t timeout,
|
||||
int can_sja1000_send(const struct device *dev, const struct can_frame *frame, k_timeout_t timeout,
|
||||
can_tx_callback_t callback, void *user_data)
|
||||
{
|
||||
struct can_sja1000_data *data = dev->data;
|
||||
|
@ -352,7 +352,7 @@ int can_sja1000_send(const struct device *dev, const struct zcan_frame *frame, k
|
|||
}
|
||||
|
||||
int can_sja1000_add_rx_filter(const struct device *dev, can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter)
|
||||
const struct can_filter *filter)
|
||||
{
|
||||
struct can_sja1000_data *data = dev->data;
|
||||
int filter_id = -ENOSPC;
|
||||
|
@ -386,7 +386,7 @@ void can_sja1000_remove_rx_filter(const struct device *dev, int filter_id)
|
|||
if (atomic_test_and_clear_bit(data->rx_allocs, filter_id)) {
|
||||
data->filters[filter_id].callback = NULL;
|
||||
data->filters[filter_id].user_data = NULL;
|
||||
data->filters[filter_id].filter = (struct zcan_filter){0};
|
||||
data->filters[filter_id].filter = (struct can_filter){0};
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -479,7 +479,7 @@ int can_sja1000_get_max_bitrate(const struct device *dev, uint32_t *max_bitrate)
|
|||
static void can_sja1000_handle_receive_irq(const struct device *dev)
|
||||
{
|
||||
struct can_sja1000_data *data = dev->data;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
can_rx_callback_t callback;
|
||||
uint8_t sr;
|
||||
int i;
|
||||
|
|
|
@ -91,7 +91,7 @@ struct can_sja1000_config {
|
|||
CAN_SJA1000_DT_CONFIG_GET(DT_DRV_INST(inst), _custom, _read_reg, _write_reg, _ocr, _cdr)
|
||||
|
||||
struct can_sja1000_rx_filter {
|
||||
struct zcan_filter filter;
|
||||
struct can_filter filter;
|
||||
can_rx_callback_t callback;
|
||||
void *user_data;
|
||||
};
|
||||
|
@ -124,11 +124,11 @@ int can_sja1000_get_capabilities(const struct device *dev, can_mode_t *cap);
|
|||
|
||||
int can_sja1000_set_mode(const struct device *dev, can_mode_t mode);
|
||||
|
||||
int can_sja1000_send(const struct device *dev, const struct zcan_frame *frame, k_timeout_t timeout,
|
||||
int can_sja1000_send(const struct device *dev, const struct can_frame *frame, k_timeout_t timeout,
|
||||
can_tx_callback_t callback, void *user_data);
|
||||
|
||||
int can_sja1000_add_rx_filter(const struct device *dev, can_rx_callback_t callback, void *user_data,
|
||||
const struct zcan_filter *filter);
|
||||
const struct can_filter *filter);
|
||||
|
||||
void can_sja1000_remove_rx_filter(const struct device *dev, int filter_id);
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ static void can_stm32_signal_tx_complete(const struct device *dev, struct can_st
|
|||
}
|
||||
}
|
||||
|
||||
static void can_stm32_rx_fifo_pop(CAN_FIFOMailBox_TypeDef *mbox, struct zcan_frame *frame)
|
||||
static void can_stm32_rx_fifo_pop(CAN_FIFOMailBox_TypeDef *mbox, struct can_frame *frame)
|
||||
{
|
||||
if (mbox->RIR & CAN_RI0R_IDE) {
|
||||
frame->id = mbox->RIR >> CAN_RI0R_EXID_Pos;
|
||||
|
@ -89,7 +89,7 @@ static inline void can_stm32_rx_isr_handler(const struct device *dev)
|
|||
CAN_TypeDef *can = cfg->can;
|
||||
CAN_FIFOMailBox_TypeDef *mbox;
|
||||
int filter_id, index;
|
||||
struct zcan_frame frame;
|
||||
struct can_frame frame;
|
||||
can_rx_callback_t callback = NULL;
|
||||
void *cb_arg;
|
||||
|
||||
|
@ -663,7 +663,7 @@ done:
|
|||
#endif /* CONFIG_CAN_AUTO_BUS_OFF_RECOVERY */
|
||||
|
||||
|
||||
static int can_stm32_send(const struct device *dev, const struct zcan_frame *frame,
|
||||
static int can_stm32_send(const struct device *dev, const struct can_frame *frame,
|
||||
k_timeout_t timeout, can_tx_callback_t callback,
|
||||
void *user_data)
|
||||
{
|
||||
|
@ -776,35 +776,35 @@ static void can_stm32_set_filter_bank(int filter_id, CAN_FilterRegister_TypeDef
|
|||
}
|
||||
}
|
||||
|
||||
static inline uint32_t can_stm32_filter_to_std_mask(const struct zcan_filter *filter)
|
||||
static inline uint32_t can_stm32_filter_to_std_mask(const struct can_filter *filter)
|
||||
{
|
||||
return (filter->id_mask << CAN_STM32_FIRX_STD_ID_POS) |
|
||||
(filter->rtr_mask << CAN_STM32_FIRX_STD_RTR_POS) |
|
||||
(1U << CAN_STM32_FIRX_STD_IDE_POS);
|
||||
}
|
||||
|
||||
static inline uint32_t can_stm32_filter_to_ext_mask(const struct zcan_filter *filter)
|
||||
static inline uint32_t can_stm32_filter_to_ext_mask(const struct can_filter *filter)
|
||||
{
|
||||
return (filter->id_mask << CAN_STM32_FIRX_EXT_EXT_ID_POS) |
|
||||
(filter->rtr_mask << CAN_STM32_FIRX_EXT_RTR_POS) |
|
||||
(1U << CAN_STM32_FIRX_EXT_IDE_POS);
|
||||
}
|
||||
|
||||
static inline uint32_t can_stm32_filter_to_std_id(const struct zcan_filter *filter)
|
||||
static inline uint32_t can_stm32_filter_to_std_id(const struct can_filter *filter)
|
||||
{
|
||||
return (filter->id << CAN_STM32_FIRX_STD_ID_POS) |
|
||||
(filter->rtr << CAN_STM32_FIRX_STD_RTR_POS);
|
||||
|
||||
}
|
||||
|
||||
static inline uint32_t can_stm32_filter_to_ext_id(const struct zcan_filter *filter)
|
||||
static inline uint32_t can_stm32_filter_to_ext_id(const struct can_filter *filter)
|
||||
{
|
||||
return (filter->id << CAN_STM32_FIRX_EXT_EXT_ID_POS) |
|
||||
(filter->rtr << CAN_STM32_FIRX_EXT_RTR_POS) |
|
||||
(1U << CAN_STM32_FIRX_EXT_IDE_POS);
|
||||
}
|
||||
|
||||
static inline int can_stm32_set_filter(const struct device *dev, const struct zcan_filter *filter)
|
||||
static inline int can_stm32_set_filter(const struct device *dev, const struct can_filter *filter)
|
||||
{
|
||||
const struct can_stm32_config *cfg = dev->config;
|
||||
struct can_stm32_data *data = dev->data;
|
||||
|
@ -875,7 +875,7 @@ static inline int can_stm32_set_filter(const struct device *dev, const struct zc
|
|||
* Currently, all filter banks are assigned to FIFO 0 and FIFO 1 is not used.
|
||||
*/
|
||||
static int can_stm32_add_rx_filter(const struct device *dev, can_rx_callback_t cb,
|
||||
void *cb_arg, const struct zcan_filter *filter)
|
||||
void *cb_arg, const struct can_filter *filter)
|
||||
{
|
||||
struct can_stm32_data *data = dev->data;
|
||||
int filter_id;
|
||||
|
|
|
@ -18,8 +18,8 @@
|
|||
* @param filter CAN filter.
|
||||
* @return true if the CAN filter matches the CAN frame, false otherwise
|
||||
*/
|
||||
static inline bool can_utils_filter_match(const struct zcan_frame *frame,
|
||||
struct zcan_filter *filter)
|
||||
static inline bool can_utils_filter_match(const struct can_frame *frame,
|
||||
struct can_filter *filter)
|
||||
{
|
||||
if (frame->id_type != filter->id_type) {
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue