eda0bf482eaa03036e54c384f10cd46c54ead804
[openwrt/staging/xback.git] /
1 From bdd70b997799099597fc0952fb0ec1bd80505bc4 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
3 Date: Thu, 11 Feb 2021 13:12:39 +0100
4 Subject: [PATCH] net: broadcom: bcm4908_enet: fix endianness in xmit code
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Use le32_to_cpu() for reading __le32 struct field filled by hw.
10
11 Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
12 Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
13 Signed-off-by: David S. Miller <davem@davemloft.net>
14 ---
15 drivers/net/ethernet/broadcom/bcm4908_enet.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18 --- a/drivers/net/ethernet/broadcom/bcm4908_enet.c
19 +++ b/drivers/net/ethernet/broadcom/bcm4908_enet.c
20 @@ -476,7 +476,7 @@ static int bcm4908_enet_start_xmit(struc
21 /* Free transmitted skbs */
22 while (ring->read_idx != ring->write_idx) {
23 buf_desc = &ring->buf_desc[ring->read_idx];
24 - if (buf_desc->ctl & DMA_CTL_STATUS_OWN)
25 + if (le32_to_cpu(buf_desc->ctl) & DMA_CTL_STATUS_OWN)
26 break;
27 slot = &ring->slots[ring->read_idx];
28