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-mmc
[oweals/u-boot.git]
/
drivers
/
net
/
dnet.c
diff --git
a/drivers/net/dnet.c
b/drivers/net/dnet.c
index efac746e31571eb9daa9939cd7f7829a4ff34bcf..944a0c046f7a9214b0e405cf91465029d7fbe353 100644
(file)
--- a/
drivers/net/dnet.c
+++ b/
drivers/net/dnet.c
@@
-20,6
+20,7
@@
#include <miiphy.h>
#include <asm/io.h>
#include <miiphy.h>
#include <asm/io.h>
+#include <asm/unaligned.h>
#include "dnet.h"
#include "dnet.h"
@@
-129,19
+130,15
@@
static u16 dnet_mdio_read(struct dnet_device *dnet, u8 reg)
return value;
}
return value;
}
-static int dnet_send(struct eth_device *netdev, volatile void *packet,
- int length)
+static int dnet_send(struct eth_device *netdev, void *packet, int length)
{
struct dnet_device *dnet = to_dnet(netdev);
{
struct dnet_device *dnet = to_dnet(netdev);
- int i,
len,
wrsz;
+ int i, wrsz;
unsigned int *bufp;
unsigned int tx_cmd;
debug(DRIVERNAME "[%s] Sending %u bytes\n", __func__, length);
unsigned int *bufp;
unsigned int tx_cmd;
debug(DRIVERNAME "[%s] Sending %u bytes\n", __func__, length);
- /* frame size (words) */
- len = (length + 3) >> 2;
-
bufp = (unsigned int *) (((u32)packet) & 0xFFFFFFFC);
wrsz = (u32)length + 3;
wrsz += ((u32)packet) & 0x3;
bufp = (unsigned int *) (((u32)packet) & 0xFFFFFFFC);
wrsz = (u32)length + 3;
wrsz += ((u32)packet) & 0x3;
@@
-206,11
+203,11
@@
static void dnet_set_hwaddr(struct eth_device *netdev)
struct dnet_device *dnet = to_dnet(netdev);
u16 tmp;
struct dnet_device *dnet = to_dnet(netdev);
u16 tmp;
- tmp =
cpu_to_be16(*((u16 *)netdev->enetaddr)
);
+ tmp =
get_unaligned_be16(netdev->enetaddr
);
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
- tmp =
cpu_to_be16(*((u16 *)(netdev->enetaddr + 2))
);
+ tmp =
get_unaligned_be16(&netdev->enetaddr[2]
);
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
- tmp =
cpu_to_be16(*((u16 *)(netdev->enetaddr + 4))
);
+ tmp =
get_unaligned_be16(&netdev->enetaddr[4]
);
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
}
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
}
@@
-393,4
+390,3
@@
int dnet_eth_initialize(int id, void *regs, unsigned int phy_addr)
return 0;
}
return 0;
}
-