summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeert Uytterhoeven <geert@linux-m68k.org>2003-05-05 00:30:57 -0700
committerGreg Kroah-Hartman <greg@kroah.com>2003-05-05 00:30:57 -0700
commit56822f2ea3c343935c9b6cdb016f33eaa905696e (patch)
treef925382815b47fbcc6ddb41269b1a65de16e9a0b
parent6abe9ab2fc875867fa5d62324c993b7bb7f98dc2 (diff)
[PATCH] USB: Big endian RTL8150
The RTL8150 USB Ethernet driver doesn't work on big endian machines. Here are patches (for both 2.4.x and 2.5.x) to fix that. The fix was tested on the 2.4.20 and 2.4.21-rc1 version of the driver on big endian MIPS. Changes: - Fix endianness of rx_creg (from Dimitri Torfs <Dimitri.Torfs@sonycom.com>) - Kill unused last parameter of async_set_registers()
-rw-r--r--drivers/usb/net/rtl8150.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c
index 1ea808e0f36a..24ed5fe182e4 100644
--- a/drivers/usb/net/rtl8150.c
+++ b/drivers/usb/net/rtl8150.c
@@ -160,7 +160,7 @@ static void ctrl_callback(struct urb *urb, struct pt_regs *regs)
clear_bit(RX_REG_SET, &dev->flags);
}
-static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size, void *data)
+static int async_set_registers(rtl8150_t * dev, u16 indx, u16 size)
{
int ret;
@@ -537,7 +537,8 @@ static int enable_net_traffic(rtl8150_t * dev)
warn("%s - device reset failed", __FUNCTION__);
}
/* RCR bit7=1 attach Rx info at the end; =0 HW CRC (which is broken) */
- dev->rx_creg = rcr = 0x9e;
+ rcr = 0x9e; /* bit7=1 attach Rx info at the end */
+ dev->rx_creg = cpu_to_le16(rcr);
tcr = 0xd8;
cr = 0x0c;
if (!(rcr & 0x80))
@@ -584,18 +585,18 @@ static void rtl8150_set_multicast(struct net_device *netdev)
dev = netdev->priv;
netif_stop_queue(netdev);
if (netdev->flags & IFF_PROMISC) {
- dev->rx_creg |= 0x0001;
+ dev->rx_creg |= cpu_to_le16(0x0001);
info("%s: promiscuous mode", netdev->name);
} else if ((netdev->mc_count > multicast_filter_limit) ||
(netdev->flags & IFF_ALLMULTI)) {
- dev->rx_creg &= 0xfffe;
- dev->rx_creg |= 0x0002;
+ dev->rx_creg &= cpu_to_le16(0xfffe);
+ dev->rx_creg |= cpu_to_le16(0x0002);
info("%s: allmulti set", netdev->name);
} else {
/* ~RX_MULTICAST, ~RX_PROMISCUOUS */
- dev->rx_creg &= 0x00fc;
+ dev->rx_creg &= cpu_to_le16(0x00fc);
}
- async_set_registers(dev, RCR, 2, &dev->rx_creg);
+ async_set_registers(dev, RCR, 2);
netif_wake_queue(netdev);
}