Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 228553 - no drivers for USB 802.11 adapter with Ralink 2870 chipset (rt2870)
Summary: no drivers for USB 802.11 adapter with Ralink 2870 chipset (rt2870)
Status: CONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High enhancement with 2 votes (vote)
Assignee: Default Assignee for New Packages
URL:
Whiteboard:
Keywords:
: 265061 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-06-20 14:53 UTC by Max Arnold
Modified: 2012-04-14 17:06 UTC (History)
11 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
ebuild, initial release (rt2870usb-1.3.0.0.ebuild,1.40 KB, text/plain)
2008-07-20 11:57 UTC, Max Arnold
Details
small fixes (rt2870usb-1.3.0.0-fixes.patch,1.87 KB, patch)
2008-07-20 11:57 UTC, Max Arnold
Details | Diff
enable wpa support (rt2870usb-1.3.0.0-wpa.patch,647 bytes, patch)
2008-07-20 11:58 UTC, Max Arnold
Details | Diff
reduce debug verbosity (rt2870usb-1.3.0.0-nodebug.patch,651 bytes, patch)
2008-07-20 11:59 UTC, Max Arnold
Details | Diff
compilation error handling added (rt2870usb-1.3.0.0.ebuild,1.43 KB, text/plain)
2008-07-20 23:36 UTC, Max Arnold
Details
version bump to 1.3.1.0 (rt2870usb-1.3.1.0.ebuild,1.46 KB, text/plain)
2008-09-08 13:20 UTC, Max Arnold
Details
small fixes (rt2870usb-1.4.0.0-fixes.patch,2.23 KB, patch)
2008-10-12 03:47 UTC, Max Arnold
Details | Diff
reduce debug verbosity (rt2870usb-1.4.0.0-nodebug.patch,532 bytes, patch)
2008-10-12 03:47 UTC, Max Arnold
Details | Diff
enable wpa support (rt2870usb-1.4.0.0-wpa.patch,630 bytes, patch)
2008-10-12 03:55 UTC, Max Arnold
Details | Diff
version bump to 1.4.0.0 (rt2870usb-1.4.0.0.ebuild,1.48 KB, text/plain)
2008-10-12 03:59 UTC, Max Arnold
Details
Build.log (build.log,321.07 KB, text/plain)
2008-12-29 19:14 UTC, Mieszko Ślusarczyk
Details
fix for security issue CVE-2009-0282 (rt2870usb-1.4.0.0-cve-2009-0282.patch,699 bytes, patch)
2009-01-29 14:18 UTC, Max Arnold
Details | Diff
revision bump to fix security issue (rt2870usb-1.4.0.0-r1.ebuild,1.53 KB, text/plain)
2009-01-29 14:25 UTC, Max Arnold
Details
patch to add 2.6.29 kernel support for rt2870-2.1.0.0 (rt2870-2.6.29-compile.patch,18.22 KB, patch)
2009-04-05 04:44 UTC, Max Arnold
Details | Diff
rt2870usb-1.4.0.0-2.6.29-compile.patch (rt2870usb-1.4.0.0-2.6.29-compile.patch,19.11 KB, patch)
2009-06-13 03:15 UTC, Michal Kurgan
Details | Diff
rt2870usb-1.4.0.0-devices.patch (rt2870usb-1.4.0.0-devices.patch,657 bytes, patch)
2009-06-13 03:16 UTC, Michal Kurgan
Details | Diff
rt2870usb-1.4.0.0-r2.ebuild (rt2870usb-1.4.0.0-r2.ebuild,1.62 KB, text/plain)
2009-06-13 03:19 UTC, Michal Kurgan
Details
ebuild version bump to 2.1.2.0 (rt2870usb-2.1.2.0.ebuild,1.34 KB, text/plain)
2009-06-13 07:19 UTC, Max Arnold
Details
turn off verbose debugging (rt2870usb-2.1.2.0-nodebug.patch,526 bytes, patch)
2009-06-13 07:20 UTC, Max Arnold
Details | Diff
wpa enabling patch (rt2870usb-2.1.2.0-wpa.patch,745 bytes, patch)
2009-06-13 07:21 UTC, Max Arnold
Details | Diff
miscellaneous fixes (rt2870usb-2.1.2.0-fixes.patch,1.62 KB, patch)
2009-06-13 07:24 UTC, Max Arnold
Details | Diff
fixes to the ebuild allowing compilation on amd64 without symlinking and some other minor fixes (rt2870usb-2.1.2.0-r1.ebuild,1.32 KB, text/plain)
2009-07-14 23:41 UTC, PhobosK
Details
ebuild version bump to 2.2.0.0 (rt2870usb-2.2.0.0.ebuild,1.47 KB, text/plain)
2009-10-17 15:40 UTC, Max Arnold
Details
turn off verbose debugging (rt2870usb-2.2.0.0-nodebug.patch,531 bytes, patch)
2009-10-17 15:42 UTC, Max Arnold
Details | Diff
enable wpa (rt2870usb-2.2.0.0-wpa.patch,617 bytes, patch)
2009-10-17 15:44 UTC, Max Arnold
Details | Diff
miscellaneous fixes (rt2870usb-2.2.0.0-fixes.patch,2.12 KB, patch)
2009-10-17 15:46 UTC, Max Arnold
Details | Diff
The ebuild for the 2.3.0.0 version of the rt2870usb Ralink kernel driver (rt2870usb-2.3.0.0.ebuild,1.70 KB, text/plain)
2010-01-13 14:34 UTC, PhobosK
Details
The patch for turning off debugging (rt2870usb-2.3.0.0-nodebug.patch,363 bytes, patch)
2010-01-13 14:36 UTC, PhobosK
Details | Diff
A unified patch fixing various issues (rt2870usb-2.3.0.0-unified.patch,1.63 KB, patch)
2010-01-13 14:37 UTC, PhobosK
Details | Diff
ebuild for rt3572 Ralink sources (based on rt2870usb-2.3.0.0.ebuild) (rt3572usb-2.3.0.0.ebuild,1.77 KB, text/plain)
2010-02-14 19:40 UTC, Andreas Sturmlechner
Details
Makefile patch (rt3572usb-2.3.0.0-Makefile.patch,394 bytes, patch)
2010-02-14 19:42 UTC, Andreas Sturmlechner
Details | Diff
enable WPA (rt3572usb-2.3.0.0-config.mk.patch,429 bytes, patch)
2010-02-14 19:43 UTC, Andreas Sturmlechner
Details | Diff
add WUSB600n ver2 and WUSB54GC device strings (rt3572usb-2.3.0.0-rtusb_dev_id.c.patch,869 bytes, patch)
2010-02-14 19:44 UTC, Andreas Sturmlechner
Details | Diff
don't debug if explicitly asked for (rt3572usb-2.3.0.0-nodebug.patch,363 bytes, patch)
2010-02-14 19:45 UTC, Andreas Sturmlechner
Details | Diff
emerging rt3572usb on amd64; note compilation warnings (emerge-rt3572usb.txt,16.26 KB, text/plain)
2010-06-20 17:30 UTC, Sumant Oemrawsingh
Details
The rtusb_dev_id patch updated for 2.4.0.0 and added Linksys AE1000 (rt3572usb-2.4.0.0-rtusb_dev_id.c.patch,815 bytes, patch)
2010-06-27 23:12 UTC, z35
Details | Diff
implicitly declared usb_buffer_alloc/usb_buffer_free patch for kernel 2.6.35+ (rt2870usb-2.4.0.1-usb_alloc_free.patch,1.08 KB, patch)
2010-09-19 08:54 UTC, Michael Gelfand
Details | Diff
Turn off debugging (rt2870usb-2.4.0.1-nodebug.patch,513 bytes, patch)
2010-10-30 18:57 UTC, Max Arnold
Details | Diff
Combined patch (rt2870usb-2.4.0.1-unified.patch,2.49 KB, patch)
2010-10-30 18:59 UTC, Max Arnold
Details | Diff
ebuild for 2.4.0.1 (rt2870usb-2.4.0.1.ebuild,1.78 KB, text/plain)
2010-10-30 19:07 UTC, Max Arnold
Details
ebuild for 2.4.0.1 revision 1 (rt2870usb-2.4.0.1-r1.ebuild,2.09 KB, text/plain)
2010-11-07 19:21 UTC, PhobosK
Details
ebuild for 2.4.0.1 revision 2 (rt2870usb-2.4.0.1-r2.ebuild,2.16 KB, text/plain)
2011-02-07 11:37 UTC, PhobosK
Details
A patch for fixing the kernel's warnings about netif_stop_queue() (rt2870usb-2.4.0.1-netif_stop_queue.patch,246 bytes, patch)
2011-02-07 11:39 UTC, PhobosK
Details | Diff
ralink-rt2870-2.5.0.3-r1.ebuild (ralink-rt2870-2.5.0.3-r1.ebuild,2.05 KB, text/plain)
2012-01-14 09:56 UTC, Vladimir Berezhnoy
Details
ralink-rt2870-notftp.patch (ralink-rt2870-notftp.patch,485 bytes, text/plain)
2012-01-14 09:56 UTC, Vladimir Berezhnoy
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Max Arnold 2008-06-20 14:53:48 UTC
My rt2870-based 802.11n USB adapter (ASUS WL-160n) does not work with stock rt2x00usb driver. Kernel version 2.6.24-gentoo-r4

