#include <miiphy.h>
#include <asm/io.h>
-#include <asm/unaligned.h>
#include "dnet.h"
return value;
}
-static int dnet_send(struct eth_device *netdev, void *packet, int length)
+static int dnet_send(struct eth_device *netdev, volatile void *packet,
+ int length)
{
struct dnet_device *dnet = to_dnet(netdev);
- int i, wrsz;
+ int i, len, wrsz;
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;
struct dnet_device *dnet = to_dnet(netdev);
u16 tmp;
- tmp = get_unaligned_be16(netdev->enetaddr);
+ tmp = cpu_to_be16(*((u16 *)netdev->enetaddr));
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_0_REG, tmp);
- tmp = get_unaligned_be16(&netdev->enetaddr[2]);
+ tmp = cpu_to_be16(*((u16 *)(netdev->enetaddr + 2)));
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_1_REG, tmp);
- tmp = get_unaligned_be16(&netdev->enetaddr[4]);
+ tmp = cpu_to_be16(*((u16 *)(netdev->enetaddr + 4)));
dnet_writew_mac(dnet, DNET_INTERNAL_MAC_ADDR_2_REG, tmp);
}