ChangeSet 1.1235, 2003/06/18 16:48:57-07:00, geert@linux-m68k.org [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 ) - Kill unused last parameter of async_set_registers() drivers/usb/rtl8150.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/rtl8150.c b/drivers/usb/rtl8150.c --- a/drivers/usb/rtl8150.c Wed Jun 18 17:35:35 2003 +++ b/drivers/usb/rtl8150.c Wed Jun 18 17:35:35 2003 @@ -155,7 +155,7 @@ 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; @@ -426,7 +426,8 @@ if (rtl8150_reset(dev)) { warn("%s - device reset failed", __FUNCTION__); } - dev->rx_creg = rcr = 0x9e; /* bit7=1 attach Rx info at the end */ + rcr = 0x9e; /* bit7=1 attach Rx info at the end */ + dev->rx_creg = cpu_to_le16(rcr); tcr = 0xd8; cr = 0x0c; set_registers(dev, RCR, 1, &rcr); @@ -471,18 +472,18 @@ 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); }