| View previous topic :: View next topic |
| Author |
Message |
marschw n00b

Joined: 04 Jun 2003 Posts: 51
|
Posted: Mon Aug 20, 2007 10:37 pm Post subject: rt2x00 for 2.6.22 |
|
|
The current rt2x00 CVS ebuild that's in portage doesn't build with my 2.6.22 kernel (I'm using kamikaze-5, but I think it won't currently build on anything 2.6.22), so I edited the ebuild a little bit to get it to work. The changes are REALLY quick and dirty, and have only undergone very basic testing, but for me it's at least enough to associate with my access point.
EDIT: Changed it around to be somewhat more proper. It doesn't mess up if you have the rfkill use flag, it doesn't always build the usb module, and several other changes. As before, though, it may not work, I've barely tested it...
| Code: | # Copyright 1999-2007 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-wireless/rt2x00/rt2x00-9999.ebuild,v 1.21 2007/02/27 07:34:08 uberlord Exp $
inherit linux-mod cvs
DESCRIPTION="Driver for the RaLink RT2x00 wireless chipsets"
HOMEPAGE="http://rt2x00.serialmonkey.com"
LICENSE="GPL-2"
ECVS_SERVER="rt2400.cvs.sourceforge.net:/cvsroot/rt2400"
ECVS_MODULE="source/rt2x00"
ECVS_LOCALNAME="${P}"
KEYWORDS="-* ~amd64 ~x86"
RDEPEND="net-wireless/wireless-tools"
IUSE_RT2X00_DEVICES="rt2400pci rt2500pci rt2500usb rt61pci rt73usb"
IUSE_RT2X00_EXTRA="rfkill"
IUSE="asm debug"
for x in ${IUSE_RT2X00_DEVICES} ${IUSE_RT2X00_EXTRA} ; do
IUSE="${IUSE} ${x}"
done
pkg_setup() {
#CONFIG_CHECK="NET_RADIO"
#ERROR_NET_RADIO="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_NET_RADIO)."
# dScape requires some crypto
CONFIG_CHECK="${CONFIG_CHECK} CRYPTO_AES CRYPTO_ARC4"
ERROR_CRYPTO_AES="${P} requires support for AES Cryptography (CONFIG_CRYPTO_AES)."
ERROR_CRYPTO_ARC4="${P} requires support for ARC4 Cryptography (CONFIG_CRYPTO_ARC4)."
if use rfkill ; then
CONFIG_CHECK="${CONFIG_CHECK} INPUT"
fi
if use rt2400pci \
|| use rt2500pci \
|| use rt61pci ; then
CONFIG_CHECK="${CONFIG_CHECK} PCI"
fi
if use rt2500usb || use rt73usb ; then
CONFIG_CHECK="${CONFIG_CHECK} USB"
fi
if use rt61pci || use rt73usb ; then
CONFIG_CHECK="${CONFIG_CHECK} FW_LOADER"
ERROR_FW_LOADER="${P} requires support for Firmware module loading (CONFIG_FW_LOADER)."
fi
if use debug ; then
CONFIG_CHECK="${CONFIG_CHECK} DEBUG_FS"
ERROR_DEBUG_FS="${P} requires Kernel Debug FS support (CONFIG_DEBUG_FS)"
fi
kernel_is lt 2 6 17 && die "${P} requires at least kernel 2.6.17"
linux-mod_pkg_setup
BUILD_PARAMS="KERNDIR=${KV_DIR} KERNOUT=${KV_OUT_DIR}"
BUILD_TARGETS=" " # Target "module" is not supported, so we blank it
}
src_compile() {
local m= asm="n" button="n" debug="n" full="y" yn= M=
use asm && asm="y"
use debug && debug="y"
for m in ${IUSE_RT2X00_DEVICES} ; do
if use "${m}" ; then
full="n"
break
fi
done
if [[ ${full} == "n" ]] ; then
use rfkill && button="y"
else
ewarn "No module specified in USE flags - building everything."
button="y"
fi
# Generate the config file now
echo "# Config file generated by portage" > config
# D80211 module
echo "CONFIG_D80211=y" >> config
echo "CONFIG_D80211_DEBUG=${debug}" >> config
echo "CONFIG_D80211_ASM=${asm}" >> config
# Enable the rt2x00lib module
echo "CONFIG_RT2X00=y" >> config
echo "CONFIG_RT2X00_ASM=${asm}" >> config
MODULE_NAMES="${MODULE_NAMES} rt2x00lib(rt2x00:)"
# Enable the new DEBUGFS module
if use debug ; then
echo "CONFIG_RT2X00_DEBUG=y" >> config
echo "CONFIG_RT2X00_DEBUGFS=y" >> config
MODULE_NAMES="${MODULE_NAMES} rt2x00debug(rt2x00:)"
fi
# Enable the rfkill module
if use rfkill ; then
if use rt2400pci ; then
echo "CONFIG_RT2400PCI_RFKILL=y" >> config
fi
if use rt2500pci ; then
echo "CONFIG_RT2500PCI_RFKILL=y" >> config
fi
if use rt61pci ; then
echo "CONFIG_RT61PCI_RFKILL=y" >> config
fi
fi
# Enable the USB code
if use rt2500usb || use rt73usb ; then
MODULE_NAMES="${MODULE_NAMES} rt2x00usb(rt2x00:)"
fi
# RT61 and RT73 require CONFIG_CRC_ITU_T
if [[ ${full} == "y" ]] || \
use rt61pci || use rt73usb ; then
echo "CONFIG_CRC_ITU_T=y" >> config
echo "CONFIG_CRC_ITU_T_ASM=${asm}" >> config
fi
# rt2400pci, rt2500pci and rt61pci require the EEPROM module and the
# rt2x00pci module
if use rt2400pci || use rt2500pci || use rt61pci || [[ ${full} == "y" ]] ; then
echo "CONFIG_EEPROM_93CX6=y" >> config
echo "CONFIG_EEPROM_93CX6_ASM=${asm}" >> config
MODULE_NAMES="${MODULE_NAMES} eeprom_93cx6(rt2x00:) rt2x00pci(rt2x00:)"
fi
for m in ${IUSE_RT2X00_EXTRA} ${IUSE_RT2X00_DEVICES} ; do
local yn="n" M=$(echo "${m}" | tr '[:lower:]' '[:upper:]')
if [[ ${full} == "y" ]] || use "${m}" ; then
yn="y"
fi
echo "CONFIG_${M}=${yn}" >> config
echo "CONFIG_${M}_BUTTON=${button}" >> config
if [[ ${yn} == "y" ]] ; then
MODULE_NAMES="${MODULE_NAMES} ${m}(rt2x00:)"
fi
done
sed -i -e 's/ rt2x00dev->interface.id,//g' rt2x00mac.c
# SO quick and dirty...
echo '#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10)' >> rt2x00.h
linux-mod_src_compile
}
src_install() {
linux-mod_src_install
dodoc COPYING README THANKS
}
pkg_postinst() {
linux-mod_pkg_postinst
ewarn "This is a CVS ebuild - REALLY quick and dirty"
ewarn "Any bugs reported to Gentoo will be marked INVALID"
} |
Last edited by marschw on Fri Aug 31, 2007 8:17 pm; edited 1 time in total |
|
| Back to top |
|
 |