But there is driver source code from vendor: http://www.ralinktech.com/ralink/Home/Support/Linux.html

And it works: http://ubuntuforums.org/showthread.php?t=766850

Can someone create proper ebuild?  Right now I'm trying to compile driver, but it probably requires some patches to fix directory layout and compilation issues. I'll test and report later.

Reproducible: Always
Comment 1 Max Arnold 2008-07-20 11:57:17 UTC
Created attachment 160914 [details]
ebuild, initial release
Comment 2 Max Arnold 2008-07-20 11:57:54 UTC
Created attachment 160915 [details, diff]
small fixes
Comment 3 Max Arnold 2008-07-20 11:58:24 UTC
Created attachment 160916 [details, diff]
enable wpa support
Comment 4 Max Arnold 2008-07-20 11:59:13 UTC
Created attachment 160917 [details, diff]
reduce debug verbosity
Comment 5 Max Arnold 2008-07-20 12:05:00 UTC
Ebuild attached.  Tested on x86, kernel-2.6.24-gentoo-r8 with wpa_supplicant.
Please check carefully, because I never tried to write ebuild for kernel module.

Module still prints some weird looking strings into kernel output, but at least not so much as without nodebug patch.
Comment 6 Pino Silvaggio 2008-07-20 18:46:08 UTC
Thanks for making the ebuild.

I got a problem emerging:

 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/2.6.26-rc8-zen1.0/build
 * Found sources for kernel version:
 *     2.6.26-rc8-zen1.0
 * Checking for suitable kernel configuration options...                                                                                                                              [ ok ]
>>> Unpacking source...
>>> Unpacking 2008_0528_RT2870_Linux_STA_v1.3.0.0.tar.bz2 to /var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0 ...
 * Applying rt2870usb-1.3.0.0-fixes.patch ...                                                                                                                                         [ ok ]
 * Applying rt2870usb-1.3.0.0-wpa.patch ...                                                                                                                                           [ ok ]
 * Applying rt2870usb-1.3.0.0-nodebug.patch ...                                                                                                                                       [ ok ]
make -C tools
make[1]: Entering directory `/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/tools'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
gcc -g bin2h.c -o bin2h
cp -f os/linux/Makefile.6 /var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26-rc8-zen1.0/build SUBDIRS=/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux modules
make[1]: Leaving directory `/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/tools'
/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/tools/bin2h
make[1]: Entering directory `/usr/src/linux-2.6.26-rc8-zen1.0'
Makefile:530: /usr/src/linux-2.6.26-rc8-zen1.0/arch/amd64/Makefile: No such file or directory
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: *** No rule to make target `/usr/src/linux-2.6.26-rc8-zen1.0/arch/amd64/Makefile'.  Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.26-rc8-zen1.0'
make: *** [LINUX] Error 2
>>> Source compiled.
>>> Test phase [not enabled]: net-wireless/rt2870usb-1.3.0.0

>>> Install rt2870usb-1.3.0.0 into /var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/image/ category net-wireless
 * Installing rt2870sta module
install: cannot stat `rt2870sta.ko': No such file or directory


Also "#linux-mod_src_compile", is this correct?
Comment 7 Max Arnold 2008-07-20 23:33:11 UTC
(In reply to comment #6)
> Thanks for making the ebuild.
> 
> I got a problem emerging:
> make[1]: *** No rule to make target
> `/usr/src/linux-2.6.26-rc8-zen1.0/arch/amd64/Makefile'.  Stop.

Are you on amd64?   I have not tested such configuration. Try to compile module manually - unpack, apply attached patches and issue 'make'. Then look for resulting module in os/linux/rt2870sta.ko

BTW, replace ebuild line 'emake' with 'emake || die "Compilation failed!"' - it should not try to install files after unsuccessful compilation.

> Also "#linux-mod_src_compile", is this correct?

Well, I'm not sure :)  If you know how to properly use linux-mod eclass, feel free to correct.
Comment 8 Max Arnold 2008-07-20 23:36:05 UTC
Created attachment 160968 [details]
compilation error handling added
Comment 9 Pino Silvaggio 2008-07-21 01:11:13 UTC
Well, I just noticed it won't compile because of this error:

