All of lore.kernel.org
 help / color / mirror / Atom feed
* license issues of can-utils
@ 2013-08-17 19:05 Uwe Kleine-König
  2013-08-17 20:24 ` Marc Kleine-Budde
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
  0 siblings, 2 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2013-08-17 19:05 UTC (permalink / raw)
  To: linux-can; +Cc: Robert Haddon, Oliver Hartkopp

Hello,

I started to create a Debian package for can-utils and while looking
through the source files to collect their copyright and license
information, I noticed two things that probably need fixing before a
can-utils package can enter Debian.

a) slcand.c claims to be licensed under both GPL and GFDL-NIV. These two
licenses are not compatible though (according to some Debian people in
#debian-ftp) and so are not distributable.
Obvious solutions are:

	- rm slcand.c (and optionally rewrite it); or
	- find out which parts are affected by GFDL-NIV and just
	  substitute these; or
	- look at the wikipedia template and judge it to be that little
	  creative to allow dropping GFDL-NIV (IANAL, but I guess that
	  is hardly possible, looking at
	  https://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&oldid=280005270#Sample_Program_in_C_on_Linux)

b) several headers below include/socketcan/can have a copyright but no
license. I think the best approach here (as also suggested by Marc in a
private discussion) is to fix the original headers in the kernel and
then copy these back into can-utils. I assume the standard boilerplate
with BSD-3-Clause + GPL-2 is the desired addition? If yes I can prepare
a patch.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: license issues of can-utils
  2013-08-17 19:05 license issues of can-utils Uwe Kleine-König
@ 2013-08-17 20:24 ` Marc Kleine-Budde
  2013-08-18 10:26   ` Oliver Hartkopp
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
  1 sibling, 1 reply; 41+ messages in thread
From: Marc Kleine-Budde @ 2013-08-17 20:24 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Robert Haddon, Oliver Hartkopp

[-- Attachment #1: Type: text/plain, Size: 1830 bytes --]

On 08/17/2013 09:05 PM, Uwe Kleine-König wrote:
> I started to create a Debian package for can-utils and while looking
> through the source files to collect their copyright and license
> information, I noticed two things that probably need fixing before a
> can-utils package can enter Debian.

[...]

> b) several headers below include/socketcan/can have a copyright but no
> license. I think the best approach here (as also suggested by Marc in a
> private discussion) is to fix the original headers in the kernel and
> then copy these back into can-utils. I assume the standard boilerplate
> with BSD-3-Clause + GPL-2 is the desired addition? If yes I can prepare
> a patch.

tl;dr IANAL: netlink.h GPL, all others DUAL BSD/GPL.

Marc

We're talking about the uapi can headers which are:

include/uapi/linux/can/error.h		added with initial code which is Dual BSD/GPL

Copyright by VW, Author Oliver.


include/uapi/linux/can.h		added with initial code which is Dual BSD/GPL
include/uapi/linux/can/raw.h		added with initial code which is Dual BSD/GPL

Both copyright by VW, Author Oliver and Urs.


include/uapi/linux/can/bcm.h		bcm.c has MODULE_LICENSE("Dual BSD/GPL");
include/uapi/linux/can/gw.h		gw.c has MODULE_LICENSE("Dual BSD/GPL")

Both copyright by VW, Author Oliver.


include/uapi/linux/can/netlink.h	was added by Wolfgang Grandegger:
  39549ee can: CAN Network device driver and Netlink interface
dev.c holds the netlink parsing code which has MODULE_LICENSE("GPL v2");

Copyright by Wolfgang.

-- 
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: 259 bytes --]

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: license issues of can-utils
  2013-08-17 20:24 ` Marc Kleine-Budde
@ 2013-08-18 10:26   ` Oliver Hartkopp
  0 siblings, 0 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2013-08-18 10:26 UTC (permalink / raw)
  To: Marc Kleine-Budde, Uwe Kleine-König; +Cc: linux-can, Robert Haddon

On 17.08.2013 22:24, Marc Kleine-Budde wrote:
> On 08/17/2013 09:05 PM, Uwe Kleine-König wrote:
>> I started to create a Debian package for can-utils and while looking
>> through the source files to collect their copyright and license
>> information, I noticed two things that probably need fixing before a
>> can-utils package can enter Debian.
> 

Which is a good idea :-)

> 
>> b) several headers below include/socketcan/can have a copyright but no
>> license. I think the best approach here (as also suggested by Marc in a
>> private discussion) is to fix the original headers in the kernel and
>> then copy these back into can-utils. I assume the standard boilerplate
>> with BSD-3-Clause + GPL-2 is the desired addition? If yes I can prepare
>> a patch.
> 
> tl;dr IANAL: netlink.h GPL, all others DUAL BSD/GPL.

Yep.

When intentionally putting the 'missing license' in the header files we just
oriented to other header files, where a more detailed license was only
provided in the C files.

Btw. when reworking the license information in the header files I would
suggest to take the version which was checked by our lawyer - which is e.g. in
linux/net/can/raw.c

It has parts of BSD and alternatively refers to GPLv2. And it's not too long.

Does this fit the Debian requirements?

Tnx & brest regards,
Oliver


> 
> We're talking about the uapi can headers which are:
> 
> include/uapi/linux/can/error.h		added with initial code which is Dual BSD/GPL
> 
> Copyright by VW, Author Oliver.
> 
> 
> include/uapi/linux/can.h		added with initial code which is Dual BSD/GPL
> include/uapi/linux/can/raw.h		added with initial code which is Dual BSD/GPL
> 
> Both copyright by VW, Author Oliver and Urs.
> 
> 
> include/uapi/linux/can/bcm.h		bcm.c has MODULE_LICENSE("Dual BSD/GPL");
> include/uapi/linux/can/gw.h		gw.c has MODULE_LICENSE("Dual BSD/GPL")
> 
> Both copyright by VW, Author Oliver.
> 
> 
> include/uapi/linux/can/netlink.h	was added by Wolfgang Grandegger:
>   39549ee can: CAN Network device driver and Netlink interface
> dev.c holds the netlink parsing code which has MODULE_LICENSE("GPL v2");
> 
> Copyright by Wolfgang.
> 


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils 0/3] License cleanup
  2013-08-17 19:05 license issues of can-utils Uwe Kleine-König
  2013-08-17 20:24 ` Marc Kleine-Budde
@ 2014-01-11 23:10 ` Uwe Kleine-König
  2014-01-11 23:10   ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
                     ` (3 more replies)
  1 sibling, 4 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-11 23:10 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

Hello,

this series fixes all license issues I identified back in August last
year and so opens the possibility to create a Debian package for
can-utils.

Uwe Kleine-König (3):
  Update license information for some header files
  ioctl.h: drop unused header
  slcand: remove program as it is undistributable

 .gitignore                      |   1 -
 Android.mk                      |  14 --
 GNUmakefile.am                  |   2 -
 Makefile                        |   2 +-
 include/socketcan/can/bcm.h     |  32 +++
 include/socketcan/can/error.h   |  32 +++
 include/socketcan/can/gw.h      |  32 +++
 include/socketcan/can/ioctl.h   |  99 --------
 include/socketcan/can/netlink.h |   8 +
 include/socketcan/can/raw.h     |  32 +++
 slcand.c                        | 503 ----------------------------------------
 11 files changed, 137 insertions(+), 620 deletions(-)
 delete mode 100644 include/socketcan/can/ioctl.h
 delete mode 100644 slcand.c

-- 
1.8.5.2


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils 1/3] Update license information for some header files
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
@ 2014-01-11 23:10   ` Uwe Kleine-König
  2014-01-12 10:09     ` Oliver Hartkopp
  2014-01-11 23:10   ` [PATCH can-utils 2/3] ioctl.h: drop unused header Uwe Kleine-König
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-11 23:10 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

This corresponds to Linux commits
  2485602f1af2 (can: add explicit copyrights to can headers)
  1c2da13c21a1 (can: add explicit copyrights to can's netlink header)
---
Hello,

I would have expected to just need to do something like:

cd $path_to_canutils
rm -r include/socketcan/can
cd $path_to_linux
git archive --format=tar --prefix=socketcan/can/ v3.13-rc7:include/uapi/linux/can | tar xC $path_to_canutils/include
git cat-file blob v3.13-rc7:include/uapi/linux/can.h > $path_to_canutils/include/socketcan/can.h

to sync the header files. I didn't test but some changes introduced by
the above sequence seem to be uncompilable so I choosed to only
cherry-pick the two Linux commits. IMHO this is a bug (in Linux or
can-utils or maybe both).

Best regards
Uwe

 include/socketcan/can/bcm.h     | 32 ++++++++++++++++++++++++++++++++
 include/socketcan/can/error.h   | 32 ++++++++++++++++++++++++++++++++
 include/socketcan/can/gw.h      | 32 ++++++++++++++++++++++++++++++++
 include/socketcan/can/netlink.h |  8 ++++++++
 include/socketcan/can/raw.h     | 32 ++++++++++++++++++++++++++++++++
 5 files changed, 136 insertions(+)

diff --git a/include/socketcan/can/bcm.h b/include/socketcan/can/bcm.h
index 10185e86a596..5cd07152cd45 100644
--- a/include/socketcan/can/bcm.h
+++ b/include/socketcan/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/socketcan/can/error.h b/include/socketcan/can/error.h
index b65c2317b40a..923c65c32e0f 100644
--- a/include/socketcan/can/error.h
+++ b/include/socketcan/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/socketcan/can/gw.h b/include/socketcan/can/gw.h
index 56d3246d7348..7f67c62a688a 100644
--- a/include/socketcan/can/gw.h
+++ b/include/socketcan/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/socketcan/can/netlink.h b/include/socketcan/can/netlink.h
index 9bb47e31748e..d97cb0d6ee4a 100644
--- a/include/socketcan/can/netlink.h
+++ b/include/socketcan/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/socketcan/can/raw.h b/include/socketcan/can/raw.h
index ee683c58412b..76fe9ecf45d5 100644
--- a/include/socketcan/can/raw.h
+++ b/include/socketcan/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] 41+ messages in thread

* [PATCH can-utils 2/3] ioctl.h: drop unused header
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
  2014-01-11 23:10   ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
@ 2014-01-11 23:10   ` Uwe Kleine-König
  2014-01-12 10:18     ` Oliver Hartkopp
  2014-01-11 23:10   ` [PATCH can-utils 3/3] slcand: remove program as it is undistributable Uwe Kleine-König
  2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
  3 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-11 23:10 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

This header doesn't exist in the Linux tree and it's unused by can-utils,
so drop it. As a side effect this fixes the last file not specifying any
license and/or copyright information.
---
 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 fc8f6e73e139..8c18e72794fa 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -23,7 +23,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 ab34e8918667..000000000000
--- 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] 41+ messages in thread

