ChangeSet 1.1042.81.4, 2003/05/05 14:30: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/net/rtl8150.c | 15 ++++++++------- 1 files changed, 8 insertions(+), 7 deletions(-) diff -Nru a/drivers/usb/net/rtl8150.c b/drivers/usb/net/rtl8150.c --- a/drivers/usb/net/rtl8150.c Wed May 7 11:12:55 2003 +++ b/drivers/usb/net/rtl8150.c Wed May 7 11:12:55 2003 @@ -160,7 +160,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; @@ -537,7 +537,8 @@ 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 @@ 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); }