/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux/../../os/linux/rt_main_dev.c: In function 'rt_ieee80211_if_setup':
/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux/../../os/linux/rt_main_dev.c:788: error: 'struct net_device' has no member named 'nd_net'
make[2]: *** [/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux/../../os/linux/rt_main_dev.o] Error 1
make[1]: *** [_module_/var/tmp/portage/net-wireless/rt2870usb-1.3.0.0/work/2008_0528_RT2870_Linux_STA_v1.3.0.0/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-2.6.26-rc8-zen1.0'

which I believe is due to my 2.6.26 kernel... This sucks. I'll investigate further.
Comment 10 Perttu Luukko 2008-09-07 17:02:52 UTC
The updated version 1.3.1.0 driver from RaLink works great for me on x86 with kernel 2.6.26-gentoo-r1 and D-Link DWA-140 wireless USB dongle. Just rename the ebuild and update MY_P to

MY_P="2008_0718_RT2870_Linux_STA_v${PV}"

because it seems that RaLink adds some random numbers to the download path. Can we work around this somehow?
Comment 11 Max Arnold 2008-09-08 13:20:16 UTC
Created attachment 164905 [details]
version bump to 1.3.1.0

New version attached. I can't find official changelog, but according to the source there is some improvements in 64-bit support and code has been updated for kernel 2.6.26.

I've tested it on 2.6.25-gentoo-r7 and x86 arch, works for me. Please someone with access to amd64 hardware try new version and post your results here.

Regarding download path, these random numbers seem to match internal Ralink driver release date, so there is no simple way to automatically figure them in the ebuild code (unless you want to programmatically fetch home page and run some regexps on it :)
Comment 12 Perttu Luukko 2008-10-11 18:22:06 UTC
It seems that Ralink has released 1.4.0.0 with quite an interesting changelog including stuff such as

Add Ad-Hoc to support N rate
Migrate Mesh supporting to Draft-2.0
Support Linux Kernel 2.6.27

(see http://www.ralinktech.com.tw/data/drivers/ReleaseNote-RT2870.txt)

Anyone up for updating the ebuild? I tried but I couldn't get the patches to apply and finally I gave up. I really should learn more about the inner workings of patch :)
Comment 13 Max Arnold 2008-10-12 03:47:14 UTC
Created attachment 168114 [details, diff]
small fixes
Comment 14 Max Arnold 2008-10-12 03:47:42 UTC
Created attachment 168116 [details, diff]
reduce debug verbosity
Comment 15 Max Arnold 2008-10-12 03:55:10 UTC
Created attachment 168118 [details, diff]
enable wpa support
Comment 16 Max Arnold 2008-10-12 03:59:36 UTC
Created attachment 168122 [details]
version bump to 1.4.0.0

Ebuild updated to version 1.4.0.0.  Official changelog:

1. Add IWEVGENIE in iwlist ra0 scan.                                                           
2. Add new WSC hardware push button function                                                   
3. Add Ad-Hoc to support N rate.                                                               
4. Add "iwpriv ra0 set CarrierDetect=0(or 1)"                                                  
5. Add Station N only mode in Infra mode. (Only connects to N-AP)                              
6. Add Global country domain (ch1-11:active scan, ch12-14 passive scan)                        
7. Fixed connection failed with Range Maximizer - 515 AP (Marvell Chip) when security is WPAPSK/TKIP.                                                                                          
8. Fixed crash in LinkDown when there are >64 APs exists.                                      
9. Fixed compile error when CARRIER_DETECTION_SUPPORT is enabled.                               
10. Fixed suspend/resume error when ra0 down, ra0 up                                            
11. Modified iwpriv ra0 get_site_survey: When security of AP is OPEN/WEP or SHARED/WEP, show UNKNOW/WEP in scan list.                                                                          
12. When the secondary channel of AP exceeds the country region's range, station will auto fallback to 20MHz. i.e. need both control and secondary channel are both in country region's channel list.                                                      
13. Migrate Mesh supporting to Draft-2.0.                                                      
14. Support DLS                                                                                 
15. Support WAPI functionality                                                                  
16. Support Linux Kernel 2.6.27                                                                 
17. Fixed WPS failed when AP is not in scan table or AP's channel changing after user sets "iwpriv ra0 wsc_start"                                                                             
18. Add WPS Wireless Event strings.                                                            
19. Fixed WPA(2)PSK issue when group cipher of AP is WEP40 or WEP104.
Comment 17 coolone 2008-11-01 22:27:21 UTC
cannot compile the latest version 1.4.0.0, mine is AMD64

 [32;01m*[0m Determining the location of the kernel source code
 [32;01m*[0m Found kernel source directory:
 [32;01m*[0m     /usr/src/linux
 [32;01m*[0m Found kernel object directory:
 [32;01m*[0m     /lib/modules/2.6.26.2/build
 [32;01m*[0m Found sources for kernel version:
 [32;01m*[0m     2.6.26.2
 [32;01m*[0m Checking for suitable kernel configuration options...
[A[72C  [34;01m[ [32;01mok[34;01m ][0m
>>> Unpacking source...
>>> Unpacking 2008_0925_RT2870_Linux_STA_v1.4.0.0.tar.bz2 to /var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0 ...
 [32;01m*[0m Applying rt2870usb-1.4.0.0-fixes.patch ...
[A[72C  [34;01m[ [32;01mok[34;01m ][0m
 [32;01m*[0m Applying rt2870usb-1.4.0.0-wpa.patch ...
[A[72C  [34;01m[ [32;01mok[34;01m ][0m
 [32;01m*[0m Applying rt2870usb-1.4.0.0-nodebug.patch ...
[A[72C  [34;01m[ [32;01mok[34;01m ][0m
make -C tools
make[1]: Entering directory `/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools'
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
gcc -g bin2h.c -o bin2h
cp -f os/linux/Makefile.6 /var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux/Makefile
make  -C  /lib/modules/2.6.26.2/build SUBDIRS=/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0/os/linux modules
make[1]: Leaving directory `/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools'
/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/work/2008_0925_RT2870_Linux_STA_v1.4.0.0/tools/bin2h
make[1]: Entering directory `/usr/src/linux-2.6.26.2'
Makefile:518: /usr/src/linux-2.6.26.2/arch/amd64/Makefile: No such file or directory
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: *** No rule to make target `/usr/src/linux-2.6.26.2/arch/amd64/Makefile'.  Stop.
make[1]: Leaving directory `/usr/src/linux-2.6.26.2'
make: *** [LINUX] Error 2
 [31;01m*[0m 
 [31;01m*[0m ERROR: net-wireless/rt2870usb-1.4.0.0 failed.
 [31;01m*[0m Call stack:
 [31;01m*[0m               ebuild.sh, line   49:  Called src_compile
 [31;01m*[0m             environment, line 3220:  Called die
 [31;01m*[0m The specific snippet of code:
 [31;01m*[0m       emake || die "Compilation failed!"
 [31;01m*[0m  The die message:
 [31;01m*[0m   Compilation failed!
 [31;01m*[0m 
 [31;01m*[0m If you need support, post the topmost build error, and the call stack if relevant.
 [31;01m*[0m A complete build log is located at '/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/temp/build.log'.
 [31;01m*[0m The ebuild environment file is located at '/var/tmp/portage/net-wireless/rt2870usb-1.4.0.0/temp/environment'.

Comment 18 Edoardo Dusi 2008-11-09 22:04:00 UTC
(In reply to comment #16)

# cd /usr/src/linux/arch
# ln -s x86 amd64

This should solve.
Comment 19 coolone 2008-11-17 10:56:35 UTC
(In reply to comment #18)
thank you a lot,succeed!

I got another problem that is whenever i boot up the wireless device
i got some error information, the following is the error information

localhost ~ # /etc/init.d/net.wlan0 restart
 * Stopping wlan0
 *   Bringing down wlan0
 *     Shutting down wlan0 ...                                            [ ok ]
 * Starting wlan0
 *   Starting wpa_supplicant on wlan0 ...
ioctl[SIOCSIWAUTH]: Operation not supported                                      [ ok ]th param 4 value 0x0 - 
 *   Starting wpa_cli on wlan0 ...                                        [ ok ]
 *     Backgrounding ...


seems i can get the wireless device on, i can ping myself, but cannot get through to the server.

ping 192.168.1.106
PING 192.168.1.106 (192.168.1.106) 56(84) bytes of data.
64 bytes from 192.168.1.106: icmp_seq=1 ttl=64 time=0.026 ms
64 bytes from 192.168.1.106: icmp_seq=2 ttl=64 time=0.023 ms
64 bytes from 192.168.1.106: icmp_seq=3 ttl=64 time=0.025 ms
64 bytes from 192.168.1.106: icmp_seq=4 ttl=64 time=0.024 ms
64 bytes from 192.168.1.106: icmp_seq=5 ttl=64 time=0.024 ms
^C
--- 192.168.1.106 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4004ms
rtt min/avg/max/mdev = 0.023/0.024/0.026/0.004 ms

-------------------
localhost ~ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.106 icmp_seq=1 Destination Host Unreachable
From 192.168.1.106 icmp_seq=2 Destination Host Unreachable
From 192.168.1.106 icmp_seq=3 Destination Host Unreachable


Could someone help with this? thanks in advanced.
Comment 20 Max Arnold 2008-11-17 12:57:17 UTC
> I got another problem that is whenever i boot up the wireless device
> i got some error information, the following is the error information

Please show the output of the following commands (as root):
ifconfig
netstat -rn
iptables -L
arp
Comment 21 coolone 2008-11-17 19:06:15 UTC
(In reply to comment #20)
> Please show the output of the following commands (as root):
> ifconfig
> netstat -rn
> iptables -L
> arp

heres output

ifconfig

eth0      Link encap:Ethernet  HWaddr 00:17:31:20:36:56  
          inet addr:10.1.1.14  Bcast:10.255.255.255  Mask:255.0.0.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:23 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

wlan0     Link encap:Ethernet  HWaddr 00:1c:f0:13:6c:56  
          inet addr:192.168.1.106  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21c:f0ff:fe13:6c56/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:519 errors:0 dropped:0 overruns:0 frame:0
          TX packets:45 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:74500 (72.7 KiB)  TX bytes:3074 (3.0 KiB)


netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
10.0.0.0        0.0.0.0         255.0.0.0       U         0 0          0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         10.1.1.1        0.0.0.0         UG        0 0          0 eth0
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0


> iptables -L
this one does work, says i need to upgrade my kernel
> arp
nothing showed up

thank you very much
Comment 22 Max Arnold 2008-11-18 11:56:14 UTC
(In reply to comment #21)
> nothing showed up

Oh, and I forgot to ask for output of iwconfig (you can replace any sensitive data like ESSID, mac address and encryption key with *** symbols or something like this). For example, there is how it may look:

ra0       RT2870 Wireless  ESSID:"default"  Nickname:"RT2870STA"
          Mode:Managed  Frequency=2.437 GHz  Access Point: **:**:**:**:**:**   
          Bit Rate=270 Mb/s   
          RTS thr:off   Fragment thr=65534 B   
          Encryption key:****-****-****-****-****-****-****-****
          Link Quality=100/100  Signal level:-21 dBm  Noise level:-71 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
Comment 23 coolone 2008-11-19 05:43:43 UTC
here
thanks for your reply.
Here's the output of iwconfig.

wlan0     RT2870 Wireless  ESSID:"Gsker"  Nickname:"RT2870STA"
          Mode:Auto  Frequency=2.447 GHz  Access Point: 12:3E:E8:Y9:HB:01   
          Bit Rate=1 Mb/s   
          RTS thr:off   Fragment thr=65534 B   
          Encryption key:off
          Link Quality=10/100  Signal level:-86 dBm  Noise level:-87 dBm
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0


I have been working on this a couple of days, but still cannot fix it.
thanks a lot for your help
Comment 24 Max Arnold 2008-11-19 06:56:58 UTC
(In reply to comment #23)
> I have been working on this a couple of days, but still cannot fix it.
> thanks a lot for your help

Well, for me everything seems correct...  I have no idea what can be wrong. If you have control over access point try to check its settings (security and firewall) and logs. In some cases tcpdump or wireshark can show something unusual.  Try the same adapter with different OS (Windows for example).

BTW, if wlan0 got its address automatically from access point via dhcp, then probably wireless connection itself has been established and problem exists somewhere else.

Also try to shutdown eth0 (/etc/init.d/net.eth0 stop).
Comment 25 Max Arnold 2008-11-19 07:06:53 UTC
And probably it is worth to discuss your particular problem on the gentoo forums, because this bug is about lack of driver itself. Thanks.
Comment 26 coolone 2008-11-19 08:20:01 UTC
thank you very much Max Arnold
i hope i can sort out
Comment 27 coolone 2008-11-19 08:25:12 UTC
would you mind paste your wpa_supplicant.conf file,
i think this error 
"ioctl[SIOCSIWAUTH]: Operation not supported                                    
 [ ok ]th param 4 value 0x0 - "
is about wpa_supplicant...
Comment 28 coolone 2008-11-19 11:00:59 UTC
I think this is my last post.

if i disable wpa_supplicant
vi /etc/conf.d/net

#modules=("wpa_supplicant")
#wpa_supplicant_wlan0="-Dwext"
config_wlan0=("192.168.1.111 netmask 255.255.255.0")
routes_wlan0=("default via 192.168.1.1")

seems i can get wlan0 on without error

 /etc/init.d/net.wlan0 restart
 * Stopping wlan0
 *   Bringing down wlan0
 *     Shutting down wlan0 ...                                            [ ok ]
 * Starting wlan0
 *   Configuring wireless network for wlan0
 *     wlan0 connected to ESSID "Gsker" at  12:3E:E8:Y9:HB:01  
 *     in auto mode on channel 8 (WEP disabled)
 *   Bringing up wlan0
 *     192.168.1.111                                                      [ ok ]
 *   Adding routes
 *     default via 192.168.1.1 ...                                        [ ok ]

this is my wpa_supplicant.conf 
vi /etc/wpa_supplicant/wpa_supplicant.conf 


network={
        ssid="Gsker"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=TKIP
        group=TKIP
        psk="DFSERE223412EDFE"
}

arp
Address                  HWtype  HWaddress           Flags Mask            Iface
192.168.1.1                      (incomplete)                              wlan0

 netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.1.0     0.0.0.0         255.255.255.0   U         0 0          0 wlan0
127.0.0.0       0.0.0.0         255.0.0.0       U         0 0          0 lo
0.0.0.0         192.168.1.1     0.0.0.0         UG        0 0          0 wlan0

I am wondering if i disable wireless-tool (wpa_supplicant)will the wlan0 work?
i dont think the problem from the driver, may be from the system.. not sure yet.

thanks a lot. 
Comment 29 Max Arnold 2008-11-19 16:36:41 UTC
My wpa_supplicant.conf:

ctrl_interface=/var/run/wpa_supplicant
eapol_version=1
ap_scan=1
fast_reauth=1

network={
        ssid="default"
        proto=WPA
        key_mgmt=WPA-PSK
        pairwise=CCMP TKIP
        group=CCMP TKIP WEP104 WEP40
        psk="mypassword"
        priority=2
}


And I get this annoying message too (SIOCSIWAUTH, param 4 value 0x0), but connection establishes just fine, so it is probably not critical.
Comment 30 Mieszko Ślusarczyk 2008-12-29 19:14:58 UTC
Created attachment 176791 [details]
Build.log

I tried to build it against kernel 2.6.28, and it failed.
besides i had to make directory, and create symlink on x86_64 (I haven't tested it on another arch):

mkdir /usr/src/zen-sources/arch/amd64/
ln -s /usr/src/zen-sources/arch/x86/Makefile /usr/src/zen-sources/arch/amd64/Makefile

because previously it failed saying, that it can't access /usr/src/zen-sources/arch/amd64/Makefile
Comment 31 Mieszko Ślusarczyk 2008-12-29 22:29:47 UTC
Sorry, I've missed, that I have to ln -s x86 amd64, not only makefile.
Now it compiles fine.
But just modprobing rt2870sta didn't help:(
Does anyone know what might be wrong?
Comment 32 Oliver Schoett 2009-01-29 13:03:11 UTC
Compiled and worked fine for me under 2.0.28 and 2.0.28.1

We will probably need a security patch:
http://www.debian.org/security/2009/dsa-1714
Comment 33 Max Arnold 2009-01-29 14:18:35 UTC
Created attachment 180109 [details, diff]
fix for security issue CVE-2009-0282
Comment 34 Max Arnold 2009-01-29 14:25:44 UTC
Created attachment 180111 [details]
revision bump to fix security issue

(In reply to comment #32)
> We will probably need a security patch:
> http://www.debian.org/security/2009/dsa-1714

Thank you for pointing that out!  Required patch and updated ebuild attached.
More details here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512995
Comment 35 Michael Gelfand 2009-04-05 01:45:04 UTC
Please someone update ebuild and patches to match 2.6.29 kernel (is has changes regarding net_device::priv being get using netdev_priv for example). I tried to make one myself but failed (it didn't work after all).
Comment 36 Michael Gelfand 2009-04-05 01:50:16 UTC
This might be of some interest (although that's another card): http://www.leprosys.info/2009/03/broadcom-80211-linux-sta-driver-en.html
Comment 37 Max Arnold 2009-04-05 03:13:33 UTC
Ralink has released new version about a month ago: http://www.ralinktech.com/ralink/Home/Support/Linux.html

[V2.1.0.0] Changelog:
1. New generation schema for multiple OS porting.
2. Fixed Ad-hoc ping failed in noisy environment. (Probe Response has too many retry packet then cause "not enough space in MgmtRing").
3. Fixed WPS failed with D-Link DIR-628 in 5GHz.
4. Change FastRoaming in DAT file to AutoRoaming.
5. Support kthread.
6. Add New A band channel list region 15 contains the whole channels in the A band region 4 and the new CE channel 167,169,171,173.
7. New IEEE802.11r functionality.

I've compiled it but it doesn't connect to my wpa-enabled access point, so I didn't updated the ebuild. I'm on 2.6.27. If anyone have succeeded - please post your instructions.

CVE-2009-0282 seems NOT to be fixed in 2.1.0.0.
Comment 38 Max Arnold 2009-04-05 04:44:40 UTC
Created attachment 187349 [details, diff]
patch to add 2.6.29 kernel support for rt2870-2.1.0.0

This is a patch I've found on rpmfusion.org for rt2870-2.1.0.0. It adds conditional ifdefs for kernel 2.6.29 and selects dev->priv or dev->ml_priv if necessary. Hope that helps you.

In a few days I'll try to write updated ebuild.
Comment 39 Michael Gelfand 2009-04-05 05:48:41 UTC
Okay, good news I actually got my D-Link DWA-140 working without using this driver :)

First, I got that feeling that there's something wrong with using `ml_priv` instead of `priv` member since I remember seeing both members in net_device structure before (2.6.28-r3). So I decided to grep for `ml_priv` in the whole /usr/src/linux (which points to 2.6.29 sources here) and noticed there's `drivers/staging/rt2870` directory. After a bit of searching inside `make menuconfig`, I found this one in

Device Drivers  --->
  [*] Staging drivers  --->
    [ ]   Exclude Staging drivers from being built
    <*>     Ralink 2870 wireless support

which, once turned on, worked great for me.
Comment 40 coolone 2009-05-18 07:09:35 UTC
(In reply to comment #39)
> Okay, good news I actually got my D-Link DWA-140 working without using this
> driver :)
> 
> First, I got that feeling that there's something wrong with using `ml_priv`
> instead of `priv` member since I remember seeing both members in net_device
> structure before (2.6.28-r3). So I decided to grep for `ml_priv` in the whole
> /usr/src/linux (which points to 2.6.29 sources here) and noticed there's
> `drivers/staging/rt2870` directory. After a bit of searching inside `make
> menuconfig`, I found this one in
> Device Drivers  --->
>   [*] Staging drivers  --->
>     [ ]   Exclude Staging drivers from being built
>     <*>     Ralink 2870 wireless support
> 
> which, once turned on, worked great for me.
> 



thats cool, thanks a lot. I've been searching the new driver, but now it is easier to get it work! just one more thing. 
once I recompiled the driver from the kernel the driver's name is ra0_rename, how to change the name to ra0?
Comment 41 Michal Kurgan 2009-06-13 03:15:33 UTC
Created attachment 194470 [details, diff]
rt2870usb-1.4.0.0-2.6.29-compile.patch

Patch to compilert2870usb-1.4.0.0 driver under 2.6.29 from Fedora source rpm.
Comment 42 Michal Kurgan 2009-06-13 03:16:50 UTC
Created attachment 194471 [details, diff]
rt2870usb-1.4.0.0-devices.patch

Patch to add support for Linksys WUSB54GC v3 in 1.4.0.0
Comment 43 Michal Kurgan 2009-06-13 03:19:02 UTC
Created attachment 194472 [details]
rt2870usb-1.4.0.0-r2.ebuild

Modified rt2870usb-1.4.0.0-r1.ebuild to use rt2870usb-1.4.0.0-2.6.29-compile.patch and rt2870usb-1.4.0.0-devices.patch patches. No other differences.
Comment 44 Michal Kurgan 2009-06-13 03:23:03 UTC
Above modification give wireless access to WUSB54GC v3 users, like myself. Sadly staging drivers in 2.6.29 does not work for those devices (or contain relevant USB_DEVICE entries). The same goes for 2009_0521_RT2870_Linux_STA_V2.1.2.0.tgz from vendors site.

Thanks to all other guys for helping me to enable this device under Linux...
Comment 45 Max Arnold 2009-06-13 07:19:32 UTC
Created attachment 194485 [details]
ebuild version bump to 2.1.2.0

This is updated ebuild for official Ralink RT2870 driver v2.1.2.0.  Works for me on kernel 2.6.29.
Comment 46 Max Arnold 2009-06-13 07:20:45 UTC
Created attachment 194487 [details, diff]
turn off verbose debugging
Comment 47 Max Arnold 2009-06-13 07:21:21 UTC
Created attachment 194489 [details, diff]
wpa enabling patch
Comment 48 Max Arnold 2009-06-13 07:24:14 UTC
Created attachment 194491 [details, diff]
miscellaneous fixes

This fix also contains USB device id for Linksys WUSB54GC (as reported by Michal Kurgan), although I've not tested it.
Comment 49 PhobosK 2009-07-14 23:41:47 UTC
Created attachment 197988 [details]
fixes to the ebuild allowing compilation on amd64 without symlinking and some other minor fixes

(In reply to comment #45)
> Created an attachment (id=194485) [edit]
> ebuild version bump to 2.1.2.0
> 
> This is updated ebuild for official Ralink RT2870 driver v2.1.2.0.  Works for
> me on kernel 2.6.29.
> 

There are some misused macros and variables in this ebuild that do not allow emerging on amd64 (symlinking is not the right thing to do). So i have rewrote the ebuild a bit and it should be more compliant to the QA of Gentoo.

CHANGES:
1. Going back to non stable on x86. The QA of keywords (http://devmanual.gentoo.org/keywording/index.html) describes very well how a non stable becomes stable...
2. Fixed compiling of the module according to the linux-mod eclass compliance (MODULE_NAMES, BUILD_TARGETS, using linux-mod_src_compile now and the generation of the module conf for /etc/modprobe.d on 2.6 kernels is fixed)
3. The firmware file moved to the standard /lib/firmware dir (in STA mode of the module using wpa it is not used actually). Probably the firmware should be moved in a separate ebuild.
4. The previous patches remain (*-fixes.patch; *-wpa.patch;*-nodebug.patch)
Comment 50 Thilo Bangert (RETIRED) (RETIRED) gentoo-dev 2009-10-17 11:12:26 UTC
*** Bug 265061 has been marked as a duplicate of this bug. ***
Comment 51 Max Arnold 2009-10-17 15:40:12 UTC
Created attachment 207411 [details]
ebuild version bump to 2.2.0.0

Ralink released version 2.2.0.0: http://www.ralinktech.com/support.php?s=2 (old url does not work and download links on http://web.ralinktech.com/ralink/Home/Support/Linux.html are also dead).  They use awful url naming scheme and wget can't get real filename without --content-disposition switch (my workaround is to use EAPI-2 SRC_URI syntax).

Changelog between 2.1.2.0 and 2.2.0.0 is very short (although source code contains a lot of modifications):
1. Fixed issue of showing wrong statistics value.
2. Fixed problem of showing wrong SNR in wireless extension scan list.
3. Support Client WDS.

I've updated ebuild and patches, but for me it doesn't work: association with access point succeeds, but reply for DHCP requests not received (manual IP configuration also didn't helped). So please test and report.

Also rt2870-2.2.0.0-fixes.patch contains two additional USB IDs (Planex Communications and Linksys WUSB100 v2).
Comment 52 Max Arnold 2009-10-17 15:42:55 UTC
Created attachment 207412 [details, diff]
turn off verbose debugging
Comment 53 Max Arnold 2009-10-17 15:44:13 UTC
Created attachment 207413 [details, diff]
enable wpa
Comment 54 Max Arnold 2009-10-17 15:46:11 UTC
Created attachment 207415 [details, diff]
miscellaneous fixes
Comment 55 Yiu Wai Keung 2009-11-08 09:21:09 UTC
Hi, I have a d-link dwa-140 usb wireless device with the rt2870 chip.
I just came back to gentoo after a few months of absence and did a clean system rebuild and downloaded the new 2.2.0.0 drivers from ralink's website.
I also could get the device to associate with the AP but from there i'm stuck.
DHCP nor static IP doesnt work for some weird reason. (WPA2-AES for my case)
However, after fishing out 2.1.2.0 from the web, the wireless device is now working properly.
I think something is definitely wrong with the 2.2.0.0 drivers.
Comment 56 PhobosK 2010-01-13 14:32:23 UTC
Hi all.
I am posting the ebuild for the latest version of the Ralink rt2870usb driver.
They have added even more obfuscation to the download url from their site, so i have turned fetch restriction ON in the ebuild. When you download the source file of the driver, just move it to portage dist (no matter it has the wrong extension - tar.tar.bz2).
If you previously have tried to compile the kernel staging driver rt2800usb (which for now is absolutely broken), do not worry because it will be blacklisted by the ebuild.
This ebuild has been tested on latest kernel (2.6.32-gentoo-r1) and compiles and works like a charm (incl. with wpa_supplicant).
I will try to post new ebuilds with new kernels if needed till the staging driver gets into stable.
Any comments are welcome.
Comment 57 PhobosK 2010-01-13 14:34:59 UTC
Created attachment 216354 [details]
The ebuild for the 2.3.0.0 version of the rt2870usb Ralink kernel driver

Put this into your local portage overlay ('net-wireless' section)
Comment 58 PhobosK 2010-01-13 14:36:19 UTC
Created attachment 216356 [details, diff]
The patch for turning off debugging
Comment 59 PhobosK 2010-01-13 14:37:20 UTC
Created attachment 216357 [details, diff]
A unified patch fixing various issues
Comment 60 Max Arnold 2010-01-13 16:15:22 UTC
Thanks!  While 2.2.0.0 was probably broken, I just compiled 2.3.0.0 and can confirm that it works for me on x86 and kernel-2.6.29 with WPA2-AES.

rt2870usb-2.3.0.0-unified patch misses several additional USB IDs I've added earlier, so it may be useful to look at current kernel source for list of compatible devices and their ID's: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=blob_plain;f=drivers/staging/rt2860/usb_main_dev.c;hb=HEAD

Also some info here: http://bugzilla.kernel.org/show_bug.cgi?id=13459#c3

And if someone interested, below is direct link to tarball (use wget --content-disposition) and official changelog:

http://www.ralinktech.com/download.php?t=U0wyRnpjMlYwY3k4eU1EQTVMekV5THpFMUwyUnZkMjVzYjJGa05UYzBNVFExTkRNNU5TNWllakk5UFQxU1ZESTROekJmVEdsdWRYaFRWRUZmVmpJdU15NHdMakF1ZEdGeUxuUmhjZz09Qw==

1. Support PSP XLINK in ad-hoc mode.
2. Add mac80211 iw utility other commands support.
3. Fix issue: The start address of HeaderBuf must be aligned by 4 when VENDOR_FEATURE1_SUPPORT is enabled.
4. WMM ACM: see history of acm_comm.c.
5. Shorten the waiting time when unplug the device.
6. Fix mgmt ring full issue: It happened only in big-endian platform and quickly switch the network type between Infra and Adhoc mode.
7. Fix statistics issue: It happened in big-endian platform, tx count would be zero.
8. Support WiFi Draft_3.0 11n test items.
9. Support Linux Kernel 2.6.31
Comment 61 PhobosK 2010-01-13 16:51:53 UTC
Well... you are right about some missing USB IDs, but I have only tested the one added extra and it works for sure... for adding the others... I think they all should be tested with the 2.3.0.0 release before the actual add...
IMHO we should stay closer to the orig sources so we do not introduce any bugs...
Anyway an extra IUSE flag may be added, so additional USB IDs could be added if the user needs testing them...

BTW i deliberately did not used the download url, because of two reasons:
1. The user has to accept the GNU license before download (Ralink decision) and i do not think we should disregard this.
2. The generated url works for now.. but it could change in time (probably it is a kind of a temp cache redirect or whatever)...

There could be added some more extras in the ebuild like some udev rules etc... but i think the simpler and closer to the original the ebuild stays, the better.
Comment 62 Max Arnold 2010-01-13 17:29:27 UTC
(In reply to comment #61)
> Well... you are right about some missing USB IDs, but I have only tested the
> one added extra and it works for sure... for adding the others... I think they
> all should be tested with the 2.3.0.0 release before the actual add...

I'm not insisting on this and agree that it is better for users to test the driver on actual devices they own (and report back if it works). And I've posted url to device list only for reference - it is useful to check if particular adapter can be supported by this driver.
Comment 63 Andreas Sturmlechner gentoo-dev 2010-02-14 18:08:30 UTC
rt2870-2.3.0.0.ebuild won't work with kernel 2.6.33 anymore.

1.: It expects CONFIG_WIRELESS_EXT to be set which was renamed to CONFIG_WIRELESS_EXT_SYSFS. This is easily corrected.

2.: Finally, it fails because of a wireless api change:
inux/rt_linux.c:1706: error: ‘struct net_device’ has no member named ‘wireless_handlers’
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c: In function ‘rt_ioctl_siwencode’:
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:1446: warning: suggest parentheses around operand of ‘!’ or change ‘&’ to ‘&&’ or ‘!’ to ‘~’
make[2]: *** [/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/rt_linux.o] Error 1
make[2]: *** Waiting for unfinished jobs....
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c: At top level:
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2896: error: unknown field ‘private’ specified in initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2896: warning: initialization from incompatible pointer type
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2897: error: unknown field ‘num_private’ specified in initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2897: warning: excess elements in struct initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2897: warning: (near initialization for ‘rt28xx_iw_handler_def’)
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2898: error: unknown field ‘private_args’ specified in initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2898: warning: excess elements in struct initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2898: warning: (near initialization for ‘rt28xx_iw_handler_def’)
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2899: error: unknown field ‘num_private_args’ specified in initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2899: warning: excess elements in struct initializer
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.c:2899: warning: (near initialization for ‘rt28xx_iw_handler_def’)
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/rt_main_dev.c: In function ‘rt28xx_open’:
/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/rt_main_dev.c:486: error: ‘struct net_device’ has no member named ‘wireless_handlers’
make[2]: *** [/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/rt_main_dev.o] Error 1
make[2]: *** [/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux/../../os/linux/sta_ioctl.o] Error 1
make[1]: *** [_module_/var/tmp/portage/net-wireless/rt2870usb-2.3.0.0/work/RT2870_LinuxSTA_V2.3.0.0/os/linux] Error 2
make[1]: Leaving directory `/usr/src/zen-unstable'
make: *** [LINUX] Error 2
Comment 64 PhobosK 2010-02-14 18:44:15 UTC
(In reply to comment #63)
> rt2870-2.3.0.0.ebuild won't work with kernel 2.6.33 anymore.
> 

What about the staging drivers?
Do they work on kernel 2.6.33 ? (wpa_supplicant etc?)
Comment 65 Andreas Sturmlechner gentoo-dev 2010-02-14 19:08:18 UTC
(In reply to comment #64)
> (In reply to comment #63)
> > rt2870-2.3.0.0.ebuild won't work with kernel 2.6.33 anymore.
> > 
> 
> What about the staging drivers?
> Do they work on kernel 2.6.33 ? (wpa_supplicant etc?)
> 

I can't tell. I stumbled over this bug by trying to get my Linksys WUSB600N ver2 to work, which is actually a RT3572 chip without any kind of in-kernel support right now.

I put together an ebuild and new patches for this chip and its Ralink sources. I'll add them here if that's ok.
Comment 66 Andreas Sturmlechner gentoo-dev 2010-02-14 19:40:15 UTC
Created attachment 219685 [details]
ebuild for rt3572 Ralink sources (based on rt2870usb-2.3.0.0.ebuild)

This is my ebuild for Ralink's RT35xx series (patches following). Be warned that that I haven't yet made it run without an early kernel panic!

Experience so far:

2.6.33_rc8: Does not build, see three comments above.
2.6.32.2: Builds successfully, then oopses away during connection establishment.
2.6.31.12: Again successful build, again early kernel oops when trying to connect (on verifying authentication -> "Bad Password").

Not too promising, even though this kind Ubuntu user pointing me into the right direction got it working: http://forums.gentoo.org/viewtopic-p-6171198.html#6171198

The issues might be related to some kernel option(s), so I won't give up yet.
Comment 67 Andreas Sturmlechner gentoo-dev 2010-02-14 19:42:09 UTC
Created attachment 219687 [details, diff]
Makefile patch
Comment 68 Andreas Sturmlechner gentoo-dev 2010-02-14 19:43:01 UTC
Created attachment 219689 [details, diff]
enable WPA
Comment 69 Andreas Sturmlechner gentoo-dev 2010-02-14 19:44:14 UTC
Created attachment 219691 [details, diff]
add WUSB600n ver2 and WUSB54GC device strings
Comment 70 Andreas Sturmlechner gentoo-dev 2010-02-14 19:45:32 UTC
Created attachment 219693 [details, diff]
don't debug if explicitly asked for
Comment 71 Andreas Sturmlechner gentoo-dev 2010-02-14 20:24:06 UTC
(In reply to comment #64)
> (In reply to comment #63)
> > rt2870-2.3.0.0.ebuild won't work with kernel 2.6.33 anymore.
> > 
> 
> What about the staging drivers?
> Do they work on kernel 2.6.33 ? (wpa_supplicant etc?)
> 

Actually I was wrong. WIRELESS_EXT simply isn't there anymore in 2.6.33, so we have to wait for a new driver version from Ralink. Nothing to do with sysfs.
Comment 72 Boney McCracker 2010-03-04 05:04:46 UTC
I've been using the in-kernel driver (staging), with wpa_supplicant, and it was working fine for me, up until 2.6.33.
Comment 73 cloudalmasai 2010-04-12 23:07:01 UTC
Hi can you please add id for a usb planex adapter, the id of the device is ID 2019:ab25 PLANEX, amnd support for xlink mode, sorry for my bad english. Thanks in advance.

Comment 74 Stefan Wimmer 2010-05-10 00:12:27 UTC
(In reply to comment #72)
> I've been using the in-kernel driver (staging), with wpa_supplicant, and it was
> working fine for me, up until 2.6.33.
> 

Hmm - can you share your settings John since I can't get the staging driver working with 2.6.33 ...

TIA
Stefan
Comment 75 Boney McCracker 2010-05-10 01:30:17 UTC
(In reply to comment #74)
> Hmm - can you share your settings John since I can't get the staging driver
> working with 2.6.33 ...

Sorry, Stefan.  What I meant is that it worked for me before 2.6.33, but is not working with 2.6.33.

Since I don't need it at the moment, I've been just waiting, rather than trying alternatives.
Comment 76 Sumant Oemrawsingh 2010-06-20 17:28:24 UTC
(In reply to comment #69)
> Created an attachment (id=219691) [details]
> add WUSB600n ver2 and WUSB54GC device strings
> 

I have a WUSB600n ver2 and can't get this ebuild to work on amd64 on an older kernel (2.6.30). 

Emerging shows that during compilation, there are some warnings about casting between pointers and integers, which make me suspicious that the code is not 64-bit clean.

Nevertheless, when I plug in the stick, the module is automatically loaded and the blue light comes on.

iwconfig  reports (among others):
ra0       Ralink STA  
          
I then start the interface (which uses wpa_supplicant):
# /etc/init.d/net.ra0 start
net.ra0         | * Bringing up interface ra0
net.ra0         | *   Starting wpa_supplicant on ra0 ...
net.ra0         |ioctl[SIOCGIWRANGE]: Argument list too long                                                                                                                             [ ok ]
net.ra0         | *   Starting wpa_cli on ra0 ...                                                                                                                                        [ ok ]
net.ra0         | *   Backgrounding ... ...
net.ra0         | * WARNING: net.ra0 has started, but is inactive

Nothing happens, and dmesg reports:

<-- RTMPAllocTxRxRingMemory, Status=0
-->RTUSBVenderReset
<--RTUSBVenderReset
Key1Str is Invalid key length(0) or Type(0)
Key2Str is Invalid key length(0) or Type(0)
Key3Str is Invalid key length(0) or Type(0)
Key4Str is Invalid key length(0) or Type(0)
1. Phy Mode = 5
2. Phy Mode = 5
NVM is Efuse and its size =3c[3c0-3fb] 
RTMPSetPhyMode: channel is out of range, use first channel=1 
3. Phy Mode = 5
MCS Set = ff ff 00 00 01
<==== rt28xx_init, Status=0
0x1300 = 00064300
===>rt_ioctl_giwscan. 5(5) BSS returned, data->length = 1061
==>rt_ioctl_siwfreq::SIOCSIWFREQ[cmd=0x8b04] (Channel=1)
BUG: unable to handle kernel paging request at ffffc82811743fbc
IP: [<ffffffffa0b76516>] CntlOidRTBssidProc+0x5f/0x45d [rt3572sta]
PGD 0 
Oops: 0000 [#1] SMP 
last sysfs file: /sys/devices/pci0000:00/0000:00:13.5/usb1/1-1/1-1:1.0/bInterfaceProtocol
CPU 1 
Modules linked in: rt3572sta snd_seq snd_seq_device snd_pcm_oss snd_mixer_oss fuse nvidia(P) snd_hda_codec_realtek snd_hda_intel r8169 snd_hda_codec snd_pcm snd_timer mii snd snd_page_alloc
Pid: 6495, comm: RtmpMlmeTask Tainted: P           2.6.30-gentoo-r6 #4 MS-7327
RIP: 0010:[<ffffffffa0b76516>]  [<ffffffffa0b76516>] CntlOidRTBssidProc+0x5f/0x45d [rt3572sta]
RSP: 0018:ffff88007bd71de0  EFLAGS: 00010246
RAX: 00000627fffff901 RBX: ffffc82811743f50 RCX: 0000000000000000
RDX: 0000000000000000 RSI: ffffc20011705fe8 RDI: ffffc20011744570
RBP: ffffc20011700000 R08: 0000000000000000 R09: ffffc20011700000
R10: ffff8800010346a0 R11: ffffffff803e4a4a R12: 00000000ffffffff
R13: ffffc20011705fe8 R14: ffffc20011744578 R15: 0000000000000000
FS:  00007feb6c90f6f0(0000) GS:ffff880001029000(0000) knlGS:0000000000000000
CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
CR2: ffffc82811743fbc CR3: 000000006e0ff000 CR4: 00000000000006e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process RtmpMlmeTask (pid: 6495, threadinfo ffff88007bd70000, task ffff88007e6b8640)
Stack:
 ffffc20011712e59 ffffc200117059b8 ffffc20011700000 ffffffffa0b76d19
 ffff88007bd71e10 0000000000000018 ffff88007ce3d440 0000000000010a00
 ffff88007e6b8640 0000000000000000 ffff88007ce3d440 ffffffff80591596
Call Trace:
 [<ffffffffa0b76d19>] ? CntlOidSsidProc+0x405/0x412 [rt3572sta]
 [<ffffffff80591596>] ? thread_return+0x3f/0x93
 [<ffffffffa0b90b37>] ? RT3572WriteBBPR66+0x8f/0x9f [rt3572sta]
 [<ffffffffa0b76e9b>] ? CntlIdleProc+0x76/0x120 [rt3572sta]
 [<ffffffffa0b46c98>] ? MlmeDequeue+0x48/0x53 [rt3572sta]
 [<ffffffffa0b4ad31>] ? MlmeHandler+0x135/0x1ee [rt3572sta]
 [<ffffffffa0b923d8>] ? MlmeThread+0xcd/0x101 [rt3572sta]
 [<ffffffff802496a1>] ? autoremove_wake_function+0x0/0x2e
 [<ffffffffa0b9230b>] ? MlmeThread+0x0/0x101 [rt3572sta]
 [<ffffffff8024957a>] ? kthread+0x54/0x82
 [<ffffffff8020bcba>] ? child_rip+0xa/0x20
 [<ffffffff80249526>] ? kthread+0x0/0x82
 [<ffffffff8020bcb0>] ? child_rip+0x0/0x20
Code: 87 68 19 00 00 88 87 58 2e 01 00 48 8d bf 70 45 04 00 e8 5a 1b fd ff 49 89 c4 48 69 c0 28 06 00 00 49 8d 1c 06 8a 85 79 2e 01 00 <3a> 43 6c 75 17 48 8d 73 6d 48 8d bd 59 2e 01 00 0f b6 d0 e8 0a 
RIP  [<ffffffffa0b76516>] CntlOidRTBssidProc+0x5f/0x45d [rt3572sta]
 RSP <ffff88007bd71de0>
CR2: ffffc82811743fbc
---[ end trace 304029b51d029d22 ]---
ra0: no IPv6 routers present

Basically, nothing happens, and the system becomes unstable.

I went through the code and tried to fix up as many of the integer-pointer casting problems as I could (without actually knowing anything about the code, mind you...). This got the system more stable, and actually allows the stick to find APs, but it doesn't see their essid, so it never associates with the one I want.

Any tips or things I should try out?

Thanks

#emerge --info
Portage 2.1.8.3 (default/linux/amd64/10.0/desktop, gcc-4.1.2, glibc-2.10.1-r1, 2.6.30-gentoo-r6 x86_64)
=================================================================
System uname: Linux-2.6.30-gentoo-r6-x86_64-AMD_Athlon-tm-_64_X2_Dual_Core_Processor_4600+-with-gentoo-2.0.1
Timestamp of tree: Sat, 05 Jun 2010 14:45:03 +0000
app-shells/bash:     4.0_p37
dev-java/java-config: 1.3.7-r1, 2.1.10
dev-lang/python:     2.5.4-r3, 2.6.4-r1, 3.1.1
dev-python/pycrypto: 2.0.1-r8
dev-util/cmake:      2.6.4-r3
sys-apps/baselayout: 2.0.1
sys-apps/openrc:     0.6.1-r1
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.63-r1
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.3, 1.11.1
sys-devel/binutils:  2.18-r3
sys-devel/gcc:       4.1.2, 4.3.4, 4.4.1
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA sun-bcla-java-vm skype-eula"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -march=athlon64 -pipe -msse3"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/spool/torque"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -march=athlon64 -pipe -msse3"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://mirror.uni-c.dk/pub/gentoo/ ftp://sunsite.informatik.rwth-aachen.de/pub/Linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://mirror.scarlet-internet.nl/pub/gentoo"
LDFLAGS="-Wl,-O1"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/lisp /usr/local/portage"
SYNC="rsync://rsync.nl.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X Xaw3d a52 aac acl acpi alsa amd64 apm audiofile avi bash-completion berkdb blas bluetooth branding browserplugin bzip2 cairo cddb cdinstall cdparanoia cdr cli common-lisp consolekit cracklib crypt cups curl cvs cxx dbus dlloader dri dts dvd dvdr dvdread emboss encode esd exif fam ffmpeg fftw firefox flac fluidsynth fontconfig fortran fts3 gd gdbm gif glitz glut gmp gnutls gpg gphoto2 gpm gtk gtk2 hal hardened hdf5 heterogeneous iconv icq imagemagick imap imlib ipv6 java jbig jpeg jpeg2k kpathsea lapack latex lcms ldap ldb libnotify lua mad matroska mbox metis mikmod mime mmx mng modules motif mozilla mozsvg mp3 mp4 mpeg mpi mpi-threads mplayer msn mudflap multilib ncurses nls nodrm nptl nptlonly nsplugin nvidia offensive ogg oggvorbis openaloscar opengl openmp oss pam pango password pbs pcre pdf perl plotutils png ppds pppd python qt3support quicktime rar readline reflection romio rtc sasl sbcl scanner sdl session shorten slang sox sparse spell spl sse sse2 ssl startup-notification supernodal svg sysfs tcpd tetex theora threads tiff truetype unicode usb uudeview vcd vdpau vim-syntax vim-with-x vorbis webkit wmf wxwidgets wxwindows x264 xcb xml xml2 xorg xpm xprint xsl xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="mouse keyboard joystick evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" SANE_BACKENDS="canon" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

Comment 77 Sumant Oemrawsingh 2010-06-20 17:30:44 UTC
Created attachment 236081 [details]
emerging rt3572usb on amd64; note compilation warnings
Comment 78 z35 2010-06-27 23:12:25 UTC
Created attachment 236761 [details, diff]
The rtusb_dev_id patch updated for 2.4.0.0 and added Linksys AE1000

Updated the patch for 2.4.0.0 and added the Linksys AE1000 device.
Comment 79 z35 2010-06-27 23:32:19 UTC
2010_06_25_RT3572_Linux_STA_v2.4.0.0 Released. Seems to still have be the same problems on newer kernels. 
Comment 80 Michael Gelfand 2010-09-19 08:54:13 UTC
Created attachment 247958 [details, diff]
implicitly declared usb_buffer_alloc/usb_buffer_free patch for kernel 2.6.35+

Attached a patch for 2.4.0.1 version on 2.6.35+ kernels. USB buffer memory management functions were renamed, this fixes them. Could be used together with 2.4.0.0 unified and nodebug patches. Works fine for me.
Comment 81 Michael Gelfand 2010-09-19 09:05:06 UTC
Sorry, I was talking about 2.3.0.0 patches. Anyway, they fit nice for 2.4.0.0. BTW, I didn't fix any casting warnings Sumant was pointing at.
Comment 82 Agostino Sarubbo gentoo-dev 2010-10-05 10:35:36 UTC
2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2 was released

Is possible to have an ebuild who works with .35?
Comment 83 Andreas Sturmlechner gentoo-dev 2010-10-13 12:18:27 UTC
(In reply to comment #76)
> (In reply to comment #69)
> > Created an attachment (id=219691) [details] [details]
> > add WUSB600n ver2 and WUSB54GC device strings
> > 
> 
> I have a WUSB600n ver2 and can't get this ebuild to work on amd64 on an older
> kernel (2.6.30). 

Unfortunately, I don't have the hardware anymore to test it. I decided that spending more time with getting it to work wasn't worth it compared to simply buying another stick with an Atheros chip. Turned out that isn't running quite flawlessly either, but nevertheless - it does.
Comment 84 DMoL 2010-10-30 09:45:14 UTC
Could anybody provide the ebuild for latest sources (2.4.0.1) from ra-link?
Comment 85 Max Arnold 2010-10-30 18:57:42 UTC
Created attachment 252601 [details, diff]
Turn off debugging
Comment 86 Max Arnold 2010-10-30 18:59:41 UTC
Created attachment 252603 [details, diff]
Combined patch
Comment 87 Max Arnold 2010-10-30 19:07:16 UTC
Created attachment 252605 [details]
ebuild for 2.4.0.1

> Could anybody provide the ebuild for latest sources (2.4.0.1) from ra-link?

Here it is, tested on x86 with kernel 2.6.34. Included rt2870usb-2.4.0.1-usb_alloc_free.patch for 2.6.35.

Also added (untested) support for APLANEX 150N Wireless LAN USB Adapter and XLINK mode.
Comment 88 PhobosK 2010-11-07 19:19:08 UTC
@Max Arnold,
You should not use a direct link to the source tarball in the ebuild 'cause this circumvents Ralink's license viewing and acceptance (and probably the link's url will be changed in the future).
As for CONFIG_WIRELESS_EXT, in kernels above 2.6.33 it can only be enabled by choosing a certain wireless driver like PRISM54 or IPW2200, so this should be logged for the user.
I have made some changes in the ebuild, so i am uploading it.
Comment 89 PhobosK 2010-11-07 19:21:54 UTC
Created attachment 253547 [details]
ebuild for 2.4.0.1 revision 1

Fixed some fail messages when kernel is 2.6.33+ and added fetch restrictions.
Comment 90 PhobosK 2011-02-07 11:36:04 UTC
There is a problem with the stock driver on kernels 2.6.37 because of netif_stop_queue called before TX queue allocation. This problem gives these kernel messages (approximately):

Feb  6 19:23:26 gentoo-machine kernel: rtusb init --->
Feb  6 19:23:26 gentoo-machine kernel: ------------[ cut here ]------------
Feb  6 19:23:26 gentoo-machine kernel: WARNING: at include/linux/netdevice.h:1557 0xffffffffa06d7e86()
Feb  6 19:23:26 gentoo-machine kernel: Hardware name: System Product Name
Feb  6 19:23:26 gentoo-machine kernel: Modules linked in: rt2870sta(+) tuner_simple tuner_types snd_hda_codec_hdmi joydev snd_hda_codec_via tda9887 tda8290 tea5767 uvcvideo tuner snd_usb_audio snd_usbmidi_lib cx8800(+) ir_lirc_codec lirc_dev snd_hda_intel(+) cx88xx ir_sony_decoder snd_cmipci snd_hda_codec ir_jvc_decoder gameport ir_rc6_decoder snd_pcm i2c_algo_bit ir_rc5_decoder ir_nec_decoder ir_common ir_core firewire_ohci snd_opl3_lib rtc_cmos snd_hwdep snd_mpu401_uart tveeprom rtc_core snd_rawmidi v4l2_common videodev i2c_nforce2 snd_timer firewire_core snd_seq_device video floppy v4l1_compat wmi backlight v4l2_compat_ioctl32 videobuf_dma_sg rtc_lib output snd videobuf_core snd_page_alloc button i2c_core processor pcspkr btcx_risc asus_atk0110 k10temp iscsi_tcp libiscsi_tcp libiscsi scsi_transport_iscsi fuse xfs exportfs nfs auth_rpcgss nfs_acl fscache lockd sunrpc jfs reiserfs ext2 raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor xor async_tx raid6_pq raid1 raid0 dm_snapshot dm_crypt dm_mirror dm_region_hash dm_log dm_mod scsi_wait_scan hid_sony hid_samsung hid_microsoft hid_logitech ff_memless hid_gyration hid_belkin hid_apple hid_a4tech sl811_hcd usbhid ohci_hcd uhci_hcd usb_storage usb_libusual ehci_hcd usbcore aic94xx libsas lpfc qla2xxx megaraid_sas megaraid_mbox megaraid_mm megaraid aacraid 3w_9xxx 3w_xxxx mptsas scsi_transport_sas mptfc scsi_transport_fc scsi_tgt mptspi mptscsih mptbase atp870u dc395x qla1280 imm parport dmx3191d sym53c8xx gdth advansys firmware_class initio BusLogic arcmsr aic7xxx aic79xx scsi_transport_spi sg ahci libahci sata_nv pata_jmicron pata_amd pata_platform libata
Feb  6 19:23:26 gentoo-machine kernel: Pid: 11227, comm: modprobe Not tainted 2.6.37-gentoo #2
Feb  6 19:23:26 gentoo-machine kernel: Call Trace:
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff81038c95>] ? 0xffffffff81038c95
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d7e86>] ? 0xffffffffa06d7e86
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06dfe85>] ? 0xffffffffa06dfe85
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d7d0b>] ? 0xffffffffa06d7d0b
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d7abb>] ? 0xffffffffa06d7abb
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d7f0c>] ? 0xffffffffa06d7f0c
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d78e9>] ? 0xffffffffa06d78e9
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06d77a8>] ? 0xffffffffa06d77a8
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa06dff81>] ? 0xffffffffa06dff81
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa02ba299>] ? 0xffffffffa02ba299
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123e7d2>] ? 0xffffffff8123e7d2
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123e8b1>] ? 0xffffffff8123e8b1
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123e862>] ? 0xffffffff8123e862
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123dad0>] ? 0xffffffff8123dad0
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123e167>] ? 0xffffffff8123e167
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8123eadc>] ? 0xffffffff8123eadc
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa02b9ad6>] ? 0xffffffffa02b9ad6
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffffa0336000>] ? 0xffffffffa0336000
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff810002e6>] ? 0xffffffff810002e6
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff81060743>] ? 0xffffffff81060743
Feb  6 19:23:26 gentoo-machine kernel: [<ffffffff8100293b>] ? 0xffffffff8100293b
Feb  6 19:23:26 gentoo-machine kernel: ---[ end trace 8f5722cd8c21c240 ]---
Feb  6 19:23:26 gentoo-machine kernel: netif_stop_queue() cannot be called before register_netdev()

To fix this issue, I have added the necessary patch to the new ebuild of rt2870usb - 2.4.0.1 revision 2.

More info can be found here (though it concerns the kernel staging drivers):
https://bugzilla.kernel.org/show_bug.cgi?id=26472
https://lkml.org/lkml/2011/1/10/329
Comment 91 PhobosK 2011-02-07 11:37:47 UTC
Created attachment 261705 [details]
ebuild for 2.4.0.1 revision 2
Comment 92 PhobosK 2011-02-07 11:39:08 UTC
Created attachment 261707 [details, diff]
A patch for fixing the kernel's warnings about netif_stop_queue()
Comment 93 Vladimir Berezhnoy 2012-01-14 09:56:28 UTC
Created attachment 298907 [details]
ralink-rt2870-2.5.0.3-r1.ebuild
Comment 94 Vladimir Berezhnoy 2012-01-14 09:56:59 UTC
Created attachment 298909 [details]
ralink-rt2870-notftp.patch
Comment 95 Vladimir Berezhnoy 2012-01-14 09:57:45 UTC
I added ebuild for latest version which is available on ralink site.
Comment 96 Agostino Sarubbo gentoo-dev 2012-01-14 10:09:41 UTC
A good idea is make old files as obsolete.