msubzwari n00b


Joined: 14 Sep 2004 Posts: 9 Location: Karachi, Pakistan
|
Posted: Tue Aug 21, 2007 11:17 am Post subject: |
|
|
| Can you get successful WPA2 secured connections with this? |
|
| Back to top |
|
 |
marschw n00b

Joined: 04 Jun 2003 Posts: 51
|
Posted: Tue Aug 21, 2007 7:08 pm Post subject: |
|
|
| msubzwari wrote: | | Can you get successful WPA2 secured connections with this? | I don't know, I don't use that. |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Fri Aug 24, 2007 11:43 pm Post subject: |
|
|
Thanks for posting this, I'm having the same problem. The ebuild is asking for options in the kernel that are no longer in the kernel, it seems.
Where is the file you're editing? I'm looking in /usr/portage/net-wireless/rt2500 and I see some ebuilds but not the 9999 one. Am I looking in the right place?
Thanks! |
|
| Back to top |
|
 |
marschw n00b

Joined: 04 Jun 2003 Posts: 51
|
Posted: Sat Aug 25, 2007 5:27 am Post subject: |
|
|
| kingLatency wrote: | | Where is the file you're editing? I'm looking in /usr/portage/net-wireless/rt2500 and I see some ebuilds but not the 9999 one. Am I looking in the right place? |
It's rt2x00, not rt2500. The pasted text above should go in a separate overlay, though, not in /usr/portage; it's a complete ebuild. |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Sat Aug 25, 2007 1:19 pm Post subject: |
|
|
| What overlay is that package part of? How do I set it up? |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 27781 Location: 56N 3W
|
Posted: Sat Aug 25, 2007 2:03 pm Post subject: |
|
|
kingLatency,
Its not part of any overlay - rt2x00 is in portage, so it will not be in an overlay too. You need to make your own overlay.
See /etc/make.conf.example to learn how to tell portage about your overlay location.
Put the code snippet into a file in your overlay called net-wireless/rt2x00/rt2x00-9999-r1.ebuild (now you see where 'overlay' comes from)
digest the new ebuild with ebuild /path/to/rt2x00-9999-r1.ebuild digest
Now you may emerge it in the normal way.
Do tell us if it works and and what chip set you are using. I'm having some difficulty with a rt73 USB dongle on various kernels. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
gerardo Apprentice