* [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
  2014-01-11 23:10   ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
  2014-01-11 23:10   ` [PATCH can-utils 2/3] ioctl.h: drop unused header Uwe Kleine-König
@ 2014-01-11 23:10   ` Uwe Kleine-König
  2014-01-11 23:38     ` Yegor Yefremov
  2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
  3 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-11 23:10 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
These two licenses are incompatible which makes this file undistributable.
The clean way to fix this is to remove the file and reimplement its
functionality under a valid license when need arises.
---
 .gitignore     |   1 -
 Android.mk     |  14 --
 GNUmakefile.am |   1 -
 Makefile       |   2 +-
 slcand.c       | 503 ---------------------------------------------------------
 5 files changed, 1 insertion(+), 520 deletions(-)
 delete mode 100644 slcand.c

diff --git a/.gitignore b/.gitignore
index 746b676fbf67..ce93351e80b6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -42,7 +42,6 @@ GNUmakefile.in
 /log2asc
 /log2long
 /slcan_attach
-/slcand
 /slcanpty
 
 /can-utils-*.tar.bz2
diff --git a/Android.mk b/Android.mk
index ffac95720758..25bc96bb6e66 100755
--- a/Android.mk
+++ b/Android.mk
@@ -307,20 +307,6 @@ LOCAL_CFLAGS := $(PRIVATE_LOCAL_CFLAGS)
 include $(BUILD_EXECUTABLE)
 
 #
-# slcand
-#
-
-include $(CLEAR_VARS)
-
-LOCAL_SRC_FILES := slcand.c
-LOCAL_MODULE := slcand
-LOCAL_MODULE_TAGS := optional
-LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
-LOCAL_CFLAGS := $(PRIVATE_LOCAL_CFLAGS)
-
-include $(BUILD_EXECUTABLE)
-
-#
 # slcanpty
 #
 
diff --git a/GNUmakefile.am b/GNUmakefile.am
index 8c18e72794fa..26098b82b3da 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -57,7 +57,6 @@ bin_PROGRAMS = \
 	log2asc \
 	log2long \
 	slcan_attach \
-	slcand \
 	slcanpty
 
 EXTRA_DIST = \
diff --git a/Makefile b/Makefile
index 2f79ee78ac28..0968c16a7e0d 100644
--- a/Makefile
+++ b/Makefile
@@ -51,7 +51,7 @@ CFLAGS    = -O2 -Wall -Wno-parentheses -Iinclude \
 
 PROGRAMS_ISOTP = isotpdump isotprecv isotpsend isotpsniffer isotptun isotpserver
 PROGRAMS_CANGW = cangw
-PROGRAMS_SLCAN = slcan_attach slcand
+PROGRAMS_SLCAN = slcan_attach
 PROGRAMS = can-calc-bit-timing candump cansniffer cansend canplayer cangen canbusload\
 	   log2long log2asc asc2log\
 	   canlogserver bcmserver\
diff --git a/slcand.c b/slcand.c
deleted file mode 100644
index 30f5127f8cd8..000000000000
--- a/slcand.c
+++ /dev/null
@@ -1,503 +0,0 @@
-/*
- * slcand.c - userspace daemon for serial line CAN interface driver SLCAN
- *
- * Copyright (c) 2009 Robert Haddon <robert.haddon@verari.com>
- * Copyright (c) 2009 Verari Systems Inc.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * 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.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- *
- * This code is derived from an example daemon code from
- *
- * http://en.wikipedia.org/wiki/Daemon_(computer_software)#Sample_Program_in_C_on_Linux
- * (accessed 2009-05-05)
- *
- * So it is additionally licensed under the GNU Free Documentation License:
- *
- * Permission is granted to copy, distribute and/or modify this document
- * under the terms of the GNU Free Documentation License, Version 1.2
- * or any later version published by the Free Software Foundation;
- * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
- * A copy of the license is included in the section entitled "GNU
- * Free Documentation License".
- *
- * Send feedback to <linux-can@vger.kernel.org>
- *
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <syslog.h>
-#include <errno.h>
-#include <pwd.h>
-#include <signal.h>
-#include <sys/ioctl.h>
-#include <net/if.h>
-#include <termios.h>
-
-/* default slcan line discipline since Kernel 2.6.25 */
-#define LDISC_N_SLCAN 17
-
-/* Change this to whatever your daemon is called */
-#define DAEMON_NAME "slcand"
-
-/* Change this to the user under which to run */
-#define RUN_AS_USER "root"
-
-/* The length of ttypath buffer */
-#define TTYPATH_LENGTH	64
-
-/* The length of pidfile name buffer */
-#define PIDFILE_LENGTH	64
-
-#define EXIT_SUCCESS 0
-#define EXIT_FAILURE 1
-
-void print_usage(char *prg)
-{
-	fprintf(stderr, "\nUsage: %s [options] <tty> [canif-name]\n\n", prg);
-	fprintf(stderr, "Options: -o         (send open command 'O\\r')\n");
-	fprintf(stderr, "         -c         (send close command 'C\\r')\n");
-	fprintf(stderr, "         -f         (read status flags with 'F\\r' to reset error states)\n");
-	fprintf(stderr, "         -s <speed> (set CAN speed 0..8)\n");
-	fprintf(stderr, "         -S <speed> (set UART speed in baud)\n");
-	fprintf(stderr, "         -b <btr>   (set bit time register value)\n");
-	fprintf(stderr, "         -F         (stay in foreground; no daemonize)\n");
-	fprintf(stderr, "         -h         (show this help page)\n");
-	fprintf(stderr, "\nExamples:\n");
-	fprintf(stderr, "slcand -o -c -f -s6 ttyslcan0\n");
-	fprintf(stderr, "slcand -o -c -f -s6 ttyslcan0 can0\n");
-	fprintf(stderr, "\n");
-	exit(EXIT_FAILURE);
-}
-
-static int slcand_running;
-static int exit_code;
-static char ttypath[TTYPATH_LENGTH];
-static char pidfile[PIDFILE_LENGTH];
-
-static void child_handler(int signum)
-{
-	switch (signum) {
-
-	case SIGUSR1:
-		/* exit parent */
-		exit(EXIT_SUCCESS);
-		break;
-	case SIGALRM:
-	case SIGCHLD:
-		syslog(LOG_NOTICE, "received signal %i on %s", signum, ttypath);
-		exit_code = EXIT_FAILURE;
-		slcand_running = 0;
-		break;
-	case SIGINT:
-	case SIGTERM:
-		syslog(LOG_NOTICE, "received signal %i on %s", signum, ttypath);
-		exit_code = EXIT_SUCCESS;
-		slcand_running = 0;
-		break;
-	}
-}
-
-static int look_up_uart_speed(long int s)
-{
-	switch (s) {
-
-	case 9600:
-		return B9600;
-	case 19200:
-		return B19200;
-	case 38400:
-		return B38400;
-	case 57600:
-		return B57600;
-	case 115200:
-		return B115200;
-	case 230400:
-		return B230400;
-	case 460800:
-		return B460800;
-	case 500000:
-		return B500000;
-	case 576000:
-		return B576000;
-	case 921600:
-		return B921600;
-	case 1000000:
-		return B1000000;
-	case 1152000:
-		return B1152000;
-	case 1500000:
-		return B1500000;
-	case 2000000:
-		return B2000000;
-#ifdef B2500000
-	case 2500000:
-		return B2500000;
-#endif
-#ifdef B3000000
-	case 3000000:
-		return B3000000;
-#endif
-#ifdef B3500000
-	case 3500000:
-		return B3500000;
-#endif
-#ifdef B3710000
-	case 3710000
-		return B3710000;
-#endif
-#ifdef B4000000
-	case 4000000:
-		return B4000000;
-#endif
-	default:
-		return -1;
-	}
-}
-
-static pid_t daemonize(const char *lockfile, char *tty, char *name)
-{
-	pid_t pid, sid, parent;
-	int lfp = -1;
-	FILE *pFile;
-	char const *pidprefix = "/var/run/";
-	char const *pidsuffix = ".pid";
-
-	snprintf(pidfile, PIDFILE_LENGTH, "%s%s-%s%s", pidprefix, DAEMON_NAME, tty, pidsuffix);
-
-	/* already a daemon */
-	if (getppid() == 1)
-		return 0;
-
-	/* Create the lock file as the current user */
-	if (lockfile && lockfile[0]) {
-
-		lfp = open(lockfile, O_RDWR | O_CREAT, 0640);
-		if (lfp < 0)
-		{
-			syslog(LOG_ERR, "unable to create lock file %s, code=%d (%s)",
-			       lockfile, errno, strerror(errno));
-			exit(EXIT_FAILURE);
-		}
-	}
-
-	/* Drop user if there is one, and we were run as root */
-	if (getuid() == 0 || geteuid() == 0) {
-		struct passwd *pw = getpwnam(RUN_AS_USER);
-
-		if (pw)
-		{
-			/* syslog(LOG_NOTICE, "setting user to " RUN_AS_USER); */
-			setuid(pw->pw_uid);
-		}
-	}
-
-	/* Trap signals that we expect to receive */
-	signal(SIGINT, child_handler);
-	signal(SIGTERM, child_handler);
-	signal(SIGCHLD, child_handler);
-	signal(SIGUSR1, child_handler);
-	signal(SIGALRM, child_handler);
-
-	/* Fork off the parent process */
-	pid = fork();
-	if (pid < 0) {
-		syslog(LOG_ERR, "unable to fork daemon, code=%d (%s)",
-		       errno, strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-
-	/* If we got a good PID, then we can exit the parent process. */
-	if (pid > 0) {
-		/* Wait for confirmation from the child via SIGTERM or SIGCHLD, or
-		   for five seconds to elapse (SIGALRM).  pause() should not return. */
-		alarm(5);
-		pause();
-		exit(EXIT_FAILURE);
-	}
-
-	/* At this point we are executing as the child process */
-	parent = getppid();
-
-	/* Cancel certain signals */
-	signal(SIGCHLD, SIG_DFL);	/* A child process dies */
-	signal(SIGTSTP, SIG_IGN);	/* Various TTY signals */
-	signal(SIGTTOU, SIG_IGN);
-	signal(SIGTTIN, SIG_IGN);
-	signal(SIGHUP, SIG_IGN);	/* Ignore hangup signal */
-	signal(SIGINT, child_handler);
-	signal(SIGTERM, child_handler);
-
-	/* Change the file mode mask */
-	umask(0);
-
-	/* Create a new SID for the child process */
-	sid = setsid();
-	if (sid < 0) {
-		syslog(LOG_ERR, "unable to create a new session, code %d (%s)",
-		       errno, strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-
-	pFile = fopen(pidfile, "w");
-	if (NULL == pFile) {
-		syslog(LOG_ERR, "unable to create pid file %s, code=%d (%s)",
-		       pidfile, errno, strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-	fprintf(pFile, "%d\n", sid);
-	fclose(pFile);
-
-	/* Change the current working directory.  This prevents the current
-	   directory from being locked; hence not being able to remove it. */
-	if (chdir("/") < 0) {
-		syslog(LOG_ERR, "unable to change directory to %s, code %d (%s)",
-		       "/", errno, strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-
-	/* Redirect standard files to /dev/null */
-	pFile = freopen("/dev/null", "r", stdin);
-	pFile = freopen("/dev/null", "w", stdout);
-	pFile = freopen("/dev/null", "w", stderr);
-
-	/* Tell the parent process that we are A-okay */
-	/* kill(parent, SIGUSR1); */
-	return parent;
-}
-
-int main(int argc, char *argv[])
-{
-	char *tty = NULL;
-	char const *devprefix = "/dev/";
-	char *name = NULL;
-	char buf[IFNAMSIZ+1];
-	struct termios tios;
-	speed_t old_ispeed;
-	speed_t old_ospeed;
-
-	int opt;
-	int send_open = 0;
-	int send_close = 0;
-	int send_read_status_flags = 0;
-	char *speed = NULL;
-	char *uart_speed_str = NULL;
-	long int uart_speed = 0;
-	char *btr = NULL;
-	int run_as_daemon = 1;
-	pid_t parent_pid = 0;
-	char *pch;
-	int ldisc = LDISC_N_SLCAN;
-	int fd;
-
-	ttypath[0] = '\0';
-
-	while ((opt = getopt(argc, argv, "ocfs:S:b:?hF")) != -1) {
-		switch (opt) {
-		case 'o':
-			send_open = 1;
-			break;
-		case 'c':
-			send_close = 1;
-			break;
-		case 'f':
-			send_read_status_flags = 1;
-			break;
-		case 's':
-			speed = optarg;
-			if (strlen(speed) > 1)
-				print_usage(argv[0]);
-			break;
-		case 'S':
-			uart_speed_str = optarg;
-			errno = 0;
-			uart_speed = strtol(uart_speed_str, NULL, 10);
-			if (errno)
-				print_usage(argv[0]);
-			if (look_up_uart_speed(uart_speed) == -1) {
-				fprintf(stderr, "Unsupported UART speed (%lu)\n", uart_speed);
-				exit(EXIT_FAILURE);
-			}
-			break;
-		case 'b':
-			btr = optarg;
-			if (strlen(btr) > 6)
-				print_usage(argv[0]);
-			break;
-		case 'F':
-			run_as_daemon = 0;
-			break;
-		case 'h':
-		case '?':
-		default:
-			print_usage(argv[0]);
-			break;
-		}
-	}
-
-	/* Initialize the logging interface */
-	openlog(DAEMON_NAME, LOG_PID, LOG_LOCAL5);
-
-	/* Parse serial device name and optional can interface name */
-	tty = argv[optind];
-	if (NULL == tty)
-		print_usage(argv[0]);
-
-	name = argv[optind + 1];
-
-	/* Prepare the tty device name string */
-	pch = strstr(tty, devprefix);
-	if (pch == tty)
-		print_usage(argv[0]);
-
-	snprintf(ttypath, TTYPATH_LENGTH, "%s%s", devprefix, tty);
-	syslog(LOG_INFO, "starting on TTY device %s", ttypath);
-
-	/* Daemonize */
-	if (run_as_daemon)
-		parent_pid = daemonize("/var/lock/" DAEMON_NAME, tty, name);
-	else {
-		/* Trap signals that we expect to receive */
-		signal(SIGINT, child_handler);
-		signal(SIGTERM, child_handler);
-	}
-
-	/* */
-	slcand_running = 1;
-
-	/* Now we are a daemon -- do the work for which we were paid */
-	fd = open(ttypath, O_RDWR | O_NONBLOCK | O_NOCTTY);
-	if (fd < 0) {
-		syslog(LOG_NOTICE, "failed to open TTY device %s\n", ttypath);
-		perror(ttypath);
-		exit(EXIT_FAILURE);
-	}
-
-	/* Configure baud rate */
-	memset(&tios, 0, sizeof(struct termios));
-	if (tcgetattr(fd, &tios) < 0) {
-		syslog(LOG_NOTICE, "failed to get attributes for TTY device %s: %s\n", ttypath, strerror(errno));
-		exit(EXIT_FAILURE);
-	}
-
-	/* Get old values for later restore */
-	old_ispeed = cfgetispeed(&tios);
-	old_ospeed = cfgetospeed(&tios);
-
-	/* Baud Rate */
-	cfsetispeed(&tios, look_up_uart_speed(uart_speed));
-	cfsetospeed(&tios, look_up_uart_speed(uart_speed));
-
-	/* apply changes */
-	if (tcsetattr(fd, TCSADRAIN, &tios) < 0)
-		syslog(LOG_NOTICE, "Cannot set attributes for device \"%s\": %s!\n", ttypath, strerror(errno));
-
-	if (speed) {
-		sprintf(buf, "C\rS%s\r", speed);
-		write(fd, buf, strlen(buf));
-	}
-
-	if (btr) {
-		sprintf(buf, "C\rs%s\r", btr);
-		write(fd, buf, strlen(buf));
-	}
-
-	if (send_read_status_flags) {
-		sprintf(buf, "F\r");
-		write(fd, buf, strlen(buf));
-	}
-
-	if (send_open) {
-		sprintf(buf, "O\r");
-		write(fd, buf, strlen(buf));
-	}
-
-	/* set slcan like discipline on given tty */
-	if (ioctl(fd, TIOCSETD, &ldisc) < 0) {
-		perror("ioctl TIOCSETD");
-		exit(1);
-	}
-	
-	/* retrieve the name of the created CAN netdevice */
-	if (ioctl(fd, SIOCGIFNAME, buf) < 0) {
-		perror("ioctl SIOCGIFNAME");
-		exit(1);
-	}
-
-	syslog(LOG_NOTICE, "attached TTY %s to netdevice %s\n", ttypath, buf);
-	
-	/* try to rename the created netdevice */
-	if (name) {
-		struct ifreq ifr;
-		int s = socket(PF_INET, SOCK_DGRAM, 0);
-
-		if (s < 0)
-			perror("socket for interface rename");
-		else {
-			strncpy(ifr.ifr_name, buf, IFNAMSIZ);
-			strncpy(ifr.ifr_newname, name, IFNAMSIZ);
-
-			if (ioctl(s, SIOCSIFNAME, &ifr) < 0) {
-				syslog(LOG_NOTICE, "netdevice %s rename to %s failed\n", buf, name);
-				perror("ioctl SIOCSIFNAME rename");
-				exit(1);
-			} else
-				syslog(LOG_NOTICE, "netdevice %s renamed to %s\n", buf, name);
-
-			close(s);
-		}	
-	}
-	if (parent_pid > 0)
-		kill(parent_pid, SIGUSR1);
-
-	/* The Big Loop */
-	while (slcand_running)
-		sleep(1); /* wait 1 second */
-
-	/* Reset line discipline */
-	syslog(LOG_INFO, "stopping on TTY device %s", ttypath);
-	ldisc = N_TTY;
-	if (ioctl(fd, TIOCSETD, &ldisc) < 0) {
-		perror("ioctl TIOCSETD");
-		exit(EXIT_FAILURE);
-	}
-
-	if (send_close) {
-		sprintf(buf, "C\r");
-		write(fd, buf, strlen(buf));
-	}
-
-	/* Reset old rates */
-	cfsetispeed(&tios, old_ispeed);
-	cfsetospeed(&tios, old_ospeed);
-
-	/* apply changes */
-	if (tcsetattr(fd, TCSADRAIN, &tios) < 0)
-		syslog(LOG_NOTICE, "Cannot set attributes for device \"%s\": %s!\n", ttypath, strerror(errno));
-
-	/* Remove pidfile */
-	if (run_as_daemon)
-		unlink(pidfile);
-
-	/* Finish up */
-	syslog(LOG_NOTICE, "terminated on %s", ttypath);
-	closelog();
-	return exit_code;
-}
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-11 23:10   ` [PATCH can-utils 3/3] slcand: remove program as it is undistributable Uwe Kleine-König
@ 2014-01-11 23:38     ` Yegor Yefremov
  2014-01-12 10:57       ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Yegor Yefremov @ 2014-01-11 23:38 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Oliver Hartkopp, Marc Kleine-Budde

On Sun, Jan 12, 2014 at 12:10 AM, Uwe Kleine-König
<u.kleine-koenig@pengutronix.de> wrote:
> The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
> These two licenses are incompatible which makes this file undistributable.
> The clean way to fix this is to remove the file and reimplement its
> functionality under a valid license when need arises.

There is need for this daemon. I'm using it in production tests.

Yegor

> ---
>  .gitignore     |   1 -
>  Android.mk     |  14 --
>  GNUmakefile.am |   1 -
>  Makefile       |   2 +-
>  slcand.c       | 503 ---------------------------------------------------------
>  5 files changed, 1 insertion(+), 520 deletions(-)
>  delete mode 100644 slcand.c
>
> diff --git a/.gitignore b/.gitignore
> index 746b676fbf67..ce93351e80b6 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -42,7 +42,6 @@ GNUmakefile.in
>  /log2asc
>  /log2long
>  /slcan_attach
> -/slcand
>  /slcanpty
>
>  /can-utils-*.tar.bz2
> diff --git a/Android.mk b/Android.mk
> index ffac95720758..25bc96bb6e66 100755
> --- a/Android.mk
> +++ b/Android.mk
> @@ -307,20 +307,6 @@ LOCAL_CFLAGS := $(PRIVATE_LOCAL_CFLAGS)
>  include $(BUILD_EXECUTABLE)
>
>  #
> -# slcand
> -#
> -
> -include $(CLEAR_VARS)
> -
> -LOCAL_SRC_FILES := slcand.c
> -LOCAL_MODULE := slcand
> -LOCAL_MODULE_TAGS := optional
> -LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/
> -LOCAL_CFLAGS := $(PRIVATE_LOCAL_CFLAGS)
> -
> -include $(BUILD_EXECUTABLE)
> -
> -#
>  # slcanpty
>  #
>
> diff --git a/GNUmakefile.am b/GNUmakefile.am
> index 8c18e72794fa..26098b82b3da 100644
> --- a/GNUmakefile.am
> +++ b/GNUmakefile.am
> @@ -57,7 +57,6 @@ bin_PROGRAMS = \
>         log2asc \
>         log2long \
>         slcan_attach \
> -       slcand \
>         slcanpty
>
>  EXTRA_DIST = \
> diff --git a/Makefile b/Makefile
> index 2f79ee78ac28..0968c16a7e0d 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -51,7 +51,7 @@ CFLAGS    = -O2 -Wall -Wno-parentheses -Iinclude \
>
>  PROGRAMS_ISOTP = isotpdump isotprecv isotpsend isotpsniffer isotptun isotpserver
>  PROGRAMS_CANGW = cangw
> -PROGRAMS_SLCAN = slcan_attach slcand
> +PROGRAMS_SLCAN = slcan_attach
>  PROGRAMS = can-calc-bit-timing candump cansniffer cansend canplayer cangen canbusload\
>            log2long log2asc asc2log\
>            canlogserver bcmserver\
> diff --git a/slcand.c b/slcand.c
> deleted file mode 100644
> index 30f5127f8cd8..000000000000
> --- a/slcand.c
> +++ /dev/null
> @@ -1,503 +0,0 @@
> -/*
> - * slcand.c - userspace daemon for serial line CAN interface driver SLCAN
> - *
> - * Copyright (c) 2009 Robert Haddon <robert.haddon@verari.com>
> - * Copyright (c) 2009 Verari Systems Inc.
> - *
> - * This program is free software; you can redistribute it and/or modify
> - * it under the terms of the GNU General Public License as published by
> - * the Free Software Foundation; either version 2 of the License, or
> - * (at your option) any later version.
> - *
> - * 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.
> - *
> - * You should have received a copy of the GNU General Public License
> - * along with this program; if not, write to the Free Software
> - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
> - *
> - * This code is derived from an example daemon code from
> - *
> - * http://en.wikipedia.org/wiki/Daemon_(computer_software)#Sample_Program_in_C_on_Linux
> - * (accessed 2009-05-05)
> - *
> - * So it is additionally licensed under the GNU Free Documentation License:
> - *
> - * Permission is granted to copy, distribute and/or modify this document
> - * under the terms of the GNU Free Documentation License, Version 1.2
> - * or any later version published by the Free Software Foundation;
> - * with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
> - * A copy of the license is included in the section entitled "GNU
> - * Free Documentation License".
> - *
> - * Send feedback to <linux-can@vger.kernel.org>
> - *
> - */
> -
> -#include <stdio.h>
> -#include <stdlib.h>
> -#include <string.h>
> -#include <unistd.h>
> -#include <sys/types.h>
> -#include <sys/stat.h>
> -#include <fcntl.h>
> -#include <syslog.h>
> -#include <errno.h>
> -#include <pwd.h>
> -#include <signal.h>
> -#include <sys/ioctl.h>
> -#include <net/if.h>
> -#include <termios.h>
> -
> -/* default slcan line discipline since Kernel 2.6.25 */
> -#define LDISC_N_SLCAN 17
> -
> -/* Change this to whatever your daemon is called */
> -#define DAEMON_NAME "slcand"
> -
> -/* Change this to the user under which to run */
> -#define RUN_AS_USER "root"
> -
> -/* The length of ttypath buffer */
> -#define TTYPATH_LENGTH 64
> -
> -/* The length of pidfile name buffer */
> -#define PIDFILE_LENGTH 64
> -
> -#define EXIT_SUCCESS 0
> -#define EXIT_FAILURE 1
> -
> -void print_usage(char *prg)
> -{
> -       fprintf(stderr, "\nUsage: %s [options] <tty> [canif-name]\n\n", prg);
> -       fprintf(stderr, "Options: -o         (send open command 'O\\r')\n");
> -       fprintf(stderr, "         -c         (send close command 'C\\r')\n");
> -       fprintf(stderr, "         -f         (read status flags with 'F\\r' to reset error states)\n");
> -       fprintf(stderr, "         -s <speed> (set CAN speed 0..8)\n");
> -       fprintf(stderr, "         -S <speed> (set UART speed in baud)\n");
> -       fprintf(stderr, "         -b <btr>   (set bit time register value)\n");
> -       fprintf(stderr, "         -F         (stay in foreground; no daemonize)\n");
> -       fprintf(stderr, "         -h         (show this help page)\n");
> -       fprintf(stderr, "\nExamples:\n");
> -       fprintf(stderr, "slcand -o -c -f -s6 ttyslcan0\n");
> -       fprintf(stderr, "slcand -o -c -f -s6 ttyslcan0 can0\n");
> -       fprintf(stderr, "\n");
> -       exit(EXIT_FAILURE);
> -}
> -
> -static int slcand_running;
> -static int exit_code;
> -static char ttypath[TTYPATH_LENGTH];
> -static char pidfile[PIDFILE_LENGTH];
> -
> -static void child_handler(int signum)
> -{
> -       switch (signum) {
> -
> -       case SIGUSR1:
> -               /* exit parent */
> -               exit(EXIT_SUCCESS);
> -               break;
> -       case SIGALRM:
> -       case SIGCHLD:
> -               syslog(LOG_NOTICE, "received signal %i on %s", signum, ttypath);
> -               exit_code = EXIT_FAILURE;
> -               slcand_running = 0;
> -               break;
> -       case SIGINT:
> -       case SIGTERM:
> -               syslog(LOG_NOTICE, "received signal %i on %s", signum, ttypath);
> -               exit_code = EXIT_SUCCESS;
> -               slcand_running = 0;
> -               break;
> -       }
> -}
> -
> -static int look_up_uart_speed(long int s)
> -{
> -       switch (s) {
> -
> -       case 9600:
> -               return B9600;
> -       case 19200:
> -               return B19200;
> -       case 38400:
> -               return B38400;
> -       case 57600:
> -               return B57600;
> -       case 115200:
> -               return B115200;
> -       case 230400:
> -               return B230400;
> -       case 460800:
> -               return B460800;
> -       case 500000:
> -               return B500000;
> -       case 576000:
> -               return B576000;
> -       case 921600:
> -               return B921600;
> -       case 1000000:
> -               return B1000000;
> -       case 1152000:
> -               return B1152000;
> -       case 1500000:
> -               return B1500000;
> -       case 2000000:
> -               return B2000000;
> -#ifdef B2500000
> -       case 2500000:
> -               return B2500000;
> -#endif
> -#ifdef B3000000
> -       case 3000000:
> -               return B3000000;
> -#endif
> -#ifdef B3500000
> -       case 3500000:
> -               return B3500000;
> -#endif
> -#ifdef B3710000
> -       case 3710000
> -               return B3710000;
> -#endif
> -#ifdef B4000000
> -       case 4000000:
> -               return B4000000;
> -#endif
> -       default:
> -               return -1;
> -       }
> -}
> -
> -static pid_t daemonize(const char *lockfile, char *tty, char *name)
> -{
> -       pid_t pid, sid, parent;
> -       int lfp = -1;
> -       FILE *pFile;
> -       char const *pidprefix = "/var/run/";
> -       char const *pidsuffix = ".pid";
> -
> -       snprintf(pidfile, PIDFILE_LENGTH, "%s%s-%s%s", pidprefix, DAEMON_NAME, tty, pidsuffix);
> -
> -       /* already a daemon */
> -       if (getppid() == 1)
> -               return 0;
> -
> -       /* Create the lock file as the current user */
> -       if (lockfile && lockfile[0]) {
> -
> -               lfp = open(lockfile, O_RDWR | O_CREAT, 0640);
> -               if (lfp < 0)
> -               {
> -                       syslog(LOG_ERR, "unable to create lock file %s, code=%d (%s)",
> -                              lockfile, errno, strerror(errno));
> -                       exit(EXIT_FAILURE);
> -               }
> -       }
> -
> -       /* Drop user if there is one, and we were run as root */
> -       if (getuid() == 0 || geteuid() == 0) {
> -               struct passwd *pw = getpwnam(RUN_AS_USER);
> -
> -               if (pw)
> -               {
> -                       /* syslog(LOG_NOTICE, "setting user to " RUN_AS_USER); */
> -                       setuid(pw->pw_uid);
> -               }
> -       }
> -
> -       /* Trap signals that we expect to receive */
> -       signal(SIGINT, child_handler);
> -       signal(SIGTERM, child_handler);
> -       signal(SIGCHLD, child_handler);
> -       signal(SIGUSR1, child_handler);
> -       signal(SIGALRM, child_handler);
> -
> -       /* Fork off the parent process */
> -       pid = fork();
> -       if (pid < 0) {
> -               syslog(LOG_ERR, "unable to fork daemon, code=%d (%s)",
> -                      errno, strerror(errno));
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       /* If we got a good PID, then we can exit the parent process. */
> -       if (pid > 0) {
> -               /* Wait for confirmation from the child via SIGTERM or SIGCHLD, or
> -                  for five seconds to elapse (SIGALRM).  pause() should not return. */
> -               alarm(5);
> -               pause();
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       /* At this point we are executing as the child process */
> -       parent = getppid();
> -
> -       /* Cancel certain signals */
> -       signal(SIGCHLD, SIG_DFL);       /* A child process dies */
> -       signal(SIGTSTP, SIG_IGN);       /* Various TTY signals */
> -       signal(SIGTTOU, SIG_IGN);
> -       signal(SIGTTIN, SIG_IGN);
> -       signal(SIGHUP, SIG_IGN);        /* Ignore hangup signal */
> -       signal(SIGINT, child_handler);
> -       signal(SIGTERM, child_handler);
> -
> -       /* Change the file mode mask */
> -       umask(0);
> -
> -       /* Create a new SID for the child process */
> -       sid = setsid();
> -       if (sid < 0) {
> -               syslog(LOG_ERR, "unable to create a new session, code %d (%s)",
> -                      errno, strerror(errno));
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       pFile = fopen(pidfile, "w");
> -       if (NULL == pFile) {
> -               syslog(LOG_ERR, "unable to create pid file %s, code=%d (%s)",
> -                      pidfile, errno, strerror(errno));
> -               exit(EXIT_FAILURE);
> -       }
> -       fprintf(pFile, "%d\n", sid);
> -       fclose(pFile);
> -
> -       /* Change the current working directory.  This prevents the current
> -          directory from being locked; hence not being able to remove it. */
> -       if (chdir("/") < 0) {
> -               syslog(LOG_ERR, "unable to change directory to %s, code %d (%s)",
> -                      "/", errno, strerror(errno));
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       /* Redirect standard files to /dev/null */
> -       pFile = freopen("/dev/null", "r", stdin);
> -       pFile = freopen("/dev/null", "w", stdout);
> -       pFile = freopen("/dev/null", "w", stderr);
> -
> -       /* Tell the parent process that we are A-okay */
> -       /* kill(parent, SIGUSR1); */
> -       return parent;
> -}
> -
> -int main(int argc, char *argv[])
> -{
> -       char *tty = NULL;
> -       char const *devprefix = "/dev/";
> -       char *name = NULL;
> -       char buf[IFNAMSIZ+1];
> -       struct termios tios;
> -       speed_t old_ispeed;
> -       speed_t old_ospeed;
> -
> -       int opt;
> -       int send_open = 0;
> -       int send_close = 0;
> -       int send_read_status_flags = 0;
> -       char *speed = NULL;
> -       char *uart_speed_str = NULL;
> -       long int uart_speed = 0;
> -       char *btr = NULL;
> -       int run_as_daemon = 1;
> -       pid_t parent_pid = 0;
> -       char *pch;
> -       int ldisc = LDISC_N_SLCAN;
> -       int fd;
> -
> -       ttypath[0] = '\0';
> -
> -       while ((opt = getopt(argc, argv, "ocfs:S:b:?hF")) != -1) {
> -               switch (opt) {
> -               case 'o':
> -                       send_open = 1;
> -                       break;
> -               case 'c':
> -                       send_close = 1;
> -                       break;
> -               case 'f':
> -                       send_read_status_flags = 1;
> -                       break;
> -               case 's':
> -                       speed = optarg;
> -                       if (strlen(speed) > 1)
> -                               print_usage(argv[0]);
> -                       break;
> -               case 'S':
> -                       uart_speed_str = optarg;
> -                       errno = 0;
> -                       uart_speed = strtol(uart_speed_str, NULL, 10);
> -                       if (errno)
> -                               print_usage(argv[0]);
> -                       if (look_up_uart_speed(uart_speed) == -1) {
> -                               fprintf(stderr, "Unsupported UART speed (%lu)\n", uart_speed);
> -                               exit(EXIT_FAILURE);
> -                       }
> -                       break;
> -               case 'b':
> -                       btr = optarg;
> -                       if (strlen(btr) > 6)
> -                               print_usage(argv[0]);
> -                       break;
> -               case 'F':
> -                       run_as_daemon = 0;
> -                       break;
> -               case 'h':
> -               case '?':
> -               default:
> -                       print_usage(argv[0]);
> -                       break;
> -               }
> -       }
> -
> -       /* Initialize the logging interface */
> -       openlog(DAEMON_NAME, LOG_PID, LOG_LOCAL5);
> -
> -       /* Parse serial device name and optional can interface name */
> -       tty = argv[optind];
> -       if (NULL == tty)
> -               print_usage(argv[0]);
> -
> -       name = argv[optind + 1];
> -
> -       /* Prepare the tty device name string */
> -       pch = strstr(tty, devprefix);
> -       if (pch == tty)
> -               print_usage(argv[0]);
> -
> -       snprintf(ttypath, TTYPATH_LENGTH, "%s%s", devprefix, tty);
> -       syslog(LOG_INFO, "starting on TTY device %s", ttypath);
> -
> -       /* Daemonize */
> -       if (run_as_daemon)
> -               parent_pid = daemonize("/var/lock/" DAEMON_NAME, tty, name);
> -       else {
> -               /* Trap signals that we expect to receive */
> -               signal(SIGINT, child_handler);
> -               signal(SIGTERM, child_handler);
> -       }
> -
> -       /* */
> -       slcand_running = 1;
> -
> -       /* Now we are a daemon -- do the work for which we were paid */
> -       fd = open(ttypath, O_RDWR | O_NONBLOCK | O_NOCTTY);
> -       if (fd < 0) {
> -               syslog(LOG_NOTICE, "failed to open TTY device %s\n", ttypath);
> -               perror(ttypath);
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       /* Configure baud rate */
> -       memset(&tios, 0, sizeof(struct termios));
> -       if (tcgetattr(fd, &tios) < 0) {
> -               syslog(LOG_NOTICE, "failed to get attributes for TTY device %s: %s\n", ttypath, strerror(errno));
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       /* Get old values for later restore */
> -       old_ispeed = cfgetispeed(&tios);
> -       old_ospeed = cfgetospeed(&tios);
> -
> -       /* Baud Rate */
> -       cfsetispeed(&tios, look_up_uart_speed(uart_speed));
> -       cfsetospeed(&tios, look_up_uart_speed(uart_speed));
> -
> -       /* apply changes */
> -       if (tcsetattr(fd, TCSADRAIN, &tios) < 0)
> -               syslog(LOG_NOTICE, "Cannot set attributes for device \"%s\": %s!\n", ttypath, strerror(errno));
> -
> -       if (speed) {
> -               sprintf(buf, "C\rS%s\r", speed);
> -               write(fd, buf, strlen(buf));
> -       }
> -
> -       if (btr) {
> -               sprintf(buf, "C\rs%s\r", btr);
> -               write(fd, buf, strlen(buf));
> -       }
> -
> -       if (send_read_status_flags) {
> -               sprintf(buf, "F\r");
> -               write(fd, buf, strlen(buf));
> -       }
> -
> -       if (send_open) {
> -               sprintf(buf, "O\r");
> -               write(fd, buf, strlen(buf));
> -       }
> -
> -       /* set slcan like discipline on given tty */
> -       if (ioctl(fd, TIOCSETD, &ldisc) < 0) {
> -               perror("ioctl TIOCSETD");
> -               exit(1);
> -       }
> -
> -       /* retrieve the name of the created CAN netdevice */
> -       if (ioctl(fd, SIOCGIFNAME, buf) < 0) {
> -               perror("ioctl SIOCGIFNAME");
> -               exit(1);
> -       }
> -
> -       syslog(LOG_NOTICE, "attached TTY %s to netdevice %s\n", ttypath, buf);
> -
> -       /* try to rename the created netdevice */
> -       if (name) {
> -               struct ifreq ifr;
> -               int s = socket(PF_INET, SOCK_DGRAM, 0);
> -
> -               if (s < 0)
> -                       perror("socket for interface rename");
> -               else {
> -                       strncpy(ifr.ifr_name, buf, IFNAMSIZ);
> -                       strncpy(ifr.ifr_newname, name, IFNAMSIZ);
> -
> -                       if (ioctl(s, SIOCSIFNAME, &ifr) < 0) {
> -                               syslog(LOG_NOTICE, "netdevice %s rename to %s failed\n", buf, name);
> -                               perror("ioctl SIOCSIFNAME rename");
> -                               exit(1);
> -                       } else
> -                               syslog(LOG_NOTICE, "netdevice %s renamed to %s\n", buf, name);
> -
> -                       close(s);
> -               }
> -       }
> -       if (parent_pid > 0)
> -               kill(parent_pid, SIGUSR1);
> -
> -       /* The Big Loop */
> -       while (slcand_running)
> -               sleep(1); /* wait 1 second */
> -
> -       /* Reset line discipline */
> -       syslog(LOG_INFO, "stopping on TTY device %s", ttypath);
> -       ldisc = N_TTY;
> -       if (ioctl(fd, TIOCSETD, &ldisc) < 0) {
> -               perror("ioctl TIOCSETD");
> -               exit(EXIT_FAILURE);
> -       }
> -
> -       if (send_close) {
> -               sprintf(buf, "C\r");
> -               write(fd, buf, strlen(buf));
> -       }
> -
> -       /* Reset old rates */
> -       cfsetispeed(&tios, old_ispeed);
> -       cfsetospeed(&tios, old_ospeed);
> -
> -       /* apply changes */
> -       if (tcsetattr(fd, TCSADRAIN, &tios) < 0)
> -               syslog(LOG_NOTICE, "Cannot set attributes for device \"%s\": %s!\n", ttypath, strerror(errno));
> -
> -       /* Remove pidfile */
> -       if (run_as_daemon)
> -               unlink(pidfile);
> -
> -       /* Finish up */
> -       syslog(LOG_NOTICE, "terminated on %s", ttypath);
> -       closelog();
> -       return exit_code;
> -}
> --
> 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] 41+ messages in thread

* Re: [PATCH can-utils 1/3] Update license information for some header files
  2014-01-11 23:10   ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
@ 2014-01-12 10:09     ` Oliver Hartkopp
  2014-01-12 19:02       ` [PATCH] can: add explicit copyrights to can userspace header Uwe Kleine-König
  2014-01-12 19:53       ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
  0 siblings, 2 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 10:09 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde



On 12.01.2014 00:10, Uwe Kleine-König wrote:
> This corresponds to Linux commits
>   2485602f1af2 (can: add explicit copyrights to can headers)
>   1c2da13c21a1 (can: add explicit copyrights to can's netlink header)
> ---
> Hello,
> 
> I would have expected to just need to do something like:
> 
> cd $path_to_canutils
> rm -r include/socketcan/can
> cd $path_to_linux
> git archive --format=tar --prefix=socketcan/can/ v3.13-rc7:include/uapi/linux/can | tar xC $path_to_canutils/include
> git cat-file blob v3.13-rc7:include/uapi/linux/can.h > $path_to_canutils/include/socketcan/can.h
> 
> to sync the header files. I didn't test but some changes introduced by
> the above sequence seem to be uncompilable so I choosed to only
> cherry-pick the two Linux commits. IMHO this is a bug (in Linux or
> can-utils or maybe both).
> 
> Best regards
> Uwe
> 
>  include/socketcan/can/bcm.h     | 32 ++++++++++++++++++++++++++++++++
>  include/socketcan/can/error.h   | 32 ++++++++++++++++++++++++++++++++
>  include/socketcan/can/gw.h      | 32 ++++++++++++++++++++++++++++++++
>  include/socketcan/can/netlink.h |  8 ++++++++
>  include/socketcan/can/raw.h     | 32 ++++++++++++++++++++++++++++++++
>  5 files changed, 136 insertions(+)

Hello Uwe,

thanks for the effort.

Btw.

- include/socketcan/can.h
- include/socketcan/can/isotp.h

are both missing in this process.

Unfortunately we missed linux/include/uapi/linux/can.h in commit 2485602f1af2
(can: add explicit copyrights to can headers).

Would you like to pick this update of your original commit too?

Best regards,
Oliver



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 2/3] ioctl.h: drop unused header
  2014-01-11 23:10   ` [PATCH can-utils 2/3] ioctl.h: drop unused header Uwe Kleine-König
@ 2014-01-12 10:18     ` Oliver Hartkopp
  0 siblings, 0 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 10:18 UTC (permalink / raw)
  To: Uwe Kleine-König, Wolfgang Grandegger; +Cc: linux-can, Marc Kleine-Budde

This is a relict from the first implementation of a CAN driver configuration
interface from 2006.

As the current can-utils do not reference them nor the ioctl interface has any
relevance removing this file is a good idea :-)

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>

Tnx Uwe!

On 12.01.2014 00:10, Uwe Kleine-König wrote:
> This header doesn't exist in the Linux tree and it's unused by can-utils,
> so drop it. As a side effect this fixes the last file not specifying any
> license and/or copyright information.
> ---
>  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 fc8f6e73e139..8c18e72794fa 100644
> --- a/GNUmakefile.am
> +++ b/GNUmakefile.am
> @@ -23,7 +23,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 ab34e8918667..000000000000
> --- 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 */
> 

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-11 23:38     ` Yegor Yefremov
@ 2014-01-12 10:57       ` Oliver Hartkopp
  2014-01-12 16:09         ` Yegor Yefremov
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 10:57 UTC (permalink / raw)
  To: Yegor Yefremov, Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde



On 12.01.2014 00:38, Yegor Yefremov wrote:
> On Sun, Jan 12, 2014 at 12:10 AM, Uwe Kleine-König
> <u.kleine-koenig@pengutronix.de> wrote:
>> The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
>> These two licenses are incompatible which makes this file undistributable.
>> The clean way to fix this is to remove the file and reimplement its
>> functionality under a valid license when need arises.
> 
> There is need for this daemon. I'm using it in production tests.
> 

Oh, yes. There was so much effort put into this slcand.
We should better look how we might fix the license issues.

The original thread where slcand comes from was here:

http://socket-can.996257.n3.nabble.com/slcan-attach-and-resetting-line-disciplines-td1396.html

And here was the original commit to the SVN:
http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/slcand.c?rev=973&peg=973

The code has been removed from Wikipedia in October 2009
http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=321383226&oldid=320644717
(not a textbook. these examples are completely opaque to non-experts)

And it has been added here (wihout any license information):
http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=273831207&oldid=273016660

I assume we need to rewrite the daemon-specific code, e.g. use the
other reference in Wikipedia:

	http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize

which is public domain - and I assume this to be the original source ...

Oh well :-(

Regards,
Oliver



^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-12 10:57       ` Oliver Hartkopp
@ 2014-01-12 16:09         ` Yegor Yefremov
  2014-01-12 18:22           ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Yegor Yefremov @ 2014-01-12 16:09 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: Uwe Kleine-König, linux-can, Marc Kleine-Budde

On Sun, Jan 12, 2014 at 11:57 AM, Oliver Hartkopp
<socketcan@hartkopp.net> wrote:
>
>
> On 12.01.2014 00:38, Yegor Yefremov wrote:
>> On Sun, Jan 12, 2014 at 12:10 AM, Uwe Kleine-König
>> <u.kleine-koenig@pengutronix.de> wrote:
>>> The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
>>> These two licenses are incompatible which makes this file undistributable.
>>> The clean way to fix this is to remove the file and reimplement its
>>> functionality under a valid license when need arises.
>>
>> There is need for this daemon. I'm using it in production tests.
>>
>
> Oh, yes. There was so much effort put into this slcand.
> We should better look how we might fix the license issues.
>
> The original thread where slcand comes from was here:
>
> http://socket-can.996257.n3.nabble.com/slcan-attach-and-resetting-line-disciplines-td1396.html
>
> And here was the original commit to the SVN:
> http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/slcand.c?rev=973&peg=973
>
> The code has been removed from Wikipedia in October 2009
> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=321383226&oldid=320644717
> (not a textbook. these examples are completely opaque to non-experts)
>
> And it has been added here (wihout any license information):
> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=273831207&oldid=273016660
>
> I assume we need to rewrite the daemon-specific code, e.g. use the
> other reference in Wikipedia:
>
>         http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize
>
> which is public domain - and I assume this to be the original source ...

Would this call do the job: http://man7.org/linux/man-pages/man3/daemon.3.html?

Yegor

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-12 16:09         ` Yegor Yefremov
@ 2014-01-12 18:22           ` Oliver Hartkopp
  2014-01-12 19:54             ` Yegor Yefremov
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 18:22 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Uwe Kleine-König, linux-can, Marc Kleine-Budde



On 12.01.2014 17:09, Yegor Yefremov wrote:
> On Sun, Jan 12, 2014 at 11:57 AM, Oliver Hartkopp
> <socketcan@hartkopp.net> wrote:
>>
>>
>> On 12.01.2014 00:38, Yegor Yefremov wrote:
>>> On Sun, Jan 12, 2014 at 12:10 AM, Uwe Kleine-König
>>> <u.kleine-koenig@pengutronix.de> wrote:
>>>> The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
>>>> These two licenses are incompatible which makes this file undistributable.
>>>> The clean way to fix this is to remove the file and reimplement its
>>>> functionality under a valid license when need arises.
>>>
>>> There is need for this daemon. I'm using it in production tests.
>>>
>>
>> Oh, yes. There was so much effort put into this slcand.
>> We should better look how we might fix the license issues.
>>
>> The original thread where slcand comes from was here:
>>
>> http://socket-can.996257.n3.nabble.com/slcan-attach-and-resetting-line-disciplines-td1396.html
>>
>> And here was the original commit to the SVN:
>> http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/slcand.c?rev=973&peg=973
>>
>> The code has been removed from Wikipedia in October 2009
>> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=321383226&oldid=320644717
>> (not a textbook. these examples are completely opaque to non-experts)
>>
>> And it has been added here (wihout any license information):
>> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=273831207&oldid=273016660
>>
>> I assume we need to rewrite the daemon-specific code, e.g. use the
>> other reference in Wikipedia:
>>
>>         http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize
>>
>> which is public domain - and I assume this to be the original source ...
> 
> Would this call do the job: http://man7.org/linux/man-pages/man3/daemon.3.html?

Yes, I think so.

Here's a uClibc code for daemon()
https://github.com/hwoarang/uClibc/blob/master-metag/libc/unistd/daemon.c

As we do not need any 'specialties' for slcand (e.g. file i/o, logging, etc)
this could shorten the slcand a lot.

There are also some examples out there that could be adopted without getting
into a licensing issue again:
https://www.google.de/#q=linux+daemon+unistd

Regards,
Oliver


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH] can: add explicit copyrights to can userspace header
  2014-01-12 10:09     ` Oliver Hartkopp
@ 2014-01-12 19:02       ` Uwe Kleine-König
  2014-01-12 19:27         ` Oliver Hartkopp
  2014-01-16 16:27         ` Marc Kleine-Budde
  2014-01-12 19:53       ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
  1 sibling, 2 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 19:02 UTC (permalink / raw)
  To: linux-can; +Cc: kernel, Oliver Hartkopp, Urs Thuermann, Marc Kleine-Budde

This is in the spirit of commit 2485602f1af2 (can: add explicit
copyrights to can headers). It seems I have missed can.h back then.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

On Sun, Jan 12, 2014 at 11:09:21AM +0100, Oliver Hartkopp wrote:
> Btw.
> 
> - include/socketcan/can.h
> - include/socketcan/can/isotp.h
> 
> are both missing in this process.
> 
> Unfortunately we missed linux/include/uapi/linux/can.h in commit 2485602f1af2
> (can: add explicit copyrights to can headers).
> 
> Would you like to pick this update of your original commit too?
yeah, here it comes.

isotp.h isn't a kernel header, so it needs only an update in can-utils
alone.

Best regards
Uwe

 include/uapi/linux/can.h | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h
index e52958d7c2d1..5d9d1d140718 100644
--- a/include/uapi/linux/can.h
+++ b/include/uapi/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
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* Re: [PATCH] can: add explicit copyrights to can userspace header
  2014-01-12 19:02       ` [PATCH] can: add explicit copyrights to can userspace header Uwe Kleine-König
@ 2014-01-12 19:27         ` Oliver Hartkopp
  2014-01-16 16:27         ` Marc Kleine-Budde
  1 sibling, 0 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 19:27 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, kernel, Urs Thuermann, Marc Kleine-Budde



On 12.01.2014 20:02, Uwe Kleine-König wrote:
> This is in the spirit of commit 2485602f1af2 (can: add explicit
> copyrights to can headers). It seems I have missed can.h back then.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> On Sun, Jan 12, 2014 at 11:09:21AM +0100, Oliver Hartkopp wrote:
>> Btw.
>>
>> - include/socketcan/can.h
>> - include/socketcan/can/isotp.h
>>
>> are both missing in this process.
>>
>> Unfortunately we missed linux/include/uapi/linux/can.h in commit 2485602f1af2
>> (can: add explicit copyrights to can headers).
>>
>> Would you like to pick this update of your original commit too?
> yeah, here it comes.
> 
> isotp.h isn't a kernel header, so it needs only an update in can-utils
> alone.

Correct.

Tnx Uwe!

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>

> 
> Best regards
> Uwe
> 
>  include/uapi/linux/can.h | 32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> diff --git a/include/uapi/linux/can.h b/include/uapi/linux/can.h
> index e52958d7c2d1..5d9d1d140718 100644
> --- a/include/uapi/linux/can.h
> +++ b/include/uapi/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
> 

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 1/3] Update license information for some header files
  2014-01-12 10:09     ` Oliver Hartkopp
  2014-01-12 19:02       ` [PATCH] can: add explicit copyrights to can userspace header Uwe Kleine-König
@ 2014-01-12 19:53       ` Uwe Kleine-König
  1 sibling, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 19:53 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde

Hello,

On Sun, Jan 12, 2014 at 11:09:21AM +0100, Oliver Hartkopp wrote:
> On 12.01.2014 00:10, Uwe Kleine-König wrote:
> > This corresponds to Linux commits
> >   2485602f1af2 (can: add explicit copyrights to can headers)
> >   1c2da13c21a1 (can: add explicit copyrights to can's netlink header)
> > ---
> > Hello,
> > 
> > I would have expected to just need to do something like:
> > 
> > cd $path_to_canutils
> > rm -r include/socketcan/can
> > cd $path_to_linux
> > git archive --format=tar --prefix=socketcan/can/ v3.13-rc7:include/uapi/linux/can | tar xC $path_to_canutils/include
> > git cat-file blob v3.13-rc7:include/uapi/linux/can.h > $path_to_canutils/include/socketcan/can.h
> > 
> > to sync the header files. I didn't test but some changes introduced by
> > the above sequence seem to be uncompilable so I choosed to only
> > cherry-pick the two Linux commits. IMHO this is a bug (in Linux or
> > can-utils or maybe both).
That is actually easy to resolve. Please don't pick up this patch, I
will send a better one shortly.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-12 18:22           ` Oliver Hartkopp
@ 2014-01-12 19:54             ` Yegor Yefremov
  2014-01-12 19:59               ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Yegor Yefremov @ 2014-01-12 19:54 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: Uwe Kleine-König, linux-can, Marc Kleine-Budde

On Sun, Jan 12, 2014 at 7:22 PM, Oliver Hartkopp <socketcan@hartkopp.net> wrote:
>
>
> On 12.01.2014 17:09, Yegor Yefremov wrote:
>> On Sun, Jan 12, 2014 at 11:57 AM, Oliver Hartkopp
>> <socketcan@hartkopp.net> wrote:
>>>
>>>
>>> On 12.01.2014 00:38, Yegor Yefremov wrote:
>>>> On Sun, Jan 12, 2014 at 12:10 AM, Uwe Kleine-König
>>>> <u.kleine-koenig@pengutronix.de> wrote:
>>>>> The source file specifies slcand to be licensed under both GPL-2+ and GFDL.
>>>>> These two licenses are incompatible which makes this file undistributable.
>>>>> The clean way to fix this is to remove the file and reimplement its
>>>>> functionality under a valid license when need arises.
>>>>
>>>> There is need for this daemon. I'm using it in production tests.
>>>>
>>>
>>> Oh, yes. There was so much effort put into this slcand.
>>> We should better look how we might fix the license issues.
>>>
>>> The original thread where slcand comes from was here:
>>>
>>> http://socket-can.996257.n3.nabble.com/slcan-attach-and-resetting-line-disciplines-td1396.html
>>>
>>> And here was the original commit to the SVN:
>>> http://svn.berlios.de/wsvn/socketcan/trunk/can-utils/slcand.c?rev=973&peg=973
>>>
>>> The code has been removed from Wikipedia in October 2009
>>> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=321383226&oldid=320644717
>>> (not a textbook. these examples are completely opaque to non-experts)
>>>
>>> And it has been added here (wihout any license information):
>>> http://en.wikipedia.org/w/index.php?title=Daemon_%28computing%29&diff=273831207&oldid=273016660
>>>
>>> I assume we need to rewrite the daemon-specific code, e.g. use the
>>> other reference in Wikipedia:
>>>
>>>         http://www-theorie.physik.unizh.ch/~dpotter/howto/daemonize
>>>
>>> which is public domain - and I assume this to be the original source ...
>>
>> Would this call do the job: http://man7.org/linux/man-pages/man3/daemon.3.html?
>
> Yes, I think so.
>
> Here's a uClibc code for daemon()
> https://github.com/hwoarang/uClibc/blob/master-metag/libc/unistd/daemon.c
>
> As we do not need any 'specialties' for slcand (e.g. file i/o, logging, etc)
> this could shorten the slcand a lot.
>
> There are also some examples out there that could be adopted without getting
> into a licensing issue again:
> https://www.google.de/#q=linux+daemon+unistd

Would it be sufficient to submit a patch, that reimplements
daemonize() and fixes license? Instead of removing the file and
readding it?

Yegor

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils 3/3] slcand: remove program as it is undistributable
  2014-01-12 19:54             ` Yegor Yefremov
@ 2014-01-12 19:59               ` Oliver Hartkopp
  0 siblings, 0 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-12 19:59 UTC (permalink / raw)
  To: Yegor Yefremov; +Cc: Uwe Kleine-König, linux-can, Marc Kleine-Budde



On 12.01.2014 20:54, Yegor Yefremov wrote:

>>> Would this call do the job: http://man7.org/linux/man-pages/man3/daemon.3.html?
>>
>> Yes, I think so.
>>

(..)

> 
> Would it be sufficient to submit a patch, that reimplements
> daemonize() and fixes license? Instead of removing the file and
> readding it?
> 

Yes. Fixing this with a patch should be appropriate.

There's so many slcan specific code in slcand (of course) that pointing at
this special issue is the right thing to do IMO.

Regards,
Oliver

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils v2 0/3] License cleanup
  2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
                     ` (2 preceding siblings ...)
  2014-01-11 23:10   ` [PATCH can-utils 3/3] slcand: remove program as it is undistributable Uwe Kleine-König
@ 2014-01-12 21:24   ` Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers Uwe Kleine-König
                       ` (2 more replies)
  3 siblings, 3 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 21:24 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde, Yegor Yefremov

This is v2 of my effort to clean up the license stuff of can-utils to
make it fit for packaging for Debian.

Changes since (implicit) v1, Message-Id:
1389481823-8379-1-git-send-email-u.kleine-koenig@pengutronix.de:

 - drop patch "slcand: remove program as it is undistributable". I hope
   that Yegor and Oliver are resolving the issue I fixed by dropping the
   program.
 - new patch that adds license information to isotp.h
 - amend the kernel header sync with a cleanup to only have kernel
   headers below include/linux.

Best regards
Uwe

Uwe Kleine-König (3):
  headers: use include/linux only for Linux kernel headers
  ioctl.h: drop unused header
  isotp.h: add explicit license information

 GNUmakefile.am                  |  14 +--
 include/linux/can.h             | 195 +++++++++++++++++++++++++++++++++++++-
 include/linux/can/bcm.h         |  99 ++++++++++++++++++-
 include/linux/can/core.h        |   1 -
 include/linux/can/dev.h         |   1 -
 include/linux/can/error.h       | 124 +++++++++++++++++++++++-
 include/linux/can/gw.h          | 204 +++++++++++++++++++++++++++++++++++++++-
 include/linux/can/isotp.h       |   1 -
 include/linux/can/netlink.h     | 131 +++++++++++++++++++++++++-
 include/linux/can/raw.h         |  63 ++++++++++++-
 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/ioctl.h   |  99 -------------------
 include/socketcan/can/isotp.h   | 110 ----------------------
 include/socketcan/can/netlink.h | 122 ------------------------
 include/socketcan/can/raw.h     |  30 ------
 isotp.h                         | 140 +++++++++++++++++++++++++++
 isotprecv.c                     |   2 +-
 isotpsend.c                     |   2 +-
 isotpserver.c                   |   2 +-
 isotpsniffer.c                  |   2 +-
 isotptun.c                      |   2 +-
 24 files changed, 957 insertions(+), 882 deletions(-)
 delete mode 100644 include/linux/can/core.h
 delete mode 100644 include/linux/can/dev.h
 delete mode 100644 include/linux/can/isotp.h
 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/ioctl.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
 create mode 100644 isotp.h

-- 
1.8.5.2


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
@ 2014-01-12 21:24     ` Uwe Kleine-König
  2014-01-13  6:23       ` Oliver Hartkopp
  2014-01-12 21:24     ` [PATCH can-utils v2 2/3] ioctl.h: drop unused header Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 3/3] isotp.h: add explicit license information Uwe Kleine-König
  2 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 21:24 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde, Yegor Yefremov

