Skip to contentSkip to conversation

Adding support for ARINC429 into the Linux kernel

DISCUSSION Guenter Roeck 3 participants 6 messages Jun 19, 2013 – Jul 1, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

Hi all,

I have been asked to explore options for adding ARINC 429 support [1] into the Linux kernel, primarily to support devices from Holt Integrated Circuits [2] (the request is unrelated to the chip manufacturer).

ARINC429 is a protocol which is widely used in commercial airplanes.

There are various chips supporting this protocol available, as well as out-of-tree Linux support. The drivers I have looked at implement it either as character device or misc device and typically pass raw receive data to userspace.

I can see a number of options for going forward:
1) Implement as character device (or possibly misc device) and pass raw data to/from user space
1a) Just implement a driver for the specific chips
2b) Implement some kind of generic infrastructure
2) Implement as network driver with a new address family, similar to, say, AF_CAN.

Any thoughts / suggestions which approach would be better and, most of all, which approach might have a better chance of being accepted upstream ?

Thanks,
Guenter

--
[1] http://en.wikipedia.org/wiki/ARINC_429
[2] http://www.holtic.com/category/352-arinc-429.aspx

#1 lore raw
Quoted 19 lines · Guenter Roeck

I have been asked to explore options for adding ARINC 429 support [1] into the Linux kernel, primarily to support devices from Holt Integrated Circuits [2] (the request is unrelated to the chip manufacturer).

ARINC429 is a protocol which is widely used in commercial airplanes.

There are various chips supporting this protocol available, as well as out-of-tree Linux support. The drivers I have looked at implement it either as character device or misc device and typically pass raw receive data to userspace.

I can see a number of options for going forward:
1) Implement as character device (or possibly misc device) and pass raw data to/from user space
1a) Just implement a driver for the specific chips
2b) Implement some kind of generic infrastructure
2) Implement as network driver with a new address family, similar to, say, AF_CAN.

Quoted 2 lines

Any thoughts / suggestions which approach would be better and, most of all, which approach might have a better chance of being accepted upstream ?

Since this is a standard protocol, a driver that just supports a specific chip (1a) would be the worst option IMHO.

A character device and a network protocol both sound reasonable, but it really depends on the use cases:

* Does Linux act both as the sender and receiver, or do you want to support just one of the cases (which?)?

* Would you expect to always just transfer a single 32-bit word, or are there larger chunks of logically contigous data? What are typical and maximum sizes for those?

* Would you expect the kernel to filter for specific data on the receiver side?

* Would a user space receiver want to always see all data from one sender, or only the latest word?

Arnd

#2 lore raw
Quoted 20 lines · Arnd Bergmann
Quoted 19 lines · Guenter Roeck

I have been asked to explore options for adding ARINC 429 support [1] into the Linux kernel, primarily to support devices from Holt Integrated Circuits [2] (the request is unrelated to the chip manufacturer).

ARINC429 is a protocol which is widely used in commercial airplanes.

There are various chips supporting this protocol available, as well as out-of-tree Linux support. The drivers I have looked at implement it either as character device or misc device and typically pass raw receive data to userspace.

I can see a number of options for going forward:
1) Implement as character device (or possibly misc device) and pass raw data to/from user space
1a) Just implement a driver for the specific chips
2b) Implement some kind of generic infrastructure
2) Implement as network driver with a new address family, similar to, say, AF_CAN.

Quoted 6 lines
Quoted 2 lines

Any thoughts / suggestions which approach would be better and, most of all, which approach might have a better chance of being accepted upstream ?

Since this is a standard protocol, a driver that just supports a specific chip (1a) would be the worst option IMHO.

It would not be optimal, but straightforward and easy to implement.

Quoted 6 lines

A character device and a network protocol both sound reasonable, but it really depends on the use cases:

* Does Linux act both as the sender and receiver, or do you want to support just one of the cases (which?)?

Both, depending on the use case. Some of those are

1) ACARS -
http://en.wikipedia.org/wiki/Aircraft_Communications_Addressing_and_Reporting_System
Rx and tx

2) CIDS - Cabin Intercommunication Data System
Rx and tx

3) IRS (Inertial Reference System) and FMS (Flight Management System) Rx only

Quoted 4 lines

* Would you expect to always just transfer a single 32-bit word, or are there larger chunks of logically contigous data? What are typical and maximum sizes for those?

The raw protocol is chunks of 32 bit (Logical Data Unit, or LDU), which the protocol refers to as 'physical layer'. Broadcast messages such as those from IRS and FMS use this format.

