fix sierra_net endianess bug
Subsystems (3)
PATCH 1/1 fix sierra_net endianess bug
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.
---
drivers/net/usb/sierra_net.c +1 -1
@@ -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" );
---
Quoted 2 lines · Maris Paupe
I have found that
sierra_netdoes not work properly on big-endian systems, it works if bytes are flipped in this particular location.
That should probably be fixed in sierra_net_get_fw_attr (and the author of sierra_net_get_fw_attr should be hit with a cluestick to not use kmalloc for allocating a single u16).
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
Quoted 8 lines · Andreas Schwab
Quoted 2 lines · Maris Paupe
I have found that
sierra_netdoes not work properly on big-endian systems, it works if bytes are flipped in this particular location.That should probably be fixed in
sierra_net_get_fw_attr(and the author ofsierra_net_get_fw_attrshould be hit with a cluestick to not use kmalloc for allocating a single u16).
You cannot use stack buffers for DMA, which includes all USB I/O.
Ben.
Signature · 3 lines
Ben Hutchings, Staff Engineer, Solarflare Not speaking for my employer; that's the marketing department's job. They asked us to note that Solarflare product names are trademarked.
Quoted 11 lines · Ben Hutchings
Quoted 8 lines · Andreas Schwab
Quoted 2 lines · Maris Paupe
I have found that
sierra_netdoes not work properly on big-endian systems, it works if bytes are flipped in this particular location.That should probably be fixed in
sierra_net_get_fw_attr(and the author ofsierra_net_get_fw_attrshould be hit with a cluestick to not use kmalloc for allocating a single u16).You cannot use stack buffers for DMA, which includes all USB I/O.
Ok, sorry, I didn't know that.
Andreas.
Signature · 3 lines
Andreas Schwab, [email protected] GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."