]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: qca8k: fix inband mgmt for big-endian systems
authorChristian Marangi <ansuelsmth@gmail.com>
Wed, 12 Oct 2022 17:18:36 +0000 (19:18 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 14 Oct 2022 07:22:28 +0000 (08:22 +0100)
commit6348744bff9fa14349833cf09f626947748dbb6a
tree7b4b095a99ab0cbcf8dad9f77408287805fbfa2f
parent4ed2e71f4d6e999d5aab802aac8eaaa0c33bca67
net: dsa: qca8k: fix inband mgmt for big-endian systems

The header and the data of the skb for the inband mgmt requires
to be in little-endian. This is problematic for big-endian system
as the mgmt header is written in the cpu byte order.

Fix this by converting each value for the mgmt header and data to
little-endian, and convert to cpu byte order the mgmt header and
data sent by the switch.

Fixes: 6f1bf00c8a2b ("net: dsa: qca8k: add support for mgmt read/write 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>
Reviewed-by: Lech Perczak <lech.perczak@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/qca/qca8k-8xxx.c
include/linux/dsa/tag_qca.h