[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YX/igyj2u/Aen9za@lunn.ch>
Date: Mon, 1 Nov 2021 13:50:11 +0100
From: Andrew Lunn <andrew@...n.ch>
To: Gerhard Engleder <gerhard@...leder-embedded.com>
Cc: Jakub Kicinski <kuba@...nel.org>,
David Miller <davem@...emloft.net>,
netdev <netdev@...r.kernel.org>
Subject: Re: [PATCH net-next v3 3/3] tsnep: Add TSN endpoint Ethernet MAC
driver
> About endian: I have not considered endian so far, as this driver is used
> only for x86 and arm64. Is that ok?
In general, Linux drivers should work both endieannesses, unless the
hardware is embedded in the SoC and so it is physically impossible for
it to be used the other way. Somebody could connect your FPGA to a big
endian MIPs system.
In most cases, there is little you need to do, so long as you use the
correct methods to access the bus. PCI registers are always little
endian for example, so easy to handle. Memory mapped structures are
where you need to be careful, your receive and transmit descriptors.
You need to use the correct __le32 or __be32 annotation, and then
sparse will warn you if you access them without the needed conversion.
Andrew
Powered by blists - more mailing lists