commit:     1f2270c561cb13b8cf446b976f1f8ce5c0299d3c
Author:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
AuthorDate: Tue Jun  6 12:31:59 2017 +0000
Commit:     Pacho Ramos <pacho <AT> gentoo <DOT> org>
CommitDate: Tue Jun  6 12:33:51 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1f2270c5

net-wireless/ndiswrapper: Version bump

Package-Manager: Portage-2.3.6, Repoman-2.3.2

 net-wireless/ndiswrapper/Manifest                  |   1 +
 .../files/ndiswrapper-1.61-kernel-4.11.patch       |  55 +++++++++++
 net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild   | 110 +++++++++++++++++++++
 3 files changed, 166 insertions(+)

diff --git a/net-wireless/ndiswrapper/Manifest 
b/net-wireless/ndiswrapper/Manifest
index d74f905ae7c..6cbfeb5beec 100644
--- a/net-wireless/ndiswrapper/Manifest
+++ b/net-wireless/ndiswrapper/Manifest
@@ -1 +1,2 @@
 DIST ndiswrapper-1.59.tar.gz 201257 SHA256 
66a5d3ffb3fc8a63d87e381bbc627511597dfd25c4c37dda3b953ccf98f5d4bc SHA512 
dd1d486b6178185e813217e4fff38f6ea6b21f8a3544c5cc25be9edbca60f34b21656e5d46b9d02cb1e43c8cc82856283aaa428964b8f85cb07146a41e40e44d
 WHIRLPOOL 
ae4dca59911625146de4e2da02b72bcf1b695e63c8d0d900a91ec9b0c5b7452c9ba0de37ad95129d330d96be16d9c4b488b5d40936f51af14dca2597281b7b84
+DIST ndiswrapper-1.61.tar.gz 202240 SHA256 
2ac1847c24cbfa4f48a800b04c9721219614f1663a4ac94af3c7939b45c47584 SHA512 
67a50071a2e04113b91259e0d5236b4bf02b46a0d60ecae779c34e047f678c70b18e3191bad1435525c8499e554bd26794a03a79a71e1e603987432f4c590b43
 WHIRLPOOL 
39b2cae9eab28147a5e7103f1b4b2fa44618afe4d1bbdd6f8108180b867ec319f4f2a3f4dc7b1e141f51e39765dccb9c3476537ed4158d38f7ff9eda3ffd2bea

