diff options
author | Lada Trimasova <Lada.Trimasova@synopsys.com> | 2016-03-03 14:07:46 (GMT) |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-03-03 22:20:08 (GMT) |
commit | b54b8c2d6e3cd1db17405a402ba42da5a9c8bf1d (patch) | |
tree | c86b9a80d933da5798d6d0fc5262baa4f4fafcd5 /COPYING | |
parent | 274ba628a32ee15bb8e08b8a9240c354066ed24a (diff) | |
download | linux-b54b8c2d6e3cd1db17405a402ba42da5a9c8bf1d.tar.xz |
net: ezchip: adapt driver to little endian architecture
Since ezchip network driver is written with big endian EZChip platform it
is necessary to add support for little endian architecture.
The first issue is that the order of the bits in a bit field is
implementation specific. So all the bit fields are removed.
Named constants are used to access necessary fields.
And the second one is that network byte order is big endian.
For example, data on ethernet is transmitted with most-significant
octet (byte) first. So in case of little endian architecture
it is important to swap data byte order when we read it from
register. In case of unaligned access we can use "get_unaligned_be32"
and in other case we can use function "ioread32_rep" which reads all
data from register and works either with little endian or big endian
architecture.
And then when we are going to write data to register we need to restore
byte order using the function "put_unaligned_be32" in case of
unaligned access and in other case "iowrite32_rep".
The last little fix is a space between type and pointer to observe
coding style.
Signed-off-by: Lada Trimasova <ltrimas@synopsys.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Cc: Noam Camus <noamc@ezchip.com>
Cc: Tal Zilcer <talz@ezchip.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'COPYING')
0 files changed, 0 insertions, 0 deletions