There is also bit-oriented data. The two protocols I am aware of are "Bit- Oriented File Transfer Protocol", and "Bit-Oriented Media Access Control (MAC) Protocol", which is supposed to be IEEE 802 compliant. Packet size is 3 to 255 LDUs for FTP and 3 to 1023 LDUs for the MAC protocol. Both include a SOF and EOF marker, so the actual data size would be 1-253 or 1-1021 LDUs. Each LDU carries 20 bit, and partial words are possible in 4-bit increments, which means the data transfer size is 4 to 20,420 bit (2,552.5 bytes) for the MAC protocol, and 4 to 5,060 bit (632.5 bytes) for FTP.

Bit-oriented data is commonly used for ACARS and CIDS, where bi-directional communication is used.

Details are available in Specification ARINC-429P3-19-2009, sections 2.5 and 3.0. You should be able to find it on the web if you are interested.

Quoted 3 lines

* Would you expect the kernel to filter for specific data on the receiver side?

Each LDU has an 8-bit label. Applications listen for specific sets of labels. The chips have a configurable hardware filter; if there are not enough hardware filters, the kernel would have to do the filtering. Either case, the kernel has to select protocol receivers (sockets or open file descriptors) based on bind/registration information. For example, one aplication may register for label 1,3,5, and 7, and another for labels 1, 3, 12, and 14. So there can be overlaps.

Quoted 3 lines

* Would a user space receiver want to always see all data from one sender, or only the latest word?

The receiver would want to receive all data for the labels it has registered for.

Hope this helps. Note that, at least as first step, I only envision to handle 4-byte units and pass those to/from user-space. Implementing the two link layer protocols would probably make sense, especially with the socket interface, but that would be a second step.

Thanks,
Guenter

#3 lore raw
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Arnd Bergmann

On Wednesday 19 June 2013, Guenter Roeck wrote:

Since this is a standard protocol, a driver that just supports a specific chip (1a) would be the worst option IMHO.

It would not be optimal, but straightforward and easy to implement.

The most important aspect would be the user interface: We should not merge a driver that implements a character device (or something else) in a way that would not be compatible with a general subsystem. I think designing a generic interface is the hard part here, much more so than implementing an abstraction layer.

Quoted 12 lines
Quoted 6 lines

A character device and a network protocol both sound reasonable, but it really depends on the use cases:

* Does Linux act both as the sender and receiver, or do you want to support just one of the cases (which?)?

Both, depending on the use case. Some of those are

1) ACARS -
http://en.wikipedia.org/wiki/Aircraft_Communications_Addressing_and_Reporting_System
Rx and tx

Quoted 5 lines

2) CIDS - Cabin Intercommunication Data System
Rx and tx

3) IRS (Inertial Reference System) and FMS (Flight Management System) Rx only

Ok, I see.

Quoted 18 lines
Quoted 4 lines

* Would you expect to always just transfer a single 32-bit word, or are there larger chunks of logically contigous data? What are typical and maximum sizes for those?

The raw protocol is chunks of 32 bit (Logical Data Unit, or LDU), which the protocol refers to as 'physical layer'. Broadcast messages such as those from IRS and FMS use this format.

There is also bit-oriented data. The two protocols I am aware of are "Bit- Oriented File Transfer Protocol", and "Bit-Oriented Media Access Control (MAC) Protocol", which is supposed to be IEEE 802 compliant. Packet size is 3 to 255 LDUs for FTP and 3 to 1023 LDUs for the MAC protocol. Both include a SOF and EOF marker, so the actual data size would be 1-253 or 1-1021 LDUs. Each LDU carries 20 bit, and partial words are possible in 4-bit increments, which means the data transfer size is 4 to 20,420 bit (2,552.5 bytes) for the MAC protocol, and 4 to 5,060 bit (632.5 bytes) for FTP.

Quoted 5 lines

Bit-oriented data is commonly used for ACARS and CIDS, where bi-directional communication is used.

Details are available in Specification ARINC-429P3-19-2009, sections 2.5 and 3.0. You should be able to find it on the web if you are interested.

Ok, this sounds like it would make a network type interface more practical, at least for the 802 specific parts.

Quoted 10 lines
Quoted 3 lines

* Would you expect the kernel to filter for specific data on the receiver side?

Each LDU has an 8-bit label. Applications listen for specific sets of labels. The chips have a configurable hardware filter; if there are not enough hardware filters, the kernel would have to do the filtering. Either case, the kernel has to select protocol receivers (sockets or open file descriptors) based on bind/registration information. For example, one aplication may register for label 1,3,5, and 7, and another for labels 1, 3, 12, and 14. So there can be overlaps.

Ok

Quoted 10 lines
Quoted 3 lines

* Would a user space receiver want to always see all data from one sender, or only the latest word?

The receiver would want to receive all data for the labels it has registered for.

Hope this helps. Note that, at least as first step, I only envision to handle 4-byte units and pass those to/from user-space. Implementing the two link layer protocols would probably make sense, especially with the socket interface, but that would be a second step.

