updated dkms-8192cu to version v4.0.2

This commit is contained in:
zombiepantslol 2013-11-12 17:07:02 +01:00
parent 4fcfb27929
commit e59fb07a6e
6 changed files with 59 additions and 252 deletions

View file

@ -1,12 +1,9 @@
# Maintainer: Jan Madaj < madaj.jan@gmail.com >
#alarm: moonman
# -dkms.conf: change ARCH=i386 to ARCH=arm
# -add missing ids for Netgear WNA1000N & D-Link Alpha (taken from R-Pi kernel)
# Creater: Runnytu < runnytu at gmail.com >
# Maintainer: Christian Hammacher < bmasterc@gmail.com >
pkgname=dkms-8192cu
pkgver=v3.4.4_4749
pkgrel=9
pkgver=v4.0.2_9000.20130911
pkgrel=1
pkgdesc="Driver for Realtek RTL8188CUS (8188C, 8192C) chipset wireless cards"
arch=('arm')
url="http://www.realtek.com.tw/"
@ -16,49 +13,39 @@ conflicts=("8192cu" "rt8192cu")
install=${pkgname}.install
options=(!strip)
_pkgname="8192cu"
source=("https://www.dropbox.com/s/3rrxrg55hmnzr1l/$_pkgname-$pkgver.tar.bz2"
"dkms.conf"
"blacklist-dkms-8192cu.conf"
"use_kthread_run_v2.patch"
"add_missing_ids_netgear_dlink.patch"
"fix_310_proc.patch")
md5sums=('f4291ba24e9ff3408c26606ba9400152'
'9de2f7a7788689e2bf7680950b4451d9'
'5f2d28bf3839447bfe762416a89e1a21'
'7b22f83c62456e4b8310e21b56bb4c2f'
'a595c7c7ed240e50e8001094c4488a5a'
'345072f62970d27af3599dccc540683b')
source=("https://www.dropbox.com/s/61askvmgh6iyh6p/rtl8188C_8192C_usb_linux_$pkgver.tar.gz"
"dkms-8192cu.install"
"fix_310_proc.patch"
"dkms.conf"
"blacklist-dkms-8192cu.conf")
md5sums=('efb71a576f781c3d15531511aac2c5c9'
'82db3ab6573dbe2ede43e49ac35259cb'
'5b764e13afd1ccad5bb14bd4d9633604'
'21077239f17639254b74d74daea8655b'
'5f2d28bf3839447bfe762416a89e1a21')
package() {
installDir="$pkgdir/usr/src/$_pkgname-$pkgver"
install -dm755 "$installDir"
install -m644 "$srcdir/dkms.conf" "$installDir"
install -dm755 "$pkgdir/etc/modprobe.d"
install -m644 "$srcdir/blacklist-dkms-8192cu.conf" "$pkgdir/etc/modprobe.d/blacklist-dkms-8192cu.conf"
cd "${srcdir}/${_pkgname}-${pkgver}/"
patch -p1 -i "$srcdir/use_kthread_run_v2.patch"
patch -Np1 -i "$srcdir/add_missing_ids_netgear_dlink.patch"
patch -Np1 -i "$srcdir/fix_310_proc.patch"
installDir="$pkgdir/usr/src/$_pkgname-$pkgver"
install -dm755 "$installDir"
install -m644 "$srcdir/dkms.conf" "$installDir/dkms.conf"
install -dm755 "$pkgdir/etc/modprobe.d"
install -m644 "$srcdir/blacklist-dkms-8192cu.conf" "$pkgdir/etc/modprobe.d/blacklist-dkms-8192cu.conf"
cd "${srcdir}/rtl8188C_8192C_usb_linux_${pkgver}/"
#Disable Power Saving
sed -i 's/^CONFIG_POWER_SAVING\ \ \ =\ y/CONFIG_POWER_SAVING\ =\ n/' Makefile
for d in `find . -type d`
do
install -dm755 "$installDir/$d"
done
for f in `find . -type f`
do
install -m644 "${srcdir}/${_pkgname}-${pkgver}/$f" "$installDir/$f"
done
patch -p1 -i "$srcdir/fix_310_proc.patch"
for d in `find . -type d`
do
install -dm755 "$installDir/$d"
done
for f in `find . -type f`
do
install -m644 "${srcdir}/rtl8188C_8192C_usb_linux_${pkgver}/$f" "$installDir/$f"
done
}

View file

