02101048a3f8b03e905ce5b1441e802ba29c7435
[revag-bap.git] / vw-bap.h
1 #ifndef __VW_BAP_H__
2 #define __VW_BAP_H__
3
4 #include <linux/can.h>
5
6
7 typedef unsigned char BAP_OpCode;
8 typedef unsigned char BAP_SubNode;
9 typedef unsigned char BAP_SubFunction;
10 typedef unsigned short BAP_FrameLen;
11
12
13 struct BAP_Frame {
14         BAP_OpCode opcode;
15         BAP_SubNode subnode;
16         BAP_SubFunction function;
17         BAP_FrameLen len;
18
19         char data[4096];
20 };
21
22
23 struct BAP_RXer {
24         struct BAP_Frame *mfchannel[8];
25         BAP_FrameLen len_done[8];
26 };
27
28
29
30
31
32 void vw_bap_frame_dump(struct BAP_Frame *bap_frame);
33
34 struct BAP_Frame* vw_bap_handle_can_frame(struct BAP_RXer *bap, struct can_frame *frame);
35
36 struct BAP_RXer* vw_bap_alloc();
37 void vw_bap_free(struct BAP_RXer *bap);
38 void vw_bap_frame_free(struct BAP_Frame *bap_frame);
39
40
41
42 #endif