Joined: 05 Feb 2004 Posts: 228 Location: Belgium
|
Posted: Sat Aug 25, 2007 11:55 pm Post subject: |
|
|
Thanks for this ebuild.
I tried the new ralink-rt61 ebuild from in this bug, which should be working but refuses: everything I set with iwconfig doesn't do anything...
why do you include
| Code: | | MODULE_NAMES="${MODULE_NAMES} rt2x00usb(rt2x00:)" |
It's not at the right spot there, as it breaks installing because I don't have a USB wireless (only rt61)...
for rt61, it should be
| Code: | | MODULE_NAMES="${MODULE_NAMES} rt2x00pci(rt2x00:)" |
_________________ Windoze : Plug and Pay... |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Sun Aug 26, 2007 5:53 am Post subject: |
|
|
| NeddySeagoon wrote: | kingLatency,
Its not part of any overlay - rt2x00 is in portage, so it will not be in an overlay too. You need to make your own overlay.
See /etc/make.conf.example to learn how to tell portage about your overlay location.
Put the code snippet into a file in your overlay called net-wireless/rt2x00/rt2x00-9999-r1.ebuild (now you see where 'overlay' comes from)
digest the new ebuild with ebuild /path/to/rt2x00-9999-r1.ebuild digest
Now you may emerge it in the normal way.
Do tell us if it works and and what chip set you are using. I'm having some difficulty with a rt73 USB dongle on various kernels. |
I'm using a rt2500 USB chipset. When I did USE=rt2500usb it emerged fine, but now what do I do? iwconfig ra0 didn't work: no such device". |
|
| Back to top |
|
 |
gerardo Apprentice


Joined: 05 Feb 2004 Posts: 228 Location: Belgium
|
Posted: Sun Aug 26, 2007 8:23 am Post subject: |
|
|
| kingLatency wrote: |
I'm using a rt2500 USB chipset. When I did USE=rt2500usb it emerged fine, but now what do I do? iwconfig ra0 didn't work: no such device". |
These drivers don't use ra0 but wlan0 (and a dummy wlanmaster0)
Check the file /etc/udev/rules.d/70-persistent-net.rules. It should have the line:
| Code: | | SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="## your mac address of your wireless stick##", ATTRS{type}=="1", NAME="wlan0" |
_________________ Windoze : Plug and Pay... |
|
| Back to top |
|
 |
marschw n00b

Joined: 04 Jun 2003 Posts: 51
|
Posted: Sun Aug 26, 2007 9:38 am Post subject: |
|
|
| gerardo wrote: | Thanks for this ebuild.
I tried the new ralink-rt61 ebuild from in this bug, which should be working but refuses: everything I set with iwconfig doesn't do anything...
why do you include
| Code: | | MODULE_NAMES="${MODULE_NAMES} rt2x00usb(rt2x00:)" |
It's not at the right spot there, as it breaks installing because I don't have a USB wireless (only rt61)...
for rt61, it should be
| Code: | | MODULE_NAMES="${MODULE_NAMES} rt2x00pci(rt2x00:)" |
|
Heh, because I didn't bother with adding a routine to check what hardware was requested; like I said, it's REALLY quick and dirty. |
|
| Back to top |
|
 |