My vote would be for a new socket family for the low-level protocol, with room for extension later to support the advanced features.

This should be one of the simplest socket implementations possible, if you just need to send and receive 32 bit words, and can bind to a a set of labels for rx as you described above.

The only possible concern I see with that interface is slightly higher latency than what you would be able to get with a straight read/write based character device.

Arnd

#4 lore raw
Quoted 89 lines · Arnd Bergmann
Quoted 7 lines · Guenter Roeck
Quoted 5 lines · Arnd Bergmann

On Wednesday 19 June 2013, Guenter Roeck wrote:

Since this is a standard protocol, a driver that just supports a specific chip (1a) would be the worst option IMHO.

It would not be optimal, but straightforward and easy to implement.

The most important aspect would be the user interface: We should not merge a driver that implements a character device (or something else) in a way that would not be compatible with a general subsystem. I think designing a generic interface is the hard part here, much more so than implementing an abstraction layer.

Quoted 12 lines
Quoted 6 lines

A character device and a network protocol both sound reasonable, but it really depends on the use cases:

* Does Linux act both as the sender and receiver, or do you want to support just one of the cases (which?)?

Both, depending on the use case. Some of those are

1) ACARS -
http://en.wikipedia.org/wiki/Aircraft_Communications_Addressing_and_Reporting_System
Rx and tx

Quoted 5 lines

2) CIDS - Cabin Intercommunication Data System
Rx and tx

3) IRS (Inertial Reference System) and FMS (Flight Management System) Rx only

Ok, I see.

Quoted 18 lines
Quoted 4 lines

* Would you expect to always just transfer a single 32-bit word, or are there larger chunks of logically contigous data? What are typical and maximum sizes for those?

The raw protocol is chunks of 32 bit (Logical Data Unit, or LDU), which the protocol refers to as 'physical layer'. Broadcast messages such as those from IRS and FMS use this format.

There is also bit-oriented data. The two protocols I am aware of are "Bit- Oriented File Transfer Protocol", and "Bit-Oriented Media Access Control (MAC) Protocol", which is supposed to be IEEE 802 compliant. Packet size is 3 to 255 LDUs for FTP and 3 to 1023 LDUs for the MAC protocol. Both include a SOF and EOF marker, so the actual data size would be 1-253 or 1-1021 LDUs. Each LDU carries 20 bit, and partial words are possible in 4-bit increments, which means the data transfer size is 4 to 20,420 bit (2,552.5 bytes) for the MAC protocol, and 4 to 5,060 bit (632.5 bytes) for FTP.

Quoted 5 lines

Bit-oriented data is commonly used for ACARS and CIDS, where bi-directional communication is used.

Details are available in Specification ARINC-429P3-19-2009, sections 2.5 and 3.0. You should be able to find it on the web if you are interested.

Ok, this sounds like it would make a network type interface more practical, at least for the 802 specific parts.

Quoted 10 lines
Quoted 3 lines

* Would you expect the kernel to filter for specific data on the receiver side?

Each LDU has an 8-bit label. Applications listen for specific sets of labels. The chips have a configurable hardware filter; if there are not enough hardware filters, the kernel would have to do the filtering. Either case, the kernel has to select protocol receivers (sockets or open file descriptors) based on bind/registration information. For example, one aplication may register for label 1,3,5, and 7, and another for labels 1, 3, 12, and 14. So there can be overlaps.

Ok

Quoted 10 lines
Quoted 3 lines

* Would a user space receiver want to always see all data from one sender, or only the latest word?

The receiver would want to receive all data for the labels it has registered for.

Hope this helps. Note that, at least as first step, I only envision to handle 4-byte units and pass those to/from user-space. Implementing the two link layer protocols would probably make sense, especially with the socket interface, but that would be a second step.

My vote would be for a new socket family for the low-level protocol, with room for extension later to support the advanced features.

Quoted 8 lines

This should be one of the simplest socket implementations possible, if you just need to send and receive 32 bit words, and can bind to a a set of labels for rx as you described above.

The only possible concern I see with that interface is slightly higher latency than what you would be able to get with a straight read/write based character device.

Any further feedback on this ?

Key question: Would a new address family have a chance of being accepted ?

Guenter

#5 lore raw

Hi!

Quoted 7 lines
Quoted 7 lines

My vote would be for a new socket family for the low-level protocol, with room for extension later to support the advanced features.

This should be one of the simplest socket implementations possible, if you just need to send and receive 32 bit words, and can bind to a a set of labels for rx as you described above.

Quoted 7 lines
Quoted 4 lines

The only possible concern I see with that interface is slightly higher latency than what you would be able to get with a straight read/write based character device.

Any further feedback on this ?

Key question: Would a new address family have a chance of being accepted ?

Yes... that seems like cleanest way to implement it.

Pavel

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html