diff --git a/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.11.patch 
b/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.11.patch
new file mode 100644
index 00000000000..f39c7bde4d2
--- /dev/null
+++ b/net-wireless/ndiswrapper/files/ndiswrapper-1.61-kernel-4.11.patch
@@ -0,0 +1,55 @@
+commit fa2aeeccd5366378ca2eb83c6daee64b511fe792
+Author: Felix Yan <[email protected]>
+Date:   Tue May 16 01:32:56 2017 +0800
+
+    Add support for Linux 4.11+
+
+diff --git a/ndiswrapper/driver/ndis.c b/ndiswrapper/driver/ndis.c
+index c1913a05..2ab4dd21 100644
+--- a/driver/ndis.c
++++ b/driver/ndis.c
+@@ -2258,7 +2258,9 @@ wstdcall void NdisMIndicateReceivePacket(struct 
ndis_mp_block *nmb,
+                       WARNING("empty packet ignored");
+                       continue;
+               }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+               wnd->net_dev->last_rx = jiffies;
++#endif
+               /* get total number of bytes in packet */
+               NdisGetFirstBufferFromPacketSafe(packet, &buffer, &virt,
+                                                &length, &total_length,
+@@ -2346,7 +2348,9 @@ wstdcall void EthRxIndicateHandler(struct ndis_mp_block 
*nmb, void *rx_ctx,
+               ERROR("nmb is NULL");
+               EXIT3(return);
+       }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+       wnd->net_dev->last_rx = jiffies;
++#endif
+ 
+       if (look_ahead_size < packet_size) {
+               struct ndis_packet *packet;
+@@ -2461,7 +2465,9 @@ wstdcall void NdisMTransferDataComplete(struct 
ndis_mp_block *nmb,
+               WARNING("illegal packet");
+               EXIT3(return);
+       }
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+       wnd->net_dev->last_rx = jiffies;
++#endif
+       oob_data = NDIS_PACKET_OOB_DATA(packet);
+       skb_size = sizeof(oob_data->header) + oob_data->look_ahead_size +
+               bytes_txed;
+diff --git a/ndiswrapper/driver/ntoskernel.h b/ndiswrapper/driver/ntoskernel.h
+index 3c4c6ff0..f1c52e51 100644
+--- a/driver/ntoskernel.h
++++ b/driver/ntoskernel.h
+@@ -296,6 +296,10 @@ static inline void (INIT_WORK)(struct work_struct *work, 
work_func_t func)
+ #define add_taint(flag, lockdep_ok) add_taint(flag)
+ #endif
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
++#include <linux/sched/signal.h>
++#endif
++
+ #include "winnt_types.h"
+ #include "ndiswrapper.h"
+ #include "pe_linker.h"

diff --git a/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild 
b/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild
new file mode 100644
index 00000000000..19f6f4ad1e8
--- /dev/null
+++ b/net-wireless/ndiswrapper/ndiswrapper-1.61.ebuild
@@ -0,0 +1,110 @@
+# Copyright 1999-2017 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=6
+inherit linux-mod toolchain-funcs
+
+DESCRIPTION="Wrapper for using Windows drivers for some wireless cards"
+HOMEPAGE="http://ndiswrapper.sourceforge.net/";
+SRC_URI="mirror://sourceforge/${PN}/stable/${P}.tar.gz"
+
+LICENSE="GPL-2"
+KEYWORDS="~amd64 ~x86"
+IUSE="debug usb"
+
+DEPEND="sys-apps/pciutils"
+RDEPEND="${DEPEND}
+       net-wireless/wireless-tools
+"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.59-cflags.patch
+       "${FILESDIR}"/${PN}-1.61-kernel-4.11.patch
+)
+
+MODULE_NAMES="ndiswrapper(misc:${S}/driver)"
+BUILD_TARGETS="all"
+MODULESD_NDISWRAPPER_ALIASES=("wlan0 ndiswrapper")
+
+pkg_pretend() {
+       CONFIG_CHECK="~WEXT_PRIV"
+       use usb && CONFIG_CHECK="${CONFIG_CHECK} ~USB"
+       ERROR_USB="You need to enable USB support in your kernel to use usb 
support in ndiswrapper."
+       ERROR_WEXT_PRIV="Your kernel does not support WEXT_PRIV. To enable it 
you need to enable a wireless driver that enables it, for example PRISM54 or 
IPW2200"
+       linux-mod_pkg_setup
+}
+
+src_compile() {
+       local params
+
+       # Enable verbose debugging information
+       if use debug; then
+               params="DEBUG=3"
+               use usb && params="${params} USB_DEBUG=1"
+       fi
+
+       cd utils
+       emake CC=$(tc-getCC)
+
+       use usb || params="${params} DISABLE_USB=1"
+
+       BUILD_PARAMS="KSRC=${KV_DIR} KVERS=${KV_FULL} KBUILD='${KV_OUT_DIR}' 
${params}"
+       linux-mod_src_compile
+}
+
+src_install() {
+       dodoc AUTHORS ChangeLog INSTALL README
+       doman ndiswrapper.8
+
+       keepdir /etc/ndiswrapper
+
+       linux-mod_src_install
+
+       cd utils
+       emake DESTDIR="${D}" install
+}
+
+pkg_postinst() {
+       linux-mod_pkg_postinst
+
+       echo
+       elog "NDISwrapper requires .inf and .sys files from a Windows(tm) 
driver"
+       elog "to function. Download these to /root for example, then"
+       elog "run 'ndiswrapper -i /root/foo.inf'. After that you can delete 
them."
+       elog "They will be copied to /etc/ndiswrapper/."
+       elog "Once done, please run 'update-modules'."
+       echo
+
+       elog "Please look at ${HOMEPAGE}"
+       elog "for the FAQ, HowTos, tips, configuration, and installation"
+       elog "information."
+       echo
+
+       for i in $(lspci -n | egrep '(0280|0200):' |  cut -d' ' -f1)
+       do
+               i_desc=$(lspci -nn | grep "$i" | awk -F': ' '{print $2}' | awk 
-F'[' '{print $1}')
+               if [[ -n "${i_desc}" ]] ; then
+                       elog "Possible hardware: ${i_desc}"
+               fi
+       done
+
+       echo
+       elog "NDISwrapper devs need support (_hardware_, cash)."
+       elog "Don't hesitate if you can help."
+       elog "See ${HOMEPAGE} for details."
+       echo
+
+       if [[ ${ROOT} == "/" ]]; then
+
+               einfo "Attempting to automatically reinstall any Windows 
drivers"
+               einfo "you might already have."
+               echo
+
+               local driver
+               for driver in $(ls /etc/ndiswrapper) ; do
+                       einfo "Driver: ${driver}"
+                       mv "/etc/ndiswrapper/${driver}" "${T}"
+                       ndiswrapper -i "${T}/${driver}/${driver}.inf"
+               done
+       fi
+}

Reply via email to