* [PATCH v7 00/10] License cleanup
@ 2014-01-21 12:59 Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 01/10] include: Remove two unused header files Marc Kleine-Budde
` (9 more replies)
0 siblings, 10 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can
Picking up ukl's patches.
changes since v6:
- update commit message of 05/10
- fix embedded paths in header 06/10
- import kernel headers 07/10...10/10
regards,
Marc
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v7 01/10] include: Remove two unused header files
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
@ 2014-01-21 12:59 ` Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 02/10] ioctl.h: drop unused header Marc Kleine-Budde
` (8 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can; +Cc: Uwe Kleine-König, Marc Kleine-Budde
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
These seem to have never been used. They entered can-utils in commit
77de10356fe0 (include: import kernel header files into tree) and already
back then only consisted in an #include of a non-existing file.
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
GNUmakefile.am | 2 --
include/linux/can/core.h | 1 -
include/linux/can/dev.h | 1 -
3 files changed, 4 deletions(-)
delete mode 100644 include/linux/can/core.h
delete mode 100644 include/linux/can/dev.h
diff --git a/GNUmakefile.am b/GNUmakefile.am
index fc8f6e7..34a7740 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -11,8 +11,6 @@ noinst_HEADERS = \
lib.h \
terminal.h \
include/linux/can/bcm.h \
- include/linux/can/core.h \
- include/linux/can/dev.h \
include/linux/can/error.h \
include/linux/can/gw.h \
include/linux/can.h \
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
deleted file mode 100644
index 620c88d..0000000
--- a/include/linux/can/core.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <socketcan/can/core.h>
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
deleted file mode 100644
index 9187985..0000000
--- a/include/linux/can/dev.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <socketcan/can/dev.h>
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 02/10] ioctl.h: drop unused header
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 01/10] include: Remove two unused header files Marc Kleine-Budde
@ 2014-01-21 12:59 ` Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 03/10] isotp.h: add explicit license information Marc Kleine-Budde
` (7 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can; +Cc: Uwe Kleine-König, Marc Kleine-Budde
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This header doesn't exist in the Linux tree and it's unused by can-utils,
so drop it.
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
GNUmakefile.am | 1 -
include/socketcan/can/ioctl.h | 99 -------------------------------------------
2 files changed, 100 deletions(-)
delete mode 100644 include/socketcan/can/ioctl.h
diff --git a/GNUmakefile.am b/GNUmakefile.am
index 34a7740..9b30d9c 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -21,7 +21,6 @@ noinst_HEADERS = \
include/socketcan/can/error.h \
include/socketcan/can/gw.h \
include/socketcan/can.h \
- include/socketcan/can/ioctl.h \
include/socketcan/can/isotp.h \
include/socketcan/can/netlink.h \
include/socketcan/can/raw.h
diff --git a/include/socketcan/can/ioctl.h b/include/socketcan/can/ioctl.h
deleted file mode 100644
index ab34e89..0000000
--- a/include/socketcan/can/ioctl.h
+++ /dev/null
@@ -1,99 +0,0 @@
-
-/*
- * socketcan/can/ioctl.h
- *
- * Definitions for CAN controller setup (work in progress)
- *
- * $Id$
- *
- * Send feedback to <linux-can@vger.kernel.org>
- *
- */
-
-#ifndef CAN_IOCTL_H
-#define CAN_IOCTL_H
-
-#include <linux/sockios.h>
-
-/*
- * CAN bitrate
- */
-#define CAN_BITRATE_UNCONFIGURED ((__u32) 0xFFFFFFFFU)
-#define CAN_BITRATE_UNKNOWN 0
-#define CAN_BITRATE_DEFAULT 500000
-
-/*
- * CAN custom bit time
- */
-enum can_bittimes {
- CAN_BITTIME_STD,
- CAN_BITTIME_BTR
-};
-
-/* TSEG1 of controllers usually is a sum of synch_seg (always 1),
- * prop_seg and phase_seg1, TSEG2 = phase_seg2 */
-
-struct can_bittime_std {
- __u32 brp; /* baud rate prescaler */
- __u8 prop_seg; /* from 1 to 8 */
- __u8 phase_seg1; /* from 1 to 8 */
- __u8 phase_seg2; /* from 1 to 8 */
- __u8 sjw:7; /* from 1 to 4 */
- __u8 sam:1; /* 1 - enable triple sampling */
-};
-
-struct can_bittime_btr {
- __u8 btr0;
- __u8 btr1;
-};
-
-struct can_bittime {
- enum can_bittimes type;
- union {
- struct can_bittime_std std;
- struct can_bittime_btr btr;
- };
-};
-
-/*
- * CAN mode
- */
-enum can_mode {
- CAN_MODE_STOP = 0,
- CAN_MODE_START,
- CAN_MODE_SLEEP
-};
-
-/*
- * CAN controller mode
- */
-#define CAN_CTRLMODE_LOOPBACK 0x1
-#define CAN_CTRLMODE_LISTENONLY 0x2
-
-/*
- * CAN operational and error states
- */
-enum can_state {
- CAN_STATE_ACTIVE = 0,
- CAN_STATE_BUS_WARNING,
- CAN_STATE_BUS_PASSIVE,
- CAN_STATE_BUS_OFF,
- CAN_STATE_STOPPED,
- CAN_STATE_SLEEPING
-};
-
-/*
- * CAN device statistics
- */
-struct can_device_stats {
- int error_warning;
- int data_overrun;
- int wakeup;
- int bus_error;
- int error_passive;
- int arbitration_lost;
- int restarts;
- int bus_error_at_init;
-};
-
-#endif /* CAN_IOCTL_H */
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 03/10] isotp.h: add explicit license information
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 01/10] include: Remove two unused header files Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 02/10] ioctl.h: drop unused header Marc Kleine-Budde
@ 2014-01-21 12:59 ` Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 04/10] include/socketcan: prepare headers to be moved to include/linux Marc Kleine-Budde
` (6 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can; +Cc: Uwe Kleine-König, Marc Kleine-Budde
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
The copyright suggests to use the license used by the other files created by
Volkswagen.
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/socketcan/can/isotp.h | 36 +++++++++++++++++++++++++++++++++---
1 file changed, 33 insertions(+), 3 deletions(-)
diff --git a/include/socketcan/can/isotp.h b/include/socketcan/can/isotp.h
index 6ba5ef1..541369a 100644
--- a/include/socketcan/can/isotp.h
+++ b/include/socketcan/can/isotp.h
@@ -3,14 +3,44 @@
*
* Definitions for isotp CAN sockets
*
- * $Id$
- *
* Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
* Copyright (c) 2008 Volkswagen Group Electronic Research
* All rights reserved.
*
- * Send feedback to <linux-can@vger.kernel.org>
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
*
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * Send feedback to <linux-can@vger.kernel.org>
*/
#ifndef CAN_ISOTP_H
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 04/10] include/socketcan: prepare headers to be moved to include/linux
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (2 preceding siblings ...)
2014-01-21 12:59 ` [PATCH v7 03/10] isotp.h: add explicit license information Marc Kleine-Budde
@ 2014-01-21 12:59 ` Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 05/10] include: Move all includes from include/socketcan " Marc Kleine-Budde
` (5 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
This patch changes the include from the socketcan folder to the linux folder:
-#include <socketcan/can.h>
+#include <linux/can.h>
so that the socketcan folder can be eliminated in a later patch.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/socketcan/can/bcm.h | 2 +-
include/socketcan/can/gw.h | 2 +-
include/socketcan/can/isotp.h | 2 +-
include/socketcan/can/raw.h | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/include/socketcan/can/bcm.h b/include/socketcan/can/bcm.h
index 10185e8..f10af82 100644
--- a/include/socketcan/can/bcm.h
+++ b/include/socketcan/can/bcm.h
@@ -13,7 +13,7 @@
#define CAN_BCM_H
#include <linux/types.h>
-#include <socketcan/can.h>
+#include <linux/can.h>
/**
* struct bcm_msg_head - head of messages to/from the broadcast manager
diff --git a/include/socketcan/can/gw.h b/include/socketcan/can/gw.h
index 56d3246..f709809 100644
--- a/include/socketcan/can/gw.h
+++ b/include/socketcan/can/gw.h
@@ -13,7 +13,7 @@
#define CAN_GW_H
#include <linux/types.h>
-#include <socketcan/can.h>
+#include <linux/can.h>
struct rtcanmsg {
__u8 can_family;
diff --git a/include/socketcan/can/isotp.h b/include/socketcan/can/isotp.h
index 541369a..18d13d1 100644
--- a/include/socketcan/can/isotp.h
+++ b/include/socketcan/can/isotp.h
@@ -46,7 +46,7 @@
#ifndef CAN_ISOTP_H
#define CAN_ISOTP_H
-#include <socketcan/can.h>
+#include <linux/can.h>
#define SOL_CAN_ISOTP (SOL_CAN_BASE + CAN_ISOTP)
diff --git a/include/socketcan/can/raw.h b/include/socketcan/can/raw.h
index ee683c5..c80bff0 100644
--- a/include/socketcan/can/raw.h
+++ b/include/socketcan/can/raw.h
@@ -13,7 +13,7 @@
#ifndef CAN_RAW_H
#define CAN_RAW_H
-#include <socketcan/can.h>
+#include <linux/can.h>
#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 05/10] include: Move all includes from include/socketcan to include/linux
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (3 preceding siblings ...)
2014-01-21 12:59 ` [PATCH v7 04/10] include/socketcan: prepare headers to be moved to include/linux Marc Kleine-Budde
@ 2014-01-21 12:59 ` Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 06/10] include: fix paths mentioned in files Marc Kleine-Budde
` (4 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 12:59 UTC (permalink / raw)
To: linux-can; +Cc: Uwe Kleine-König, Marc Kleine-Budde
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
This makes it possible to import header from the kernel more easily, e.g.:
cd $path_to_linux_repo
make headers_install
rsync -a --exclude .\* usr/include/linux/can* $path_to_can_utils/include/linux
[mkl: also move isotp.h although Uwe skipped it as it is not
part of the upstream kernel; adapt commit log accordingly]
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
GNUmakefile.am | 9 +--
include/linux/can.h | 168 ++++++++++++++++++++++++++++++++++++++-
include/linux/can/bcm.h | 67 +++++++++++++++-
include/linux/can/error.h | 92 ++++++++++++++++++++-
include/linux/can/gw.h | 172 +++++++++++++++++++++++++++++++++++++++-
include/linux/can/isotp.h | 141 +++++++++++++++++++++++++++++++-
include/linux/can/netlink.h | 123 +++++++++++++++++++++++++++-
include/linux/can/raw.h | 31 +++++++-
include/socketcan/can.h | 167 --------------------------------------
include/socketcan/can/bcm.h | 66 ---------------
include/socketcan/can/error.h | 91 ---------------------
include/socketcan/can/gw.h | 171 ---------------------------------------
include/socketcan/can/isotp.h | 140 --------------------------------
include/socketcan/can/netlink.h | 122 ----------------------------
include/socketcan/can/raw.h | 30 -------
15 files changed, 788 insertions(+), 802 deletions(-)
delete mode 100644 include/socketcan/can.h
delete mode 100644 include/socketcan/can/bcm.h
delete mode 100644 include/socketcan/can/error.h
delete mode 100644 include/socketcan/can/gw.h
delete mode 100644 include/socketcan/can/isotp.h
delete mode 100644 include/socketcan/can/netlink.h
delete mode 100644 include/socketcan/can/raw.h
diff --git a/GNUmakefile.am b/GNUmakefile.am
index 9b30d9c..630a69a 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -16,14 +16,7 @@ noinst_HEADERS = \
include/linux/can.h \
include/linux/can/isotp.h \
include/linux/can/netlink.h \
- include/linux/can/raw.h \
- include/socketcan/can/bcm.h \
- include/socketcan/can/error.h \
- include/socketcan/can/gw.h \
- include/socketcan/can.h \
- include/socketcan/can/isotp.h \
- include/socketcan/can/netlink.h \
- include/socketcan/can/raw.h
+ include/linux/can/raw.h
noinst_LTLIBRARIES = \
diff --git a/include/linux/can.h b/include/linux/can.h
index 958a3f4..8452f0e 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -1 +1,167 @@
-#include <socketcan/can.h>
+/*
+ * socketcan/can.h
+ *
+ * Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
+ *
+ * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Urs Thuermann <urs.thuermann@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ */
+
+#ifndef CAN_H
+#define CAN_H
+
+#include <linux/version.h>
+#include <linux/types.h>
+#include <linux/socket.h>
+
+/* controller area network (CAN) kernel definitions */
+
+/* special address description flags for the CAN_ID */
+#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
+#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
+#define CAN_ERR_FLAG 0x20000000U /* error message frame */
+
+/* valid bits in CAN ID for frame formats */
+#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
+#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
+#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
+
+/*
+ * Controller Area Network Identifier structure
+ *
+ * bit 0-28 : CAN identifier (11/29 bit)
+ * bit 29 : error message frame flag (0 = data frame, 1 = error message)
+ * bit 30 : remote transmission request flag (1 = rtr frame)
+ * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
+ */
+typedef __u32 canid_t;
+
+#define CAN_SFF_ID_BITS 11
+#define CAN_EFF_ID_BITS 29
+
+/*
+ * Controller Area Network Error Message Frame Mask structure
+ *
+ * bit 0-28 : error class mask (see include/socketcan/can/error.h)
+ * bit 29-31 : set to zero
+ */
+typedef __u32 can_err_mask_t;
+
+/* CAN payload length and DLC definitions according to ISO 11898-1 */
+#define CAN_MAX_DLC 8
+#define CAN_MAX_DLEN 8
+
+/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
+#define CANFD_MAX_DLC 15
+#define CANFD_MAX_DLEN 64
+
+/**
+ * struct can_frame - basic CAN frame structure
+ * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
+ * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
+ * mapping of the 'data length code' to the real payload length
+ * @data: CAN frame payload (up to 8 byte)
+ */
+struct can_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
+ __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
+};
+
+/*
+ * defined bits for canfd_frame.flags
+ *
+ * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
+ * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
+ * the CAN controllers bitstream processor into the CAN FD mode which creates
+ * two new options within the CAN FD frame specification:
+ *
+ * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
+ * Error State Indicator - represents the error state of the transmitting node
+ *
+ * As the CANFD_ESI bit is internally generated by the transmitting CAN
+ * controller only the CANFD_BRS bit is relevant for real CAN controllers when
+ * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
+ * sense for virtual CAN interfaces to test applications with echoed frames.
+ */
+#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
+#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
+
+/**
+ * struct canfd_frame - CAN flexible data rate frame structure
+ * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
+ * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
+ * @flags: additional flags for CAN FD
+ * @__res0: reserved / padding
+ * @__res1: reserved / padding
+ * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
+ */
+struct canfd_frame {
+ canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
+ __u8 len; /* frame payload length in byte */
+ __u8 flags; /* additional flags for CAN FD */
+ __u8 __res0; /* reserved / padding */
+ __u8 __res1; /* reserved / padding */
+ __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
+};
+
+#define CAN_MTU (sizeof(struct can_frame))
+#define CANFD_MTU (sizeof(struct canfd_frame))
+
+/* particular protocols of the protocol family PF_CAN */
+#define CAN_RAW 1 /* RAW sockets */
+#define CAN_BCM 2 /* Broadcast Manager */
+#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
+#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
+#define CAN_MCNET 5 /* Bosch MCNet */
+#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
+#define CAN_NPROTO 7
+
+#define SOL_CAN_BASE 100
+
+// typedef unsigned short __kernel_sa_family_t;
+// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
+
+/**
+ * struct sockaddr_can - the sockaddr structure for CAN sockets
+ * @can_family: address family number AF_CAN.
+ * @can_ifindex: CAN network interface index.
+ * @can_addr: protocol specific address information
+ */
+struct sockaddr_can {
+ sa_family_t can_family;
+// __kernel_sa_family_t can_family;
+ int can_ifindex;
+ union {
+ /* transport protocol class address information (e.g. ISOTP) */
+ struct { canid_t rx_id, tx_id; } tp;
+
+ /* reserved for future CAN protocols address information */
+ } can_addr;
+};
+
+/**
+ * struct can_filter - CAN ID based filter in can_register().
+ * @can_id: relevant bits of CAN ID which are not masked out.
+ * @can_mask: CAN mask (see description)
+ *
+ * Description:
+ * A filter matches, when
+ *
+ * <received_can_id> & mask == can_id & mask
+ *
+ * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
+ * filter for error message frames (CAN_ERR_FLAG bit set in mask).
+ */
+struct can_filter {
+ canid_t can_id;
+ canid_t can_mask;
+};
+
+#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
+
+#endif /* CAN_H */
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index 6d61559..f10af82 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -1 +1,66 @@
-#include <socketcan/can/bcm.h>
+/*
+ * socketcan/can/bcm.h
+ *
+ * Definitions for CAN Broadcast Manager (BCM)
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ */
+
+#ifndef CAN_BCM_H
+#define CAN_BCM_H
+
+#include <linux/types.h>
+#include <linux/can.h>
+
+/**
+ * struct bcm_msg_head - head of messages to/from the broadcast manager
+ * @opcode: opcode, see enum below.
+ * @flags: special flags, see below.
+ * @count: number of frames to send before changing interval.
+ * @ival1: interval for the first @count frames.
+ * @ival2: interval for the following frames.
+ * @can_id: CAN ID of frames to be sent or received.
+ * @nframes: number of frames appended to the message head.
+ * @frames: array of CAN frames.
+ */
+struct bcm_msg_head {
+ __u32 opcode;
+ __u32 flags;
+ __u32 count;
+ struct timeval ival1, ival2;
+ canid_t can_id;
+ __u32 nframes;
+ struct can_frame frames[0];
+};
+
+enum {
+ TX_SETUP = 1, /* create (cyclic) transmission task */
+ TX_DELETE, /* remove (cyclic) transmission task */
+ TX_READ, /* read properties of (cyclic) transmission task */
+ TX_SEND, /* send one CAN frame */
+ RX_SETUP, /* create RX content filter subscription */
+ RX_DELETE, /* remove RX content filter subscription */
+ RX_READ, /* read properties of RX content filter subscription */
+ TX_STATUS, /* reply to TX_READ request */
+ TX_EXPIRED, /* notification on performed transmissions (count=0) */
+ RX_STATUS, /* reply to RX_READ request */
+ RX_TIMEOUT, /* cyclic message is absent */
+ RX_CHANGED /* updated CAN frame (detected content change) */
+};
+
+#define SETTIMER 0x0001
+#define STARTTIMER 0x0002
+#define TX_COUNTEVT 0x0004
+#define TX_ANNOUNCE 0x0008
+#define TX_CP_CAN_ID 0x0010
+#define RX_FILTER_ID 0x0020
+#define RX_CHECK_DLC 0x0040
+#define RX_NO_AUTOTIMER 0x0080
+#define RX_ANNOUNCE_RESUME 0x0100
+#define TX_RESET_MULTI_IDX 0x0200
+#define RX_RTR_FRAME 0x0400
+
+#endif /* CAN_BCM_H */
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index a02b1ca..b65c231 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -1 +1,91 @@
-#include <socketcan/can/error.h>
+/*
+ * socketcan/can/error.h
+ *
+ * Definitions of the CAN error messages to be filtered and passed to the user.
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ */
+
+#ifndef CAN_ERROR_H
+#define CAN_ERROR_H
+
+#define CAN_ERR_DLC 8 /* dlc for error message frames */
+
+/* error class (mask) in can_id */
+#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
+#define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */
+#define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */
+#define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */
+#define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */
+#define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */
+#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
+#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
+#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
+
+/* arbitration lost in bit ... / data[0] */
+#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
+ /* else bit number in bitstream */
+
+/* error status of CAN-controller / data[1] */
+#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */
+#define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */
+#define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */
+#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
+#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
+#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
+ /* (at least one error counter exceeds */
+ /* the protocol-defined level of 127) */
+
+/* error in CAN protocol (type) / data[2] */
+#define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_BIT 0x01 /* single bit error */
+#define CAN_ERR_PROT_FORM 0x02 /* frame format error */
+#define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */
+#define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */
+#define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */
+#define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */
+#define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */
+#define CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */
+
+/* error in CAN protocol (location) / data[3] */
+#define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */
+#define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */
+#define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */
+#define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/
+#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
+#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
+#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
+#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
+#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
+#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
+#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
+#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
+#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
+#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
+#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
+#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
+#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
+#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
+#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
+#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
+
+/* error status of CAN-transceiver / data[4] */
+/* CANH CANL */
+#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
+#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */
+#define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */
+#define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
+#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
+
+/* controller specific additional information / data[5..7] */
+
+#endif /* CAN_ERROR_H */
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
index f37dbf0..f709809 100644
--- a/include/linux/can/gw.h
+++ b/include/linux/can/gw.h
@@ -1 +1,171 @@
-#include <socketcan/can/gw.h>
+/*
+ * socketcan/can/gw.h
+ *
+ * Definitions for CAN frame Gateway/Router/Bridge
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2011 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ */
+
+#ifndef CAN_GW_H
+#define CAN_GW_H
+
+#include <linux/types.h>
+#include <linux/can.h>
+
+struct rtcanmsg {
+ __u8 can_family;
+ __u8 gwtype;
+ __u16 flags;
+};
+
+/* CAN gateway types */
+enum {
+ CGW_TYPE_UNSPEC,
+ CGW_TYPE_CAN_CAN, /* CAN->CAN routing */
+ __CGW_TYPE_MAX
+};
+
+#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
+
+/* CAN rtnetlink attribute definitions */
+enum {
+ CGW_UNSPEC,
+ CGW_MOD_AND, /* CAN frame modification binary AND */
+ CGW_MOD_OR, /* CAN frame modification binary OR */
+ CGW_MOD_XOR, /* CAN frame modification binary XOR */
+ CGW_MOD_SET, /* CAN frame modification set alternate values */
+ CGW_CS_XOR, /* set data[] XOR checksum into data[index] */
+ CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */
+ CGW_HANDLED, /* number of handled CAN frames */
+ CGW_DROPPED, /* number of dropped CAN frames */
+ CGW_SRC_IF, /* ifindex of source network interface */
+ CGW_DST_IF, /* ifindex of destination network interface */
+ CGW_FILTER, /* specify struct can_filter on source CAN device */
+ CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
+ CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
+ __CGW_MAX
+};
+
+#define CGW_MAX (__CGW_MAX - 1)
+
+#define CGW_FLAGS_CAN_ECHO 0x01
+#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
+#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
+
+#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
+
+/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
+#define CGW_MOD_ID 0x01
+#define CGW_MOD_DLC 0x02
+#define CGW_MOD_DATA 0x04
+
+#define CGW_FRAME_MODS 3 /* ID DLC DATA */
+
+#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
+
+struct cgw_frame_mod {
+ struct can_frame cf;
+ __u8 modtype;
+} __attribute__((packed));
+
+#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
+
+struct cgw_csum_xor {
+ __s8 from_idx;
+ __s8 to_idx;
+ __s8 result_idx;
+ __u8 init_xor_val;
+} __attribute__((packed));
+
+struct cgw_csum_crc8 {
+ __s8 from_idx;
+ __s8 to_idx;
+ __s8 result_idx;
+ __u8 init_crc_val;
+ __u8 final_xor_val;
+ __u8 crctab[256];
+ __u8 profile;
+ __u8 profile_data[20];
+} __attribute__((packed));
+
+/* length of checksum operation parameters. idx = index in CAN frame data[] */
+#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
+#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
+
+/* CRC8 profiles (compute CRC for additional data elements - see below) */
+enum {
+ CGW_CRC8PRF_UNSPEC,
+ CGW_CRC8PRF_1U8, /* compute one additional u8 value */
+ CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */
+ CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */
+ __CGW_CRC8PRF_MAX
+};
+
+#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
+
+/*
+ * CAN rtnetlink attribute contents in detail
+ *
+ * CGW_XXX_IF (length 4 bytes):
+ * Sets an interface index for source/destination network interfaces.
+ * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory.
+ *
+ * CGW_FILTER (length 8 bytes):
+ * Sets a CAN receive filter for the gateway job specified by the
+ * struct can_filter described in include/linux/can.h
+ *
+ * CGW_MOD_(AND|OR|XOR|SET) (length 17 bytes):
+ * Specifies a modification that's done to a received CAN frame before it is
+ * send out to the destination interface.
+ *
+ * <struct can_frame> data used as operator
+ * <u8> affected CAN frame elements
+ *
+ * CGW_LIM_HOPS (length 1 byte):
+ * Limit the number of hops of this specific rule. Usually the received CAN
+ * frame can be processed as much as 'max_hops' times (which is given at module
+ * load time of the can-gw module). This value is used to reduce the number of
+ * possible hops for this gateway job to a value smaller then max_hops.
+ *
+ * CGW_CS_XOR (length 4 bytes):
+ * Set a simple XOR checksum starting with an initial value into
+ * data[result-idx] using data[start-idx] .. data[end-idx]
+ *
+ * The XOR checksum is calculated like this:
+ *
+ * xor = init_xor_val
+ *
+ * for (i = from_idx .. to_idx)
+ * xor ^= can_frame.data[i]
+ *
+ * can_frame.data[ result_idx ] = xor
+ *
+ * CGW_CS_CRC8 (length 282 bytes):
+ * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table,
+ * a given initial value and a defined input data[start-idx] .. data[end-idx].
+ * Finally the result value is XOR'ed with the final_xor_val.
+ *
+ * The CRC8 checksum is calculated like this:
+ *
+ * crc = init_crc_val
+ *
+ * for (i = from_idx .. to_idx)
+ * crc = crctab[ crc ^ can_frame.data[i] ]
+ *
+ * can_frame.data[ result_idx ] = crc ^ final_xor_val
+ *
+ * The calculated CRC may contain additional source data elements that can be
+ * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs
+ * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf
+ * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs)
+ * that are used depending on counter values inside the CAN frame data[].
+ * So far only three profiles have been implemented for illustration.
+ *
+ * Remark: In general the attribute data is a linear buffer.
+ * Beware of sending unpacked or aligned structs!
+ */
+
+#endif
diff --git a/include/linux/can/isotp.h b/include/linux/can/isotp.h
index c52850f..18d13d1 100644
--- a/include/linux/can/isotp.h
+++ b/include/linux/can/isotp.h
@@ -1 +1,140 @@
-#include <socketcan/can/isotp.h>
+/*
+ * socketcan/can/isotp.h
+ *
+ * Definitions for isotp CAN sockets
+ *
+ * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Copyright (c) 2008 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
+ *
+ * Send feedback to <linux-can@vger.kernel.org>
+ */
+
+#ifndef CAN_ISOTP_H
+#define CAN_ISOTP_H
+
+#include <linux/can.h>
+
+#define SOL_CAN_ISOTP (SOL_CAN_BASE + CAN_ISOTP)
+
+/* for socket options affecting the socket (not the global system) */
+
+#define CAN_ISOTP_OPTS 1 /* pass struct can_isotp_options */
+
+#define CAN_ISOTP_RECV_FC 2 /* pass struct can_isotp_fc_options */
+
+/* sockopts to force stmin timer values for protocol regression tests */
+
+#define CAN_ISOTP_TX_STMIN 3 /* pass __u32 value in nano secs */
+ /* use this time instead of value */
+ /* provided in FC from the receiver */
+
+#define CAN_ISOTP_RX_STMIN 4 /* pass __u32 value in nano secs */
+ /* ignore received CF frames which */
+ /* timestamps differ less than val */
+
+struct can_isotp_options {
+
+ __u32 flags; /* set flags for isotp behaviour. */
+ /* __u32 value : flags see below */
+
+ __u32 frame_txtime; /* frame transmission time (N_As/N_Ar) */
+ /* __u32 value : time in nano secs */
+
+ __u8 ext_address; /* set address for extended addressing */
+ /* __u8 value : extended address */
+
+ __u8 txpad_content; /* set content of padding byte (tx) */
+ /* __u8 value : content on tx path */
+
+ __u8 rxpad_content; /* set content of padding byte (rx) */
+ /* __u8 value : content on rx path */
+};
+
+struct can_isotp_fc_options {
+
+ __u8 bs; /* blocksize provided in FC frame */
+ /* __u8 value : blocksize. 0 = off */
+
+ __u8 stmin; /* separation time provided in FC frame */
+ /* __u8 value : */
+ /* 0x00 - 0x7F : 0 - 127 ms */
+ /* 0x80 - 0xF0 : reserved */
+ /* 0xF1 - 0xF9 : 100 us - 900 us */
+ /* 0xFA - 0xFF : reserved */
+
+ __u8 wftmax; /* max. number of wait frame transmiss. */
+ /* __u8 value : 0 = omit FC N_PDU WT */
+};
+
+
+/* flags for isotp behaviour */
+
+#define CAN_ISOTP_LISTEN_MODE 0x001 /* listen only (do not send FC) */
+#define CAN_ISOTP_EXTEND_ADDR 0x002 /* enable extended addressing */
+#define CAN_ISOTP_TX_PADDING 0x004 /* enable CAN frame padding tx path */
+#define CAN_ISOTP_RX_PADDING 0x008 /* enable CAN frame padding rx path */
+#define CAN_ISOTP_CHK_PAD_LEN 0x010 /* check received CAN frame padding */
+#define CAN_ISOTP_CHK_PAD_DATA 0x020 /* check received CAN frame padding */
+#define CAN_ISOTP_HALF_DUPLEX 0x040 /* half duplex error state handling */
+#define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */
+#define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */
+
+
+/* default values */
+
+#define CAN_ISOTP_DEFAULT_FLAGS 0
+#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00
+#define CAN_ISOTP_DEFAULT_RXPAD_CONTENT 0x00
+#define CAN_ISOTP_DEFAULT_TXPAD_CONTENT 0x00
+#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0
+#define CAN_ISOTP_DEFAULT_RECV_BS 0
+#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00
+#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0
+
+/*
+ * Remark on CAN_ISOTP_DEFAULT_RECV_* values:
+ *
+ * We can strongly assume, that the Linux Kernel implementation of
+ * CAN_ISOTP is capable to run with BS=0, STmin=0 and WFTmax=0.
+ * But as we like to be able to behave as a commonly available ECU,
+ * these default settings can be changed via sockopts.
+ * For that reason the STmin value is intentionally _not_ checked for
+ * consistency and copied directly into the flow control (FC) frame.
+ *
+ */
+
+#endif
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 99425f9..9bb47e3 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -1 +1,122 @@
-#include <socketcan/can/netlink.h>
+/*
+ * socketcan/can/netlink.h
+ *
+ * Definitions for the CAN netlink interface
+ *
+ * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
+ *
+ */
+
+#ifndef CAN_NETLINK_H
+#define CAN_NETLINK_H
+
+#include <linux/types.h>
+
+/*
+ * CAN bit-timing parameters
+ *
+ * For further information, please read chapter "8 BIT TIMING
+ * REQUIREMENTS" of the "Bosch CAN Specification version 2.0"
+ * at http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
+ */
+struct can_bittiming {
+ __u32 bitrate; /* Bit-rate in bits/second */
+ __u32 sample_point; /* Sample point in one-tenth of a percent */
+ __u32 tq; /* Time quanta (TQ) in nanoseconds */
+ __u32 prop_seg; /* Propagation segment in TQs */
+ __u32 phase_seg1; /* Phase buffer segment 1 in TQs */
+ __u32 phase_seg2; /* Phase buffer segment 2 in TQs */
+ __u32 sjw; /* Synchronisation jump width in TQs */
+ __u32 brp; /* Bit-rate prescaler */
+};
+
+/*
+ * CAN harware-dependent bit-timing constant
+ *
+ * Used for calculating and checking bit-timing parameters
+ */
+struct can_bittiming_const {
+ char name[16]; /* Name of the CAN controller hardware */
+ __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */
+ __u32 tseg1_max;
+ __u32 tseg2_min; /* Time segement 2 = phase_seg2 */
+ __u32 tseg2_max;
+ __u32 sjw_max; /* Synchronisation jump width */
+ __u32 brp_min; /* Bit-rate prescaler */
+ __u32 brp_max;
+ __u32 brp_inc;
+};
+
+/*
+ * CAN clock parameters
+ */
+struct can_clock {
+ __u32 freq; /* CAN system clock frequency in Hz */
+};
+
+/*
+ * CAN operational and error states
+ */
+enum can_state {
+ CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */
+ CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */
+ CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */
+ CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */
+ CAN_STATE_STOPPED, /* Device is stopped */
+ CAN_STATE_SLEEPING, /* Device is sleeping */
+ CAN_STATE_MAX
+};
+
+/*
+ * CAN bus error counters
+ */
+struct can_berr_counter {
+ __u16 txerr;
+ __u16 rxerr;
+};
+
+/*
+ * CAN controller mode
+ */
+struct can_ctrlmode {
+ __u32 mask;
+ __u32 flags;
+};
+
+#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
+#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
+#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
+#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
+#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
+
+/*
+ * CAN device statistics
+ */
+struct can_device_stats {
+ __u32 bus_error; /* Bus errors */
+ __u32 error_warning; /* Changes to error warning state */
+ __u32 error_passive; /* Changes to error passive state */
+ __u32 bus_off; /* Changes to bus off state */
+ __u32 arbitration_lost; /* Arbitration lost errors */
+ __u32 restarts; /* CAN controller re-starts */
+};
+
+/*
+ * CAN netlink interface
+ */
+enum {
+ IFLA_CAN_UNSPEC,
+ IFLA_CAN_BITTIMING,
+ IFLA_CAN_BITTIMING_CONST,
+ IFLA_CAN_CLOCK,
+ IFLA_CAN_STATE,
+ IFLA_CAN_CTRLMODE,
+ IFLA_CAN_RESTART_MS,
+ IFLA_CAN_RESTART,
+ IFLA_CAN_BERR_COUNTER,
+ __IFLA_CAN_MAX
+};
+
+#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
+
+#endif /* CAN_NETLINK_H */
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index 22a90e5..c80bff0 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -1 +1,30 @@
-#include <socketcan/can/raw.h>
+/*
+ * socketcan/can/raw.h
+ *
+ * Definitions for raw CAN sockets
+ *
+ * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
+ * Urs Thuermann <urs.thuermann@volkswagen.de>
+ * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
+ * All rights reserved.
+ *
+ */
+
+#ifndef CAN_RAW_H
+#define CAN_RAW_H
+
+#include <linux/can.h>
+
+#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
+
+/* for socket options affecting the socket (not the global system) */
+
+enum {
+ CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
+ CAN_RAW_ERR_FILTER, /* set filter for error frames */
+ CAN_RAW_LOOPBACK, /* local loopback (default:on) */
+ CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
+ CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
+};
+
+#endif
diff --git a/include/socketcan/can.h b/include/socketcan/can.h
deleted file mode 100644
index 8452f0e..0000000
--- a/include/socketcan/can.h
+++ /dev/null
@@ -1,167 +0,0 @@
-/*
- * socketcan/can.h
- *
- * Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
- *
- * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Urs Thuermann <urs.thuermann@volkswagen.de>
- * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- */
-
-#ifndef CAN_H
-#define CAN_H
-
-#include <linux/version.h>
-#include <linux/types.h>
-#include <linux/socket.h>
-
-/* controller area network (CAN) kernel definitions */
-
-/* special address description flags for the CAN_ID */
-#define CAN_EFF_FLAG 0x80000000U /* EFF/SFF is set in the MSB */
-#define CAN_RTR_FLAG 0x40000000U /* remote transmission request */
-#define CAN_ERR_FLAG 0x20000000U /* error message frame */
-
-/* valid bits in CAN ID for frame formats */
-#define CAN_SFF_MASK 0x000007FFU /* standard frame format (SFF) */
-#define CAN_EFF_MASK 0x1FFFFFFFU /* extended frame format (EFF) */
-#define CAN_ERR_MASK 0x1FFFFFFFU /* omit EFF, RTR, ERR flags */
-
-/*
- * Controller Area Network Identifier structure
- *
- * bit 0-28 : CAN identifier (11/29 bit)
- * bit 29 : error message frame flag (0 = data frame, 1 = error message)
- * bit 30 : remote transmission request flag (1 = rtr frame)
- * bit 31 : frame format flag (0 = standard 11 bit, 1 = extended 29 bit)
- */
-typedef __u32 canid_t;
-
-#define CAN_SFF_ID_BITS 11
-#define CAN_EFF_ID_BITS 29
-
-/*
- * Controller Area Network Error Message Frame Mask structure
- *
- * bit 0-28 : error class mask (see include/socketcan/can/error.h)
- * bit 29-31 : set to zero
- */
-typedef __u32 can_err_mask_t;
-
-/* CAN payload length and DLC definitions according to ISO 11898-1 */
-#define CAN_MAX_DLC 8
-#define CAN_MAX_DLEN 8
-
-/* CAN FD payload length and DLC definitions according to ISO 11898-7 */
-#define CANFD_MAX_DLC 15
-#define CANFD_MAX_DLEN 64
-
-/**
- * struct can_frame - basic CAN frame structure
- * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
- * @can_dlc: frame payload length in byte (0 .. 8) aka data length code
- * N.B. the DLC field from ISO 11898-1 Chapter 8.4.2.3 has a 1:1
- * mapping of the 'data length code' to the real payload length
- * @data: CAN frame payload (up to 8 byte)
- */
-struct can_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
- __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */
- __u8 data[CAN_MAX_DLEN] __attribute__((aligned(8)));
-};
-
-/*
- * defined bits for canfd_frame.flags
- *
- * The use of struct canfd_frame implies the Extended Data Length (EDL) bit to
- * be set in the CAN frame bitstream on the wire. The EDL bit switch turns
- * the CAN controllers bitstream processor into the CAN FD mode which creates
- * two new options within the CAN FD frame specification:
- *
- * Bit Rate Switch - to indicate a second bitrate is/was used for the payload
- * Error State Indicator - represents the error state of the transmitting node
- *
- * As the CANFD_ESI bit is internally generated by the transmitting CAN
- * controller only the CANFD_BRS bit is relevant for real CAN controllers when
- * building a CAN FD frame for transmission. Setting the CANFD_ESI bit can make
- * sense for virtual CAN interfaces to test applications with echoed frames.
- */
-#define CANFD_BRS 0x01 /* bit rate switch (second bitrate for payload data) */
-#define CANFD_ESI 0x02 /* error state indicator of the transmitting node */
-
-/**
- * struct canfd_frame - CAN flexible data rate frame structure
- * @can_id: CAN ID of the frame and CAN_*_FLAG flags, see canid_t definition
- * @len: frame payload length in byte (0 .. CANFD_MAX_DLEN)
- * @flags: additional flags for CAN FD
- * @__res0: reserved / padding
- * @__res1: reserved / padding
- * @data: CAN FD frame payload (up to CANFD_MAX_DLEN byte)
- */
-struct canfd_frame {
- canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */
- __u8 len; /* frame payload length in byte */
- __u8 flags; /* additional flags for CAN FD */
- __u8 __res0; /* reserved / padding */
- __u8 __res1; /* reserved / padding */
- __u8 data[CANFD_MAX_DLEN] __attribute__((aligned(8)));
-};
-
-#define CAN_MTU (sizeof(struct can_frame))
-#define CANFD_MTU (sizeof(struct canfd_frame))
-
-/* particular protocols of the protocol family PF_CAN */
-#define CAN_RAW 1 /* RAW sockets */
-#define CAN_BCM 2 /* Broadcast Manager */
-#define CAN_TP16 3 /* VAG Transport Protocol v1.6 */
-#define CAN_TP20 4 /* VAG Transport Protocol v2.0 */
-#define CAN_MCNET 5 /* Bosch MCNet */
-#define CAN_ISOTP 6 /* ISO 15765-2 Transport Protocol */
-#define CAN_NPROTO 7
-
-#define SOL_CAN_BASE 100
-
-// typedef unsigned short __kernel_sa_family_t;
-// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
-
-/**
- * struct sockaddr_can - the sockaddr structure for CAN sockets
- * @can_family: address family number AF_CAN.
- * @can_ifindex: CAN network interface index.
- * @can_addr: protocol specific address information
- */
-struct sockaddr_can {
- sa_family_t can_family;
-// __kernel_sa_family_t can_family;
- int can_ifindex;
- union {
- /* transport protocol class address information (e.g. ISOTP) */
- struct { canid_t rx_id, tx_id; } tp;
-
- /* reserved for future CAN protocols address information */
- } can_addr;
-};
-
-/**
- * struct can_filter - CAN ID based filter in can_register().
- * @can_id: relevant bits of CAN ID which are not masked out.
- * @can_mask: CAN mask (see description)
- *
- * Description:
- * A filter matches, when
- *
- * <received_can_id> & mask == can_id & mask
- *
- * The filter can be inverted (CAN_INV_FILTER bit set in can_id) or it can
- * filter for error message frames (CAN_ERR_FLAG bit set in mask).
- */
-struct can_filter {
- canid_t can_id;
- canid_t can_mask;
-};
-
-#define CAN_INV_FILTER 0x20000000U /* to be set in can_filter.can_id */
-
-#endif /* CAN_H */
diff --git a/include/socketcan/can/bcm.h b/include/socketcan/can/bcm.h
deleted file mode 100644
index f10af82..0000000
--- a/include/socketcan/can/bcm.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * socketcan/can/bcm.h
- *
- * Definitions for CAN Broadcast Manager (BCM)
- *
- * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- */
-
-#ifndef CAN_BCM_H
-#define CAN_BCM_H
-
-#include <linux/types.h>
-#include <linux/can.h>
-
-/**
- * struct bcm_msg_head - head of messages to/from the broadcast manager
- * @opcode: opcode, see enum below.
- * @flags: special flags, see below.
- * @count: number of frames to send before changing interval.
- * @ival1: interval for the first @count frames.
- * @ival2: interval for the following frames.
- * @can_id: CAN ID of frames to be sent or received.
- * @nframes: number of frames appended to the message head.
- * @frames: array of CAN frames.
- */
-struct bcm_msg_head {
- __u32 opcode;
- __u32 flags;
- __u32 count;
- struct timeval ival1, ival2;
- canid_t can_id;
- __u32 nframes;
- struct can_frame frames[0];
-};
-
-enum {
- TX_SETUP = 1, /* create (cyclic) transmission task */
- TX_DELETE, /* remove (cyclic) transmission task */
- TX_READ, /* read properties of (cyclic) transmission task */
- TX_SEND, /* send one CAN frame */
- RX_SETUP, /* create RX content filter subscription */
- RX_DELETE, /* remove RX content filter subscription */
- RX_READ, /* read properties of RX content filter subscription */
- TX_STATUS, /* reply to TX_READ request */
- TX_EXPIRED, /* notification on performed transmissions (count=0) */
- RX_STATUS, /* reply to RX_READ request */
- RX_TIMEOUT, /* cyclic message is absent */
- RX_CHANGED /* updated CAN frame (detected content change) */
-};
-
-#define SETTIMER 0x0001
-#define STARTTIMER 0x0002
-#define TX_COUNTEVT 0x0004
-#define TX_ANNOUNCE 0x0008
-#define TX_CP_CAN_ID 0x0010
-#define RX_FILTER_ID 0x0020
-#define RX_CHECK_DLC 0x0040
-#define RX_NO_AUTOTIMER 0x0080
-#define RX_ANNOUNCE_RESUME 0x0100
-#define TX_RESET_MULTI_IDX 0x0200
-#define RX_RTR_FRAME 0x0400
-
-#endif /* CAN_BCM_H */
diff --git a/include/socketcan/can/error.h b/include/socketcan/can/error.h
deleted file mode 100644
index b65c231..0000000
--- a/include/socketcan/can/error.h
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * socketcan/can/error.h
- *
- * Definitions of the CAN error messages to be filtered and passed to the user.
- *
- * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- */
-
-#ifndef CAN_ERROR_H
-#define CAN_ERROR_H
-
-#define CAN_ERR_DLC 8 /* dlc for error message frames */
-
-/* error class (mask) in can_id */
-#define CAN_ERR_TX_TIMEOUT 0x00000001U /* TX timeout (by netdevice driver) */
-#define CAN_ERR_LOSTARB 0x00000002U /* lost arbitration / data[0] */
-#define CAN_ERR_CRTL 0x00000004U /* controller problems / data[1] */
-#define CAN_ERR_PROT 0x00000008U /* protocol violations / data[2..3] */
-#define CAN_ERR_TRX 0x00000010U /* transceiver status / data[4] */
-#define CAN_ERR_ACK 0x00000020U /* received no ACK on transmission */
-#define CAN_ERR_BUSOFF 0x00000040U /* bus off */
-#define CAN_ERR_BUSERROR 0x00000080U /* bus error (may flood!) */
-#define CAN_ERR_RESTARTED 0x00000100U /* controller restarted */
-
-/* arbitration lost in bit ... / data[0] */
-#define CAN_ERR_LOSTARB_UNSPEC 0x00 /* unspecified */
- /* else bit number in bitstream */
-
-/* error status of CAN-controller / data[1] */
-#define CAN_ERR_CRTL_UNSPEC 0x00 /* unspecified */
-#define CAN_ERR_CRTL_RX_OVERFLOW 0x01 /* RX buffer overflow */
-#define CAN_ERR_CRTL_TX_OVERFLOW 0x02 /* TX buffer overflow */
-#define CAN_ERR_CRTL_RX_WARNING 0x04 /* reached warning level for RX errors */
-#define CAN_ERR_CRTL_TX_WARNING 0x08 /* reached warning level for TX errors */
-#define CAN_ERR_CRTL_RX_PASSIVE 0x10 /* reached error passive status RX */
-#define CAN_ERR_CRTL_TX_PASSIVE 0x20 /* reached error passive status TX */
- /* (at least one error counter exceeds */
- /* the protocol-defined level of 127) */
-
-/* error in CAN protocol (type) / data[2] */
-#define CAN_ERR_PROT_UNSPEC 0x00 /* unspecified */
-#define CAN_ERR_PROT_BIT 0x01 /* single bit error */
-#define CAN_ERR_PROT_FORM 0x02 /* frame format error */
-#define CAN_ERR_PROT_STUFF 0x04 /* bit stuffing error */
-#define CAN_ERR_PROT_BIT0 0x08 /* unable to send dominant bit */
-#define CAN_ERR_PROT_BIT1 0x10 /* unable to send recessive bit */
-#define CAN_ERR_PROT_OVERLOAD 0x20 /* bus overload */
-#define CAN_ERR_PROT_ACTIVE 0x40 /* active error announcement */
-#define CAN_ERR_PROT_TX 0x80 /* error occurred on transmission */
-
-/* error in CAN protocol (location) / data[3] */
-#define CAN_ERR_PROT_LOC_UNSPEC 0x00 /* unspecified */
-#define CAN_ERR_PROT_LOC_SOF 0x03 /* start of frame */
-#define CAN_ERR_PROT_LOC_ID28_21 0x02 /* ID bits 28 - 21 (SFF: 10 - 3) */
-#define CAN_ERR_PROT_LOC_ID20_18 0x06 /* ID bits 20 - 18 (SFF: 2 - 0 )*/
-#define CAN_ERR_PROT_LOC_SRTR 0x04 /* substitute RTR (SFF: RTR) */
-#define CAN_ERR_PROT_LOC_IDE 0x05 /* identifier extension */
-#define CAN_ERR_PROT_LOC_ID17_13 0x07 /* ID bits 17-13 */
-#define CAN_ERR_PROT_LOC_ID12_05 0x0F /* ID bits 12-5 */
-#define CAN_ERR_PROT_LOC_ID04_00 0x0E /* ID bits 4-0 */
-#define CAN_ERR_PROT_LOC_RTR 0x0C /* RTR */
-#define CAN_ERR_PROT_LOC_RES1 0x0D /* reserved bit 1 */
-#define CAN_ERR_PROT_LOC_RES0 0x09 /* reserved bit 0 */
-#define CAN_ERR_PROT_LOC_DLC 0x0B /* data length code */
-#define CAN_ERR_PROT_LOC_DATA 0x0A /* data section */
-#define CAN_ERR_PROT_LOC_CRC_SEQ 0x08 /* CRC sequence */
-#define CAN_ERR_PROT_LOC_CRC_DEL 0x18 /* CRC delimiter */
-#define CAN_ERR_PROT_LOC_ACK 0x19 /* ACK slot */
-#define CAN_ERR_PROT_LOC_ACK_DEL 0x1B /* ACK delimiter */
-#define CAN_ERR_PROT_LOC_EOF 0x1A /* end of frame */
-#define CAN_ERR_PROT_LOC_INTERM 0x12 /* intermission */
-
-/* error status of CAN-transceiver / data[4] */
-/* CANH CANL */
-#define CAN_ERR_TRX_UNSPEC 0x00 /* 0000 0000 */
-#define CAN_ERR_TRX_CANH_NO_WIRE 0x04 /* 0000 0100 */
-#define CAN_ERR_TRX_CANH_SHORT_TO_BAT 0x05 /* 0000 0101 */
-#define CAN_ERR_TRX_CANH_SHORT_TO_VCC 0x06 /* 0000 0110 */
-#define CAN_ERR_TRX_CANH_SHORT_TO_GND 0x07 /* 0000 0111 */
-#define CAN_ERR_TRX_CANL_NO_WIRE 0x40 /* 0100 0000 */
-#define CAN_ERR_TRX_CANL_SHORT_TO_BAT 0x50 /* 0101 0000 */
-#define CAN_ERR_TRX_CANL_SHORT_TO_VCC 0x60 /* 0110 0000 */
-#define CAN_ERR_TRX_CANL_SHORT_TO_GND 0x70 /* 0111 0000 */
-#define CAN_ERR_TRX_CANL_SHORT_TO_CANH 0x80 /* 1000 0000 */
-
-/* controller specific additional information / data[5..7] */
-
-#endif /* CAN_ERROR_H */
diff --git a/include/socketcan/can/gw.h b/include/socketcan/can/gw.h
deleted file mode 100644
index f709809..0000000
--- a/include/socketcan/can/gw.h
+++ /dev/null
@@ -1,171 +0,0 @@
-/*
- * socketcan/can/gw.h
- *
- * Definitions for CAN frame Gateway/Router/Bridge
- *
- * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Copyright (c) 2011 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- */
-
-#ifndef CAN_GW_H
-#define CAN_GW_H
-
-#include <linux/types.h>
-#include <linux/can.h>
-
-struct rtcanmsg {
- __u8 can_family;
- __u8 gwtype;
- __u16 flags;
-};
-
-/* CAN gateway types */
-enum {
- CGW_TYPE_UNSPEC,
- CGW_TYPE_CAN_CAN, /* CAN->CAN routing */
- __CGW_TYPE_MAX
-};
-
-#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
-
-/* CAN rtnetlink attribute definitions */
-enum {
- CGW_UNSPEC,
- CGW_MOD_AND, /* CAN frame modification binary AND */
- CGW_MOD_OR, /* CAN frame modification binary OR */
- CGW_MOD_XOR, /* CAN frame modification binary XOR */
- CGW_MOD_SET, /* CAN frame modification set alternate values */
- CGW_CS_XOR, /* set data[] XOR checksum into data[index] */
- CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */
- CGW_HANDLED, /* number of handled CAN frames */
- CGW_DROPPED, /* number of dropped CAN frames */
- CGW_SRC_IF, /* ifindex of source network interface */
- CGW_DST_IF, /* ifindex of destination network interface */
- CGW_FILTER, /* specify struct can_filter on source CAN device */
- CGW_DELETED, /* number of deleted CAN frames (see max_hops param) */
- CGW_LIM_HOPS, /* limit the number of hops of this specific rule */
- __CGW_MAX
-};
-
-#define CGW_MAX (__CGW_MAX - 1)
-
-#define CGW_FLAGS_CAN_ECHO 0x01
-#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
-#define CGW_FLAGS_CAN_IIF_TX_OK 0x04
-
-#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
-
-/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
-#define CGW_MOD_ID 0x01
-#define CGW_MOD_DLC 0x02
-#define CGW_MOD_DATA 0x04
-
-#define CGW_FRAME_MODS 3 /* ID DLC DATA */
-
-#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
-
-struct cgw_frame_mod {
- struct can_frame cf;
- __u8 modtype;
-} __attribute__((packed));
-
-#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
-
-struct cgw_csum_xor {
- __s8 from_idx;
- __s8 to_idx;
- __s8 result_idx;
- __u8 init_xor_val;
-} __attribute__((packed));
-
-struct cgw_csum_crc8 {
- __s8 from_idx;
- __s8 to_idx;
- __s8 result_idx;
- __u8 init_crc_val;
- __u8 final_xor_val;
- __u8 crctab[256];
- __u8 profile;
- __u8 profile_data[20];
-} __attribute__((packed));
-
-/* length of checksum operation parameters. idx = index in CAN frame data[] */
-#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
-#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
-
-/* CRC8 profiles (compute CRC for additional data elements - see below) */
-enum {
- CGW_CRC8PRF_UNSPEC,
- CGW_CRC8PRF_1U8, /* compute one additional u8 value */
- CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */
- CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */
- __CGW_CRC8PRF_MAX
-};
-
-#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
-
-/*
- * CAN rtnetlink attribute contents in detail
- *
- * CGW_XXX_IF (length 4 bytes):
- * Sets an interface index for source/destination network interfaces.
- * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory.
- *
- * CGW_FILTER (length 8 bytes):
- * Sets a CAN receive filter for the gateway job specified by the
- * struct can_filter described in include/linux/can.h
- *
- * CGW_MOD_(AND|OR|XOR|SET) (length 17 bytes):
- * Specifies a modification that's done to a received CAN frame before it is
- * send out to the destination interface.
- *
- * <struct can_frame> data used as operator
- * <u8> affected CAN frame elements
- *
- * CGW_LIM_HOPS (length 1 byte):
- * Limit the number of hops of this specific rule. Usually the received CAN
- * frame can be processed as much as 'max_hops' times (which is given at module
- * load time of the can-gw module). This value is used to reduce the number of
- * possible hops for this gateway job to a value smaller then max_hops.
- *
- * CGW_CS_XOR (length 4 bytes):
- * Set a simple XOR checksum starting with an initial value into
- * data[result-idx] using data[start-idx] .. data[end-idx]
- *
- * The XOR checksum is calculated like this:
- *
- * xor = init_xor_val
- *
- * for (i = from_idx .. to_idx)
- * xor ^= can_frame.data[i]
- *
- * can_frame.data[ result_idx ] = xor
- *
- * CGW_CS_CRC8 (length 282 bytes):
- * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table,
- * a given initial value and a defined input data[start-idx] .. data[end-idx].
- * Finally the result value is XOR'ed with the final_xor_val.
- *
- * The CRC8 checksum is calculated like this:
- *
- * crc = init_crc_val
- *
- * for (i = from_idx .. to_idx)
- * crc = crctab[ crc ^ can_frame.data[i] ]
- *
- * can_frame.data[ result_idx ] = crc ^ final_xor_val
- *
- * The calculated CRC may contain additional source data elements that can be
- * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs
- * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf
- * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs)
- * that are used depending on counter values inside the CAN frame data[].
- * So far only three profiles have been implemented for illustration.
- *
- * Remark: In general the attribute data is a linear buffer.
- * Beware of sending unpacked or aligned structs!
- */
-
-#endif
diff --git a/include/socketcan/can/isotp.h b/include/socketcan/can/isotp.h
deleted file mode 100644
index 18d13d1..0000000
--- a/include/socketcan/can/isotp.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * socketcan/can/isotp.h
- *
- * Definitions for isotp CAN sockets
- *
- * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Copyright (c) 2008 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of Volkswagen nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * Alternatively, provided that this notice is retained in full, this
- * software may be distributed under the terms of the GNU General
- * Public License ("GPL") version 2, in which case the provisions of the
- * GPL apply INSTEAD OF those given above.
- *
- * The provided data structures and external interfaces from this code
- * are not restricted to be used by modules with a GPL compatible license.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
- * DAMAGE.
- *
- * Send feedback to <linux-can@vger.kernel.org>
- */
-
-#ifndef CAN_ISOTP_H
-#define CAN_ISOTP_H
-
-#include <linux/can.h>
-
-#define SOL_CAN_ISOTP (SOL_CAN_BASE + CAN_ISOTP)
-
-/* for socket options affecting the socket (not the global system) */
-
-#define CAN_ISOTP_OPTS 1 /* pass struct can_isotp_options */
-
-#define CAN_ISOTP_RECV_FC 2 /* pass struct can_isotp_fc_options */
-
-/* sockopts to force stmin timer values for protocol regression tests */
-
-#define CAN_ISOTP_TX_STMIN 3 /* pass __u32 value in nano secs */
- /* use this time instead of value */
- /* provided in FC from the receiver */
-
-#define CAN_ISOTP_RX_STMIN 4 /* pass __u32 value in nano secs */
- /* ignore received CF frames which */
- /* timestamps differ less than val */
-
-struct can_isotp_options {
-
- __u32 flags; /* set flags for isotp behaviour. */
- /* __u32 value : flags see below */
-
- __u32 frame_txtime; /* frame transmission time (N_As/N_Ar) */
- /* __u32 value : time in nano secs */
-
- __u8 ext_address; /* set address for extended addressing */
- /* __u8 value : extended address */
-
- __u8 txpad_content; /* set content of padding byte (tx) */
- /* __u8 value : content on tx path */
-
- __u8 rxpad_content; /* set content of padding byte (rx) */
- /* __u8 value : content on rx path */
-};
-
-struct can_isotp_fc_options {
-
- __u8 bs; /* blocksize provided in FC frame */
- /* __u8 value : blocksize. 0 = off */
-
- __u8 stmin; /* separation time provided in FC frame */
- /* __u8 value : */
- /* 0x00 - 0x7F : 0 - 127 ms */
- /* 0x80 - 0xF0 : reserved */
- /* 0xF1 - 0xF9 : 100 us - 900 us */
- /* 0xFA - 0xFF : reserved */
-
- __u8 wftmax; /* max. number of wait frame transmiss. */
- /* __u8 value : 0 = omit FC N_PDU WT */
-};
-
-
-/* flags for isotp behaviour */
-
-#define CAN_ISOTP_LISTEN_MODE 0x001 /* listen only (do not send FC) */
-#define CAN_ISOTP_EXTEND_ADDR 0x002 /* enable extended addressing */
-#define CAN_ISOTP_TX_PADDING 0x004 /* enable CAN frame padding tx path */
-#define CAN_ISOTP_RX_PADDING 0x008 /* enable CAN frame padding rx path */
-#define CAN_ISOTP_CHK_PAD_LEN 0x010 /* check received CAN frame padding */
-#define CAN_ISOTP_CHK_PAD_DATA 0x020 /* check received CAN frame padding */
-#define CAN_ISOTP_HALF_DUPLEX 0x040 /* half duplex error state handling */
-#define CAN_ISOTP_FORCE_TXSTMIN 0x080 /* ignore stmin from received FC */
-#define CAN_ISOTP_FORCE_RXSTMIN 0x100 /* ignore CFs depending on rx stmin */
-
-
-/* default values */
-
-#define CAN_ISOTP_DEFAULT_FLAGS 0
-#define CAN_ISOTP_DEFAULT_EXT_ADDRESS 0x00
-#define CAN_ISOTP_DEFAULT_RXPAD_CONTENT 0x00
-#define CAN_ISOTP_DEFAULT_TXPAD_CONTENT 0x00
-#define CAN_ISOTP_DEFAULT_FRAME_TXTIME 0
-#define CAN_ISOTP_DEFAULT_RECV_BS 0
-#define CAN_ISOTP_DEFAULT_RECV_STMIN 0x00
-#define CAN_ISOTP_DEFAULT_RECV_WFTMAX 0
-
-/*
- * Remark on CAN_ISOTP_DEFAULT_RECV_* values:
- *
- * We can strongly assume, that the Linux Kernel implementation of
- * CAN_ISOTP is capable to run with BS=0, STmin=0 and WFTmax=0.
- * But as we like to be able to behave as a commonly available ECU,
- * these default settings can be changed via sockopts.
- * For that reason the STmin value is intentionally _not_ checked for
- * consistency and copied directly into the flow control (FC) frame.
- *
- */
-
-#endif
diff --git a/include/socketcan/can/netlink.h b/include/socketcan/can/netlink.h
deleted file mode 100644
index 9bb47e3..0000000
--- a/include/socketcan/can/netlink.h
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * socketcan/can/netlink.h
- *
- * Definitions for the CAN netlink interface
- *
- * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
- *
- */
-
-#ifndef CAN_NETLINK_H
-#define CAN_NETLINK_H
-
-#include <linux/types.h>
-
-/*
- * CAN bit-timing parameters
- *
- * For further information, please read chapter "8 BIT TIMING
- * REQUIREMENTS" of the "Bosch CAN Specification version 2.0"
- * at http://www.semiconductors.bosch.de/pdf/can2spec.pdf.
- */
-struct can_bittiming {
- __u32 bitrate; /* Bit-rate in bits/second */
- __u32 sample_point; /* Sample point in one-tenth of a percent */
- __u32 tq; /* Time quanta (TQ) in nanoseconds */
- __u32 prop_seg; /* Propagation segment in TQs */
- __u32 phase_seg1; /* Phase buffer segment 1 in TQs */
- __u32 phase_seg2; /* Phase buffer segment 2 in TQs */
- __u32 sjw; /* Synchronisation jump width in TQs */
- __u32 brp; /* Bit-rate prescaler */
-};
-
-/*
- * CAN harware-dependent bit-timing constant
- *
- * Used for calculating and checking bit-timing parameters
- */
-struct can_bittiming_const {
- char name[16]; /* Name of the CAN controller hardware */
- __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */
- __u32 tseg1_max;
- __u32 tseg2_min; /* Time segement 2 = phase_seg2 */
- __u32 tseg2_max;
- __u32 sjw_max; /* Synchronisation jump width */
- __u32 brp_min; /* Bit-rate prescaler */
- __u32 brp_max;
- __u32 brp_inc;
-};
-
-/*
- * CAN clock parameters
- */
-struct can_clock {
- __u32 freq; /* CAN system clock frequency in Hz */
-};
-
-/*
- * CAN operational and error states
- */
-enum can_state {
- CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */
- CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */
- CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */
- CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */
- CAN_STATE_STOPPED, /* Device is stopped */
- CAN_STATE_SLEEPING, /* Device is sleeping */
- CAN_STATE_MAX
-};
-
-/*
- * CAN bus error counters
- */
-struct can_berr_counter {
- __u16 txerr;
- __u16 rxerr;
-};
-
-/*
- * CAN controller mode
- */
-struct can_ctrlmode {
- __u32 mask;
- __u32 flags;
-};
-
-#define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */
-#define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */
-#define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */
-#define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */
-#define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */
-
-/*
- * CAN device statistics
- */
-struct can_device_stats {
- __u32 bus_error; /* Bus errors */
- __u32 error_warning; /* Changes to error warning state */
- __u32 error_passive; /* Changes to error passive state */
- __u32 bus_off; /* Changes to bus off state */
- __u32 arbitration_lost; /* Arbitration lost errors */
- __u32 restarts; /* CAN controller re-starts */
-};
-
-/*
- * CAN netlink interface
- */
-enum {
- IFLA_CAN_UNSPEC,
- IFLA_CAN_BITTIMING,
- IFLA_CAN_BITTIMING_CONST,
- IFLA_CAN_CLOCK,
- IFLA_CAN_STATE,
- IFLA_CAN_CTRLMODE,
- IFLA_CAN_RESTART_MS,
- IFLA_CAN_RESTART,
- IFLA_CAN_BERR_COUNTER,
- __IFLA_CAN_MAX
-};
-
-#define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1)
-
-#endif /* CAN_NETLINK_H */
diff --git a/include/socketcan/can/raw.h b/include/socketcan/can/raw.h
deleted file mode 100644
index c80bff0..0000000
--- a/include/socketcan/can/raw.h
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * socketcan/can/raw.h
- *
- * Definitions for raw CAN sockets
- *
- * Authors: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
- * Urs Thuermann <urs.thuermann@volkswagen.de>
- * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
- * All rights reserved.
- *
- */
-
-#ifndef CAN_RAW_H
-#define CAN_RAW_H
-
-#include <linux/can.h>
-
-#define SOL_CAN_RAW (SOL_CAN_BASE + CAN_RAW)
-
-/* for socket options affecting the socket (not the global system) */
-
-enum {
- CAN_RAW_FILTER = 1, /* set 0 .. n can_filter(s) */
- CAN_RAW_ERR_FILTER, /* set filter for error frames */
- CAN_RAW_LOOPBACK, /* local loopback (default:on) */
- CAN_RAW_RECV_OWN_MSGS, /* receive my own msgs (default:off) */
- CAN_RAW_FD_FRAMES, /* allow CAN FD frames (default:off) */
-};
-
-#endif
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 06/10] include: fix paths mentioned in files
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (4 preceding siblings ...)
2014-01-21 12:59 ` [PATCH v7 05/10] include: Move all includes from include/socketcan " Marc Kleine-Budde
@ 2014-01-21 13:00 ` Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 07/10] include: can.h: remove unused include of version.h Marc Kleine-Budde
` (3 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 13:00 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
This patch fixes paths mentioned in the files which are wrong now, due the move
of the files in the previous patch.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/linux/can.h | 4 ++--
include/linux/can/bcm.h | 2 +-
include/linux/can/error.h | 2 +-
include/linux/can/gw.h | 2 +-
include/linux/can/netlink.h | 2 +-
include/linux/can/raw.h | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/include/linux/can.h b/include/linux/can.h
index 8452f0e..2f77ab3 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can.h
+ * linux/can.h
*
* Definitions for CAN network layer (socket addr / CAN frame / CAN filter)
*
@@ -45,7 +45,7 @@ typedef __u32 canid_t;
/*
* Controller Area Network Error Message Frame Mask structure
*
- * bit 0-28 : error class mask (see include/socketcan/can/error.h)
+ * bit 0-28 : error class mask (see include/linux/can/error.h)
* bit 29-31 : set to zero
*/
typedef __u32 can_err_mask_t;
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index f10af82..3ebe387 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can/bcm.h
+ * linux/can/bcm.h
*
* Definitions for CAN Broadcast Manager (BCM)
*
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index b65c231..7b7148b 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can/error.h
+ * linux/can/error.h
*
* Definitions of the CAN error messages to be filtered and passed to the user.
*
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
index f709809..a9d4363 100644
--- a/include/linux/can/gw.h
+++ b/include/linux/can/gw.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can/gw.h
+ * linux/can/gw.h
*
* Definitions for CAN frame Gateway/Router/Bridge
*
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 9bb47e3..14966dd 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can/netlink.h
+ * linux/can/netlink.h
*
* Definitions for the CAN netlink interface
*
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index c80bff0..a814062 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -1,5 +1,5 @@
/*
- * socketcan/can/raw.h
+ * linux/can/raw.h
*
* Definitions for raw CAN sockets
*
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 07/10] include: can.h: remove unused include of version.h
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (5 preceding siblings ...)
2014-01-21 13:00 ` [PATCH v7 06/10] include: fix paths mentioned in files Marc Kleine-Budde
@ 2014-01-21 13:00 ` Marc Kleine-Budde
2014-01-21 13:22 ` Uwe Kleine-König
2014-01-21 13:00 ` [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t Marc Kleine-Budde
` (2 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 13:00 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
This patch remove the include of version.h, as it's not used.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/linux/can.h | 1 -
1 file changed, 1 deletion(-)
diff --git a/include/linux/can.h b/include/linux/can.h
index 2f77ab3..5802cb3 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -13,7 +13,6 @@
#ifndef CAN_H
#define CAN_H
-#include <linux/version.h>
#include <linux/types.h>
#include <linux/socket.h>
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (6 preceding siblings ...)
2014-01-21 13:00 ` [PATCH v7 07/10] include: can.h: remove unused include of version.h Marc Kleine-Budde
@ 2014-01-21 13:00 ` Marc Kleine-Budde
2014-01-21 13:20 ` Uwe Kleine-König
2014-01-21 13:00 ` [PATCH v7 09/10] include: gw.h: update comment Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 10/10] include: import copyright information from the kernel Marc Kleine-Budde
9 siblings, 1 reply; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 13:00 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
This patch updates the comment about the introduction of __kernel_sa_family_t,
while there get rid of C++ commenting style.
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/linux/can.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/linux/can.h b/include/linux/can.h
index 5802cb3..e7b1029 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -122,8 +122,10 @@ struct canfd_frame {
#define SOL_CAN_BASE 100
-// typedef unsigned short __kernel_sa_family_t;
-// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
+/*
+ * typedef unsigned short __kernel_sa_family_t;
+ * introduced in Linux 3.1 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
+ */
/**
* struct sockaddr_can - the sockaddr structure for CAN sockets
@@ -133,7 +135,7 @@ struct canfd_frame {
*/
struct sockaddr_can {
sa_family_t can_family;
-// __kernel_sa_family_t can_family;
+ /* __kernel_sa_family_t can_family; */
int can_ifindex;
union {
/* transport protocol class address information (e.g. ISOTP) */
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 09/10] include: gw.h: update comment
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (7 preceding siblings ...)
2014-01-21 13:00 ` [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t Marc Kleine-Budde
@ 2014-01-21 13:00 ` Marc Kleine-Budde
2014-01-21 13:24 ` Uwe Kleine-König
2014-01-21 13:00 ` [PATCH v7 10/10] include: import copyright information from the kernel Marc Kleine-Budde
9 siblings, 1 reply; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 13:00 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
This comment was added to the kernel in patch:
391ac12 can: gw: add a per rule limitation of frame hops
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/linux/can/gw.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
index a9d4363..4e27c82 100644
--- a/include/linux/can/gw.h
+++ b/include/linux/can/gw.h
@@ -128,7 +128,7 @@ enum {
* Limit the number of hops of this specific rule. Usually the received CAN
* frame can be processed as much as 'max_hops' times (which is given at module
* load time of the can-gw module). This value is used to reduce the number of
- * possible hops for this gateway job to a value smaller then max_hops.
+ * possible hops for this gateway rule to a value smaller then max_hops.
*
* CGW_CS_XOR (length 4 bytes):
* Set a simple XOR checksum starting with an initial value into
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v7 10/10] include: import copyright information from the kernel
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
` (8 preceding siblings ...)
2014-01-21 13:00 ` [PATCH v7 09/10] include: gw.h: update comment Marc Kleine-Budde
@ 2014-01-21 13:00 ` Marc Kleine-Budde
9 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-21 13:00 UTC (permalink / raw)
To: linux-can; +Cc: Marc Kleine-Budde
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
include/linux/can.h | 32 ++++++++++++++++++++++++++++++++
include/linux/can/bcm.h | 32 ++++++++++++++++++++++++++++++++
include/linux/can/error.h | 32 ++++++++++++++++++++++++++++++++
include/linux/can/gw.h | 32 ++++++++++++++++++++++++++++++++
include/linux/can/netlink.h | 8 ++++++++
include/linux/can/raw.h | 32 ++++++++++++++++++++++++++++++++
6 files changed, 168 insertions(+)
diff --git a/include/linux/can.h b/include/linux/can.h
index e7b1029..4d44fc3 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -8,6 +8,38 @@
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
* All rights reserved.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*/
#ifndef CAN_H
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index 3ebe387..382251a 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -7,6 +7,38 @@
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
* All rights reserved.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*/
#ifndef CAN_BCM_H
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index 7b7148b..b632045 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -7,6 +7,38 @@
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
* All rights reserved.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*/
#ifndef CAN_ERROR_H
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
index 4e27c82..844c896 100644
--- a/include/linux/can/gw.h
+++ b/include/linux/can/gw.h
@@ -7,6 +7,38 @@
* Copyright (c) 2011 Volkswagen Group Electronic Research
* All rights reserved.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*/
#ifndef CAN_GW_H
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 14966dd..df944ed 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -5,6 +5,14 @@
*
* Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the version 2 of the GNU General Public License
+ * as published by the Free Software Foundation
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
*/
#ifndef CAN_NETLINK_H
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index a814062..c7d8c33 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -8,6 +8,38 @@
* Copyright (c) 2002-2007 Volkswagen Group Electronic Research
* All rights reserved.
*
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of Volkswagen nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * Alternatively, provided that this notice is retained in full, this
+ * software may be distributed under the terms of the GNU General
+ * Public License ("GPL") version 2, in which case the provisions of the
+ * GPL apply INSTEAD OF those given above.
+ *
+ * The provided data structures and external interfaces from this code
+ * are not restricted to be used by modules with a GPL compatible license.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
+ * DAMAGE.
*/
#ifndef CAN_RAW_H
--
1.8.5.2
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-21 13:00 ` [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t Marc Kleine-Budde
@ 2014-01-21 13:20 ` Uwe Kleine-König
2014-01-21 14:28 ` Oliver Hartkopp
0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2014-01-21 13:20 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: linux-can
Hello Marc,
On Tue, Jan 21, 2014 at 02:00:02PM +0100, Marc Kleine-Budde wrote:
> This patch updates the comment about the introduction of __kernel_sa_family_t,
> while there get rid of C++ commenting style.
>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> include/linux/can.h | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/include/linux/can.h b/include/linux/can.h
> index 5802cb3..e7b1029 100644
> --- a/include/linux/can.h
> +++ b/include/linux/can.h
> @@ -122,8 +122,10 @@ struct canfd_frame {
>
> #define SOL_CAN_BASE 100
>
> -// typedef unsigned short __kernel_sa_family_t;
> -// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
> +/*
> + * typedef unsigned short __kernel_sa_family_t;
> + * introduced in Linux 3.1 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
> + */
I'd make this:
-// typedef unsigned short __kernel_sa_family_t;
-// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
+/*
+ * This typedef was introduced in Linux v3.1-rc2
+ * (commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c) in <linux/socket.h>.
+ * It must be duplicated here to make the can headers self-contained.
+ */
+ typedef unsigned short __kernel_sa_family_t;
and then drop the following hunk. That should work as intended also on
systems that have kernel headers newer than v3.1-rc2 because a
duplicated typedef shouldn't hurt. (Note I didn't test that or tried to
find a proof in my C book.)
Best regards
Uwe
> /**
> * struct sockaddr_can - the sockaddr structure for CAN sockets
> @@ -133,7 +135,7 @@ struct canfd_frame {
> */
> struct sockaddr_can {
> sa_family_t can_family;
> -// __kernel_sa_family_t can_family;
> + /* __kernel_sa_family_t can_family; */
> int can_ifindex;
> union {
> /* transport protocol class address information (e.g. ISOTP) */
> --
> 1.8.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 07/10] include: can.h: remove unused include of version.h
2014-01-21 13:00 ` [PATCH v7 07/10] include: can.h: remove unused include of version.h Marc Kleine-Budde
@ 2014-01-21 13:22 ` Uwe Kleine-König
2014-01-21 14:33 ` Oliver Hartkopp
0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2014-01-21 13:22 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: linux-can
On Tue, Jan 21, 2014 at 02:00:01PM +0100, Marc Kleine-Budde wrote:
> This patch remove the include of version.h, as it's not used.
>
Maybe point out that this #include is also missing in the kernel and so
this drops another difference that need to be cared for when syncing the
kernel headers into can-utils.
Uwe
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> include/linux/can.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/include/linux/can.h b/include/linux/can.h
> index 2f77ab3..5802cb3 100644
> --- a/include/linux/can.h
> +++ b/include/linux/can.h
> @@ -13,7 +13,6 @@
> #ifndef CAN_H
> #define CAN_H
>
> -#include <linux/version.h>
> #include <linux/types.h>
> #include <linux/socket.h>
>
> --
> 1.8.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 09/10] include: gw.h: update comment
2014-01-21 13:00 ` [PATCH v7 09/10] include: gw.h: update comment Marc Kleine-Budde
@ 2014-01-21 13:24 ` Uwe Kleine-König
2014-01-21 14:41 ` Oliver Hartkopp
0 siblings, 1 reply; 22+ messages in thread
From: Uwe Kleine-König @ 2014-01-21 13:24 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: linux-can
On Tue, Jan 21, 2014 at 02:00:03PM +0100, Marc Kleine-Budde wrote:
> This comment was added to the kernel in patch:
>
> 391ac12 can: gw: add a per rule limitation of frame hops
The corresponding can-utils commit is:
ad7f44095ac3 (cangw: add an option for the per rule limitation of frame hops)
which somehow introduced the difference even though it referenced commit
391ac12.
Best regards
Uwe
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
> include/linux/can/gw.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
> index a9d4363..4e27c82 100644
> --- a/include/linux/can/gw.h
> +++ b/include/linux/can/gw.h
> @@ -128,7 +128,7 @@ enum {
> * Limit the number of hops of this specific rule. Usually the received CAN
> * frame can be processed as much as 'max_hops' times (which is given at module
> * load time of the can-gw module). This value is used to reduce the number of
> - * possible hops for this gateway job to a value smaller then max_hops.
> + * possible hops for this gateway rule to a value smaller then max_hops.
> *
> * CGW_CS_XOR (length 4 bytes):
> * Set a simple XOR checksum starting with an initial value into
> --
> 1.8.5.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-21 13:20 ` Uwe Kleine-König
@ 2014-01-21 14:28 ` Oliver Hartkopp
2014-01-23 13:18 ` Oliver Hartkopp
0 siblings, 1 reply; 22+ messages in thread
From: Oliver Hartkopp @ 2014-01-21 14:28 UTC (permalink / raw)
To: Uwe Kleine-König, Marc Kleine-Budde; +Cc: linux-can
On 21.01.2014 14:20, Uwe Kleine-König wrote:
> Hello Marc,
>
> On Tue, Jan 21, 2014 at 02:00:02PM +0100, Marc Kleine-Budde wrote:
> I'd make this:
>
> -// typedef unsigned short __kernel_sa_family_t;
> -// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
> +/*
> + * This typedef was introduced in Linux v3.1-rc2
> + * (commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c) in <linux/socket.h>.
> + * It must be duplicated here to make the can headers self-contained.
> + */
> + typedef unsigned short __kernel_sa_family_t;
>
> and then drop the following hunk. That should work as intended also on
> systems that have kernel headers newer than v3.1-rc2 because a
> duplicated typedef shouldn't hurt. (Note I didn't test that or tried to
> find a proof in my C book.)
>
Good idea!
I double checked this by simply adding two identical typedefs:
--- a/include/socketcan/can.h
+++ b/include/socketcan/can.h
@@ -126,6 +126,10 @@ struct canfd_frame {
// typedef unsigned short __kernel_sa_family_t;
// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
+
+typedef unsigned short __kernel_sa_family_t;
+typedef unsigned short __kernel_sa_family_t;
+
/**
* struct sockaddr_can - the sockaddr structure for CAN sockets
* @can_family: address family number AF_CAN.
It compiles without problems (and warnings).
Tnx!
Oliver
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 07/10] include: can.h: remove unused include of version.h
2014-01-21 13:22 ` Uwe Kleine-König
@ 2014-01-21 14:33 ` Oliver Hartkopp
0 siblings, 0 replies; 22+ messages in thread
From: Oliver Hartkopp @ 2014-01-21 14:33 UTC (permalink / raw)
To: Uwe Kleine-König, Marc Kleine-Budde; +Cc: linux-can
On 21.01.2014 14:22, Uwe Kleine-König wrote:
> On Tue, Jan 21, 2014 at 02:00:01PM +0100, Marc Kleine-Budde wrote:
>> This patch remove the include of version.h, as it's not used.
>>
> Maybe point out that this #include is also missing in the kernel and so
> this drops another difference that need to be cared for when syncing the
> kernel headers into can-utils.
The version stuff was only needed for some kernel internal code in can-modules.
For can-utils we always have a proper userspace API where the latest and
greatest is the best to get.
So just dropping off that line is fine.
Regards,
Oliver
>
> Uwe
>> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
>> ---
>> include/linux/can.h | 1 -
>> 1 file changed, 1 deletion(-)
>>
>> diff --git a/include/linux/can.h b/include/linux/can.h
>> index 2f77ab3..5802cb3 100644
>> --- a/include/linux/can.h
>> +++ b/include/linux/can.h
>> @@ -13,7 +13,6 @@
>> #ifndef CAN_H
>> #define CAN_H
>>
>> -#include <linux/version.h>
>> #include <linux/types.h>
>> #include <linux/socket.h>
>>
>> --
>> 1.8.5.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-can" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 09/10] include: gw.h: update comment
2014-01-21 13:24 ` Uwe Kleine-König
@ 2014-01-21 14:41 ` Oliver Hartkopp
0 siblings, 0 replies; 22+ messages in thread
From: Oliver Hartkopp @ 2014-01-21 14:41 UTC (permalink / raw)
To: Uwe Kleine-König, Marc Kleine-Budde; +Cc: linux-can
On 21.01.2014 14:24, Uwe Kleine-König wrote:
> On Tue, Jan 21, 2014 at 02:00:03PM +0100, Marc Kleine-Budde wrote:
>> This comment was added to the kernel in patch:
>>
>> 391ac12 can: gw: add a per rule limitation of frame hops
> The corresponding can-utils commit is:
>
> ad7f44095ac3 (cangw: add an option for the per rule limitation of frame hops)
>
> which somehow introduced the difference even though it referenced commit
> 391ac12.
>
Ugh.
I obviously did this small change before posting the upstream patch.
Now it get's back to the correct kernel header source.
Tnx.
Oliver
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-21 14:28 ` Oliver Hartkopp
@ 2014-01-23 13:18 ` Oliver Hartkopp
2014-01-23 13:19 ` Marc Kleine-Budde
0 siblings, 1 reply; 22+ messages in thread
From: Oliver Hartkopp @ 2014-01-23 13:18 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: Uwe Kleine-König, linux-can
Hi Marc,
would you like to apply the include cleanup series too after changing this
point below - following the suggestion from Uwe?
Regards,
Oliver
On 21.01.2014 15:28, Oliver Hartkopp wrote:
>
>
> On 21.01.2014 14:20, Uwe Kleine-König wrote:
>> Hello Marc,
>>
>> On Tue, Jan 21, 2014 at 02:00:02PM +0100, Marc Kleine-Budde wrote:
>
>
>> I'd make this:
>>
>> -// typedef unsigned short __kernel_sa_family_t;
>> -// introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
>> +/*
>> + * This typedef was introduced in Linux v3.1-rc2
>> + * (commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c) in <linux/socket.h>.
>> + * It must be duplicated here to make the can headers self-contained.
>> + */
>> + typedef unsigned short __kernel_sa_family_t;
>>
>> and then drop the following hunk. That should work as intended also on
>> systems that have kernel headers newer than v3.1-rc2 because a
>> duplicated typedef shouldn't hurt. (Note I didn't test that or tried to
>> find a proof in my C book.)
>>
>
> Good idea!
>
> I double checked this by simply adding two identical typedefs:
>
> --- a/include/socketcan/can.h
> +++ b/include/socketcan/can.h
> @@ -126,6 +126,10 @@ struct canfd_frame {
> // typedef unsigned short __kernel_sa_family_t;
> // introduced in Linux 3.2 commit 6602a4baf4d1a73cc4685a39ef859e1c5ddf654c
>
> +
> +typedef unsigned short __kernel_sa_family_t;
> +typedef unsigned short __kernel_sa_family_t;
> +
> /**
> * struct sockaddr_can - the sockaddr structure for CAN sockets
> * @can_family: address family number AF_CAN.
>
> It compiles without problems (and warnings).
>
> Tnx!
>
> Oliver
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-can" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-23 13:18 ` Oliver Hartkopp
@ 2014-01-23 13:19 ` Marc Kleine-Budde
2014-01-23 13:24 ` Marc Kleine-Budde
0 siblings, 1 reply; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-23 13:19 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Uwe Kleine-König, linux-can
[-- Attachment #1: Type: text/plain, Size: 531 bytes --]
On 01/23/2014 02:18 PM, Oliver Hartkopp wrote:
> Hi Marc,
>
> would you like to apply the include cleanup series too after changing this
> point below - following the suggestion from Uwe?
Yes, I'm currently working through the comments.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-23 13:19 ` Marc Kleine-Budde
@ 2014-01-23 13:24 ` Marc Kleine-Budde
2014-01-23 13:36 ` Oliver Hartkopp
0 siblings, 1 reply; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-23 13:24 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Uwe Kleine-König, linux-can
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
On 01/23/2014 02:19 PM, Marc Kleine-Budde wrote:
> On 01/23/2014 02:18 PM, Oliver Hartkopp wrote:
>> Hi Marc,
>>
>> would you like to apply the include cleanup series too after changing this
>> point below - following the suggestion from Uwe?
>
> Yes, I'm currently working through the comments.
done.
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-23 13:24 ` Marc Kleine-Budde
@ 2014-01-23 13:36 ` Oliver Hartkopp
2014-01-23 13:39 ` Marc Kleine-Budde
0 siblings, 1 reply; 22+ messages in thread
From: Oliver Hartkopp @ 2014-01-23 13:36 UTC (permalink / raw)
To: Marc Kleine-Budde; +Cc: Uwe Kleine-König, linux-can
Great!
I fixed the path from socketcan/can/isotp.h to linux/can/isotp.h .
Already pushed to master.
Tnx to both of you for the effort.
Oliver
On 23.01.2014 14:24, Marc Kleine-Budde wrote:
> On 01/23/2014 02:19 PM, Marc Kleine-Budde wrote:
>> On 01/23/2014 02:18 PM, Oliver Hartkopp wrote:
>>> Hi Marc,
>>>
>>> would you like to apply the include cleanup series too after changing this
>>> point below - following the suggestion from Uwe?
>>
>> Yes, I'm currently working through the comments.
>
> done.
>
> Marc
>
>
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t
2014-01-23 13:36 ` Oliver Hartkopp
@ 2014-01-23 13:39 ` Marc Kleine-Budde
0 siblings, 0 replies; 22+ messages in thread
From: Marc Kleine-Budde @ 2014-01-23 13:39 UTC (permalink / raw)
To: Oliver Hartkopp; +Cc: Uwe Kleine-König, linux-can
[-- Attachment #1: Type: text/plain, Size: 440 bytes --]
On 01/23/2014 02:36 PM, Oliver Hartkopp wrote:
> I fixed the path from socketcan/can/isotp.h to linux/can/isotp.h .
> Already pushed to master.
Tnx,
Marc
--
Pengutronix e.K. | Marc Kleine-Budde |
Industrial Linux Solutions | Phone: +49-231-2826-924 |
Vertretung West/Dortmund | Fax: +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686 | http://www.pengutronix.de |
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 242 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2014-01-23 13:39 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-21 12:59 [PATCH v7 00/10] License cleanup Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 01/10] include: Remove two unused header files Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 02/10] ioctl.h: drop unused header Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 03/10] isotp.h: add explicit license information Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 04/10] include/socketcan: prepare headers to be moved to include/linux Marc Kleine-Budde
2014-01-21 12:59 ` [PATCH v7 05/10] include: Move all includes from include/socketcan " Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 06/10] include: fix paths mentioned in files Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 07/10] include: can.h: remove unused include of version.h Marc Kleine-Budde
2014-01-21 13:22 ` Uwe Kleine-König
2014-01-21 14:33 ` Oliver Hartkopp
2014-01-21 13:00 ` [PATCH v7 08/10] include: can.h: update comment about introduction of __kernel_sa_family_t Marc Kleine-Budde
2014-01-21 13:20 ` Uwe Kleine-König
2014-01-21 14:28 ` Oliver Hartkopp
2014-01-23 13:18 ` Oliver Hartkopp
2014-01-23 13:19 ` Marc Kleine-Budde
2014-01-23 13:24 ` Marc Kleine-Budde
2014-01-23 13:36 ` Oliver Hartkopp
2014-01-23 13:39 ` Marc Kleine-Budde
2014-01-21 13:00 ` [PATCH v7 09/10] include: gw.h: update comment Marc Kleine-Budde
2014-01-21 13:24 ` Uwe Kleine-König
2014-01-21 14:41 ` Oliver Hartkopp
2014-01-21 13:00 ` [PATCH v7 10/10] include: import copyright information from the kernel Marc Kleine-Budde
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).