]> rtime.felk.cvut.cz Git - socketcan-devel.git/blob - patch-series/2.6.22/01-can-proto-numbers.diff
Add kernel version depency for Kernel 3.1.x which extended __rtnl_register().
[socketcan-devel.git] / patch-series / 2.6.22 / 01-can-proto-numbers.diff
1 DESC
2 CAN: Allocate protocol numbers for PF_CAN
3 EDESC
4 This patch adds a protocol/address family number, ARP hardware type,
5 ethernet packet type, and a line discipline number for the SocketCAN
6 implementation.
7
8 Signed-off-by: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
9 Signed-off-by: Urs Thuermann <urs.thuermann@volkswagen.de>
10
11 ---
12  include/linux/if_arp.h   |    1 +
13  include/linux/if_ether.h |    1 +
14  include/linux/socket.h   |    2 ++
15  include/linux/tty.h      |    3 ++-
16  net/core/sock.c          |    4 ++--
17  5 files changed, 8 insertions(+), 3 deletions(-)
18
19 Index: linux-2.6.22/include/linux/if_arp.h
20 ===================================================================
21 --- linux-2.6.22.orig/include/linux/if_arp.h    2007-07-09 10:42:42.000000000 +0200
22 +++ linux-2.6.22/include/linux/if_arp.h 2007-07-09 10:42:48.000000000 +0200
23 @@ -52,6 +52,7 @@
24  #define ARPHRD_ROSE    270
25  #define ARPHRD_X25     271             /* CCITT X.25                   */
26  #define ARPHRD_HWX25   272             /* Boards with X.25 in firmware */
27 +#define ARPHRD_CAN     280             /* Controller Area Network      */
28  #define ARPHRD_PPP     512
29  #define ARPHRD_CISCO   513             /* Cisco HDLC                   */
30  #define ARPHRD_HDLC    ARPHRD_CISCO
31 Index: linux-2.6.22/include/linux/if_ether.h
32 ===================================================================
33 --- linux-2.6.22.orig/include/linux/if_ether.h  2007-07-09 10:42:42.000000000 +0200
34 +++ linux-2.6.22/include/linux/if_ether.h       2007-07-09 10:42:48.000000000 +0200
35 @@ -90,6 +90,7 @@
36  #define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
37  #define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
38  #define ETH_P_LOCALTALK 0x0009         /* Localtalk pseudo type        */
39 +#define ETH_P_CAN      0x000C          /* Controller Area Network      */
40  #define ETH_P_PPPTALK  0x0010          /* Dummy type for Atalk over PPP*/
41  #define ETH_P_TR_802_2 0x0011          /* 802.2 frames                 */
42  #define ETH_P_MOBITEX  0x0015          /* Mobitex (kaz@cafe.net)       */
43 Index: linux-2.6.22/include/linux/socket.h
44 ===================================================================
45 --- linux-2.6.22.orig/include/linux/socket.h    2007-07-09 10:42:42.000000000 +0200
46 +++ linux-2.6.22/include/linux/socket.h 2007-07-09 10:42:48.000000000 +0200
47 @@ -185,6 +185,7 @@
48  #define AF_PPPOX       24      /* PPPoX sockets                */
49  #define AF_WANPIPE     25      /* Wanpipe API Sockets */
50  #define AF_LLC         26      /* Linux LLC                    */
51 +#define AF_CAN         29      /* Controller Area Network      */
52  #define AF_TIPC                30      /* TIPC sockets                 */
53  #define AF_BLUETOOTH   31      /* Bluetooth sockets            */
54  #define AF_IUCV                32      /* IUCV sockets                 */
55 @@ -220,6 +221,7 @@
56  #define PF_PPPOX       AF_PPPOX
57  #define PF_WANPIPE     AF_WANPIPE
58  #define PF_LLC         AF_LLC
59 +#define PF_CAN         AF_CAN
60  #define PF_TIPC                AF_TIPC
61  #define PF_BLUETOOTH   AF_BLUETOOTH
62  #define PF_IUCV                AF_IUCV
63 Index: linux-2.6.22/include/linux/tty.h
64 ===================================================================
65 --- linux-2.6.22.orig/include/linux/tty.h       2007-07-09 10:42:42.000000000 +0200
66 +++ linux-2.6.22/include/linux/tty.h    2007-07-09 10:42:48.000000000 +0200
67 @@ -24,7 +24,7 @@
68  #define NR_PTYS        CONFIG_LEGACY_PTY_COUNT   /* Number of legacy ptys */
69  #define NR_UNIX98_PTY_DEFAULT  4096      /* Default maximum for Unix98 ptys */
70  #define NR_UNIX98_PTY_MAX      (1 << MINORBITS) /* Absolute limit */
71 -#define NR_LDISCS              17
72 +#define NR_LDISCS              18
73  
74  /* line disciplines */
75  #define N_TTY          0
76 @@ -45,6 +45,7 @@
77  #define N_SYNC_PPP     14      /* synchronous PPP */
78  #define N_HCI          15      /* Bluetooth HCI UART */
79  #define N_GIGASET_M101 16      /* Siemens Gigaset M101 serial DECT adapter */
80 +#define N_SLCAN                17      /* Serial / USB serial CAN Adaptors */
81  
82  /*
83   * This character is the same as _POSIX_VDISABLE: it cannot be used as
84 Index: linux-2.6.22/net/core/sock.c
85 ===================================================================
86 --- linux-2.6.22.orig/net/core/sock.c   2007-07-09 10:42:42.000000000 +0200
87 +++ linux-2.6.22/net/core/sock.c        2007-07-09 10:42:48.000000000 +0200
88 @@ -153,7 +153,7 @@
89    "sk_lock-AF_ASH"   , "sk_lock-AF_ECONET"   , "sk_lock-AF_ATMSVC"   ,
90    "sk_lock-21"       , "sk_lock-AF_SNA"      , "sk_lock-AF_IRDA"     ,
91    "sk_lock-AF_PPPOX" , "sk_lock-AF_WANPIPE"  , "sk_lock-AF_LLC"      ,
92 -  "sk_lock-27"       , "sk_lock-28"          , "sk_lock-29"          ,
93 +  "sk_lock-27"       , "sk_lock-28"          , "sk_lock-AF_CAN"      ,
94    "sk_lock-AF_TIPC"  , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV"        ,
95    "sk_lock-AF_RXRPC" , "sk_lock-AF_MAX"
96  };
97 @@ -167,7 +167,7 @@
98    "slock-AF_ASH"   , "slock-AF_ECONET"   , "slock-AF_ATMSVC"   ,
99    "slock-21"       , "slock-AF_SNA"      , "slock-AF_IRDA"     ,
100    "slock-AF_PPPOX" , "slock-AF_WANPIPE"  , "slock-AF_LLC"      ,
101 -  "slock-27"       , "slock-28"          , "slock-29"          ,
102 +  "slock-27"       , "slock-28"          , "slock-AF_CAN"      ,
103    "slock-AF_TIPC"  , "slock-AF_BLUETOOTH", "slock-AF_IUCV"     ,
104    "slock-AF_RXRPC" , "slock-AF_MAX"
105  };