net: dsa: qca8k: fix ethtool autocast mib for big-endian systems

The switch sends autocast mib in little-endian. This is problematic for
big-endian system as the values needs to be converted.

Fix this by converting each mib value to cpu byte order.

Fixes: 5c957c7ca7 ("net: dsa: qca8k: add support for mib autocast in Ethernet packet")
Tested-by: Pawel Dembicki <paweldembicki@gmail.com>
Tested-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Christian Marangi
2022-10-12 19:18:37 +02:00
committed by David S. Miller
parent a2550d3ce5
commit 0d4636f7d7
2 changed files with 9 additions and 13 deletions

View File

@@ -73,7 +73,7 @@ enum mdio_cmd {
};
struct mib_ethhdr {
u32 data[3]; /* first 3 mib counter */
__le32 data[3]; /* first 3 mib counter */
__be16 hdr; /* qca hdr */
} __packed;