1 /* SPDX-License-Identifier: ((GPL-2.0-only WIT !! 1 /* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause) */ 2 /* 2 /* 3 * linux/can/bcm.h 3 * linux/can/bcm.h 4 * 4 * 5 * Definitions for CAN Broadcast Manager (BCM) 5 * Definitions for CAN Broadcast Manager (BCM) 6 * 6 * 7 * Author: Oliver Hartkopp <oliver.hartkopp@vo 7 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de> 8 * Copyright (c) 2002-2007 Volkswagen Group El 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 9 * All rights reserved. 9 * All rights reserved. 10 * 10 * 11 * Redistribution and use in source and binary 11 * Redistribution and use in source and binary forms, with or without 12 * modification, are permitted provided that t 12 * modification, are permitted provided that the following conditions 13 * are met: 13 * are met: 14 * 1. Redistributions of source code must reta 14 * 1. Redistributions of source code must retain the above copyright 15 * notice, this list of conditions and the 15 * notice, this list of conditions and the following disclaimer. 16 * 2. Redistributions in binary form must repr 16 * 2. Redistributions in binary form must reproduce the above copyright 17 * notice, this list of conditions and the 17 * notice, this list of conditions and the following disclaimer in the 18 * documentation and/or other materials pro 18 * documentation and/or other materials provided with the distribution. 19 * 3. Neither the name of Volkswagen nor the n 19 * 3. Neither the name of Volkswagen nor the names of its contributors 20 * may be used to endorse or promote produc 20 * may be used to endorse or promote products derived from this software 21 * without specific prior written permissio 21 * without specific prior written permission. 22 * 22 * 23 * Alternatively, provided that this notice is 23 * Alternatively, provided that this notice is retained in full, this 24 * software may be distributed under the terms 24 * software may be distributed under the terms of the GNU General 25 * Public License ("GPL") version 2, in which 25 * Public License ("GPL") version 2, in which case the provisions of the 26 * GPL apply INSTEAD OF those given above. 26 * GPL apply INSTEAD OF those given above. 27 * 27 * 28 * The provided data structures and external i 28 * The provided data structures and external interfaces from this code 29 * are not restricted to be used by modules wi 29 * are not restricted to be used by modules with a GPL compatible license. 30 * 30 * 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT 31 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTI 32 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCH 33 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 34 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIR 35 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 36 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGE 36 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 37 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 38 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 39 * THEORY OF LIABILITY, WHETHER IN CONTRACT, S 39 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 41 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE PO 41 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH 42 * DAMAGE. 42 * DAMAGE. 43 */ 43 */ 44 44 45 #ifndef _UAPI_CAN_BCM_H 45 #ifndef _UAPI_CAN_BCM_H 46 #define _UAPI_CAN_BCM_H 46 #define _UAPI_CAN_BCM_H 47 47 48 #include <linux/types.h> 48 #include <linux/types.h> 49 #include <linux/can.h> 49 #include <linux/can.h> 50 50 51 struct bcm_timeval { 51 struct bcm_timeval { 52 long tv_sec; 52 long tv_sec; 53 long tv_usec; 53 long tv_usec; 54 }; 54 }; 55 55 56 /** 56 /** 57 * struct bcm_msg_head - head of messages to/f 57 * struct bcm_msg_head - head of messages to/from the broadcast manager 58 * @opcode: opcode, see enum below. 58 * @opcode: opcode, see enum below. 59 * @flags: special flags, see below. 59 * @flags: special flags, see below. 60 * @count: number of frames to send before 60 * @count: number of frames to send before changing interval. 61 * @ival1: interval for the first @count f 61 * @ival1: interval for the first @count frames. 62 * @ival2: interval for the following fram 62 * @ival2: interval for the following frames. 63 * @can_id: CAN ID of frames to be sent or 63 * @can_id: CAN ID of frames to be sent or received. 64 * @nframes: number of frames appended to th 64 * @nframes: number of frames appended to the message head. 65 * @frames: array of CAN frames. 65 * @frames: array of CAN frames. 66 */ 66 */ 67 struct bcm_msg_head { 67 struct bcm_msg_head { 68 __u32 opcode; 68 __u32 opcode; 69 __u32 flags; 69 __u32 flags; 70 __u32 count; 70 __u32 count; 71 struct bcm_timeval ival1, ival2; 71 struct bcm_timeval ival1, ival2; 72 canid_t can_id; 72 canid_t can_id; 73 __u32 nframes; 73 __u32 nframes; 74 struct can_frame frames[]; !! 74 struct can_frame frames[0]; 75 }; 75 }; 76 76 77 enum { 77 enum { 78 TX_SETUP = 1, /* create (cyclic) tra 78 TX_SETUP = 1, /* create (cyclic) transmission task */ 79 TX_DELETE, /* remove (cyclic) tra 79 TX_DELETE, /* remove (cyclic) transmission task */ 80 TX_READ, /* read properties of 80 TX_READ, /* read properties of (cyclic) transmission task */ 81 TX_SEND, /* send one CAN frame 81 TX_SEND, /* send one CAN frame */ 82 RX_SETUP, /* create RX content f 82 RX_SETUP, /* create RX content filter subscription */ 83 RX_DELETE, /* remove RX content f 83 RX_DELETE, /* remove RX content filter subscription */ 84 RX_READ, /* read properties of 84 RX_READ, /* read properties of RX content filter subscription */ 85 TX_STATUS, /* reply to TX_READ re 85 TX_STATUS, /* reply to TX_READ request */ 86 TX_EXPIRED, /* notification on per 86 TX_EXPIRED, /* notification on performed transmissions (count=0) */ 87 RX_STATUS, /* reply to RX_READ re 87 RX_STATUS, /* reply to RX_READ request */ 88 RX_TIMEOUT, /* cyclic message is a 88 RX_TIMEOUT, /* cyclic message is absent */ 89 RX_CHANGED /* updated CAN frame ( 89 RX_CHANGED /* updated CAN frame (detected content change) */ 90 }; 90 }; 91 91 92 #define SETTIMER 0x0001 92 #define SETTIMER 0x0001 93 #define STARTTIMER 0x0002 93 #define STARTTIMER 0x0002 94 #define TX_COUNTEVT 0x0004 94 #define TX_COUNTEVT 0x0004 95 #define TX_ANNOUNCE 0x0008 95 #define TX_ANNOUNCE 0x0008 96 #define TX_CP_CAN_ID 0x0010 96 #define TX_CP_CAN_ID 0x0010 97 #define RX_FILTER_ID 0x0020 97 #define RX_FILTER_ID 0x0020 98 #define RX_CHECK_DLC 0x0040 98 #define RX_CHECK_DLC 0x0040 99 #define RX_NO_AUTOTIMER 0x0080 99 #define RX_NO_AUTOTIMER 0x0080 100 #define RX_ANNOUNCE_RESUME 0x0100 100 #define RX_ANNOUNCE_RESUME 0x0100 101 #define TX_RESET_MULTI_IDX 0x0200 101 #define TX_RESET_MULTI_IDX 0x0200 102 #define RX_RTR_FRAME 0x0400 102 #define RX_RTR_FRAME 0x0400 103 #define CAN_FD_FRAME 0x0800 103 #define CAN_FD_FRAME 0x0800 104 104 105 #endif /* !_UAPI_CAN_BCM_H */ 105 #endif /* !_UAPI_CAN_BCM_H */ 106 106
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.