Put headers from the Linux kernel (and only these) under include/linux.
Move the only remaining header into the project root and fix all
users.

This cleanup makes syncing the headers from Linux easier:

	cd $path_to_linux_repo
	make headers_install
	rsync -a --delete usr/include/linux/can* $path_to_can-utils/include/linux

This also syncs the Linux headers from v3.13-rc7 + commit "can: add
explicit copyrights to can userspace header" (which isn't applied yet);
the effective changes are:

 - add license to can.h, can/bcm.h, can/error.h, can/gw.h, can/netlink.h
   and can/raw.h
 - path adaptions: s;socketcan;linux; for include files
 - add #include <linux/version.h> (reason?)
 - use __kernel_sa_family_t instead of sa_family_t which requires
   <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
   can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
   could be fixed by adding something like:
   	#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 1, 0)
	typedef unsigned short __kernel_sa_family_t;
	#endif
   (Note, the comment in the old include/socketcan/can.h that
   6602a4baf4d1 (net: Make userland include of netlink.h more sane.) was
   introduced in Linux 3.2 is wrong, it hit mainline for 3.1-rc2.)
 - fix a small difference in a comment in can/gw.h introduced between
   ad7f44095ac3 (cangw: add an option for the per rule limitation of
   frame hops) in can-utils and 391ac1282dd7 (can: gw: add a per rule
   limitation of frame hops) in the Linux kernel.
 - remove two unused header files that #included non-existing headers.
