Skip to content

Commit cd05acf

Browse files
Oliver Hartkoppdavem330
authored andcommitted
[CAN]: Allocate protocol numbers for PF_CAN
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 protected]> Signed-off-by: Urs Thuermann <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 8dbde28 commit cd05acf

File tree

6 files changed

+11
-4
lines changed

6 files changed

+11
-4
lines changed

include/linux/if.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,9 @@
5050
#define IFF_LOWER_UP 0x10000 /* driver signals L1 up */
5151
#define IFF_DORMANT 0x20000 /* driver signals dormant */
5252

53-
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|\
53+
#define IFF_ECHO 0x40000 /* echo sent packets */
54+
55+
#define IFF_VOLATILE (IFF_LOOPBACK|IFF_POINTOPOINT|IFF_BROADCAST|IFF_ECHO|\
5456
IFF_MASTER|IFF_SLAVE|IFF_RUNNING|IFF_LOWER_UP|IFF_DORMANT)
5557

5658
/* Private (from user) interface flags (netdevice->priv_flags). */

include/linux/if_arp.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define ARPHRD_ROSE 270
5353
#define ARPHRD_X25 271 /* CCITT X.25 */
5454
#define ARPHRD_HWX25 272 /* Boards with X.25 in firmware */
55+
#define ARPHRD_CAN 280 /* Controller Area Network */
5556
#define ARPHRD_PPP 512
5657
#define ARPHRD_CISCO 513 /* Cisco HDLC */
5758
#define ARPHRD_HDLC ARPHRD_CISCO

include/linux/if_ether.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
#define ETH_P_WAN_PPP 0x0007 /* Dummy type for WAN PPP frames*/
9191
#define ETH_P_PPP_MP 0x0008 /* Dummy type for PPP MP frames */
9292
#define ETH_P_LOCALTALK 0x0009 /* Localtalk pseudo type */
93+
#define ETH_P_CAN 0x000C /* Controller Area Network */
9394
#define ETH_P_PPPTALK 0x0010 /* Dummy type for Atalk over PPP*/
9495
#define ETH_P_TR_802_2 0x0011 /* 802.2 frames */
9596
#define ETH_P_MOBITEX 0x0015 /* Mobitex ([email protected]) */

include/linux/socket.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ struct ucred {
185185
#define AF_PPPOX 24 /* PPPoX sockets */
186186
#define AF_WANPIPE 25 /* Wanpipe API Sockets */
187187
#define AF_LLC 26 /* Linux LLC */
188+
#define AF_CAN 29 /* Controller Area Network */
188189
#define AF_TIPC 30 /* TIPC sockets */
189190
#define AF_BLUETOOTH 31 /* Bluetooth sockets */
190191
#define AF_IUCV 32 /* IUCV sockets */
@@ -220,6 +221,7 @@ struct ucred {
220221
#define PF_PPPOX AF_PPPOX
221222
#define PF_WANPIPE AF_WANPIPE
222223
#define PF_LLC AF_LLC
224+
#define PF_CAN AF_CAN
223225
#define PF_TIPC AF_TIPC
224226
#define PF_BLUETOOTH AF_BLUETOOTH
225227
#define PF_IUCV AF_IUCV

include/linux/tty.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
*/
2424
#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
2525
#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
26-
#define NR_LDISCS 17
26+
#define NR_LDISCS 18
2727

2828
/* line disciplines */
2929
#define N_TTY 0
@@ -44,6 +44,7 @@
4444
#define N_SYNC_PPP 14 /* synchronous PPP */
4545
#define N_HCI 15 /* Bluetooth HCI UART */
4646
#define N_GIGASET_M101 16 /* Siemens Gigaset M101 serial DECT adapter */
47+
#define N_SLCAN 17 /* Serial / USB serial CAN Adaptors */
4748

4849
/*
4950
* This character is the same as _POSIX_VDISABLE: it cannot be used as

net/core/sock.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static const char *af_family_key_strings[AF_MAX+1] = {
154154
"sk_lock-AF_ASH" , "sk_lock-AF_ECONET" , "sk_lock-AF_ATMSVC" ,
155155
"sk_lock-21" , "sk_lock-AF_SNA" , "sk_lock-AF_IRDA" ,
156156
"sk_lock-AF_PPPOX" , "sk_lock-AF_WANPIPE" , "sk_lock-AF_LLC" ,
157-
"sk_lock-27" , "sk_lock-28" , "sk_lock-29" ,
157+
"sk_lock-27" , "sk_lock-28" , "sk_lock-AF_CAN" ,
158158
"sk_lock-AF_TIPC" , "sk_lock-AF_BLUETOOTH", "sk_lock-IUCV" ,
159159
"sk_lock-AF_RXRPC" , "sk_lock-AF_MAX"
160160
};
@@ -168,7 +168,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = {
168168
"slock-AF_ASH" , "slock-AF_ECONET" , "slock-AF_ATMSVC" ,
169169
"slock-21" , "slock-AF_SNA" , "slock-AF_IRDA" ,
170170
"slock-AF_PPPOX" , "slock-AF_WANPIPE" , "slock-AF_LLC" ,
171-
"slock-27" , "slock-28" , "slock-29" ,
171+
"slock-27" , "slock-28" , "slock-AF_CAN" ,
172172
"slock-AF_TIPC" , "slock-AF_BLUETOOTH", "slock-AF_IUCV" ,
173173
"slock-AF_RXRPC" , "slock-AF_MAX"
174174
};

0 commit comments

Comments
 (0)