diff --git a/packages/linux-drivers/RTL8188EU/build b/packages/linux-drivers/RTL8188EU/build new file mode 100755 index 0000000000..5068993796 --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/build @@ -0,0 +1,26 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +cd $PKG_BUILD + LDFLAGS="" make V=1 ARCH=$TARGET_ARCH KSRC=$(kernel_path) CROSS_COMPILE=$TARGET_PREFIX CONFIG_POWER_SAVING=n diff --git a/packages/linux-drivers/RTL8188EU/install b/packages/linux-drivers/RTL8188EU/install new file mode 100755 index 0000000000..5be65b239f --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/install @@ -0,0 +1,28 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +VER=`ls $BUILD/linux*/modules/lib/modules` + +mkdir -p $INSTALL/lib/modules/$VER/RTL8188EU + cp $PKG_BUILD/*.ko $INSTALL/lib/modules/$VER/RTL8188EU diff --git a/packages/linux-drivers/RTL8188EU/meta b/packages/linux-drivers/RTL8188EU/meta new file mode 100644 index 0000000000..32c9be4eaf --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/meta @@ -0,0 +1,40 @@ +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +PKG_NAME="RTL8188EU" +PKG_VERSION="20130425" +PKG_REV="1" +PKG_ARCH="any" +PKG_LICENSE="GPL" +PKG_SITE="http://www.realtek.com.tw/downloads/downloadsView.aspx?Langid=1&PFid=48&Level=5&Conn=4&ProdID=274&DownTypeID=3&GetDown=false&Downloads=true" +PKG_URL="$DISTRO_SRC/$PKG_NAME-$PKG_VERSION.tar.xz" +PKG_DEPENDS="" +PKG_BUILD_DEPENDS="toolchain linux" +PKG_PRIORITY="optional" +PKG_SECTION="driver" +PKG_SHORTDESC="Realtek RTL81xxEU Linux 3.x driver" +PKG_LONGDESC="Realtek RTL81xxEU Linux 3.x driver" + +PKG_IS_ADDON="no" +PKG_AUTORECONF="no" + +# driver taken from +# https://github.com/Red54/linux-shumeipai2/commit/026ba2734e035b2bde089a836912d6febabe87f3 +# and patched like the RTL8192CU driver for usage on kernel 3.7 and later diff --git a/packages/linux-drivers/RTL8188EU/need_unpack b/packages/linux-drivers/RTL8188EU/need_unpack new file mode 100755 index 0000000000..ed70b61127 --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/need_unpack @@ -0,0 +1,32 @@ +#!/bin/sh + +################################################################################ +# This file is part of OpenELEC - http://www.openelec.tv +# Copyright (C) 2009-2012 Stephan Raue (stephan@openelec.tv) +# +# This Program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This Program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with OpenELEC.tv; see the file COPYING. If not, write to +# the Free Software Foundation, 51 Franklin Street, Suite 500, Boston, MA 02110, USA. +# http://www.gnu.org/copyleft/gpl.html +################################################################################ + +. config/options $1 + +STAMP=$STAMPS/$1/unpack + +test $PKG_DIR/config/linux.$TARGET_ARCH.conf -nt $STAMP -o \ + $PROJECT_DIR/$PROJECT/linux/linux.$TARGET_ARCH.conf -nt $STAMP -o \ + $PKG_DIR/url -nt $STAMP -o \ + $PKG_DIR/meta -nt $STAMP && rm -f $STAMP + +exit 0 diff --git a/packages/linux-drivers/RTL8188EU/patches/RTL8188EU-use_kthread_run_v2.patch b/packages/linux-drivers/RTL8188EU/patches/RTL8188EU-use_kthread_run_v2.patch new file mode 100644 index 0000000000..5f71e1e10d --- /dev/null +++ b/packages/linux-drivers/RTL8188EU/patches/RTL8188EU-use_kthread_run_v2.patch @@ -0,0 +1,142 @@ +diff -Naur RTL8188EU-20130425/core/rtw_mp.c RTL8188EU-20130425.patch/core/rtw_mp.c +--- RTL8188EU-20130425/core/rtw_mp.c 2013-04-27 07:20:29.000000000 +0200 ++++ RTL8188EU-20130425.patch/core/rtw_mp.c 2013-04-27 15:46:36.416055469 +0200 +@@ -1219,7 +1219,8 @@ + + //3 6. start thread + #ifdef PLATFORM_LINUX +- pmp_priv->tx.PktTxThread = kernel_thread(mp_xmit_packet_thread, pmp_priv, CLONE_FS|CLONE_FILES); ++ if(!start_kthread(&pmp_priv->tx.PktTxThread, mp_xmit_packet_thread, pmp_priv, "8188eu-mp-xmit")) ++ DBG_871X("Create PktTx Thread Fail !!!!!\n"); + #endif + #ifdef PLATFORM_FREEBSD + { +@@ -1228,9 +1229,9 @@ + pmp_priv->tx.PktTxThread = kproc_kthread_add(mp_xmit_packet_thread, pmp_priv, + &p, &td, RFHIGHPID, 0, "MPXmitThread", "MPXmitThread"); + } ++if (pmp_priv->tx.PktTxThread < 0) ++ DBG_871X("Create PktTx Thread Fail !!!!!\n"); + #endif +- if (pmp_priv->tx.PktTxThread < 0) +- DBG_871X("Create PktTx Thread Fail !!!!!\n"); + + } + +diff -Naur RTL8188EU-20130425/include/osdep_service.h RTL8188EU-20130425.patch/include/osdep_service.h +--- RTL8188EU-20130425/include/osdep_service.h 2013-04-27 07:20:29.000000000 +0200 ++++ RTL8188EU-20130425.patch/include/osdep_service.h 2013-04-27 15:59:42.647641402 +0200 +@@ -813,6 +813,9 @@ + #include + #endif + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)) ++ #include ++#endif + + #ifdef CONFIG_USB_HCI + typedef struct urb * PURB; +@@ -846,8 +849,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; + +@@ -1394,7 +1401,7 @@ + static __inline void thread_enter(char *name) + { + #ifdef PLATFORM_LINUX +- daemonize("%s", name); ++ //daemonize("%s", name); + allow_signal(SIGTERM); + #endif + #ifdef PLATFORM_FREEBSD +@@ -1677,4 +1684,8 @@ + + #endif + ++#ifdef PLATFORM_LINUX ++extern int start_kthread(_thread_hdl_ *t_hdl, int (*threadfn)(void *data), ++ void *data, const char *name); ++#endif + +diff -Naur RTL8188EU-20130425/include/rtw_recv.h RTL8188EU-20130425.patch/include/rtw_recv.h +--- RTL8188EU-20130425/include/rtw_recv.h 2013-04-27 07:20:29.000000000 +0200 ++++ RTL8188EU-20130425.patch/include/rtw_recv.h 2013-04-27 16:01:59.026051453 +0200 +@@ -658,7 +658,9 @@ + //from any given member of recv_frame. + // rxmem indicates the any member/address in recv_frame + +- return (union recv_frame*)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN); ++ //return (union recv_frame*)(((uint)rxmem>>RXFRAME_ALIGN) <> RXFRAME_ALIGN) << RXFRAME_ALIGN); ++ return (union recv_frame*)(((ulong)rxmem>>RXFRAME_ALIGN) <xmitThread = kernel_thread(rtw_xmit_thread, padapter, CLONE_FS|CLONE_FILES); +- if(padapter->xmitThread < 0) ++ if(!start_kthread(&padapter->xmitThread, rtw_xmit_thread, padapter, "8188eu-xmit")) + _status = _FAIL; + #endif + + #ifdef CONFIG_RECV_THREAD_MODE +- padapter->recvThread = kernel_thread(rtw_recv_thread, padapter, CLONE_FS|CLONE_FILES); +- if(padapter->recvThread < 0) ++ if(!start_kthread(&padapter->recvThread, recv_thread, padapter, "8188eu-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, "8188eu-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, "8188eu-evt")) + _status = _FAIL; + #endif + +diff -Naur RTL8188EU-20130425/os_dep/osdep_service.c RTL8188EU-20130425.patch/os_dep/osdep_service.c +--- RTL8188EU-20130425/os_dep/osdep_service.c 2013-04-27 07:20:29.000000000 +0200 ++++ RTL8188EU-20130425.patch/os_dep/osdep_service.c 2013-04-27 15:38:15.965258008 +0200 +@@ -1920,3 +1920,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 ++ diff --git a/projects/ARCTIC_MC/options b/projects/ARCTIC_MC/options index 8c33d1abd1..75c6408839 100755 --- a/projects/ARCTIC_MC/options +++ b/projects/ARCTIC_MC/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/ATV/options b/projects/ATV/options index 5ece8da1fb..3f699239fe 100755 --- a/projects/ATV/options +++ b/projects/ATV/options @@ -161,7 +161,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun bcm_sta" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun bcm_sta" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Fusion/options b/projects/Fusion/options index e9da651991..134cd0e609 100755 --- a/projects/Fusion/options +++ b/projects/Fusion/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic/options b/projects/Generic/options index cd327db891..776d010c00 100755 --- a/projects/Generic/options +++ b/projects/Generic/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Generic_OSS/options b/projects/Generic_OSS/options index e14cc2bf5f..6cb149dbb2 100755 --- a/projects/Generic_OSS/options +++ b/projects/Generic_OSS/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/ION/options b/projects/ION/options index 92b3ed28ff..499bdd1954 100755 --- a/projects/ION/options +++ b/projects/ION/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Intel/options b/projects/Intel/options index 0fd79c6a10..a750ad5d35 100755 --- a/projects/Intel/options +++ b/projects/Intel/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/RPi/options b/projects/RPi/options index 67e1d843f2..b29a476d63 100755 --- a/projects/RPi/options +++ b/projects/RPi/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Ultra/options b/projects/Ultra/options index fccf6f61ec..909560775c 100755 --- a/projects/Ultra/options +++ b/projects/Ultra/options @@ -160,7 +160,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU dvbhdhomerun" # build with network support (yes / no) NETWORK="yes" diff --git a/projects/Virtual/options b/projects/Virtual/options index 85395e0d9e..e95a1f4de7 100755 --- a/projects/Virtual/options +++ b/projects/Virtual/options @@ -155,7 +155,7 @@ # for a list of additinoal drivers see packages/linux-drivers # Space separated list is supported, # e.g. ADDITIONAL_DRIVERS="DRIVER1 DRIVER2" - ADDITIONAL_DRIVERS="RTL8192CU vboxguest dvbhdhomerun" + ADDITIONAL_DRIVERS="RTL8192CU RTL8188EU vboxguest dvbhdhomerun" # build with network support (yes / no) NETWORK="yes"