---
 GNUmakefile.am                  |  13 +--
 include/linux/can.h             | 195 +++++++++++++++++++++++++++++++++++++-
 include/linux/can/bcm.h         |  99 ++++++++++++++++++-
 include/linux/can/core.h        |   1 -
 include/linux/can/dev.h         |   1 -
 include/linux/can/error.h       | 124 +++++++++++++++++++++++-
 include/linux/can/gw.h          | 204 +++++++++++++++++++++++++++++++++++++++-
 include/linux/can/isotp.h       |   1 -
 include/linux/can/netlink.h     | 131 +++++++++++++++++++++++++-
 include/linux/can/raw.h         |  63 ++++++++++++-
 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   | 110 ----------------------
 include/socketcan/can/netlink.h | 122 ------------------------
 include/socketcan/can/raw.h     |  30 ------
 isotp.h                         | 110 ++++++++++++++++++++++
 isotprecv.c                     |   2 +-
 isotpsend.c                     |   2 +-
 isotpserver.c                   |   2 +-
 isotpsniffer.c                  |   2 +-
 isotptun.c                      |   2 +-
 23 files changed, 927 insertions(+), 782 deletions(-)
 delete mode 100644 include/linux/can/core.h
 delete mode 100644 include/linux/can/dev.h
 delete mode 100644 include/linux/can/isotp.h
 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
 create mode 100644 isotp.h

