Lines Matching refs:sframe

36 static inline void socketcan_to_can_frame(const struct socketcan_frame *sframe,  in socketcan_to_can_frame()  argument
41 zframe->flags |= (sframe->can_id & BIT(31)) != 0 ? CAN_FRAME_IDE : 0; in socketcan_to_can_frame()
42 zframe->flags |= (sframe->can_id & BIT(30)) != 0 ? CAN_FRAME_RTR : 0; in socketcan_to_can_frame()
43 zframe->flags |= (sframe->flags & CANFD_FDF) != 0 ? CAN_FRAME_FDF : 0; in socketcan_to_can_frame()
44 zframe->flags |= (sframe->flags & CANFD_BRS) != 0 ? CAN_FRAME_BRS : 0; in socketcan_to_can_frame()
45 zframe->id = sframe->can_id & BIT_MASK(29); in socketcan_to_can_frame()
46 zframe->dlc = can_bytes_to_dlc(sframe->len); in socketcan_to_can_frame()
49 memcpy(zframe->data, sframe->data, in socketcan_to_can_frame()
50 MIN(sframe->len, MIN(sizeof(sframe->data), sizeof(zframe->data)))); in socketcan_to_can_frame()
61 struct socketcan_frame *sframe) in socketcan_from_can_frame() argument
63 memset(sframe, 0, sizeof(*sframe)); in socketcan_from_can_frame()
65 sframe->can_id = zframe->id; in socketcan_from_can_frame()
66 sframe->can_id |= (zframe->flags & CAN_FRAME_IDE) != 0 ? BIT(31) : 0; in socketcan_from_can_frame()
67 sframe->can_id |= (zframe->flags & CAN_FRAME_RTR) != 0 ? BIT(30) : 0; in socketcan_from_can_frame()
68 sframe->len = can_dlc_to_bytes(zframe->dlc); in socketcan_from_can_frame()
71 sframe->flags |= CANFD_FDF; in socketcan_from_can_frame()
75 sframe->flags |= CANFD_BRS; in socketcan_from_can_frame()
79 memcpy(sframe->data, zframe->data, in socketcan_from_can_frame()
80 MIN(sframe->len, MIN(sizeof(zframe->data), sizeof(sframe->data)))); in socketcan_from_can_frame()