blob: 4c4f2c6502a8e0a674b9e3371b21ec7d09fc0655 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
Christopher Ferrisba8d4f42014-09-03 19:56:49 -070019#ifndef _UAPI_CAN_H
20#define _UAPI_CAN_H
Ben Cheng655a7c02013-10-16 16:09:24 -070021#include <linux/types.h>
22#include <linux/socket.h>
23/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
24#define CAN_EFF_FLAG 0x80000000U
25#define CAN_RTR_FLAG 0x40000000U
26#define CAN_ERR_FLAG 0x20000000U
27#define CAN_SFF_MASK 0x000007FFU
28/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
29#define CAN_EFF_MASK 0x1FFFFFFFU
30#define CAN_ERR_MASK 0x1FFFFFFFU
31typedef __u32 canid_t;
32#define CAN_SFF_ID_BITS 11
33/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
34#define CAN_EFF_ID_BITS 29
35typedef __u32 can_err_mask_t;
36#define CAN_MAX_DLC 8
37#define CAN_MAX_DLEN 8
38/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
39#define CANFD_MAX_DLC 15
40#define CANFD_MAX_DLEN 64
41struct can_frame {
Tao Baod7db5942015-01-28 10:07:51 -080042 canid_t can_id;
Ben Cheng655a7c02013-10-16 16:09:24 -070043/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080044 __u8 can_dlc;
45 __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
Ben Cheng655a7c02013-10-16 16:09:24 -070046};
47#define CANFD_BRS 0x01
48/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
49#define CANFD_ESI 0x02
50struct canfd_frame {
Tao Baod7db5942015-01-28 10:07:51 -080051 canid_t can_id;
52 __u8 len;
Ben Cheng655a7c02013-10-16 16:09:24 -070053/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080054 __u8 flags;
55 __u8 __res0;
56 __u8 __res1;
57 __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
Ben Cheng655a7c02013-10-16 16:09:24 -070058/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
59};
60#define CAN_MTU (sizeof(struct can_frame))
61#define CANFD_MTU (sizeof(struct canfd_frame))
62#define CAN_RAW 1
63/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
64#define CAN_BCM 2
65#define CAN_TP16 3
66#define CAN_TP20 4
67#define CAN_MCNET 5
68/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
69#define CAN_ISOTP 6
70#define CAN_NPROTO 7
71#define SOL_CAN_BASE 100
72struct sockaddr_can {
73/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080074 __kernel_sa_family_t can_family;
75 int can_ifindex;
76 union {
77 struct {
Ben Cheng655a7c02013-10-16 16:09:24 -070078/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Tao Baod7db5942015-01-28 10:07:51 -080079 canid_t rx_id, tx_id;
80 } tp;
81 } can_addr;
Ben Cheng655a7c02013-10-16 16:09:24 -070082};
Tao Baod7db5942015-01-28 10:07:51 -080083/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070084struct can_filter {
Tao Baod7db5942015-01-28 10:07:51 -080085 canid_t can_id;
86 canid_t can_mask;
Ben Cheng655a7c02013-10-16 16:09:24 -070087};
Tao Baod7db5942015-01-28 10:07:51 -080088/* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define CAN_INV_FILTER 0x20000000U
90#endif