[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Mon, 23 Dec 2013 02:29:23 +0100
From: Alexander Graf <agraf@...e.de>
To: linuxppc-dev@...ts.ozlabs.org
Cc: Ben Herrenschmidt <benh@...nel.crashing.org>,
Anton Blanchard <anton@...ba.org>,
Dinar Valeev <dvaleev@...e.com>,
Santiago Leon <santil@...ux.vnet.ibm.com>,
netdev@...r.kernel.org
Subject: [PATCH] ibmveth: Fix more little endian issues
The ibmveth driver is memcpy()'ing the mac address between a variable
(register) and memory. This assumes a certain endianness of the
system, so let's make that implicit assumption work again.
This patch adds be64_to_cpu() calls to all places where the mac address
gets memcpy()'ed into a local variable.
Signed-off-by: Alexander Graf <agraf@...e.de>
---
drivers/net/ethernet/ibm/ibmveth.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ibm/ibmveth.c b/drivers/net/ethernet/ibm/ibmveth.c
index 952d795..97f4ee96 100644
--- a/drivers/net/ethernet/ibm/ibmveth.c
+++ b/drivers/net/ethernet/ibm/ibmveth.c
@@ -581,7 +581,7 @@ static int ibmveth_open(struct net_device *netdev)
adapter->rx_queue.toggle = 1;
memcpy(&mac_address, netdev->dev_addr, netdev->addr_len);
- mac_address = mac_address >> 16;
+ mac_address = be64_to_cpu(mac_address) >> 16;
rxq_desc.fields.flags_len = IBMVETH_BUF_VALID |
adapter->rx_queue.queue_len;
@@ -1186,6 +1186,7 @@ static void ibmveth_set_multicast_list(struct net_device *netdev)
/* add the multicast address to the filter table */
unsigned long mcast_addr = 0;
memcpy(((char *)&mcast_addr)+2, ha->addr, ETH_ALEN);
+ mcast_addr = cpu_to_be64(mcast_addr);
lpar_rc = h_multicast_ctrl(adapter->vdev->unit_address,
IbmVethMcastAddFilter,
mcast_addr);
--
1.8.1.4
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists