xref: /OK3568_Linux_fs/kernel/include/uapi/linux/can/raw.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1*4882a593Smuzhiyun /* SPDX-License-Identifier: ((GPL-2.0-only WITH Linux-syscall-note) OR BSD-3-Clause) */
2*4882a593Smuzhiyun /*
3*4882a593Smuzhiyun  * linux/can/raw.h
4*4882a593Smuzhiyun  *
5*4882a593Smuzhiyun  * Definitions for raw CAN sockets
6*4882a593Smuzhiyun  *
7*4882a593Smuzhiyun  * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
8*4882a593Smuzhiyun  *          Urs Thuermann   <urs.thuermann@volkswagen.de>
9*4882a593Smuzhiyun  * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
10*4882a593Smuzhiyun  * All rights reserved.
11*4882a593Smuzhiyun  *
12*4882a593Smuzhiyun  * Redistribution and use in source and binary forms, with or without
13*4882a593Smuzhiyun  * modification, are permitted provided that the following conditions
14*4882a593Smuzhiyun  * are met:
15*4882a593Smuzhiyun  * 1. Redistributions of source code must retain the above copyright
16*4882a593Smuzhiyun  *    notice, this list of conditions and the following disclaimer.
17*4882a593Smuzhiyun  * 2. Redistributions in binary form must reproduce the above copyright
18*4882a593Smuzhiyun  *    notice, this list of conditions and the following disclaimer in the
19*4882a593Smuzhiyun  *    documentation and/or other materials provided with the distribution.
20*4882a593Smuzhiyun  * 3. Neither the name of Volkswagen nor the names of its contributors
21*4882a593Smuzhiyun  *    may be used to endorse or promote products derived from this software
22*4882a593Smuzhiyun  *    without specific prior written permission.
23*4882a593Smuzhiyun  *
24*4882a593Smuzhiyun  * Alternatively, provided that this notice is retained in full, this
25*4882a593Smuzhiyun  * software may be distributed under the terms of the GNU General
26*4882a593Smuzhiyun  * Public License ("GPL") version 2, in which case the provisions of the
27*4882a593Smuzhiyun  * GPL apply INSTEAD OF those given above.
28*4882a593Smuzhiyun  *
29*4882a593Smuzhiyun  * The provided data structures and external interfaces from this code
30*4882a593Smuzhiyun  * are not restricted to be used by modules with a GPL compatible license.
31*4882a593Smuzhiyun  *
32*4882a593Smuzhiyun  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33*4882a593Smuzhiyun  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34*4882a593Smuzhiyun  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
35*4882a593Smuzhiyun  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36*4882a593Smuzhiyun  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
37*4882a593Smuzhiyun  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
38*4882a593Smuzhiyun  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
39*4882a593Smuzhiyun  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
40*4882a593Smuzhiyun  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
41*4882a593Smuzhiyun  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
42*4882a593Smuzhiyun  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
43*4882a593Smuzhiyun  * DAMAGE.
44*4882a593Smuzhiyun  */
45*4882a593Smuzhiyun 
46*4882a593Smuzhiyun #ifndef _UAPI_CAN_RAW_H
47*4882a593Smuzhiyun #define _UAPI_CAN_RAW_H
48*4882a593Smuzhiyun 
49*4882a593Smuzhiyun #include <linux/can.h>
50*4882a593Smuzhiyun 
51*4882a593Smuzhiyun #define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
52*4882a593Smuzhiyun enum {
53*4882a593Smuzhiyun 	SCM_CAN_RAW_ERRQUEUE = 1,
54*4882a593Smuzhiyun };
55*4882a593Smuzhiyun 
56*4882a593Smuzhiyun /* for socket options affecting the socket (not the global system) */
57*4882a593Smuzhiyun 
58*4882a593Smuzhiyun enum {
59*4882a593Smuzhiyun 	CAN_RAW_FILTER = 1,	/* set 0 .. n can_filter(s)          */
60*4882a593Smuzhiyun 	CAN_RAW_ERR_FILTER,	/* set filter for error frames       */
61*4882a593Smuzhiyun 	CAN_RAW_LOOPBACK,	/* local loopback (default:on)       */
62*4882a593Smuzhiyun 	CAN_RAW_RECV_OWN_MSGS,	/* receive my own msgs (default:off) */
63*4882a593Smuzhiyun 	CAN_RAW_FD_FRAMES,	/* allow CAN FD frames (default:off) */
64*4882a593Smuzhiyun 	CAN_RAW_JOIN_FILTERS,	/* all filters must match to trigger */
65*4882a593Smuzhiyun };
66*4882a593Smuzhiyun 
67*4882a593Smuzhiyun #endif /* !_UAPI_CAN_RAW_H */
68