]> rtime.felk.cvut.cz Git - socketcan-devel.git/blob - patch-series/net-2.6.24/01-can-proto-numbers.diff
059777074253a711093e4001b0e3b473d6f89c1a
[socketcan-devel.git] / patch-series / net-2.6.24 / 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.h       |    4 +++-
13  include/linux/if_arp.h   |    1 +
14  include/linux/if_ether.h |    1 +
15  include/linux/socket.h   |    2 ++
16  include/linux/tty.h      |    3 ++-
17  net/core/sock.c          |    4 ++--
18  6 files changed, 11 insertions(+), 4 deletions(-)
19
20 Index: net-2.6.24/include/linux/if_arp.h
21 ===================================================================
22 --- net-2.6.24.orig/include/linux/if_arp.h      2007-10-02 12:10:51.000000000 +0200
23 +++ net-2.6.24/include/linux/if_arp.h   2007-10-02 12:11:01.000000000 +0200
24 @@ -52,6 +52,7 @@
25  #define ARPHRD_ROSE    270
26  #define ARPHRD_X25     271             /* CCITT X.25                   */
27  #define ARPHRD_HWX25   272             /* Boards with X.25 in firmware */
28 +#define ARPHRD_CAN     280             /* Controller Area Network      */
29  #define ARPHRD_PPP     512
30  #define ARPHRD_CISCO   513             /* Cisco HDLC                   */
31  #define ARPHRD_HDLC    ARPHRD_CISCO
32 Index: net-2.6.24/include/linux/if_ether.h
33 ===================================================================
34 --- net-2.6.24.orig/include/linux/if_ether.h    2007-10-02 12:10:51.000000000 +0200
35 +++ net-2.6.24/include/linux/if_ether.h 2007-10-02 12:11:01.000000000 +0200
36 @@ -90,6 +90,7 @@
37  #define ETH_P_WAN_PPP   0x0007          /* Dummy type for WAN PPP frames*/
38  #define ETH_P_PPP_MP    0x0008          /* Dummy type for PPP MP frames */
39  #define ETH_P_LOCALTALK 0x0009         /* Localtalk pseudo type        */
40 +#define ETH_P_CAN      0x000C          /* Controller Area Network      */
41  #define ETH_P_PPPTALK  0x0010          /* Dummy type for Atalk over PPP*/
42  #define ETH_P_TR_802_2 0x0011          /* 802.2 frames                 */
43  #define ETH_P_MOBITEX  0x0015          /* Mobitex (kaz@cafe.net)       */
44 Index: net-2.6.24/include/linux/socket.h
45 ===================================================================
46 --- net-2.6.24.orig/include/linux/socket.h      2007-10-02 12:10:51.000000000 +0200
47 +++ net-2.6.24/include/linux/socket.h   2007-10-02 12:11:01.000000000 +0200
48 @@ -185,6 +185,7 @@
49  #define AF_PPPOX       24      /* PPPoX sockets                */
50  #define AF_WANPIPE     25      /* Wanpipe API Sockets */
51  #define AF_LLC         26      /* Linux LLC                    */
52 +#define AF_CAN         29      /* Controller Area Network      */
53  #define AF_TIPC                30      /* TIPC sockets                 */
54  #define AF_BLUETOOTH   31      /* Bluetooth sockets            */
55  #define AF_IUCV                32      /* IUCV sockets                 */
56 @@ -220,6 +221,7 @@
57  #define PF_PPPOX       AF_PPPOX
58  #define PF_WANPIPE     AF_WANPIPE
59  #define PF_LLC         AF_LLC
60 +#define PF_CAN         AF_CAN
61  #define PF_TIPC                AF_TIPC
62  #define PF_BLUETOOTH   AF_BLUETOOTH
63  #define PF_IUCV                AF_IUCV
64 Index: net-2.6.24/include/linux/tty.h
65 ===================================================================
66 --- net-2.6.24.orig/include/linux/tty.h 2007-10-02 12:10:51.000000000 +0200
67 +++ net-2.6.24/include/linux/tty.h      2007-10-02 12:11:02.000000000 +0200
68 @@ -24,7 +24,7 @@
69  #define NR_PTYS        CONFIG_LEGACY_PTY_COUNT   /* Number of legacy ptys */
70  #define NR_UNIX98_PTY_DEFAULT  4096      /* Default maximum for Unix98 ptys */
71  #define NR_UNIX98_PTY_MAX      (1 << MINORBITS) /* Absolute limit */
72 -#define NR_LDISCS              17
73 +#define NR_LDISCS              18
74  
75  /* line disciplines */
76  #define N_TTY          0
77 @@ -45,6 +45,7 @@
78  #define N_SYNC_PPP     14      /* synchronous PPP */
79  #define N_HCI          15      /* Bluetooth HCI UART */
80  #define N_GIGASET_M101 16      /* Siemens Gigaset M101 serial DECT adapter */
81 +#define N_SLCAN                17      /* Serial / USB serial CAN Adaptors */
82  
83  /*
84   * This character is the same as _POSIX_VDISABLE: it cannot be used as
85 Index: net-2.6.24/net/core/sock.c
86 ===================================================================
87 --- net-2.6.24.orig/net/core/sock.c     2007-10-02 12:10:51.000000000 +0200
88 +++ net-2.6.24/net/core/sock.c  2007-10-02 12:11:02.000000000 +0200
89 @@ -154,7 +154,7 @@
90    "sk_lock-AF_ASH"   , "sk_lock-AF_ECONET"   , "sk_lock-AF_ATMSVC"   ,
91    "sk_lock-21"       , "sk_lock-AF_SNA"      , "sk_lock-AF_IRDA"     ,
92    "sk_lock-AF_PPPOX" , "sk_lock-AF_WANPIPE"  , "sk_lock-AF_LLC"      ,
93 -  "sk_lock-27"       , "sk_lock-28"          , "sk_lock-29"          ,
94 +  "sk_lock-27"       , "sk_lock-28"          , "sk_lock-AF_CAN"      ,
95    "sk_lock-AF_TIPC"  , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV"        ,
96    "sk_lock-AF_RXRPC" , "sk_lock-AF_MAX"
97  };
98 @@ -168,7 +168,7 @@
99    "slock-AF_ASH"   , "slock-AF_ECONET"   , "slock-AF_ATMSVC"   ,
100    "slock-21"       , "slock-AF_SNA"      , "slock-AF_IRDA"     ,
101    "slock-AF_PPPOX" , "slock-AF_WANPIPE"  , "slock-AF_LLC"      ,
102 -  "slock-27"       , "slock-28"          , "slock-29"          ,
103 +  "slock-27"       , "slock-28"          , "slock-AF_CAN"      ,
104    "slock-AF_TIPC"  , "slock-AF_BLUETOOTH", "slock-AF_IUCV"     ,
105    "slock-AF_RXRPC" , "slock-AF_MAX"
106  };
107 Index: net-2.6.24/include/linux/if.h
108 ===================================================================
109 --- net-2.6.24.orig/include/linux/if.h  2007-10-02 12:10:28.000000000 +0200
110 +++ net-2.6.24/include/linux/if.h       2007-10-02 12:09:34.000000000 +0200
111 @@ -50,7 +50,9 @@
112  #define IFF_LOWER_UP   0x10000         /* driver signals L1 up         */
113  #define IFF_DORMANT    0x20000         /* driver signals dormant       */
114  
115 -#define IFF_VOLATILE   (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\
116 +#define IFF_ECHO       0x40000         /* echo sent packets            */
117 +
118 +#define IFF_VOLATILE   (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
119                 IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
120  
121  /* Private (from user) interface flags (netdevice->priv_flags). */