diff --git a/GNUmakefile.am b/GNUmakefile.am
index fc8f6e73e139..744875d80c52 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -8,25 +8,16 @@ LDADD = \
 	libcan.la
 
 noinst_HEADERS = \
+	isotp.h \
 	lib.h \
 	terminal.h \
+	include/linux/can.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 \
-	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/ioctl.h \
-	include/socketcan/can/isotp.h \
-	include/socketcan/can/netlink.h \
-	include/socketcan/can/raw.h
 
 
 noinst_LTLIBRARIES = \
diff --git a/include/linux/can.h b/include/linux/can.h
index 958a3f42eedf..5d9d1d140718 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -1 +1,194 @@
-#include <socketcan/can.h>
+/*
+ * linux/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.
+ *
+ * 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
+#define CAN_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/linux/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
+
+/**
+ * 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 {
+	__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 6d61559ccb85..382251a1d214 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -1 +1,98 @@
-#include <socketcan/can/bcm.h>
+/*
+ * linux/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.
+ *
+ * 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
+#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/core.h b/include/linux/can/core.h
deleted file mode 100644
index 620c88ddc5c5..000000000000
--- 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 91879859cdf6..000000000000
--- a/include/linux/can/dev.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <socketcan/can/dev.h>
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index a02b1cae3388..b63204545320 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -1 +1,123 @@
-#include <socketcan/can/error.h>
+/*
+ * linux/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.
+ *
+ * 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
+#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 f37dbf064458..844c8964bdfe 100644
--- a/include/linux/can/gw.h
+++ b/include/linux/can/gw.h
@@ -1 +1,203 @@
-#include <socketcan/can/gw.h>
+/*
+ * linux/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.
+ *
+ * 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
+#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 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
+ * 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
deleted file mode 100644
index c52850f4bdb2..000000000000
--- a/include/linux/can/isotp.h
+++ /dev/null
@@ -1 +0,0 @@
-#include <socketcan/can/isotp.h>
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 99425f95e49b..df944ed206a8 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -1 +1,130 @@
-#include <socketcan/can/netlink.h>
+/*
+ * linux/can/netlink.h
+ *
+ * Definitions for the CAN netlink interface
+ *
+ * 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
+#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 22a90e54968d..c7d8c334e0ce 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -1 +1,62 @@
-#include <socketcan/can/raw.h>
+/*
+ * linux/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.
+ *
+ * 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
+#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 8452f0ea8fca..000000000000
--- 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 10185e86a596..000000000000
--- 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 <socketcan/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 b65c2317b40a..000000000000
--- 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 56d3246d7348..000000000000
--- 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 <socketcan/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 6ba5ef1269f4..000000000000
--- a/include/socketcan/can/isotp.h
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * socketcan/can/isotp.h
- *
- * 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>
- *
- */
-
-#ifndef CAN_ISOTP_H
-#define CAN_ISOTP_H
-
-#include <socketcan/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 9bb47e31748e..000000000000
--- 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 ee683c58412b..000000000000
--- 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 <socketcan/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/isotp.h b/isotp.h
new file mode 100644
index 000000000000..5499ca8e95c0
--- /dev/null
+++ b/isotp.h
@@ -0,0 +1,110 @@
+/*
+ * isotp.h
+ *
+ * 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>
+ *
+ */
+
+#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/isotprecv.c b/isotprecv.c
index 1c8f79c6f957..ad793be75119 100644
--- a/isotprecv.c
+++ b/isotprecv.c
@@ -53,7 +53,7 @@
 #include <sys/ioctl.h>
 
 #include <linux/can.h>