@ -1,19 +0,0 @@
diff -ruN a/os_dep/linux/usb_intf.c b/os_dep/linux/usb_intf.c
--- a/os_dep/linux/usb_intf.c 2012-07-30 06:51:05.000000000 -0600
+++ b/os_dep/linux/usb_intf.c 2013-06-03 00:10:00.000000000 -0600
@@ -114,6 +114,7 @@
{USB_DEVICE(0x4856, 0x0091)},//NetweeN - Feixun
{USB_DEVICE(0x2019, 0x4902)},//Planex - Etop
{USB_DEVICE(0x2019, 0xAB2E)},//SW-WF02-AD15 -Abocom
+ {USB_DEVICE(0x0846, 0x9041)},//Netgear
/****** 8188 RU ********/
{USB_DEVICE(0x0BDA, 0x317F)},//Netcore,Netcore
@@ -137,6 +138,7 @@
{USB_DEVICE(0x2001, 0x3307)},//D-Link - Cameo
{USB_DEVICE(0x2001, 0x330A)},//D-Link - Alpha
{USB_DEVICE(0x2001, 0x3309)},//D-Link - Alpha
+ {USB_DEVICE(0x2001, 0x330D)},//D-Link - Alpha(?)
{USB_DEVICE(0x0586, 0x341F)},//Zyxel - Abocom
{USB_DEVICE(0x7392, 0x7822)},//Edimax - Edimax
{USB_DEVICE(0x2019, 0xAB2B)},//Planex - Abocom

View file

