FlexRay: Allocate numbers for FlexRay communication
Subsystems (4)
PATCH 1/1 FlexRay: Allocate numbers for FlexRay communication
This patch adds a protocol family, Ethernet protocol ID, ARP protocol identifier and a line discipline for FlexRay communication using Linux.
I do not know why ETH_P_CAN has been chosen to be 0x000C instead of 0x000A, so I have just inserted it after ETH_P_LOCALTALK, is that OK or somehow reserved?
Further code including the FlexRay core, raw sockets and examples will soon be posted on a yet-to-be-created project site.
--- include/linux/if_arp.h | 1 + include/linux/if_ether.h | 1 + include/linux/socket.h | 4 +++- include/linux/tty.h | 3 ++- net/core/sock.c | 3 +++ 5 files changed, 10 insertions(+), 2 deletions(-)
include/linux/if_arp.h +1 -0
@@ -53,6 +53,7 @@#define ARPHRD_X25 271/* CCITT X.25 */ #define ARPHRD_HWX25 272/* Boards with X.25 in firmware */ #define ARPHRD_CAN 280/* Controller Area Network */ +#define ARPHRD_FLEXRAY 281/* FlexRay */ #define ARPHRD_PPP 512#define ARPHRD_CISCO 513/* Cisco HDLC */ #define ARPHRD_HDLC ARPHRD_CISCO
include/linux/if_ether.h +1 -0
@@ -95,6 +95,7 @@#define ETH_P_PPP_MP 0x0008/* Dummy type for PPP MP frames */ #define ETH_P_LOCALTALK 0x0009/* Localtalk pseudo type */ +#define ETH_P_FLEXRAY 0x000A/* FlexRay */ #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 protected]) */
include/linux/socket.h +3 -1
@@ -194,7 +194,8 @@ struct ucred {#define AF_RXRPC 33/* RxRPC sockets */ #define AF_ISDN 34/* mISDN sockets */ #define AF_PHONET 35/* Phonet sockets */ -#define AF_MAX 36/* For now.. */ +#define AF_FLEXRAY 36/* FlexRay sockets */ +#define AF_MAX 37/* For now.. */ /* Protocol families, same as address families. */ #define PF_UNSPEC AF_UNSPEC
@@ -233,6 +234,7 @@ struct ucred {#define PF_RXRPC AF_RXRPC#define PF_ISDN AF_ISDN#define PF_PHONET AF_PHONET +#define PF_FLEXRAY AF_FLEXRAY#define PF_MAX AF_MAX/* Maximum queue length specifiable by listen. */
include/linux/tty.h +2 -1
@@ -23,7 +23,7 @@*/ #define NR_UNIX98_PTY_DEFAULT 4096/* Default maximum for Unix98 ptys */ #define NR_UNIX98_PTY_MAX (1 << MINORBITS)/* Absolute limit */ -#define NR_LDISCS 19 +#define NR_LDISCS 20/* line disciplines */ #define N_TTY 0
@@ -46,6 +46,7 @@#define N_GIGASET_M101 16/* Siemens Gigaset M101 serial DECT adapter */ #define N_SLCAN 17/* Serial / USB serial CAN Adaptors */ #define N_PPS 18/* Pulse per Second */ +#define N_SLFLEXRAY 19/* Serial / USB serial FlexRay adapters */ /* * This character is the same as _POSIX_VDISABLE: it cannot be used as
net/core/sock.c +3 -0
@@ -155,6 +155,7 @@ static const char *af_family_key_strings[AF_MAX+1] = {"sk_lock-27" ,"sk_lock-28" ,"sk_lock-AF_CAN" ,"sk_lock-AF_TIPC" ,"sk_lock-AF_BLUETOOTH" ,"sk_lock-IUCV" ,"sk_lock-AF_RXRPC" ,"sk_lock-AF_ISDN" ,"sk_lock-AF_PHONET" , +"sk_lock-AF_FLEXRAY" ,"sk_lock-AF_MAX" }; static const char *af_family_slock_key_strings[AF_MAX+1] = {
@@ -170,6 +171,7 @@ static const char *af_family_slock_key_strings[AF_MAX+1] = {"slock-27" ,"slock-28" ,"slock-AF_CAN" ,"slock-AF_TIPC" ,"slock-AF_BLUETOOTH" ,"slock-AF_IUCV" ,"slock-AF_RXRPC" ,"slock-AF_ISDN" ,"slock-AF_PHONET" , +"slock-AF_FLEXRAY" ,"slock-AF_MAX" }; static const char *af_family_clock_key_strings[AF_MAX+1] = {
@@ -185,6 +187,7 @@ static const char *af_family_clock_key_strings[AF_MAX+1] = {"clock-27" ,"clock-28" ,"clock-AF_CAN" ,"clock-AF_TIPC" ,"clock-AF_BLUETOOTH" ,"clock-AF_IUCV" ,"clock-AF_RXRPC" ,"clock-AF_ISDN" ,"clock-AF_PHONET" , +"clock-AF_FLEXRAY" ,"clock-AF_MAX" };
David Miller
maintainerFrom: Michael Arndt <[email protected]>
Date: Thu, 30 Apr 2009 18:38:26 +0200
Quoted 2 lines
Further code including the FlexRay core, raw sockets and examples will soon be posted on a yet-to-be-created project site.
These definitions can be added when you are able to get FlexRay into the upstream sources.
And no sooner.
This policy is applied equally to everyone, so please don't argue it.
Quoted 5 lines · Michael Arndt
This patch adds a protocol family, Ethernet protocol ID, ARP protocol identifier and a line discipline for FlexRay communication using Linux.
I do not know why
ETH_P_CANhas been chosen to be0x000C
perhaps because of 'C'AN ?
Quoted 3 lines
Further code including the FlexRay core, raw sockets and examples will soon be posted on a yet-to-be-created project site.
Usually there's a project and some kind of community that worked, discussed and tested the stuff for some time to be mature for mainline.
- What is the technical background?
- Is there any documentation?
- Do you need realtime?
- What hardware is supported?
include/linux/tty.h line 49
Quoted 11 lines
+++
b/include/linux/tty.hinclude/linux/tty.h +1
-0@@ -23,7 +23,7 @@*/ /* line disciplines */ #define N_TTY 0@@ -46,6 +46,7 @@#define N_GIGASET_M101 16/* Siemens Gigaset M101 serial DECT adapter */ #define N_SLCAN 17/* Serial / USB serial CAN Adaptors */ #define N_PPS 18/* Pulse per Second */ +#define N_SLFLEXRAY 19/* Serial / USB serial FlexRay adapters */
???
I bet there's no Flexray hardware on the market that can be attached on a serial line like there are for low-cost CAN adaptors, right?
So why are you claiming a line discipline here?
Regards,
Oliver
Quoted 3 lines · Oliver Hartkopp
Quoted 1 line
I do not know why
ETH_P_CANhas been chosen to be0x000Cperhaps because of 'C'AN ?
Ok, thanks for the hint. So I should maybe choose 0x000F :)
Quoted 2 lines
- What is the technical background?
- Is there any documentation?
My goal is to bring (low-cost) FlexRay communication to Linux. There is some documentation of the project which I will hopefully put up soon.
Quoted 1 line
- Do you need realtime?
Would be nice, but will probably be hard to do. Currently only sending/ receiving in pre-configured message buffers is possible, so the real low level stuff will be handled in hardware (in the FlexRay Communication Controller [CC]).
Quoted 1 line
- What hardware is supported?
See below. But the major goal is to provide a common framework for all hardware, similar to the SocketCAN implementation. Unfortunately I do not have several thousand Euros to spend for commercially available solutions [1, 2]. I also bet their drivers (if available at all for Linux; seems that only TZM has one) will be incompatible with each other and are closed source.
Quoted 2 lines
I bet there's no Flexray hardware on the market that can be attached on a serial line like there are for low-cost CAN adaptors, right?
Actually, I have a working prototype of such an (limited) adapter lying on my desk right now.
Regards,
Michael