netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]  fix sierra_net endianess bug
@ 2012-03-14 14:09 Maris Paupe
  2012-03-14 15:26 ` Andreas Schwab
  0 siblings, 1 reply; 4+ messages in thread
From: Maris Paupe @ 2012-03-14 14:09 UTC (permalink / raw)
  To: epasheva, rfiler; +Cc: netdev

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 <marisp@mt.lv>
---
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");
---

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-03-14 21:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-03-14 14:09 [PATCH] fix sierra_net endianess bug Maris Paupe
2012-03-14 15:26 ` Andreas Schwab
2012-03-14 19:24   ` Ben Hutchings
2012-03-14 21:10     ` Andreas Schwab

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).