@ -1,45 +1,16 @@
post_install (){
MODULE="8192cu"
DKMS=$(which dkms)
MODPROBE=$(which modprobe)
VERSION="v3.4.4_4749"
$DKMS add -m $MODULE -v $VERSION
$DKMS build -m $MODULE -v $VERSION
$DKMS install -m $MODULE -v $VERSION
$MODPROBE -a $MODULE
post_install() {
dkms install -m 8192cu -v ${1%%-*}
}
pre_upgrade(){
pre_remove
pre_upgrade() {
local curver=${2%%-*}
# $2 is unset due to a bug. See, https://bugs.archlinux.org/task/32278
# Query current version using pacman as fallback
[ -n "$curver" ] || curver=$(pacman -Q dkms-8192cu | cut -d' ' -f2)
pre_remove $curver
}
post_upgrade(){
post_install
post_upgrade() {
post_install ${1%%-*}
}
pre_remove (){
_inmemory=$(/usr/bin/lsmod | /usr/bin/grep 8192cu)
if [ ! -z "$_inmemory" ]; then
/usr/bin/rmmod 8192cu &> /dev/null
fi
DKMS=$(which dkms)
_line=$($DKMS status -m 8192cu)
if echo "$_line" | grep -E 'added|built|installed'; then
version=$(echo "$_line" | sed 's/8192cu,\([^,]*\)[,:].*/\1/;t;d')
$DKMS remove -m 8192cu -v $version --all
fi
pre_remove() {
dkms remove -m 8192cu -v ${1%%-*} --all
}
post_remove () {
/sbin/depmod -a
}
op=$1
shift
$op $*

View file

@ -1,6 +1,6 @@
PACKAGE_NAME="8192cu"
PACKAGE_VERSION="v3.4.4_4749"
MAKE[0]="make ARCH=arm CROSS_COMPILE= -C $kernel_source_dir M=$dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build modules"
PACKAGE_VERSION="v4.0.2_9000.20130911"
MAKE[0]="cd $dkms_tree/$PACKAGE_NAME/$PACKAGE_VERSION/build; make ARCH=arm modules"
BUILT_MODULE_NAME[0]="8192cu"
DEST_MODULE_LOCATION[0]="/kernel/drivers/net/wireless"
AUTOINSTALL="yes"

View file

@ -1,11 +1,11 @@
diff -ruN a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
--- a/os_dep/linux/os_intfs.c 2012-11-05 00:42:45.000000000 -0700
+++ b/os_dep/linux/os_intfs.c 2013-07-11 16:28:42.000000000 -0600
@@ -255,6 +255,19 @@
static struct proc_dir_entry *rtw_proc = NULL;
static int rtw_proc_cnt = 0;
--- ./os_dep/linux/os_intfs.c 2013-11-11 20:42:46.783120135 +0100
+++ ./os_dep/linux/os_intfs.c 2013-11-11 20:42:07.226118726 +0100
@@ -277,6 +277,19 @@
#define RTW_PROC_NAME DRV_NAME
+#ifndef create_proc_entry
+
+/* dummy routines */
+void rtw_proc_remove_one(struct net_device *dev)
+{
@ -15,17 +15,16 @@ diff -ruN a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
+{
+}
+
+#else /* create_proc_entry not defined */
+
+#else /* create_proc_entry not defined */
+
void rtw_proc_init_one(struct net_device *dev)
{
struct proc_dir_entry *dir_dev = NULL;
@@ -525,6 +538,7 @@
@@ -752,6 +765,7 @@
}
}
#endif
+#endif
uint loadparam( _adapter *padapter, _nic_hdl pnetdev);
uint loadparam( _adapter *padapter, _nic_hdl pnetdev)
{

View file

@ -1,131 +0,0 @@
diff -ruN a/core/rtw_mp.c b/core/rtw_mp.c
--- a/core/rtw_mp.c 2012-07-30 12:51:05.000000000 +0000
+++ b/core/rtw_mp.c 2013-03-17 19:00:28.393782000 +0000
@@ -1140,8 +1140,7 @@
_rtw_memset(ptr, payload, pkt_end - ptr);
//3 6. start thread
- pmp_priv->tx.PktTxThread = kernel_thread(mp_xmit_packet_thread, pmp_priv, CLONE_FS|CLONE_FILES);
- if(pmp_priv->tx.PktTxThread < 0)
+ if(!start_kthread(&pmp_priv->tx.PktTxThread, mp_xmit_packet_thread, pmp_priv, "8192cu-mp-xmit"))
DBG_871X("Create PktTx Thread Fail !!!!!\n");
}
diff -ruN a/include/osdep_service.h b/include/osdep_service.h
--- a/include/osdep_service.h 2012-07-30 12:51:05.000000000 +0000
+++ b/include/osdep_service.h 2013-03-17 17:37:39.105483734 +0000
@@ -100,6 +100,9 @@
#include <linux/pci.h>
#endif
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0))
+ #include <linux/kthread.h>
+#endif
#ifdef CONFIG_USB_HCI
typedef struct urb * PURB;
@@ -133,8 +136,12 @@
//typedef u32 _irqL;
typedef unsigned long _irqL;
typedef struct net_device * _nic_hdl;
-
+
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
typedef pid_t _thread_hdl_;
+#else
+ typedef struct task_struct * _thread_hdl_;
+#endif
typedef int thread_return;
typedef void* thread_context;
@@ -572,7 +579,7 @@
#ifdef PLATFORM_LINUX
//struct net_device *pnetdev = (struct net_device *)context;
//daemonize("%s", pnetdev->name);
- daemonize("%s", "RTKTHREAD");
+ //daemonize("%s", "RTKTHREAD");
allow_signal(SIGTERM);
#endif
}
@@ -827,4 +834,8 @@
#endif
+#ifdef PLATFORM_LINUX
+extern int start_kthread(_thread_hdl_ *t_hdl, int (*threadfn)(void *data),
+ void *data, const char *name);
+#endif
diff -ruN a/include/rtw_recv.h b/include/rtw_recv.h
--- a/include/rtw_recv.h 2012-07-30 12:51:05.000000000 +0000
+++ b/include/rtw_recv.h 2013-03-17 17:35:36.136873966 +0000
@@ -623,8 +623,9 @@
//from any given member of recv_frame.
// rxmem indicates the any member/address in recv_frame
- return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
-
+ //return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
+ //return (union recv_frame*)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
+ return (union recv_frame*)(((ulong)rxmem>>RXFRAME_ALIGN) <<RXFRAME_ALIGN) ;
}
__inline static union recv_frame *pkt_to_recvframe(_pkt *pkt)
diff -ruN a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c
--- a/os_dep/linux/os_intfs.c 2012-11-05 07:42:45.000000000 +0000
+++ b/os_dep/linux/os_intfs.c 2013-03-17 19:00:28.393782000 +0000
@@ -797,27 +797,22 @@
RT_TRACE(_module_os_intfs_c_,_drv_info_,("+rtw_start_drv_threads\n"));
#ifdef CONFIG_SDIO_HCI
- padapter->xmitThread = kernel_thread(rtw_xmit_thread, padapter, CLONE_FS|CLONE_FILES);
- if(padapter->xmitThread < 0)
+ if(!start_kthread(&padapter->xmitThread, rtw_xmit_thread, padapter, "8192cu-xmit"))
_status = _FAIL;
#endif
#ifdef CONFIG_RECV_THREAD_MODE
- padapter->recvThread = kernel_thread(recv_thread, padapter, CLONE_FS|CLONE_FILES);
- if(padapter->recvThread < 0)
+ if(!start_kthread(&padapter->recvThread, recv_thread, padapter, "8192cu-recv"))
_status = _FAIL;
#endif
- padapter->cmdThread = kernel_thread(rtw_cmd_thread, padapter, CLONE_FS|CLONE_FILES);
- if(padapter->cmdThread < 0)
+ if(!start_kthread(&padapter->cmdThread, rtw_cmd_thread, padapter, "8192cu-cmd"))
_status = _FAIL;
else
_rtw_down_sema(&padapter->cmdpriv.terminate_cmdthread_sema); //wait for cmd_thread to run
-
#ifdef CONFIG_EVENT_THREAD_MODE
- padapter->evtThread = kernel_thread(event_thread, padapter, CLONE_FS|CLONE_FILES);
- if(padapter->evtThread < 0)
+ if(!start_kthread(&padapter->evtThread, event_thread, padapter, "8192cu-evt"))
_status = _FAIL;
#endif
diff -ruN a/os_dep/osdep_service.c b/os_dep/osdep_service.c
--- a/os_dep/osdep_service.c 2012-07-30 12:51:05.000000000 +0000
+++ b/os_dep/osdep_service.c 2013-03-17 19:00:28.393782000 +0000
@@ -1553,3 +1553,19 @@
#endif
}
+#ifdef PLATFORM_LINUX
+int start_kthread(_thread_hdl_ *t_hdl, int (*threadfn)(void *data),
+ void *data, const char *name)
+{
+#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0))
+ *t_hdl = kernel_thread(threadfn, data, CLONE_FS|CLONE_FILES);
+ if(*t_hdl < 0)
+#else
+ *t_hdl = kthread_run(threadfn, data, name);
+ if(IS_ERR(*t_hdl))
+#endif
+ return 0;
+ return -1;
+}
+#endif
+