gerardo Apprentice


Joined: 05 Feb 2004 Posts: 228 Location: Belgium
|
Posted: Sun Aug 26, 2007 9:57 am Post subject: |
|
|
I used the ebuild from this bug and simply added your lines between done and linux-mod_src_compile:
| Code: | sed -i -e 's/ rt2x00dev->interface.id,//g' rt2x00mac.c
# SO quick and dirty...
echo '#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10)' >> rt2x00.h |
Your ebuild also gives hassles when the rfkill use-flag is selected.
Thanks for the small patch _________________ Windoze : Plug and Pay... |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Sun Aug 26, 2007 3:06 pm Post subject: |
|
|
I tried each of the ebuilds, and when I modprobe the modules I get errors in dmesg:
| Code: | usbcore: deregistering interface driver rt2500usb
wmaster0: Failed to select rate control algorithm
wmaster0: Failed to initialize rate control algorithm
phy1 -> rt2x00lib_probe_dev: Error - Failed to initialize hw.
rt2500usb: probe of 2-1:1.0 failed with error -2
usbcore: registered new interface driver rt2500usb
usbcore: deregistering interface driver rt2500usb
rt2500usb: Unknown parameter `rt2x00usb'
wmaster0: Failed to select rate control algorithm
wmaster0: Failed to initialize rate control algorithm
phy2 -> rt2x00lib_probe_dev: Error - Failed to initialize hw.
rt2500usb: probe of 2-1:1.0 failed with error -2
usbcore: registered new interface driver rt2500usb |
Has anyone else encountered this? What should I try? |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Fri Aug 31, 2007 4:06 pm Post subject: |
|
|
| gerardo wrote: | I used the ebuild from this bug and simply added your lines between done and linux-mod_src_compile:
| Code: | sed -i -e 's/ rt2x00dev->interface.id,//g' rt2x00mac.c
# SO quick and dirty...
echo '#define IEEE80211_TXCTL_LONG_RETRY_LIMIT (1<<10)' >> rt2x00.h |
Your ebuild also gives hassles when the rfkill use-flag is selected.
Thanks for the small patch |
I also tried to use this ebuild but I get the following error upon emerging:
| Code: |
* Preparing rt2x00lib module
CC [M] /var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2500usb.o
CC [M] /var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00usb.o
CC [M] /var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00dev.o
CC [M] /var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.o
CC [M] /var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00config.o
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c: In function 'rt2x00mac_tx_rts_cts':
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:62: warning: passing argument 2 of 'ieee80211_ctstoself_get' makes pointer from integer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:62: warning: passing argument 3 of 'ieee80211_ctstoself_get' makes integer from pointer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:62: warning: passing argument 4 of 'ieee80211_ctstoself_get' makes pointer from integer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:62: warning: passing argument 5 of 'ieee80211_ctstoself_get' from incompatible pointer type
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:62: error: too many arguments to function 'ieee80211_ctstoself_get'
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:66: warning: passing argument 2 of 'ieee80211_rts_get' makes pointer from integer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:66: warning: passing argument 3 of 'ieee80211_rts_get' makes integer from pointer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:66: warning: passing argument 4 of 'ieee80211_rts_get' makes pointer from integer without a cast
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:66: warning: passing argument 5 of 'ieee80211_rts_get' from incompatible pointer type
/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.c:66: error: too many arguments to function 'ieee80211_rts_get'
make[3]: *** [/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999/rt2x00mac.o] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [_module_/var/tmp/portage/net-wireless/rt2x00-9999/work/rt2x00-9999] Error 2
make[1]: *** [modules] Error 2
make: *** [default] Error 2
!!! ERROR: net-wireless/rt2x00-9999 failed.
Call stack:
ebuild.sh, line 1638: Called dyn_compile
ebuild.sh, line 985: Called qa_call 'src_compile'
ebuild.sh, line 44: Called src_compile
rt2x00-9999.ebuild, line 126: Called linux-mod_src_compile
linux-mod.eclass, line 516: Called die
!!! Unable to make KERNDIR=/usr/src/linux KERNOUT=/lib/modules/2.6.22-gentoo-r2/build .
!!! If you need support, post the topmost build error, and the call stack if relevant.
!!! A complete build log is located at '/var/tmp/portage/net-wireless/rt2x00-9999/temp/build.log'.
!!! This ebuild is from an overlay: '/usr/local/portage'
|
Am I doing something wrong here? If anyone has any ideas for where to go from here, please let me know. I just want my wireless to work!  |
|
| Back to top |
|
 |
marschw n00b

Joined: 04 Jun 2003 Posts: 51
|
Posted: Fri Aug 31, 2007 7:41 pm Post subject: |
|
|
| kingLatency wrote: | | I also tried to use this ebuild but I get the following error upon emerging:... |
That's what you get without the sed line. Did you insert those lines he mentioned into the right place in your ebuild? |
|
| Back to top |
|
 |
kingLatency n00b


Joined: 28 Sep 2002 Posts: 61 Location: Amherst, MA
|
Posted: Fri Aug 31, 2007 11:21 pm Post subject: |
|
|
I don't know what exactly I did but I managed to get it to merge correctly. Maybe I had a typo, because I copied and pasted those lines again. It seemed to error when I didn't specify USE="rt2500usb" so maybe I had to do that.
Then I modprobed the modules: rt2500, rt2x00usb rt2500usb, rt2x00 lib. They pulled in mac80211 and cfg80211. dmesg says: | Code: | wmaster0: Failed to select rate control algorithm
wmaster0: Failed to initialize rate control algorithm
phy0 -> rt2x00lib_probe_dev: Error - Failed to initialize hw.
rt2500usb: probe of 1-2:1.0 failed with error -2
usbcore: registered new interface driver rt2500usb |
iwconfig gives: | Code: | lo no wireless extensions.
sit0 no wireless extensions.
eth0 no wireless extensions.
eth1 no wireless extensions. |
I guess that means the driver doesn't work? Why not? What should I try now? |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 27781 Location: 56N 3W
|
Posted: Sat Sep 01, 2007 12:55 pm Post subject: |
|
|
kingLatency,
Many wireless interfaces need | Code: | | ifconfig <ifname> up | before they admit to having wireless extensions.
My rt73 USB dongle does.
I can't get it to work with 2.6.22-r5 and any of the known drivers yet but I'm still playing with rt2x00.
Also be warned that these lines | Code: | #CONFIG_CHECK="NET_RADIO"
#ERROR_NET_RADIO="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_NET_RADIO)." | now commented out in the ebuild, remove a configuration check on your kernel.
If you had a problem, you would find it at build or run time. The commented code above should be replaced with | Code: | CONFIG_CHECK="WIRELESS_EXT MAC80211 WLAN_80211"
ERROR_WIRELESS_EXT="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (WIRELESS_EXT)." |
_________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
gerardo Apprentice


Joined: 05 Feb 2004 Posts: 228 Location: Belgium
|
Posted: Tue Sep 04, 2007 11:59 am Post subject: |
|
|
Just a small suggestion: it isn't necessary to modprobe all specified modules.
In your case modprobe rt2500usb should be enough. The others will be pulled in by dependency.
My drivers (rt61pci) don't work 100% either, sometimes I loose my connection. It might be the card though, as I sometimes see the Ralink applet flashing in Windows. _________________ Windoze : Plug and Pay... |
|
| Back to top |
|
 |
NeddySeagoon Administrator


Joined: 05 Jul 2003 Posts: 27781 Location: 56N 3W
|
Posted: Tue Sep 04, 2007 12:04 pm Post subject: |
|
|
gerardo,
I only build the USB part of the driver | Code: | | net-wireless/rt2x00-9999-r1 USE="rt2500usb rt73usb -asm -debug -rfkill -rt2400pci -rt2500pci -rt61pci" | Its -r1 because I have changed the ebuild.
So far, it will associate and report Linik status and Signal to noise but will not pass any data.
The serialmonkey web site suggested using the rt2x00 wifi stack, not the in kernel one, so I shall play with that next. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
| Back to top |
|
 |
|