Subject: [PATCH] fix sierra_net endianess bug

From: Maris Paupe <[email-masked]>
Date: Wed, 14 Mar 2012 16:09:25 +0200

Hello,
I have found that sierra_net does not work properly on big-endian
systems, it works if bytes are flipped in this particular location.

Signed-off-by: Maris Paupe <[email-masked]>
---
diff --git a/drivers/net/usb/sierra_net.c b/drivers/net/usb/sierra_net.c
index b59cf20..cf11924 100644
--- a/drivers/net/usb/sierra_net.c
+++ b/drivers/net/usb/sierra_net.c
@@ -779,7 +779,7 @@ static int sierra_net_bind(struct usbnet *dev, struct usb_interface *intf)
  	dev_dbg(&dev->udev->dev, "Fw attr: %x\n", fwattr);
  
  	/* test whether firmware supports DHCP */
-	if (!(status == sizeof(fwattr) && (fwattr & SWI_GET_FW_ATTR_MASK))) {
+	if (!(status == sizeof(fwattr) && (le16_to_cpu(fwattr) & SWI_GET_FW_ATTR_MASK))) {
  		/* found incompatible firmware version */
  		dev_err(&dev->udev->dev, "Incompatible driver and firmware"
  			" versions\n");
---