Home
last modified time | relevance | path

Searched refs:filter_id (Results 1 – 25 of 28) sorted by relevance

12

/Zephyr-latest/tests/drivers/can/api/src/
Dclassic.c264 int filter_id; in add_rx_msgq() local
266 filter_id = can_add_rx_filter_msgq(dev, &can_msgq, filter); in add_rx_msgq()
267 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_msgq()
268 zassert_true(filter_id >= 0, "negative filter number"); in add_rx_msgq()
270 return filter_id; in add_rx_msgq()
286 int filter_id; in add_rx_filter() local
290 filter_id = can_add_rx_filter(dev, callback, (void *)filter, filter); in add_rx_filter()
291 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_filter()
292 zassert_true(filter_id >= 0, "negative filter number"); in add_rx_filter()
294 return filter_id; in add_rx_filter()
[all …]
Dcanfd.c134 int filter_id; in add_rx_msgq() local
136 filter_id = can_add_rx_filter_msgq(dev, &can_msgq, filter); in add_rx_msgq()
137 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_msgq()
138 zassert_true(filter_id >= 0, "negative filter number"); in add_rx_msgq()
140 return filter_id; in add_rx_msgq()
156 int filter_id; in add_rx_filter() local
160 filter_id = can_add_rx_filter(dev, callback, (void *)filter, filter); in add_rx_filter()
161 zassert_not_equal(filter_id, -ENOSPC, "no filters available"); in add_rx_filter()
162 zassert_true(filter_id >= 0, "negative filter number"); in add_rx_filter()
164 return filter_id; in add_rx_filter()
/Zephyr-latest/tests/subsys/canbus/isotp/conformance/src/
Dmain.c307 int filter_id; in add_rx_msgq() local
314 filter_id = can_add_rx_filter_msgq(can_dev, &frame_msgq, &filter); in add_rx_msgq()
315 zassert_not_equal(filter_id, -ENOSPC, "Filter full"); in add_rx_msgq()
316 zassert_true((filter_id >= 0), "Negative filter number [%d]", in add_rx_msgq()
317 filter_id); in add_rx_msgq()
319 return filter_id; in add_rx_msgq()
398 int filter_id; in ZTEST() local
403 filter_id = add_rx_msgq(rx_addr.std_id, CAN_STD_ID_MASK); in ZTEST()
404 zassert_true((filter_id >= 0), "Negative filter number [%d]", in ZTEST()
405 filter_id); in ZTEST()
[all …]
/Zephyr-latest/drivers/can/
Dcan_native_linux.c61 for (int filter_id = 0; filter_id < ARRAY_SIZE(data->filters); filter_id++) { in dispatch_frame() local
62 if (data->filters[filter_id].rx_cb == NULL) { in dispatch_frame()
66 if (!can_frame_matches_filter(frame, &data->filters[filter_id].filter)) { in dispatch_frame()
73 callback = data->filters[filter_id].rx_cb; in dispatch_frame()
74 callback(dev, &tmp_frame, data->filters[filter_id].cb_arg); in dispatch_frame()
203 int filter_id = -ENOSPC; in can_native_linux_add_rx_filter() local
217 filter_id = i; in can_native_linux_add_rx_filter()
222 if (filter_id < 0) { in can_native_linux_add_rx_filter()
225 return filter_id; in can_native_linux_add_rx_filter()
228 filter_ctx = &data->filters[filter_id]; in can_native_linux_add_rx_filter()
[all …]
Dcan_stm32_bxcan.c120 int filter_id, index; in can_stm32_rx_isr_handler() local
127 filter_id = ((mbox->RDTR & CAN_RDT0R_FMI) >> CAN_RDT0R_FMI_Pos); in can_stm32_rx_isr_handler()
129 LOG_DBG("Message on filter_id %d", filter_id); in can_stm32_rx_isr_handler()
133 if (filter_id < CONFIG_CAN_MAX_EXT_ID_FILTER) { in can_stm32_rx_isr_handler()
134 callback = data->rx_cb_ext[filter_id]; in can_stm32_rx_isr_handler()
135 cb_arg = data->cb_arg_ext[filter_id]; in can_stm32_rx_isr_handler()
136 } else if (filter_id < CAN_STM32_MAX_FILTER_ID) { in can_stm32_rx_isr_handler()
137 index = filter_id - CONFIG_CAN_MAX_EXT_ID_FILTER; in can_stm32_rx_isr_handler()
851 static void can_stm32_set_filter_bank(int filter_id, CAN_FilterRegister_TypeDef *filter_reg, in can_stm32_set_filter_bank() argument
858 if ((filter_id - CONFIG_CAN_MAX_EXT_ID_FILTER) % 2 == 0) { in can_stm32_set_filter_bank()
[all …]
Dcan_loopback.c180 int filter_id; in can_loopback_add_rx_filter() local
190 filter_id = get_free_filter(data->filters); in can_loopback_add_rx_filter()
192 if (filter_id < 0) { in can_loopback_add_rx_filter()
195 return filter_id; in can_loopback_add_rx_filter()
198 loopback_filter = &data->filters[filter_id]; in can_loopback_add_rx_filter()
205 LOG_DBG("Filter added. ID: %d", filter_id); in can_loopback_add_rx_filter()
207 return filter_id; in can_loopback_add_rx_filter()
210 static void can_loopback_remove_rx_filter(const struct device *dev, int filter_id) in can_loopback_remove_rx_filter() argument
214 if (filter_id < 0 || filter_id >= ARRAY_SIZE(data->filters)) { in can_loopback_remove_rx_filter()
215 LOG_ERR("filter ID %d out-of-bounds", filter_id); in can_loopback_remove_rx_filter()
[all …]
Dcan_mcan.c1076 int filter_id = -ENOSPC; in can_mcan_add_rx_filter_std() local
1084 filter_id = i; in can_mcan_add_rx_filter_std()
1089 if (filter_id == -ENOSPC) { in can_mcan_add_rx_filter_std()
1096 filter_element.sfec = filter_id & 0x01 ? CAN_MCAN_XFEC_FIFO1 : CAN_MCAN_XFEC_FIFO0; in can_mcan_add_rx_filter_std()
1099 filter_id * sizeof(struct can_mcan_std_filter), in can_mcan_add_rx_filter_std()
1108 LOG_DBG("Attached std filter at %d", filter_id); in can_mcan_add_rx_filter_std()
1110 __ASSERT_NO_MSG(filter_id < cbs->num_std); in can_mcan_add_rx_filter_std()
1111 cbs->std[filter_id].function = callback; in can_mcan_add_rx_filter_std()
1112 cbs->std[filter_id].user_data = user_data; in can_mcan_add_rx_filter_std()
1114 return filter_id; in can_mcan_add_rx_filter_std()
[all …]
Dcan_mcp2515.c602 int filter_id = 0; in mcp2515_add_rx_filter() local
614 while ((BIT(filter_id) & dev_data->filter_usage) in mcp2515_add_rx_filter()
615 && (filter_id < CONFIG_CAN_MAX_FILTER)) { in mcp2515_add_rx_filter()
616 filter_id++; in mcp2515_add_rx_filter()
620 if (filter_id < CONFIG_CAN_MAX_FILTER) { in mcp2515_add_rx_filter()
621 dev_data->filter_usage |= BIT(filter_id); in mcp2515_add_rx_filter()
623 dev_data->filter[filter_id] = *filter; in mcp2515_add_rx_filter()
624 dev_data->rx_cb[filter_id] = rx_cb; in mcp2515_add_rx_filter()
625 dev_data->cb_arg[filter_id] = cb_arg; in mcp2515_add_rx_filter()
628 filter_id = -ENOSPC; in mcp2515_add_rx_filter()
[all …]
Dcan_renesas_ra.c211 for (uint32_t filter_id = 0; filter_id < cfg->rx_filter_num; filter_id++) { in get_free_filter_id() local
212 if (!data->rx_filter[filter_id].set) { in get_free_filter_id()
213 return filter_id; in get_free_filter_id()
635 int filter_id = -ENOSPC; in can_renesas_ra_add_rx_filter() local
639 filter_id = get_free_filter_id(dev); in can_renesas_ra_add_rx_filter()
640 if (filter_id == -ENOSPC) { in can_renesas_ra_add_rx_filter()
644 set_afl_rule(dev, filter, filter_id); in can_renesas_ra_add_rx_filter()
646 memcpy(&data->rx_filter[filter_id].filter, filter, sizeof(struct can_filter)); in can_renesas_ra_add_rx_filter()
647 data->rx_filter[filter_id].rx_cb = callback; in can_renesas_ra_add_rx_filter()
648 data->rx_filter[filter_id].rx_usr_data = user_data; in can_renesas_ra_add_rx_filter()
[all …]
Dcan_sja1000.c440 int filter_id = -ENOSPC; in can_sja1000_add_rx_filter() local
450 filter_id = i; in can_sja1000_add_rx_filter()
455 if (filter_id >= 0) { in can_sja1000_add_rx_filter()
456 data->filters[filter_id].filter = *filter; in can_sja1000_add_rx_filter()
457 data->filters[filter_id].user_data = user_data; in can_sja1000_add_rx_filter()
458 data->filters[filter_id].callback = callback; in can_sja1000_add_rx_filter()
461 return filter_id; in can_sja1000_add_rx_filter()
464 void can_sja1000_remove_rx_filter(const struct device *dev, int filter_id) in can_sja1000_remove_rx_filter() argument
468 if (filter_id < 0 || filter_id >= ARRAY_SIZE(data->filters)) { in can_sja1000_remove_rx_filter()
469 LOG_ERR("filter ID %d out of bounds", filter_id); in can_sja1000_remove_rx_filter()
[all …]
Dcan_nxp_s32_canxl.c150 static void can_nxp_s32_config_rx_fifo_filter(const struct device *dev, int filter_id) in can_nxp_s32_config_rx_fifo_filter() argument
159 &data->rx_fifo_filter[filter_id], filter_id); in can_nxp_s32_config_rx_fifo_filter()
175 for (int filter_id = 0; filter_id < CONFIG_CAN_NXP_S32_MAX_RX; filter_id++) { in can_nxp_s32_get_rx_fifo_filter() local
176 mask = data->rx_fifo_filter[filter_id].idAddrFilterL; in can_nxp_s32_get_rx_fifo_filter()
183 (data->rx_fifo_filter[filter_id].idAddrFilterH & mask)) { in can_nxp_s32_get_rx_fifo_filter()
184 alloc = filter_id; in can_nxp_s32_get_rx_fifo_filter()
446 static void can_nxp_s32_remove_rx_filter(const struct device *dev, int filter_id) in can_nxp_s32_remove_rx_filter() argument
450 int mb_indx = ALLOC_IDX_TO_RXMB_IDX(filter_id); in can_nxp_s32_remove_rx_filter()
452 if (filter_id < 0 || filter_id >= CONFIG_CAN_NXP_S32_MAX_RX) { in can_nxp_s32_remove_rx_filter()
453 LOG_ERR("filter ID %d out of bounds", filter_id); in can_nxp_s32_remove_rx_filter()
[all …]
Dcan_rcar.c980 int filter_id; in can_rcar_add_rx_filter() local
988 filter_id = can_rcar_add_rx_filter_unlocked(dev, cb, cb_arg, filter); in can_rcar_add_rx_filter()
990 return filter_id; in can_rcar_add_rx_filter()
993 static void can_rcar_remove_rx_filter(const struct device *dev, int filter_id) in can_rcar_remove_rx_filter() argument
997 if (filter_id < 0 || filter_id >= CONFIG_CAN_RCAR_MAX_FILTER) { in can_rcar_remove_rx_filter()
998 LOG_ERR("filter ID %d out of bounds", filter_id); in can_rcar_remove_rx_filter()
1004 data->rx_callback[filter_id] = NULL; in can_rcar_remove_rx_filter()
Dcan_handlers.c233 static inline void z_vrfy_can_remove_rx_filter(const struct device *dev, int filter_id) in z_vrfy_can_remove_rx_filter() argument
237 z_impl_can_remove_rx_filter(dev, filter_id); in z_vrfy_can_remove_rx_filter()
Dcan_mcux_flexcan.c886 static void mcux_flexcan_remove_rx_filter(const struct device *dev, int filter_id) in mcux_flexcan_remove_rx_filter() argument
890 if (filter_id < 0 || filter_id >= MCUX_FLEXCAN_MAX_RX) { in mcux_flexcan_remove_rx_filter()
891 LOG_ERR("filter ID %d out of bounds", filter_id); in mcux_flexcan_remove_rx_filter()
897 if (atomic_test_and_clear_bit(data->rx_allocs, filter_id)) { in mcux_flexcan_remove_rx_filter()
904 mcux_flexcan_mb_stop(dev, filter_id); in mcux_flexcan_remove_rx_filter()
909 data->rx_cbs[filter_id].function = NULL; in mcux_flexcan_remove_rx_filter()
910 data->rx_cbs[filter_id].arg = NULL; in mcux_flexcan_remove_rx_filter()
912 LOG_WRN("Filter ID %d already detached", filter_id); in mcux_flexcan_remove_rx_filter()
/Zephyr-latest/tests/drivers/can/host/pytest/
Dcan_shell.py128 filter_id = int(m.group('id'))
129 self._filter_ids.append(filter_id)
134 def _remove_filter(self, filter_id: int) -> None:
136 if filter_id in self._filter_ids:
137 self._filter_ids.remove(filter_id)
146 for filter_id in self._filter_ids[:]:
147 self._remove_filter(filter_id)
/Zephyr-latest/modules/canopennode/
DCO_driver.c80 if (CANmodule->rx_array[i].filter_id != -ENOSPC) { in canopen_detach_all_rx_filters()
82 CANmodule->rx_array[i].filter_id); in canopen_detach_all_rx_filters()
83 CANmodule->rx_array[i].filter_id = -ENOSPC; in canopen_detach_all_rx_filters()
102 if (buffer->filter_id == -ENOSPC || buffer->pFunct == NULL) { in canopen_rx_callback()
259 rxArray[i].filter_id = -ENOSPC; in CO_CANmodule_init()
344 if (buffer->filter_id != -ENOSPC) { in CO_CANrxBufferInit()
345 can_remove_rx_filter(CANmodule->dev, buffer->filter_id); in CO_CANrxBufferInit()
348 buffer->filter_id = can_add_rx_filter(CANmodule->dev, in CO_CANrxBufferInit()
351 if (buffer->filter_id == -ENOSPC) { in CO_CANrxBufferInit()
DCO_driver_target.h67 int filter_id; member
/Zephyr-latest/include/zephyr/net/
Dcanbus.h37 void (*close)(const struct device *dev, int filter_id);
Dnet_context.h659 int filter_id) in net_context_set_can_filter_id() argument
663 context->can_filter_id = filter_id; in net_context_set_can_filter_id()
667 int filter_id) in net_context_set_can_filter_id() argument
670 ARG_UNUSED(filter_id); in net_context_set_can_filter_id()
/Zephyr-latest/drivers/net/
Dcanbus.c85 static void net_canbus_close(const struct device *dev, int filter_id) in net_canbus_close() argument
89 can_remove_rx_filter(cfg->can_dev, filter_id); in net_canbus_close()
/Zephyr-latest/samples/drivers/can/counter/src/
Dmain.c71 int filter_id; in rx_thread() local
73 filter_id = can_add_rx_filter_msgq(can_dev, &counter_msgq, &filter); in rx_thread()
74 printf("Counter filter id: %d\n", filter_id); in rx_thread()
/Zephyr-latest/include/zephyr/canbus/
Disotp.h421 int filter_id; member
452 int filter_id; member
/Zephyr-latest/doc/hardware/peripherals/can/
Dcontroller.rst210 int filter_id;
213 filter_id = can_add_rx_filter(can_dev, rx_callback_function, callback_arg, &my_filter);
214 if (filter_id < 0) {
215 LOG_ERR("Unable to add rx filter [%d]", filter_id);
235 int filter_id;
238 filter_id = can_add_rx_filter_msgq(can_dev, &my_can_msgq, &my_filter);
239 if (filter_id < 0) {
240 LOG_ERR("Unable to add rx msgq [%d]", filter_id);
253 can_remove_rx_filter(can_dev, filter_id);
/Zephyr-latest/subsys/canbus/isotp/
Disotp.c606 rctx->filter_id = can_add_rx_filter(rctx->can_dev, receive_can_rx, rctx, &filter); in add_ff_sf_filter()
607 if (rctx->filter_id < 0) { in add_ff_sf_filter()
608 LOG_ERR("Error adding FF filter [%d]", rctx->filter_id); in add_ff_sf_filter()
676 if (rctx->filter_id >= 0 && rctx->can_dev) { in isotp_unbind()
677 can_remove_rx_filter(rctx->can_dev, rctx->filter_id); in isotp_unbind()
1140 if (sctx->filter_id >= 0) { in send_state_machine()
1141 can_remove_rx_filter(sctx->can_dev, sctx->filter_id); in send_state_machine()
1182 sctx->filter_id = can_add_rx_filter(sctx->can_dev, send_can_rx_cb, sctx, in add_fc_filter()
1184 if (sctx->filter_id < 0) { in add_fc_filter()
1185 LOG_ERR("Error adding FC filter [%d]", sctx->filter_id); in add_fc_filter()
[all …]
/Zephyr-latest/include/zephyr/drivers/
Dcan.h468 typedef void (*can_remove_rx_filter_t)(const struct device *dev, int filter_id);
1365 __syscall void can_remove_rx_filter(const struct device *dev, int filter_id);
1367 static inline void z_impl_can_remove_rx_filter(const struct device *dev, int filter_id) in z_impl_can_remove_rx_filter() argument
1371 api->remove_rx_filter(dev, filter_id); in z_impl_can_remove_rx_filter()

12