Subject: Re: [PATCH 1/7] CAN: Allocate protocol numbers for PF_CAN

From: Arnaldo Carvalho de Melo <[email-masked]>
Date: Tue, 2 Oct 2007 11:11:38 -0300

Em Tue, Oct 02, 2007 at 03:10:07PM +0200, Urs Thuermann escreveu:
> This patch adds a protocol/address family number, ARP hardware type,
> ethernet packet type, and a line discipline number for the SocketCAN
> implementation.
> 
> Signed-off-by: Oliver Hartkopp <[email-masked]>
> Signed-off-by: Urs Thuermann <[email-masked]>
> 
> ---
>  include/linux/if.h       |    4 +++-
>  include/linux/if_arp.h   |    1 +
>  include/linux/if_ether.h |    1 +
>  include/linux/socket.h   |    2 ++
>  include/linux/tty.h      |    3 ++-
>  net/core/sock.c          |    4 ++--
>  6 files changed, 11 insertions(+), 4 deletions(-)
> 
> Index: net-2.6.24/include/linux/if_arp.h
> ===================================================================
> --- net-2.6.24.orig/include/linux/if_arp.h	2007-10-02 12:10:51.000000000 +0200
> +++ net-2.6.24/include/linux/if_arp.h	2007-10-02 12:11:01.000000000 +0200
> @@ -52,6 +52,7 @@
>  #define ARPHRD_ROSE	270
>  #define ARPHRD_X25	271		/* CCITT X.25			*/
>  #define ARPHRD_HWX25	272		/* Boards with X.25 in firmware	*/
> +#define ARPHRD_CAN	280		/* Controller Area Network      */

Is 280 used in other OS? Just curious as why not using 273

>  #define ARPHRD_PPP	512
>  #define ARPHRD_CISCO	513		/* Cisco HDLC	 		*/
>  #define ARPHRD_HDLC	ARPHRD_CISCO
> Index: net-2.6.24/include/linux/if_ether.h
> ===================================================================
> --- net-2.6.24.orig/include/linux/if_ether.h	2007-10-02 12:10:51.000000000 +0200
> +++ net-2.6.24/include/linux/if_ether.h	2007-10-02 12:11:01.000000000 +0200
> @@ -90,6 +90,7 @@
>  #define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
>  #define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
>  #define ETH_P_LOCALTALK 0x0009		/* Localtalk pseudo type 	*/
> +#define ETH_P_CAN	0x000C		/* Controller Area Network      */
>  #define ETH_P_PPPTALK	0x0010		/* Dummy type for Atalk over PPP*/
>  #define ETH_P_TR_802_2	0x0011		/* 802.2 frames 		*/
>  #define ETH_P_MOBITEX	0x0015		/* Mobitex ([email-masked])	*/
> Index: net-2.6.24/include/linux/socket.h
> ===================================================================
> --- net-2.6.24.orig/include/linux/socket.h	2007-10-02 12:10:51.000000000 +0200
> +++ net-2.6.24/include/linux/socket.h	2007-10-02 12:11:01.000000000 +0200
> @@ -185,6 +185,7 @@
>  #define AF_PPPOX	24	/* PPPoX sockets		*/
>  #define AF_WANPIPE	25	/* Wanpipe API Sockets */
>  #define AF_LLC		26	/* Linux LLC			*/
> +#define AF_CAN		29	/* Controller Area Network      */

Ditto

>  #define AF_TIPC		30	/* TIPC sockets			*/
>  #define AF_BLUETOOTH	31	/* Bluetooth sockets 		*/
>  #define AF_IUCV		32	/* IUCV sockets			*/
> @@ -220,6 +221,7 @@
>  #define PF_PPPOX	AF_PPPOX