bcm.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * linux/can/bcm.h
  3. *
  4. * Definitions for CAN Broadcast Manager (BCM)
  5. *
  6. * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
  7. * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
  8. * All rights reserved.
  9. *
  10. */
  11. #ifndef CAN_BCM_H
  12. #define CAN_BCM_H
  13. #include <linux/types.h>
  14. #include <linux/can.h>
  15. /**
  16. * struct bcm_msg_head - head of messages to/from the broadcast manager
  17. * @opcode: opcode, see enum below.
  18. * @flags: special flags, see below.
  19. * @count: number of frames to send before changing interval.
  20. * @ival1: interval for the first @count frames.
  21. * @ival2: interval for the following frames.
  22. * @can_id: CAN ID of frames to be sent or received.
  23. * @nframes: number of frames appended to the message head.
  24. * @frames: array of CAN frames.
  25. */
  26. struct bcm_msg_head {
  27. __u32 opcode;
  28. __u32 flags;
  29. __u32 count;
  30. struct timeval ival1, ival2;
  31. canid_t can_id;
  32. __u32 nframes;
  33. struct can_frame frames[0];
  34. };
  35. enum {
  36. TX_SETUP = 1, /* create (cyclic) transmission task */
  37. TX_DELETE, /* remove (cyclic) transmission task */
  38. TX_READ, /* read properties of (cyclic) transmission task */
  39. TX_SEND, /* send one CAN frame */
  40. RX_SETUP, /* create RX content filter subscription */
  41. RX_DELETE, /* remove RX content filter subscription */
  42. RX_READ, /* read properties of RX content filter subscription */
  43. TX_STATUS, /* reply to TX_READ request */
  44. TX_EXPIRED, /* notification on performed transmissions (count=0) */
  45. RX_STATUS, /* reply to RX_READ request */
  46. RX_TIMEOUT, /* cyclic message is absent */
  47. RX_CHANGED /* updated CAN frame (detected content change) */
  48. };
  49. #define SETTIMER 0x0001
  50. #define STARTTIMER 0x0002
  51. #define TX_COUNTEVT 0x0004
  52. #define TX_ANNOUNCE 0x0008
  53. #define TX_CP_CAN_ID 0x0010
  54. #define RX_FILTER_ID 0x0020
  55. #define RX_CHECK_DLC 0x0040
  56. #define RX_NO_AUTOTIMER 0x0080
  57. #define RX_ANNOUNCE_RESUME 0x0100
  58. #define TX_RESET_MULTI_IDX 0x0200
  59. #define RX_RTR_FRAME 0x0400
  60. #endif /* CAN_BCM_H */