-#include <linux/can/isotp.h>
+#include "isotp.h"
 
 #define NO_CAN_ID 0xFFFFFFFFU
 
diff --git a/isotpsend.c b/isotpsend.c
index 3bb8282b2c50..8f2d96a38805 100644
--- a/isotpsend.c
+++ b/isotpsend.c
@@ -53,7 +53,7 @@
 #include <sys/ioctl.h>
 
 #include <linux/can.h>
-#include <linux/can/isotp.h>
+#include "isotp.h"
 
 #define NO_CAN_ID 0xFFFFFFFFU
 
diff --git a/isotpserver.c b/isotpserver.c
index 60b0a738c390..20c7c30a8492 100644
--- a/isotpserver.c
+++ b/isotpserver.c
@@ -73,7 +73,7 @@
 #include <netinet/in.h>
 
 #include <linux/can.h>
-#include <linux/can/isotp.h>
+#include "isotp.h"
 
 #define NO_CAN_ID 0xFFFFFFFFU
 
diff --git a/isotpsniffer.c b/isotpsniffer.c
index 84d39a2a9d46..fa5bdef33ba0 100644
--- a/isotpsniffer.c
+++ b/isotpsniffer.c
@@ -54,7 +54,7 @@
 #include <sys/ioctl.h>
 
 #include <linux/can.h>
-#include <linux/can/isotp.h>
+#include "isotp.h"
 #include "terminal.h"
 
 #define NO_CAN_ID 0xFFFFFFFFU
diff --git a/isotptun.c b/isotptun.c
index 77ee1d3cd539..bd62f4277f44 100644
--- a/isotptun.c
+++ b/isotptun.c
@@ -62,7 +62,7 @@
 #include <sys/ioctl.h>
 
 #include <linux/can.h>
-#include <linux/can/isotp.h>
+#include "isotp.h"
 #include <linux/if_tun.h>
 
 #define NO_CAN_ID 0xFFFFFFFFU
-- 
1.8.5.2


^ permalink raw reply related	[flat|nested] 41+ messages in thread

* [PATCH can-utils v2 2/3] ioctl.h: drop unused header
  2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers Uwe Kleine-König
@ 2014-01-12 21:24     ` Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 3/3] isotp.h: add explicit license information Uwe Kleine-König
  2 siblings, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 21:24 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde, Yegor Yefremov

This header doesn't exist in the Linux tree and it's unused by can-utils,
so drop it. As a side effect this fixes the last file not specifying any
license and/or copyright information.
---
 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 744875d80c52..d1a167c69588 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -17,7 +17,6 @@ noinst_HEADERS = \
 	include/linux/can/gw.h \
 	include/linux/can/netlink.h \
 	include/linux/can/raw.h \
-	include/socketcan/can/ioctl.h \
 
 
 noinst_LTLIBRARIES = \
diff --git a/include/socketcan/can/ioctl.h b/include/socketcan/can/ioctl.h
deleted file mode 100644
index ab34e8918667..000000000000
--- 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] 41+ messages in thread

* [PATCH can-utils v2 3/3] isotp.h: add explicit license information
  2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers Uwe Kleine-König
  2014-01-12 21:24     ` [PATCH can-utils v2 2/3] ioctl.h: drop unused header Uwe Kleine-König
