Results 1 to 10 of 138

Thread: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

Hybrid View

  1. #1
    Join Date
    Apr 2008
    Beans
    3

    HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    Hi all,

    As many people have pointed out the Ralink rt2870 driver will not compile OTB Hardy Heron. I have some simple patch instructions that will allow you to compile the driver ( available from http://www.ralinktech.com.tw/data/dr....2.1.0.tar.bz2 ) and regain your wifi.

    PRE:

    - Alter the makefile(s) according to your needs, just as the README_STA states.

    STEP 1:

    - navigate to /include/rt2870.h and and a NULL terminator to RT2870_USB_DEVICES.

    Code:
    #define RT2870_USB_DEVICES	\
    {	\
    	{USB_DEVICE(0x148F,0x2770)}, /* Ralink */		\
    	{USB_DEVICE(0x148F,0x2870)}, /* Ralink */		\
    	{USB_DEVICE(0x0B05,0x1731)}, /* Asus */			\
    	{USB_DEVICE(0x0B05,0x1732)}, /* Asus */			\
    	{USB_DEVICE(0x0B05,0x1742)}, /* Asus */			\
    	{USB_DEVICE(0x0DF6,0x0017)}, /* Sitecom */		\
    	{USB_DEVICE(0x0DF6,0x002B)}, /* Sitecom */		\
    	{USB_DEVICE(0x0DF6,0x002C)}, /* Sitecom */		\
    	{USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */		\
    	{USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */		\
    	{USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */		\
    	{USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */		\
    	{USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */		\
    	{USB_DEVICE(0x14B2,0x3C07)}, /* AL */			\
    	{USB_DEVICE(0x050D,0x8053)}, /* Belkin */		\
    	{USB_DEVICE(0x14B2,0x3C23)}, /* Airlink */		\
    	{USB_DEVICE(0x14B2,0x3C27)}, /* Airlink */		\
    	{USB_DEVICE(0x07AA,0x002F)}, /* Corega */		\
    	{USB_DEVICE(0x07AA,0x003C)}, /* Corega */		\
    	{USB_DEVICE(0x07AA,0x003F)}, /* Corega */		\
    	{USB_DEVICE(0x1044,0x800B)}, /* Gigabyte */		\
    	{USB_DEVICE(0x15A9,0x0006)}, /* Sparklan */		\
    	{USB_DEVICE(0x083A,0xB522)}, /* SMC */			\
    	{USB_DEVICE(0x083A,0xA618)}, /* SMC */			\
    	{USB_DEVICE(0x083A,0x7522)}, /* Arcadyan */		\
    	{USB_DEVICE(0x0CDE,0x0022)}, /* ZCOM */			\
    	{USB_DEVICE(0x0586,0x3416)}, /* Zyxel */		\
    	{USB_DEVICE(0x0CDE,0x0025)}, /* Zyxel */		\
    	{USB_DEVICE(0x1740,0x9701)}, /* EnGenius */		\
    	{USB_DEVICE(0x1740,0x9702)}, /* EnGenius */		\
    	{USB_DEVICE(0x0471,0x200f)}, /* Philips */		\
    	{USB_DEVICE(0x14B2,0x3C25)}, /* Draytek */		\
    	{USB_DEVICE(0x13D3,0x3247)}, /* AzureWave */	\
    	{USB_DEVICE(0x083A,0x6618)}, /* Accton */		\
    	{USB_DEVICE(0x15c5,0x0008)}, /* Amit */			\
    	{USB_DEVICE(0x0E66,0x0001)}, /* Hawking */		\
    	{USB_DEVICE(0x0E66,0x0003)}, /* Hawking */		\
    	{USB_DEVICE(0x129B,0x1828)}, /* Siemens */		\
    	{NULL}	\
    }
    STEP 2:

    - navigate to /os/linux/rt_main_dev.c and replace static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd) function with

    Code:
    static NDIS_STATUS rt_ieee80211_if_setup(struct net_device *dev, PRTMP_ADAPTER pAd)
    {
    	NDIS_STATUS Status;
    	INT     i=0;
    	CHAR    slot_name[IFNAMSIZ];
    	struct net_device   *device;
    
    
    	//ether_setup(dev);
    	dev->hard_start_xmit = rt28xx_send_packets;
    //	dev->set_multicast_list = ieee80211_set_multicast_list;
    //	dev->change_mtu = ieee80211_change_mtu;
    #ifdef CONFIG_STA_SUPPORT
    #if WIRELESS_EXT >= 12
    	dev->wireless_handlers = &rt28xx_iw_handler_def;
    #if WIRELESS_EXT < 21
        dev->get_wireless_stats = rt28xx_get_wireless_stats;
    #else
    	dev->get_stats = rt28xx_get_wireless_stats;
    #endif
    #endif //WIRELESS_EXT >= 12
    #endif // CONFIG_STA_SUPPORT //
    	dev->open = rt28xx_open;
    	dev->stop = rt28xx_close;
    //	dev->uninit = ieee80211_if_reinit;
    //	dev->destructor = ieee80211_if_free;
    	dev->priv_flags = INT_MAIN;
    	dev->do_ioctl = rt28xx_ioctl;
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
    	dev->validate_addr = NULL;
    #endif
    
    
    	// find available device name
    	for (i = 0; i < 8; i++)
    	{
    #ifdef MULTIPLE_CARD_SUPPORT
    		if (pAd->MC_RowID >= 0)
    			sprintf(slot_name, "ra%02d-%d", pAd->MC_RowID, i);
    		else
    #endif // MULTIPLE_CARD_SUPPORT //
    		sprintf(slot_name, "ra%d", i);
    	    
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
    #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,24)
    		device = dev_get_by_name(dev->nd_net, slot_name);
    #else
    		device = dev_get_by_name(slot_name);
    #endif
    		if (device != NULL) dev_put(device);
    #else
    		for (device = dev_base; device != NULL; device = device->next)
    		{
    			if (strncmp(device->name, slot_name, 4) == 0)
    				break;
    		}
    #endif
    		if(device == NULL)  
    			break;
    	}
    	
    	if(i == 8)
    	{
    		DBGPRINT(RT_DEBUG_ERROR, ("No available slot name\n"));
    		Status = NDIS_STATUS_FAILURE;
    	} 
    	else 
    	{
    #ifdef MULTIPLE_CARD_SUPPORT
    		if (pAd->MC_RowID >= 0)
    	        sprintf(dev->name, "ra%02d-%d", pAd->MC_RowID, i);
    		else
    #endif // MULTIPLE_CARD_SUPPORT //
    		sprintf(dev->name, "ra%d", i);
    		DBGPRINT(RT_DEBUG_INFO, ("Assign the net device name as %s\n", dev->name));
    		Status = NDIS_STATUS_SUCCESS;
    	}
    
    	return Status;
    	
    }
    STEP 3:

    - navigate to /usr/src/linux-headers-2.6.24-16/include/linux/module.h and add #define SET_MODULE_OWNER(dev) do { } while (0) just above #endif /* _LINUX_MODULE_H */

    STEP 4:

    - navigate back to the drivers root
    -make || make install
    -cp RT2870STA.dat /etc/Wireless/RT2870STA/RT2870STA.dat

    STEP 5:

    - navigate to /os/linux
    - $/sbin/insmod rt2870sta.ko
    - $/sbin/ifconfig ra0 inet YOUR_IP up

    I recommend removing/commenting the addition to module.h after installing the driver.

    Enjoy. I have only tested this connecting without no encryption so I have no idea if encryption will work. If anyone feels like taking the time to create a script or patch then please do so Hope it works for you all.

    pandapanda

  2. #2
    Join Date
    Apr 2008
    Beans
    134
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    You're my hero LOL. This issue has made me get desperated. I've been using ndiswrapper and the Vista 64 driver this afternoon, until Ralink answered me (I know they sent a patch to some people who asked), but the result has been a disaster: Some times wpa_supplicant worked... Others, the more, this wasn't able to get associated to my AP. I guess that ndiswrapper doesn't handle this Vista 64 driver very well.

    I'm just going to try your solution, using WPA-CCMP and publish my results.

  3. #3
    Join Date
    Apr 2008
    Beans
    3

    Re: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    You will have to restart network to get it associated with network manager. I did this via GUI by right clicking the network manager -> enable networking and once more network manager -> enable network. I believe ifconfig ra0 up will also do the trick - just copied $/sbin/ifconfig ra0 inet YOUR_IP up from the readme

  4. #4
    Join Date
    Apr 2008
    Beans
    134
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    You've done my day!!! I've followed your steps and it worked perfectly! At the beginning I did a stupid mistake, as I was so impatient and happy, that at the Step 3, I simply copied and pasted all the text, with your instruction "just above #endif /* _LINUX_MODULE_H */" included, ha ha ha. But checking the code carefully I realized about it. Ouch!

    Well, I've a Dlink DWA-140 wireless adaptor and a Dlink DSL-2740B router, configured both to work using WPA2-PSK, and it works flawless, like it did on Ubuntu v. 7.10.

    Many many many thanks pandapanda. I really appreciate your help, since this issue was driving me crazy and these people from Ralink, according to some opinions on the Internet, maybe took many days to answer.

    Now, every time I see a piece of bamboo, I'll remind that you helped me, he he he. Nah, seriously, many thanks for this great guide .
    Last edited by negora; April 25th, 2008 at 06:39 PM.

  5. #5
    Join Date
    Apr 2008
    Beans
    134
    Distro
    Xubuntu 14.04 Trusty Tahr

    Re: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    Ops, by the way, maybe I give a second opportunity to the Network Manager, because I HATE this. Maybe it's because I only have used this for WiFi connections, but it never worked properly for me :/ . Everytime I've tested Ubuntu/Kubuntu have ended using Kwlan or none, configuring "/etc/networks" by hand .

  6. #6
    Join Date
    Apr 2008
    Beans
    3

    Re: HOWTO: Ralink rt2870 (Native) Kernel 2.6.24

    Thank you for these instructions! I've moved these changes into an easy to apply patch and attached it here.

    Be sure to backup any existing /etc/Wireless/RT2870STA as the make install (stupidly) rm -rf's it.

    Here's the simplified instructions:
    Code:
    wget http://www.ralinktech.com.tw/data/drivers/2007_1220_RT2870_Linux_STA_v1.2.1.0.tar.bz2
    tar jxf 2007_1220_RT2870_Linux_STA_v1.2.1.0.tar.bz2
    gzip -d rt2870-v1.2.1.0_2.6.24.patch.gz
    patch -p0 < rt2870-v1.2.1.0_2.6.24.patch
    cd 2007_1220_RT2870_Linux_STA_v1.2.1.0
    make && sudo make install
    Slight addendum: attaching a modified version of the previous patch which disables the insane amount of debug being printed to the kernel ring buffer.

    All working great with my Asus WL-160N.
    Attached Files Attached Files
    Last edited by matthew.kent; April 27th, 2008 at 08:43 AM. Reason: another patch

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •