Re: [PATCH v5 1/6] fieldbus_dev: add Fieldbus Device subsystem.

From: Sven Van Asbroeck
Date: Thu Dec 06 2018 - 13:32:29 EST


Hi Greg,

On Thu, Dec 6, 2018 at 9:07 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> And as these are really devices, why not make them a "device" and a bus?
> What type of topology do you have on these busses? Are everything
> "flat" and connected directly to a PCI/USB/platform device? Or are
> there multiple devices attached to a single controller?
>
> It really feels like you want to use 'struct device' and a bus_type and
> not a class here to me...
>

I don't believe that the bus/device abstraction is appropriate for fieldbus
peripherals. But obviously I'm not a fieldbus or kernel expert, so I keep an
open mind to any elegant solutions I may have missed.

The name FieldBUS is misleading - it's an industrial network, not a bus. The
underlying network technology varies: Profinet runs over Ethernet,
Profibus over RS485. The topology is typical for networks AFAIK.

The actual layout of the raw packets exchanged over the network is proprietary;
fieldbus cards will typically implement this internally, and hide the details.

To the user, a fieldbus card typically exposes shared memory regions.
For example, a robotic arm may store its arm angle at offset 27 of its memory
region. The PC controlling the arm writes a new value to offset 27 in the
memory of its own fieldbus card. The cards then communicate over the network,
the memory in the arm's fieldbus card is updated, and the arm is notified of
the data change by an interrupt.

Like I said, I'm by no means a fieldbus expert. But this 'feels' unlike a
device/bus abstraction. And it also doesn't 'feel' right to make this part
of the network stack. But I keep an open mind.

Sven