public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Maris Paupe <marisp@mt•lv>
To: epasheva@sierrawireless•com, rfiler@sierrawireless•com
Cc: netdev@vger•kernel.org
Subject: [PATCH]  fix sierra_net endianess bug
Date: Wed, 14 Mar 2012 16:09:25 +0200	[thread overview]
Message-ID: <4F60A695.4040601@mt.lv> (raw)

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");
---

             reply	other threads:[~2012-03-14 14:28 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-14 14:09 Maris Paupe [this message]
2012-03-14 15:26 ` [PATCH] fix sierra_net endianess bug Andreas Schwab
2012-03-14 19:24   ` Ben Hutchings
2012-03-14 21:10     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F60A695.4040601@mt.lv \
    --to=marisp@mt$(echo .)lv \
    --cc=epasheva@sierrawireless$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=rfiler@sierrawireless$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox