projects
/
oweals
/
u-boot.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'master' of git://git.denx.de/u-boot-arm
[oweals/u-boot.git]
/
drivers
/
usb
/
eth
/
smsc95xx.c
diff --git
a/drivers/usb/eth/smsc95xx.c
b/drivers/usb/eth/smsc95xx.c
index 7ee4f87eaa97baf4169a39f36d3faf5176080977..c7aebea4e39f3feb9e9d0591c086b6e6c6fbdb8b 100644
(file)
--- a/
drivers/usb/eth/smsc95xx.c
+++ b/
drivers/usb/eth/smsc95xx.c
@@
-20,6
+20,7
@@
* MA 02111-1307 USA
*/
* MA 02111-1307 USA
*/
+#include <asm/unaligned.h>
#include <common.h>
#include <usb.h>
#include <linux/mii.h>
#include <common.h>
#include <usb.h>
#include <linux/mii.h>
@@
-372,26
+373,21
@@
static int smsc95xx_init_mac_address(struct eth_device *eth,
static int smsc95xx_write_hwaddr(struct eth_device *eth)
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
static int smsc95xx_write_hwaddr(struct eth_device *eth)
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
- u32 addr_lo, addr_hi;
+ u32 addr_lo = __get_unaligned_le32(ð->enetaddr[0]);
+ u32 addr_hi = __get_unaligned_le16(ð->enetaddr[4]);
int ret;
/* set hardware address */
debug("** %s()\n", __func__);
int ret;
/* set hardware address */
debug("** %s()\n", __func__);
- addr_lo = cpu_to_le32(*eth->enetaddr);
- addr_hi = cpu_to_le16(*((u16 *)(eth->enetaddr + 4)));
ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
ret = smsc95xx_write_reg(dev, ADDRL, addr_lo);
- if (ret < 0) {
- debug("Failed to write ADDRL: %d\n", ret);
+ if (ret < 0)
return ret;
return ret;
- }
ret = smsc95xx_write_reg(dev, ADDRH, addr_hi);
if (ret < 0)
return ret;
ret = smsc95xx_write_reg(dev, ADDRH, addr_hi);
if (ret < 0)
return ret;
- debug("MAC %02x:%02x:%02x:%02x:%02x:%02x\n",
- eth->enetaddr[0], eth->enetaddr[1],
- eth->enetaddr[2], eth->enetaddr[3],
- eth->enetaddr[4], eth->enetaddr[5]);
+
+ debug("MAC %pM\n", eth->enetaddr);
dev->have_hwaddr = 1;
return 0;
}
dev->have_hwaddr = 1;
return 0;
}
@@
-661,8
+657,7
@@
static int smsc95xx_init(struct eth_device *eth, bd_t *bd)
return 0;
}
return 0;
}
-static int smsc95xx_send(struct eth_device *eth, volatile void* packet,
- int length)
+static int smsc95xx_send(struct eth_device *eth, void* packet, int length)
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
int err;
{
struct ueth_data *dev = (struct ueth_data *)eth->priv;
int err;