Bug 114151 - rt2800usb: RT5370 not working with upstream firmware, works with seller packaged firmware (not redistributable?)
Summary: rt2800usb: RT5370 not working with upstream firmware, works with seller packa...
Status: RESOLVED CODE_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: drivers_network-wireless@kernel-bugs.osdl.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-09 13:41 UTC by dan.g.tob
Modified: 2016-05-21 20:54 UTC (History)
6 users (show)

See Also:
Kernel Version: 4.4.4
Subsystem:
Regression: No
Bisected commit-id:


Attachments
apparently version 0.36 of the rt2870 firmware (8.00 KB, application/octet-stream)
2016-03-09 17:40 UTC, dan.g.tob
Details

Description dan.g.tob 2016-03-09 13:41:46 UTC
Hi, I have a cheap RT5370 based usb wifi adapter (basically listed as 'Mini Nano 150Mbps 802.11n' on ebay). Device is unstable (dropouts, slow speeds) with the currently upstream firmware in linux-firmware.git (no updates since 2011, dmesg reports it as version 0.29).

[45709.256932] ieee80211 phy0: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[45709.256948] ieee80211 phy0: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.29

and alot of lines like this

rt2800usb_txdone: Warning - Data pending for entry 14 in queue 2


There are various reports around the internet about using the firmware shipped with chromeos instead. This was no better in my case. As a last report I found a few source dumps complete with firmware on the vendor packaged cd that came with the device. dmesg reports the firmware as version as 0.36

[45873.257795] ieee80211 phy2: rt2x00lib_request_firmware: Info - Loading firmware file 'rt2870.bin'
[45873.257811] ieee80211 phy2: rt2x00lib_request_firmware: Info - Firmware detected - version: 0.36

And just like magic, the device is now much more stable.

Now the question that comes up is what is the process to get the firmware upstream. There doesn't appear to be any licensing for the firmware. It obviously needs a vendor signoff of some kind. The include source appears to be under a proprietary license


/*
 ***************************************************************************
 * Ralink Tech Inc.
 * 4F, No. 2 Technology 5th Rd.
 * Science-based Industrial Park
 * Hsin-chu, Taiwan, R.O.C.
 *
 * (c) Copyright 2002-2004, Ralink Technology, Inc.
 *
 * All rights reserved. Ralink's source code is an unpublished work and the
 * use of a copyright notice does not imply otherwise. This source code
 * contains confidential trade secret material of Ralink Tech. Any attemp
 * or participation in deciphering, decoding, reverse engineering or in any
 * way altering the source code is stricitly prohibited, unless the prior
 * written consent of Ralink Technology, Inc. is obtained.
 ***************************************************************************
Comment 1 Larry Finger 2016-03-09 16:48:36 UTC
The critical part of the current license for firmware from LICENCE.ralink-firmware.txt in the linux-firmware repo says:

Redistribution.  Redistribution and use in binary form, without 
modification, are permitted provided that the following conditions are 
met:

* Redistributions must reproduce the above copyright notice and the 
  following disclaimer in the documentation and/or other materials 
  provided with the distribution. 
* Neither the name of Ralink Technology Corporation nor the names of its
  suppliers may be used to endorse or promote products derived from this
  software without specific prior written permission. 
* No reverse engineering, decompilation, or disassembly of this software 
  is permitted.

As far as I can tell, version 0.36 of the firmware, and the file from the included CD seem to meet those requirements/restrictions. Thus, I think this file could be submitted to linux-firmware. The only caveat would be to test with the other rt2870 devices to ensure that this new firmware does not harm their performance.

If it would help, I have one device that lsusb reports as "Bus 003 Device 005: ID 148f:3070 Ralink Technology, Corp. RT2870/RT3070 Wireless Adapter". If you attach that new firmware file to this bug, I will test it on my device.
Comment 2 dan.g.tob 2016-03-09 17:40:31 UTC
Created attachment 208531 [details]
apparently version 0.36 of the rt2870 firmware

My device is listed as 
ID 148f:5370 Ralink Technology, Corp. RT5370 Wireless Adapter

I can share the entire driver bundle if needed. But IDK about the legality (it was shared to me by an eBay seller, and they have probably already broken whatever copyright laws applied to it)
Comment 3 Larry Finger 2016-03-09 19:57:20 UTC
I do not need the entire bundle.

The new version of the firmware did not hurt the operation of my device, nor did I see any particular improvement. It still gets high packet loss (10-15%) as shown by ping.

I will post the availability of new firmware to the linux-wireless community and see if we get any additional testing.

Before this new version can be submitted to linux-firmware, we would need a few more details regarding the CD that contained this new version. Who was the vendor, and similar questions?
Comment 4 dan.g.tob 2016-03-10 08:34:28 UTC
The package name is 'RT5572_RT5372_Linux_AP_V2.7.1.1_Beta_DPA_20121113.tar.bz2' sha1sum is '8e471e4bb73aef76ee51d9305fce8304c2279027' (Did a quick search and it can be found online, sha1sum matches). firmware is located under 'MODULE/common/rt2800.bin'.

I honestly do not know anything more about it. This appears to be the manufacturer 'http://www.lafalink.com/product_451.html' but being china, there are probably many clones. EDIT: heres another 'http://www.szedup.com/showinfo.aspx?id=557' appears to be version 0.32 of the firmware
Comment 5 dan.g.tob 2016-03-10 10:12:44 UTC
this was my result with 0.32

--- www.google.com ping statistics ---
5406 packets transmitted, 5137 received, 4% packet loss, time 5413063ms
rtt min/avg/max/mdev = 39.540/64.366/938.047/89.775 ms
Comment 6 dan.g.tob 2016-03-10 11:03:45 UTC
0.36, looks like its possibly worse

--- www.google.com ping statistics ---
2339 packets transmitted, 2160 received, +148 duplicates, 7% packet loss, time 2341956ms
rtt min/avg/max/mdev = 39.740/443.679/13010.639/1753.554 ms, pipe 14
Comment 7 Larry Finger 2016-03-10 16:47:21 UTC
I doubt that those two results differ significantly.
Comment 8 dan.g.tob 2016-03-10 18:06:08 UTC
and finally with currently in tree 0.29. Definitely confirms my OP

--- www.google.com ping statistics ---
3947 packets transmitted, 2938 received, 25% packet loss, time 3956424ms
rtt min/avg/max/mdev = 39.479/45.386/1055.354/29.613 ms, pipe 2
Comment 9 Xose Vazquez Perez 2016-03-10 21:35:05 UTC
Is it working flawlessly on Windows ?

Latest drivers(1/20/2016): http://mediatek.com/en/downloads1/downloads/
Comment 10 dan.g.tob 2016-03-24 09:01:53 UTC
Heres another go with 0.36 on a different machine

--- www.google.com ping statistics ---
7828 packets transmitted, 7726 received, +265 duplicates, 1% packet loss, time 7836805ms
rtt min/avg/max/mdev = 39.103/345.811/20235.568/1743.673 ms, pipe 21

I have not used the device with windows, sorry
Comment 11 Xose Vazquez Perez 2016-05-16 20:00:34 UTC
FYI, 0.36(rt2870.bin) was included recently in upstream linux-firmware.git:
https://git.kernel.org/cgit/linux/kernel/git/firmware/linux-firmware.git/commit/?id=9023bf7dc753c99ea29be742fe4f09d455f379ba
Comment 12 dan.g.tob 2016-05-21 20:54:58 UTC
thanks!

Note You need to log in before you can comment on or make changes to this bug.