Searched refs:sfilter (Results 1 – 4 of 4) sorted by relevance
/Zephyr-latest/include/zephyr/net/ |
D | socketcan_utils.h | 89 static inline void socketcan_to_can_filter(const struct socketcan_filter *sfilter, in socketcan_to_can_filter() argument 94 zfilter->flags |= (sfilter->can_id & BIT(31)) != 0 ? CAN_FILTER_IDE : 0; in socketcan_to_can_filter() 95 zfilter->id = sfilter->can_id & BIT_MASK(29); in socketcan_to_can_filter() 96 zfilter->mask = sfilter->can_mask & BIT_MASK(29); in socketcan_to_can_filter() 106 struct socketcan_filter *sfilter) in socketcan_from_can_filter() argument 108 memset(sfilter, 0, sizeof(*sfilter)); in socketcan_from_can_filter() 110 sfilter->can_id = zfilter->id; in socketcan_from_can_filter() 111 sfilter->can_id |= (zfilter->flags & CAN_FILTER_IDE) != 0 ? BIT(31) : 0; in socketcan_from_can_filter() 113 sfilter->can_mask = zfilter->mask; in socketcan_from_can_filter() 114 sfilter->can_mask |= (zfilter->flags & CAN_FILTER_IDE) != 0 ? BIT(31) : 0; in socketcan_from_can_filter() [all …]
|
/Zephyr-latest/tests/net/socket/can/src/ |
D | main.c | 100 struct socketcan_filter sfilter = { 0 }; in ZTEST() local 104 sfilter.can_id = BIT(31) | 1234; in ZTEST() 105 sfilter.can_mask = BIT(31) | 1234; in ZTEST() 111 socketcan_to_can_filter(&sfilter, &zfilter); in ZTEST() 114 LOG_HEXDUMP_DBG((const uint8_t *)&sfilter, sizeof(sfilter), "sfilter"); in ZTEST() 127 struct socketcan_filter sfilter = { 0 }; in ZTEST() local 141 socketcan_from_can_filter(&zfilter, &sfilter); in ZTEST() 144 LOG_HEXDUMP_DBG((const uint8_t *)&sfilter, sizeof(sfilter), "sfilter"); in ZTEST() 147 zassert_equal(sfilter.can_id, expected.can_id, "CAN ID not same"); in ZTEST() 148 zassert_equal(sfilter.can_mask, expected.can_mask, "CAN mask not same"); in ZTEST()
|
/Zephyr-latest/samples/net/sockets/can/src/ |
D | main.c | 74 static int create_socket(const struct socketcan_filter *sfilter) in create_socket() argument 96 (void)setsockopt(fd, SOL_CAN_RAW, CAN_RAW_FILTER, sfilter, in create_socket() 97 sizeof(*sfilter)); in create_socket() 106 const struct socketcan_filter *sfilter = p3; in rx() local 158 fd = create_socket(sfilter); in rx()
|
/Zephyr-latest/subsys/net/lib/sockets/ |
D | sockets_can.c | 377 static bool is_already_attached(struct socketcan_filter *sfilter, in is_already_attached() argument 386 (UNALIGNED_GET(&sfilter->can_id) & in is_already_attached() 387 UNALIGNED_GET(&sfilter->can_mask)))) { in is_already_attached() 420 struct socketcan_filter sfilter; in can_close_socket() local 424 sfilter.can_id = receivers[i].can_id; in can_close_socket() 425 sfilter.can_mask = receivers[i].can_mask; in can_close_socket() 427 if (!is_already_attached(&sfilter, in can_close_socket() 675 struct socketcan_filter *sfilter; in can_sock_setsockopt_vmeth() local 679 sfilter = &((struct socketcan_filter *)optval)[i]; in can_sock_setsockopt_vmeth() 684 duplicate = is_already_attached(sfilter, iface, obj); in can_sock_setsockopt_vmeth() [all …]
|