@ 2014-01-12 21:24     ` Uwe Kleine-König
  2 siblings, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-12 21:24 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde, Yegor Yefremov

It seems this file was originally part of the Linux kernel as it was created
by commit 77de10356fe0 (include: import kernel header files into tree) but I
couldn't find it in the git history of the kernel. Anyhow the copyright
suggests to use the license used by the other files created by Volkswagen.
---
 isotp.h | 36 +++++++++++++++++++++++++++++++++---
 1 file changed, 33 insertions(+), 3 deletions(-)

diff --git a/isotp.h b/isotp.h
index 5499ca8e95c0..3540caf1b9b2 100644
--- a/isotp.h
+++ b/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] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-12 21:24     ` [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers Uwe Kleine-König
@ 2014-01-13  6:23       ` Oliver Hartkopp
  2014-01-13  7:20         ` Uwe Kleine-König
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-13  6:23 UTC (permalink / raw)
  To: Uwe Kleine-König, linux-can; +Cc: Marc Kleine-Budde, Yegor Yefremov

Hello Uwe,

On 12.01.2014 22:24, Uwe Kleine-König wrote:

>  - use __kernel_sa_family_t instead of sa_family_t which requires
>    <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
>    can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
>    could be fixed by adding something like:

This was exactly the idea to have a separate set of include files to make sure
the 'newest and greatest' tools can be build even on 2.6.24 environments where
there was no SocketCAN in mainline Linux.

And e.g. this

>  #include <linux/can.h>
> -#include <linux/can/isotp.h>
> +#include "isotp.h"
>  #include <linux/if_tun.h>

should be avoided too.

Please only fix the copyright information in this patch.

The wrong 3.1 -> 3.2 comparison should be fixed in a separate patch too.

But reorder the includes in a way you suggest needs at least some more
discussion (see requirements above).

Regards,
Oliver

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13  6:23       ` Oliver Hartkopp
@ 2014-01-13  7:20         ` Uwe Kleine-König
  2014-01-13 18:25           ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13  7:20 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov

Hello Oliver,

On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
> On 12.01.2014 22:24, Uwe Kleine-König wrote:
> 
> >  - use __kernel_sa_family_t instead of sa_family_t which requires
> >    <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
> >    can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
> >    could be fixed by adding something like:
> 
> This was exactly the idea to have a separate set of include files to make sure
> the 'newest and greatest' tools can be build even on 2.6.24 environments where
> there was no SocketCAN in mainline Linux.
Hmm, the newest and greatest tools are unusable if your kernel doesn't
also include the newest and greatest SocketCAN stuff. And then it is
easy to also have updated kernel headers, isn't it? Well, anyhow I just
found a system here at pengutronix with old enough kernel headers, so I
will do a fix.
 
> And e.g. this
> 
> >  #include <linux/can.h>
> > -#include <linux/can/isotp.h>
> > +#include "isotp.h"
> >  #include <linux/if_tun.h>
> 
> should be avoided too.
Why?

> Please only fix the copyright information in this patch.
OK, will split the patch accordingly.
 
> The wrong 3.1 -> 3.2 comparison should be fixed in a separate patch too.
> 
> But reorder the includes in a way you suggest needs at least some more
> discussion (see requirements above).
I'm not aware what needs discussion here (apart from the "build with old
kernel headers" requirement maybe). I will prepare a new series and then
we can discuss.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13  7:20         ` Uwe Kleine-König
@ 2014-01-13 18:25           ` Oliver Hartkopp
  2014-01-13 20:45             ` Uwe Kleine-König
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-13 18:25 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov



On 13.01.2014 08:20, Uwe Kleine-König wrote:
> Hello Oliver,
> 
> On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
>> On 12.01.2014 22:24, Uwe Kleine-König wrote:
>>
>>>  - use __kernel_sa_family_t instead of sa_family_t which requires
>>>    <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
>>>    can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
>>>    could be fixed by adding something like:
>>
>> This was exactly the idea to have a separate set of include files to make sure
>> the 'newest and greatest' tools can be build even on 2.6.24 environments where
>> there was no SocketCAN in mainline Linux.
> Hmm, the newest and greatest tools are unusable if your kernel doesn't
> also include the newest and greatest SocketCAN stuff.

Features that are not available in the kernel come back with an error.
But there's no reason not to have the latest can-utils with bug fixes and
functional enhancements for older kernels, right?

> And then it is
> easy to also have updated kernel headers, isn't it? Well, anyhow I just
> found a system here at pengutronix with old enough kernel headers, so I
> will do a fix.

ok. tnx.

>  
>> And e.g. this
>>
>>>  #include <linux/can.h>
>>> -#include <linux/can/isotp.h>
>>> +#include "isotp.h"
>>>  #include <linux/if_tun.h>
>>
>> should be avoided too.
> Why?

When isotp hits the kernel, there's no need to adapt all userland programs.

I don't think the current idea was that bad.
AFAIK the iproute2 package has a similar approach and contains always updated
kernel headers to be able to build even on older systems.


Best regards,
Oliver


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13 18:25           ` Oliver Hartkopp
@ 2014-01-13 20:45             ` Uwe Kleine-König
  2014-01-13 21:18               ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 20:45 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov

Hello Oliver,

On Mon, Jan 13, 2014 at 07:25:20PM +0100, Oliver Hartkopp wrote:
> On 13.01.2014 08:20, Uwe Kleine-König wrote:
> > Hello Oliver,
> > 
> > On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
> >> On 12.01.2014 22:24, Uwe Kleine-König wrote:
> >>
> >>>  - use __kernel_sa_family_t instead of sa_family_t which requires
> >>>    <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
> >>>    can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
> >>>    could be fixed by adding something like:
> >>
> >> This was exactly the idea to have a separate set of include files to make sure
> >> the 'newest and greatest' tools can be build even on 2.6.24 environments where
> >> there was no SocketCAN in mainline Linux.
> > Hmm, the newest and greatest tools are unusable if your kernel doesn't
> > also include the newest and greatest SocketCAN stuff.
> 
> Features that are not available in the kernel come back with an error.
> But there's no reason not to have the latest can-utils with bug fixes and
> functional enhancements for older kernels, right?
> 
> > And then it is
> > easy to also have updated kernel headers, isn't it? Well, anyhow I just
> > found a system here at pengutronix with old enough kernel headers, so I
> > will do a fix.
> 
> ok. tnx.
> 
> >  
> >> And e.g. this
> >>
> >>>  #include <linux/can.h>
> >>> -#include <linux/can/isotp.h>
> >>> +#include "isotp.h"
> >>>  #include <linux/if_tun.h>
> >>
> >> should be avoided too.
> > Why?
> 
> When isotp hits the kernel, there's no need to adapt all userland programs.
ah, didn't know that isotp targets the kernel. There is nothing in next
yet. I wonder if it's sensible to put it into can-utils' copy of the
kernel headers then. If you ask me keep isotp.h in / until it hits the
kernel, then sync the headers and switch the programs explicitly. Only
my 0.02 €.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13 20:45             ` Uwe Kleine-König
@ 2014-01-13 21:18               ` Oliver Hartkopp
  2014-01-13 21:26                 ` Uwe Kleine-König
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-13 21:18 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov



On 13.01.2014 21:45, Uwe Kleine-König wrote:
> Hello Oliver,
> 
> On Mon, Jan 13, 2014 at 07:25:20PM +0100, Oliver Hartkopp wrote:
>> On 13.01.2014 08:20, Uwe Kleine-König wrote:
>>> Hello Oliver,
>>>
>>> On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
>>>> On 12.01.2014 22:24, Uwe Kleine-König wrote:
>>>>
>>>>>  - use __kernel_sa_family_t instead of sa_family_t which requires
>>>>>    <linux/socket.h from Linux 3.1 or later. Unfortunately this makes
>>>>>    can-utils FTBFS on e.g. Debian squeeze. If this is an issue this
>>>>>    could be fixed by adding something like:
>>>>
>>>> This was exactly the idea to have a separate set of include files to make sure
>>>> the 'newest and greatest' tools can be build even on 2.6.24 environments where
>>>> there was no SocketCAN in mainline Linux.
>>> Hmm, the newest and greatest tools are unusable if your kernel doesn't
>>> also include the newest and greatest SocketCAN stuff.
>>
>> Features that are not available in the kernel come back with an error.
>> But there's no reason not to have the latest can-utils with bug fixes and
>> functional enhancements for older kernels, right?
>>
>>> And then it is
>>> easy to also have updated kernel headers, isn't it? Well, anyhow I just
>>> found a system here at pengutronix with old enough kernel headers, so I
>>> will do a fix.
>>
>> ok. tnx.
>>
>>>  
>>>> And e.g. this
>>>>
>>>>>  #include <linux/can.h>
>>>>> -#include <linux/can/isotp.h>
>>>>> +#include "isotp.h"
>>>>>  #include <linux/if_tun.h>
>>>>
>>>> should be avoided too.
>>> Why?
>>
>> When isotp hits the kernel, there's no need to adapt all userland programs.
> ah, didn't know that isotp targets the kernel. There is nothing in next
> yet. I wonder if it's sensible to put it into can-utils' copy of the
> kernel headers then. If you ask me keep isotp.h in / until it hits the
> kernel, then sync the headers and switch the programs explicitly. Only
> my 0.02 €.

What's the benefit of moving it to root and then moving it back to the includes?

Please let it stay in the current place.

Tnx,
Oliver


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13 21:18               ` Oliver Hartkopp
@ 2014-01-13 21:26                 ` Uwe Kleine-König
  2014-01-13 21:31                   ` Oliver Hartkopp
  0 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:26 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov

Hello Oliver,

On Mon, Jan 13, 2014 at 10:18:04PM +0100, Oliver Hartkopp wrote:
> On 13.01.2014 21:45, Uwe Kleine-König wrote:
> > On Mon, Jan 13, 2014 at 07:25:20PM +0100, Oliver Hartkopp wrote:
> >> On 13.01.2014 08:20, Uwe Kleine-König wrote:
> >>> On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
> >>>> And e.g. this
> >>>>
> >>>>>  #include <linux/can.h>
> >>>>> -#include <linux/can/isotp.h>
> >>>>> +#include "isotp.h"
> >>>>>  #include <linux/if_tun.h>
> >>>>
> >>>> should be avoided too.
> >>> Why?
> >>
> >> When isotp hits the kernel, there's no need to adapt all userland programs.
To be honest, it's not that hard to update all userland programs. I did
it with:

	perl -p -i -e 's,^#include <whatever/can/isotp.h>$,#include "isotp.h",' isotp*

(well, plus some reformatting, but meh).

> > ah, didn't know that isotp targets the kernel. There is nothing in next
> > yet. I wonder if it's sensible to put it into can-utils' copy of the
> > kernel headers then. If you ask me keep isotp.h in / until it hits the
> > kernel, then sync the headers and switch the programs explicitly. Only
> > my 0.02 €.
> 
> What's the benefit of moving it to root and then moving it back to the includes?
The benefit is that there is less chance for surprises. Updating the
kernel header copy still has a manual component when there are files in
can-utils that are not existing in the kernel. Also I like changes to be
explicit. When isotp.h is now kept in can-utils/include/linux and later
hits the kernel there is no explicit commit that marks the start of
using the kernel header and changing the procedure how to sync kernel
headers. YMMV

> Please let it stay in the current place.
To late for v3, only read your mail when I sent it out.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13 21:26                 ` Uwe Kleine-König
@ 2014-01-13 21:31                   ` Oliver Hartkopp
  2014-01-13 21:37                     ` Uwe Kleine-König
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
  0 siblings, 2 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-13 21:31 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov



On 13.01.2014 22:26, Uwe Kleine-König wrote:
> Hello Oliver,
> 
> On Mon, Jan 13, 2014 at 10:18:04PM +0100, Oliver Hartkopp wrote:
>> On 13.01.2014 21:45, Uwe Kleine-König wrote:
>>> On Mon, Jan 13, 2014 at 07:25:20PM +0100, Oliver Hartkopp wrote:
>>>> On 13.01.2014 08:20, Uwe Kleine-König wrote:
>>>>> On Mon, Jan 13, 2014 at 07:23:55AM +0100, Oliver Hartkopp wrote:
>>>>>> And e.g. this
>>>>>>
>>>>>>>  #include <linux/can.h>
>>>>>>> -#include <linux/can/isotp.h>
>>>>>>> +#include "isotp.h"
>>>>>>>  #include <linux/if_tun.h>
>>>>>>
>>>>>> should be avoided too.
>>>>> Why?
>>>>
>>>> When isotp hits the kernel, there's no need to adapt all userland programs.
> To be honest, it's not that hard to update all userland programs. I did
> it with:
> 
> 	perl -p -i -e 's,^#include <whatever/can/isotp.h>$,#include "isotp.h",' isotp*
> 
> (well, plus some reformatting, but meh).
> 
>>> ah, didn't know that isotp targets the kernel. There is nothing in next
>>> yet. I wonder if it's sensible to put it into can-utils' copy of the
>>> kernel headers then. If you ask me keep isotp.h in / until it hits the
>>> kernel, then sync the headers and switch the programs explicitly. Only
>>> my 0.02 €.
>>
>> What's the benefit of moving it to root and then moving it back to the includes?
> The benefit is that there is less chance for surprises. Updating the
> kernel header copy still has a manual component when there are files in
> can-utils that are not existing in the kernel. Also I like changes to be
> explicit. When isotp.h is now kept in can-utils/include/linux and later
> hits the kernel there is no explicit commit that marks the start of
> using the kernel header and changing the procedure how to sync kernel
> headers. YMMV
> 
>> Please let it stay in the current place.
> To late for v3, only read your mail when I sent it out.
> 

Sorry that I did not was faster.

But it's never too late for my NACK for the "[PATCH can-utils v3 2/5] Move
isotp.h into the project root" :-)

To all the other stuff you may add my Acked-by: in the next attempt.

Btw. did you test the stuff on the 'old' system as you mentioned?

Regards,
Oliver

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers
  2014-01-13 21:31                   ` Oliver Hartkopp
@ 2014-01-13 21:37                     ` Uwe Kleine-König
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
  1 sibling, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:37 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde, Yegor Yefremov

Hello Oliver,

On Mon, Jan 13, 2014 at 10:31:56PM +0100, Oliver Hartkopp wrote:
> >> Please let it stay in the current place.
> > To late for v3, only read your mail when I sent it out.
> > 
> 
> Sorry that I did not was faster.
> 
> But it's never too late for my NACK for the "[PATCH can-utils v3 2/5] Move
> isotp.h into the project root" :-)
> 
> To all the other stuff you may add my Acked-by: in the next attempt.
> 
> Btw. did you test the stuff on the 'old' system as you mentioned?
No, but I didn't sync the kernel headers, so everything should still
work. I will drop patch 2 as you insist and I don't care much. Then I
can test on the old system.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils v4 0/4] License cleanup
  2014-01-13 21:31                   ` Oliver Hartkopp
  2014-01-13 21:37                     ` Uwe Kleine-König
@ 2014-01-13 21:57                     ` Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 1/4] Remove two unused header files Uwe Kleine-König
                                         ` (3 more replies)
  1 sibling, 4 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:57 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

Hello,

compared to v3 I dropped the patch to move isotp.h to the project root
and did the necessary follow-up changes. Builds fine on a system that
has installed kernel headers from 2.6.32.

Best regards
Uwe

Uwe Kleine-König (4):
  Remove two unused header files
  Move includes copied from the Linux kernel into include/linux
  ioctl.h: drop unused header
  isotp.h: add explicit license information

 GNUmakefile.am                  |  11 +--
 include/linux/can.h             | 168 ++++++++++++++++++++++++++++++++++++++-
 include/linux/can/bcm.h         |  67 +++++++++++++++-
 include/linux/can/core.h        |   1 -
 include/linux/can/dev.h         |   1 -
 include/linux/can/error.h       |  92 ++++++++++++++++++++-
 include/linux/can/gw.h          | 172 +++++++++++++++++++++++++++++++++++++++-
 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/ioctl.h   |  99 -----------------------
 include/socketcan/can/isotp.h   |  38 ++++++++-
 include/socketcan/can/netlink.h | 122 ----------------------------
 include/socketcan/can/raw.h     |  30 -------
 17 files changed, 682 insertions(+), 768 deletions(-)
 delete mode 100644 include/linux/can/core.h
 delete mode 100644 include/linux/can/dev.h
 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/ioctl.h
 delete mode 100644 include/socketcan/can/netlink.h
 delete mode 100644 include/socketcan/can/raw.h

-- 
1.8.5.2


^ permalink raw reply	[flat|nested] 41+ messages in thread

* [PATCH can-utils v4 1/4] Remove two unused header files
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
@ 2014-01-13 21:57                       ` Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 2/4] Move includes copied from the Linux kernel into include/linux Uwe Kleine-König
                                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:57 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

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>
---
 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 fc8f6e73e139..34a7740c9906 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 620c88ddc5c5..000000000000
--- 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 91879859cdf6..000000000000
--- 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] 41+ messages in thread

* [PATCH can-utils v4 2/4] Move includes copied from the Linux kernel into include/linux
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 1/4] Remove two unused header files Uwe Kleine-König
@ 2014-01-13 21:57                       ` Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 3/4] ioctl.h: drop unused header Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 4/4] isotp.h: add explicit license information Uwe Kleine-König
  3 siblings, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:57 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

This makes it possible to update the copies more easily, e.g.:

	cd $path_to_linux_repo
	make headers_install
	rsync -a --delete --exclude .\* usr/include/linux/can* $path_to_can_utils/include/linux

Also fix the few users that made explicit use of the wrong location
(linux/can/{bcm,gw,raw}.h and isotp.h).

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 GNUmakefile.am                  |   8 +-
 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/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   |   2 +-
 include/socketcan/can/netlink.h | 122 ----------------------------
 include/socketcan/can/raw.h     |  30 -------
 14 files changed, 649 insertions(+), 661 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/netlink.h
 delete mode 100644 include/socketcan/can/raw.h

diff --git a/GNUmakefile.am b/GNUmakefile.am
index 34a7740c9906..e3d7c8518884 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -10,21 +10,15 @@ LDADD = \
 noinst_HEADERS = \
 	lib.h \
 	terminal.h \
+	include/linux/can.h \
 	include/linux/can/bcm.h \
 	include/linux/can/error.h \
 	include/linux/can/gw.h \
-	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/ioctl.h \
 	include/socketcan/can/isotp.h \
-	include/socketcan/can/netlink.h \
-	include/socketcan/can/raw.h
 
 
 noinst_LTLIBRARIES = \
diff --git a/include/linux/can.h b/include/linux/can.h
index 958a3f42eedf..8452f0ea8fca 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 6d61559ccb85..f10af828e5bc 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 a02b1cae3388..b65c2317b40a 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 f37dbf064458..f709809c0e99 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/netlink.h b/include/linux/can/netlink.h
index 99425f95e49b..9bb47e31748e 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 22a90e54968d..c80bff0e6c60 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 8452f0ea8fca..000000000000
--- 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 10185e86a596..000000000000
--- 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 <socketcan/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 b65c2317b40a..000000000000
--- 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 56d3246d7348..000000000000
--- 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 <socketcan/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
index 6ba5ef1269f4..0a45afe83268 100644
--- a/include/socketcan/can/isotp.h
+++ b/include/socketcan/can/isotp.h
@@ -16,7 +16,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/netlink.h b/include/socketcan/can/netlink.h
deleted file mode 100644
index 9bb47e31748e..000000000000
--- 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 ee683c58412b..000000000000
--- 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 <socketcan/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] 41+ messages in thread

