added rt2870usb for 2.6.35+ kernels and WUSB600v2 adaptor
authorAndrea Rizzolo <andrea.rizzolo@gmail.com>
Wed, 3 Nov 2010 12:42:07 +0000 (3 13:42 +0100)
committerAndrea Rizzolo <andrea.rizzolo@gmail.com>
Wed, 3 Nov 2010 12:42:07 +0000 (3 13:42 +0100)
net-wireless/rt2870usb/Manifest [new file with mode: 0644]
net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-unified.patch [new file with mode: 0644]
net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-usb_alloc_free.patch [new file with mode: 0644]
net-wireless/rt2870usb/rt2870usb-2.4.0.1.ebuild [new file with mode: 0644]

diff --git a/net-wireless/rt2870usb/Manifest b/net-wireless/rt2870usb/Manifest
new file mode 100644 (file)
index 0000000..9238751
--- /dev/null
@@ -0,0 +1,4 @@
+AUX rt2870usb-2.4.0.1-unified.patch 2551 RMD160 a4e35482dba8c3c1530a848fe9a9d3ef03db1941 SHA1 42e56984468a04e4805e7f1842e3049a46c5f8e0 SHA256 35b8a5f2f4190b9fe56aba1995672d63644fd41647510fd57d591842085115bb
+AUX rt2870usb-2.4.0.1-usb_alloc_free.patch 1112 RMD160 faa02b016ff62c50afb09ca601f1300297f8afff SHA1 3c4f3fb7e589374b7b5cb9bf2d6643efa9d52c8e SHA256 3aea2bd2c98d6f7be9e5ea502f8376627400309271493b659a14bca2a6b60e24
+DIST 2010_0709_RT2870_Linux_STA_v2.4.0.1.tar.bz2 643708 RMD160 c27059b3c187d21812277740ff5e49c98f6a2732 SHA1 f6a55fa11337ce8b1bfcc8260799267db3f01abb SHA256 bce833f8c16d8a5ccd90335bb10396c89eeab88c78036d7b679d771bcb4e660e
+EBUILD rt2870usb-2.4.0.1.ebuild 1828 RMD160 13f1e6f6a84afca53c34bfd6802f864a146f10b9 SHA1 5f9dc03edaa2ff8eaa3a06dd06e40dd377e1bd10 SHA256 840ad408c7e2561582194039e736231c08f412b76061f72705ee4c27e4238418
diff --git a/net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-unified.patch b/net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-unified.patch
new file mode 100644 (file)
index 0000000..56c2666
--- /dev/null
@@ -0,0 +1,59 @@
+diff -Naur 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/common/rtusb_dev_id.c 2010_0709_RT2870_Linux_STA_v2.4.0.1/common/rtusb_dev_id.c
+--- 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/common/rtusb_dev_id.c     2010-10-31 01:15:56.815555689 +0700
++++ 2010_0709_RT2870_Linux_STA_v2.4.0.1/common/rtusb_dev_id.c  2010-10-31 01:31:32.812555505 +0700
+@@ -59,6 +59,7 @@
+       {USB_DEVICE(0x0DF6,0x002D)}, /* Sitecom */
+       {USB_DEVICE(0x14B2,0x3C06)}, /* Conceptronic */
+       {USB_DEVICE(0x14B2,0x3C28)}, /* Conceptronic */
++      {USB_DEVICE(0x2019,0xAB25)}, /* PLANEX 150N Wireless LAN USB Adapter */
+       {USB_DEVICE(0x2019,0xED06)}, /* Planex Communications, Inc. */
+       {USB_DEVICE(0x07D1,0x3C09)}, /* D-Link */
+       {USB_DEVICE(0x07D1,0x3C11)}, /* D-Link */
+@@ -101,12 +102,13 @@
+       {USB_DEVICE(0x7392,0x7717)},
+       {USB_DEVICE(0x1737,0x0070)}, /* Linksys WUSB100 */
+       {USB_DEVICE(0x1737,0x0071)}, /* Linksys WUSB600N */
++      {USB_DEVICE(0x1737,0x0079)}, /* Linksys WUSB600N v2 */
+       {USB_DEVICE(0x0411,0x00e8)}, /* Buffalo WLI-UC-G300N*/
+       {USB_DEVICE(0x050d,0x815c)}, /* Belkin F5D8053 */
+       {USB_DEVICE(0x100D,0x9031)}, /* Motorola 2770 */
+       {USB_DEVICE(0x0DB0,0x6899)},
+ #endif // RT2870 //
+-      { }/* Terminating entry */
++      {NULL}/* Terminating entry */
+ };
+ INT const rtusb_usb_id_len = sizeof(rtusb_dev_id) / sizeof(USB_DEVICE_ID);
+diff -Naur 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/Makefile 2010_0709_RT2870_Linux_STA_v2.4.0.1/Makefile
+--- 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/Makefile  2010-10-31 01:15:56.810555798 +0700
++++ 2010_0709_RT2870_Linux_STA_v2.4.0.1/Makefile       2010-10-31 01:18:59.071316171 +0700
+@@ -117,7 +117,7 @@
+ ifeq ($(PLATFORM),PC)
+ # Linux 2.6
+-LINUX_SRC = /lib/modules/$(shell uname -r)/build
++LINUX_SRC = /usr/src/linux
+ # Linux 2.4 Change to your local setting
+ #LINUX_SRC = /usr/src/linux-2.4
+ LINUX_SRC_MODULE = /lib/modules/$(shell uname -r)/kernel/drivers/net/wireless/
+diff -Naur 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/os/linux/config.mk 2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/config.mk
+--- 2010_0709_RT2870_Linux_STA_v2.4.0.1.orig/os/linux/config.mk        2010-10-31 01:15:56.818555719 +0700
++++ 2010_0709_RT2870_Linux_STA_v2.4.0.1/os/linux/config.mk     2010-10-31 01:28:45.135323927 +0700
+@@ -5,13 +5,13 @@
+ HAS_QA_SUPPORT=n
+ # Support XLINK mode
+-HAS_XLINK=n
++HAS_XLINK=y
+ # Support Wpa_Supplicant
+-HAS_WPA_SUPPLICANT=n
++HAS_WPA_SUPPLICANT=y
+ # Support Native WpaSupplicant for Network Maganger
+-HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=n
++HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
+ #Support Net interface block while Tx-Sw queue full
+ HAS_BLOCK_NET_IF=n
+
diff --git a/net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-usb_alloc_free.patch b/net-wireless/rt2870usb/files/rt2870usb-2.4.0.1-usb_alloc_free.patch
new file mode 100644 (file)
index 0000000..ecc4d78
--- /dev/null
@@ -0,0 +1,18 @@
+--- RT2870_Linux_STA_v2.4.0.1.orig/include/os/rt_linux.h       2010-09-19 11:42:14.000000000 +0300
++++ RT2870_Linux_STA_v2.4.0.1/include/os/rt_linux.h    2010-09-19 11:40:52.000000000 +0300
+@@ -1074,9 +1074,14 @@
+ #define RT28XX_PUT_DEVICE                                                                                                     usb_put_dev
+ #define RTUSB_ALLOC_URB(iso)                                                                                          usb_alloc_urb(iso, GFP_ATOMIC)
+ #define RTUSB_SUBMIT_URB(pUrb)                                                                                                usb_submit_urb(pUrb, GFP_ATOMIC)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 35)
+ #define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr)                          usb_buffer_alloc(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
+ #define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)      usb_buffer_free(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
+ #else
++#define RTUSB_URB_ALLOC_BUFFER(pUsb_Dev, BufSize, pDma_addr)                          usb_alloc_coherent(pUsb_Dev, BufSize, GFP_ATOMIC, pDma_addr)
++#define RTUSB_URB_FREE_BUFFER(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)      usb_free_coherent(pUsb_Dev, BufSize, pTransferBuf, Dma_addr)
++#endif
++#else
+ #define RT28XX_PUT_DEVICE                                                                                                     rausb_put_dev
+ #define RTUSB_ALLOC_URB(iso)                                                                                          rausb_alloc_urb(iso)
+
diff --git a/net-wireless/rt2870usb/rt2870usb-2.4.0.1.ebuild b/net-wireless/rt2870usb/rt2870usb-2.4.0.1.ebuild
new file mode 100644 (file)
index 0000000..02dc7fe
--- /dev/null
@@ -0,0 +1,68 @@
+# Copyright 1999-2007 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: $
+
+EAPI="2"
+
+inherit eutils linux-mod
+
+DESCRIPTION="Driver for the RaLink RT2870 USB wireless chipsets"
+HOMEPAGE="http://www.ralinktech.com/support.php?s=2"
+LICENSE="GPL-2"
+
+RESTRICT="bindist mirror"
+
+MY_P="2010_0709_RT2870_Linux_STA"
+
+SRC_URI="http://www.ralinktech.com/download.php?t=U0wyRnpjMlYwY3k4eU1ERXdMekEzTHpBNUwyUnZkMjVzYjJGa05ETTVOalU0TXpVeU5pNWllakk5UFQweU1ERXdYekEzTURsZlVsUXlPRGN3WDB4cGJuVjRYMU5VUVY5Mk1pNDBMakF1TVM1MFlYST1D
+       -> ${MY_P}_v${PV}.tar.bz2"
+
+KEYWORDS="-* ~amd64 x86"
+IUSE="debug"
+SLOT="0"
+
+DEPEND=""
+RDEPEND="net-wireless/wireless-tools"
+
+S="${WORKDIR}/${MY_P}_v${PV}"
+MODULE_NAMES="rt2870sta(net:${S}:${S}/os/linux)"
+BUILD_TARGETS=" "
+MODULESD_RT2870STA_ALIASES=('ra? rt2870sta')
+MODULESD_RT2870STA_ADDITIONS=('blacklist rt2800usb')
+
+CONFIG_CHECK="WIRELESS_EXT"
+ERROR_WIRELESS_EXT="${P} requires support for Wireless LAN drivers (non-hamradio) & Wireless Extensions (CONFIG_WIRELESS_EXT)."
+
+src_compile() {
+       epatch ${FILESDIR}/${P}-usb_alloc_free.patch
+       epatch ${FILESDIR}/${P}-unified.patch
+       use debug || epatch ${FILESDIR}/${P}-nodebug.patch
+
+       linux-mod_src_compile
+}
+
+src_install() {
+       linux-mod_src_install
+
+       dodoc README_STA iwpriv_usage.txt sta_ate_iwpriv_usage.txt "LICENSE ralink-firmware.txt"
+       insinto /etc/Wireless/RT2870STA
+       insopts -m 0600
+       doins RT2870STA.dat
+       doins RT2870STACard.dat
+       insinto /$(get_libdir)/firmware
+       insopts -m 0644
+       doins common/rt2870.bin
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+
+       einfo
+       einfo "Thanks to RaLink for releasing open drivers!"
+       einfo
+       einfo "The staging 'rt2800usb' kernel driver has been auto blacklisted."
+       einfo "If you want to use it again, blacklist this driver ('rt2870sta')"
+       einfo "and allow the 'rt2800usb' one."
+       einfo
+}
+