* [PATCH can-utils v4 3/4] ioctl.h: drop unused header
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 1/4] Remove two unused header files Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 2/4] Move includes copied from the Linux kernel into include/linux Uwe Kleine-König
@ 2014-01-13 21:57                       ` Uwe Kleine-König
  2014-01-13 21:57                       ` [PATCH can-utils v4 4/4] isotp.h: add explicit license information Uwe Kleine-König
  3 siblings, 0 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:57 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

This header doesn't exist in the Linux tree and it's unused by can-utils,
so drop it. As a side effect this fixes the last file not specifying any
license and/or copyright information.

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 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 e3d7c8518884..761f7db26ad9 100644
--- a/GNUmakefile.am
+++ b/GNUmakefile.am
@@ -17,7 +17,6 @@ noinst_HEADERS = \
 	include/linux/can/isotp.h \
 	include/linux/can/netlink.h \
 	include/linux/can/raw.h \
-	include/socketcan/can/ioctl.h \
 	include/socketcan/can/isotp.h \
 
 
diff --git a/include/socketcan/can/ioctl.h b/include/socketcan/can/ioctl.h
deleted file mode 100644
index ab34e8918667..000000000000
--- 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] 41+ messages in thread

* [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
                                         ` (2 preceding siblings ...)
  2014-01-13 21:57                       ` [PATCH can-utils v4 3/4] ioctl.h: drop unused header Uwe Kleine-König
@ 2014-01-13 21:57                       ` Uwe Kleine-König
  2014-01-14  7:01                         ` Oliver Hartkopp
  3 siblings, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-13 21:57 UTC (permalink / raw)
  To: linux-can; +Cc: Oliver Hartkopp, Marc Kleine-Budde

It seems this file was originally part of the Linux kernel as it was created
by commit 77de10356fe0 (include: import kernel header files into tree) but I
couldn't find it in the git history of the kernel. Anyhow the copyright
suggests to use the license used by the other files created by Volkswagen.

Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
---
 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 0a45afe83268..18d13d1467de 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] 41+ messages in thread

* Re: [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-13 21:57                       ` [PATCH can-utils v4 4/4] isotp.h: add explicit license information Uwe Kleine-König
@ 2014-01-14  7:01                         ` Oliver Hartkopp
  2014-01-14  8:46                           ` Uwe Kleine-König
  0 siblings, 1 reply; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-14  7:01 UTC (permalink / raw)
  To: Uwe Kleine-König, linux-can; +Cc: Marc Kleine-Budde

Hi Uwe,

On 13.01.2014 22:57, Uwe Kleine-König wrote:
> It seems this file was originally part of the Linux kernel as it was created
> by commit 77de10356fe0 (include: import kernel header files into tree) but I
> couldn't find it in the git history of the kernel.

This comes from the original development process in the BerliOS SVN.
The fact that these files are kernel header files does not necessarily mean
they have been imported from the kernel source tree :-)

> Anyhow the copyright
> suggests to use the license used by the other files created by Volkswagen.

Indeed.

> 
> Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
> ---
>  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

Is this the only file in include/socketcan now?
I thought you wanted to get rid of this construct and move everything over to
the include/linux directory to finally remove include/socketecan ??

Regards,
Oliver

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-14  7:01                         ` Oliver Hartkopp
@ 2014-01-14  8:46                           ` Uwe Kleine-König
  2014-01-14 15:49                             ` Oliver Hartkopp
  2014-01-16 19:18                             ` Uwe Kleine-König
  0 siblings, 2 replies; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-14  8:46 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde

Hey Oliver,

On Tue, Jan 14, 2014 at 08:01:33AM +0100, Oliver Hartkopp wrote:
> On 13.01.2014 22:57, Uwe Kleine-König wrote:
> > It seems this file was originally part of the Linux kernel as it was created
> > by commit 77de10356fe0 (include: import kernel header files into tree) but I
> > couldn't find it in the git history of the kernel.
> 
> This comes from the original development process in the BerliOS SVN.
> The fact that these files are kernel header files does not necessarily mean
> they have been imported from the kernel source tree :-)
Strange concept. Either you need some additional Userspace API in the
kernel for your isotp programs or you don't. In the first case there
must be a header in the kernel providing that API (if not in mainline
that at least in some can tree). In the latter case where everything
works with the kernel as is, you shouldn't declare something to be a
kernel header that doesn't need to.
 
> > Anyhow the copyright
> > suggests to use the license used by the other files created by Volkswagen.
> 
> Indeed.
> 
> > 
> > Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
> > ---
> >  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
> 
> Is this the only file in include/socketcan now?
> I thought you wanted to get rid of this construct and move everything over to
> the include/linux directory to finally remove include/socketecan ??
You said:
	Please let it stay in the current place.

So did I. :-)

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-14  8:46                           ` Uwe Kleine-König
@ 2014-01-14 15:49                             ` Oliver Hartkopp
  2014-01-16 19:18                             ` Uwe Kleine-König
  1 sibling, 0 replies; 41+ messages in thread
From: Oliver Hartkopp @ 2014-01-14 15:49 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-can, Marc Kleine-Budde

On 14.01.2014 09:46, Uwe Kleine-König wrote:

>> Is this the only file in include/socketcan now?
>> I thought you wanted to get rid of this construct and move everything over to
>> the include/linux directory to finally remove include/socketecan ??
> You said:
> 	Please let it stay in the current place.
> 
> So did I. :-)

Sigh. You are kidding me.

Please make your choice:

[ ] Please let it stay in the current place with all the other includes
[ ] Do not put it to a different place away from the other includes

We obviously need to work on our communication :-(

As you moved *all* the includes to a new place I was not able to imagine that
you would even think about leaving *only* isotp.h in include/socketcan.

Regards,
Oliver


^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH] can: add explicit copyrights to can userspace header
  2014-01-12 19:02       ` [PATCH] can: add explicit copyrights to can userspace header Uwe Kleine-König
  2014-01-12 19:27         ` Oliver Hartkopp
@ 2014-01-16 16:27         ` Marc Kleine-Budde
  1 sibling, 0 replies; 41+ messages in thread
From: Marc Kleine-Budde @ 2014-01-16 16:27 UTC (permalink / raw)
  To: Uwe Kleine-König, linux-can; +Cc: kernel, Oliver Hartkopp, Urs Thuermann

[-- Attachment #1: Type: text/plain, Size: 575 bytes --]

On 01/12/2014 08:02 PM, Uwe Kleine-König wrote:
> This is in the spirit of commit 2485602f1af2 (can: add explicit
> copyrights to can headers). It seems I have missed can.h back then.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Tnx, applied to can-next.

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] 41+ messages in thread

* Re: [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-14  8:46                           ` Uwe Kleine-König
  2014-01-14 15:49                             ` Oliver Hartkopp
@ 2014-01-16 19:18                             ` Uwe Kleine-König
  2014-01-16 22:05                               ` Marc Kleine-Budde
  1 sibling, 1 reply; 41+ messages in thread
From: Uwe Kleine-König @ 2014-01-16 19:18 UTC (permalink / raw)
  To: Oliver Hartkopp; +Cc: linux-can, Marc Kleine-Budde

Hey Oliver,

On Tue, Jan 14, 2014 at 09:46:16AM +0100, Uwe Kleine-König wrote:
> On Tue, Jan 14, 2014 at 08:01:33AM +0100, Oliver Hartkopp wrote:
> > On 13.01.2014 22:57, Uwe Kleine-König wrote:
> > > It seems this file was originally part of the Linux kernel as it was created
> > > by commit 77de10356fe0 (include: import kernel header files into tree) but I
> > > couldn't find it in the git history of the kernel.
> > 
> > This comes from the original development process in the BerliOS SVN.
> > The fact that these files are kernel header files does not necessarily mean
> > they have been imported from the kernel source tree :-)
> Strange concept. Either you need some additional Userspace API in the
> kernel for your isotp programs or you don't. In the first case there
> must be a header in the kernel providing that API (if not in mainline
> that at least in some can tree). In the latter case where everything
> works with the kernel as is, you shouldn't declare something to be a
> kernel header that doesn't need to.
Looking a bit into the isotp*.c files it seems the isotp header falls
into the first category, i.e. you need kernel support to use these. Is
that correct? Is there an up-to-date kernel tree somewhere that holds
the necessary patches? If yes, I suggest to document that tree somewhere
in can-utils to be the source for the kernel headers.

> > > Anyhow the copyright
> > > suggests to use the license used by the other files created by Volkswagen.
> > 
> > Indeed.
> > 
> > > 
> > > Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
> > > ---
> > >  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
> > 
> > Is this the only file in include/socketcan now?
> > I thought you wanted to get rid of this construct and move everything over to
> > the include/linux directory to finally remove include/socketecan ??
> You said:
> 	Please let it stay in the current place.
> 
> So did I. :-)
I didn't intend to get on your nerves here. When I send out the series I
noticed that isotp.h stayed alone there just when patches 1-3 were
already send out and I was too tired to resolve that. I admit being
guilty not to address that when I was back at my computer the next day.
Anyhow, what I wrote above still applies, and before that isn't resolved
it feels wrong (at least to me) to include isotp.h in the move.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

^ permalink raw reply	[flat|nested] 41+ messages in thread

* Re: [PATCH can-utils v4 4/4] isotp.h: add explicit license information
  2014-01-16 19:18                             ` Uwe Kleine-König
@ 2014-01-16 22:05                               ` Marc Kleine-Budde
  0 siblings, 0 replies; 41+ messages in thread
From: Marc Kleine-Budde @ 2014-01-16 22:05 UTC (permalink / raw)
  To: Uwe Kleine-König, Oliver Hartkopp; +Cc: linux-can

[-- Attachment #1: Type: text/plain, Size: 1700 bytes --]

On 01/16/2014 08:18 PM, Uwe Kleine-König wrote:
>> On Tue, Jan 14, 2014 at 08:01:33AM +0100, Oliver Hartkopp wrote:
>>> On 13.01.2014 22:57, Uwe Kleine-König wrote:
>>>> It seems this file was originally part of the Linux kernel as it was created
>>>> by commit 77de10356fe0 (include: import kernel header files into tree) but I
>>>> couldn't find it in the git history of the kernel.
>>>
>>> This comes from the original development process in the BerliOS SVN.
>>> The fact that these files are kernel header files does not necessarily mean
>>> they have been imported from the kernel source tree :-)
>> Strange concept. Either you need some additional Userspace API in the
>> kernel for your isotp programs or you don't. In the first case there
>> must be a header in the kernel providing that API (if not in mainline
>> that at least in some can tree). In the latter case where everything
>> works with the kernel as is, you shouldn't declare something to be a
>> kernel header that doesn't need to.

> Looking a bit into the isotp*.c files it seems the isotp header falls
> into the first category, i.e. you need kernel support to use these. Is
> that correct? Is there an up-to-date kernel tree somewhere that holds
> the necessary patches? If yes, I suggest to document that tree somewhere
> in can-utils to be the source for the kernel headers.

Isotp is an external Kernel module.

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] 41+ messages in thread

end of thread, other threads:[~2014-01-16 22:05 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-08-17 19:05 license issues of can-utils Uwe Kleine-König
2013-08-17 20:24 ` Marc Kleine-Budde
2013-08-18 10:26   ` Oliver Hartkopp
2014-01-11 23:10 ` [PATCH can-utils 0/3] License cleanup Uwe Kleine-König
2014-01-11 23:10   ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
2014-01-12 10:09     ` Oliver Hartkopp
2014-01-12 19:02       ` [PATCH] can: add explicit copyrights to can userspace header Uwe Kleine-König
2014-01-12 19:27         ` Oliver Hartkopp
2014-01-16 16:27         ` Marc Kleine-Budde
2014-01-12 19:53       ` [PATCH can-utils 1/3] Update license information for some header files Uwe Kleine-König
2014-01-11 23:10   ` [PATCH can-utils 2/3] ioctl.h: drop unused header Uwe Kleine-König
2014-01-12 10:18     ` Oliver Hartkopp
2014-01-11 23:10   ` [PATCH can-utils 3/3] slcand: remove program as it is undistributable Uwe Kleine-König
2014-01-11 23:38     ` Yegor Yefremov
2014-01-12 10:57       ` Oliver Hartkopp
2014-01-12 16:09         ` Yegor Yefremov
2014-01-12 18:22           ` Oliver Hartkopp
2014-01-12 19:54             ` Yegor Yefremov
2014-01-12 19:59               ` Oliver Hartkopp
2014-01-12 21:24   ` [PATCH can-utils v2 0/3] License cleanup Uwe Kleine-König
2014-01-12 21:24     ` [PATCH can-utils v2 1/3] headers: use include/linux only for Linux kernel headers Uwe Kleine-König
2014-01-13  6:23       ` Oliver Hartkopp
2014-01-13  7:20         ` Uwe Kleine-König
2014-01-13 18:25           ` Oliver Hartkopp
2014-01-13 20:45             ` Uwe Kleine-König
2014-01-13 21:18               ` Oliver Hartkopp
2014-01-13 21:26                 ` Uwe Kleine-König
2014-01-13 21:31                   ` Oliver Hartkopp
2014-01-13 21:37                     ` Uwe Kleine-König
2014-01-13 21:57                     ` [PATCH can-utils v4 0/4] License cleanup Uwe Kleine-König
2014-01-13 21:57                       ` [PATCH can-utils v4 1/4] Remove two unused header files Uwe Kleine-König
2014-01-13 21:57                       ` [PATCH can-utils v4 2/4] Move includes copied from the Linux kernel into include/linux Uwe Kleine-König
2014-01-13 21:57                       ` [PATCH can-utils v4 3/4] ioctl.h: drop unused header Uwe Kleine-König
2014-01-13 21:57                       ` [PATCH can-utils v4 4/4] isotp.h: add explicit license information Uwe Kleine-König
2014-01-14  7:01                         ` Oliver Hartkopp
2014-01-14  8:46                           ` Uwe Kleine-König
2014-01-14 15:49                             ` Oliver Hartkopp
2014-01-16 19:18                             ` Uwe Kleine-König
2014-01-16 22:05                               ` Marc Kleine-Budde
2014-01-12 21:24     ` [PATCH can-utils v2 2/3] ioctl.h: drop unused header Uwe Kleine-König
2014-01-12 21:24     ` [PATCH can-utils v2 3/3] isotp.h: add explicit license information Uwe Kleine-König

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.