Hello community,
here is the log from the commit of package ndiswrapper
checked in at Mon Dec 31 22:45:23 CET 2007.
--------
--- arch/i386/ndiswrapper/ndiswrapper.changes 2007-11-13 00:57:32.000000000 +0100
+++ /mounts/work_src_done/STABLE/ndiswrapper/ndiswrapper.changes 2007-12-26 22:26:49.000000000 +0100
@@ -1,0 +2,10 @@
+Wed Dec 26 22:24:04 CET 2007 - crrodriguez@suse.de
+
+-update to version 1.51
+- ndiswrapper-1.49 crashes kernel, 1.51 works ok [#350735]
+- Added support for 2.6.24-rcX kernels
+- Fixed issue with changing mac address (with 'ifconfig hw ether ')
+- Fixed kernel crash observed with mrv8335 in ad-hoc mode
+- Fixed an smp issue that may cause ndiswrapper to stop transmitting packets after a while (noticed with Marvell Pre-N USB driver)
+
+-------------------------------------------------------------------
Old:
----
ndiswrapper-1.49.tar.bz2
ndiswrapper-2.6.24.diff
New:
----
ndiswrapper-1.51.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ ndiswrapper.spec ++++++
--- /var/tmp/diff_new_pack.q31772/_old 2007-12-31 22:45:00.000000000 +0100
+++ /var/tmp/diff_new_pack.q31772/_new 2007-12-31 22:45:00.000000000 +0100
@@ -1,5 +1,5 @@
#
-# spec file for package ndiswrapper (Version 1.49)
+# spec file for package ndiswrapper (Version 1.51)
#
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
# This file and all modifications and additions to the pristine
@@ -15,7 +15,7 @@
Group: System/Kernel
AutoReqProv: on
Summary: Use Microsoft NDIS Network Drivers for WLAN Cards
-Version: 1.49
+Version: 1.51
Release: 1
Requires: pciutils
Requires: ndiswrapper-kmp
@@ -24,7 +24,6 @@
Source2: README.SUSE
Source3: preamble
Patch0: ndiswrapper.diff
-Patch1: ndiswrapper-2.6.24.diff
Url: http://ndiswrapper.sourceforge.net
License: GPL v2 or later
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@@ -64,7 +63,6 @@
%prep
%setup
%patch0 -p1
-%patch1
cp %SOURCE2 .
mkdir obj
@@ -85,7 +83,6 @@
done
%install
-rm -rf %buildroot
install -d -m 755 %buildroot/sbin %buildroot/usr/sbin \
%buildroot/etc/ndiswrapper
# Userspace stuff
@@ -109,7 +106,15 @@
%doc INSTALL
%doc AUTHORS
%doc ChangeLog
+
%changelog
+* Wed Dec 26 2007 - crrodriguez@suse.de
+-update to version 1.51
+- ndiswrapper-1.49 crashes kernel, 1.51 works ok [#350735]
+- Added support for 2.6.24-rcX kernels
+- Fixed issue with changing mac address (with 'ifconfig hw ether ')
+- Fixed kernel crash observed with mrv8335 in ad-hoc mode
+- Fixed an smp issue that may cause ndiswrapper to stop transmitting packets after a while (noticed with Marvell Pre-N USB driver)
* Tue Nov 13 2007 - ro@suse.de
- hack to compile with 2.6.24rc2 (using mandriva patchkit)
* Tue Nov 13 2007 - ro@suse.de
++++++ ndiswrapper-1.49.tar.bz2 -> ndiswrapper-1.51.tar.bz2 ++++++
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/ChangeLog new/ndiswrapper-1.51/ChangeLog
--- old/ndiswrapper-1.49/ChangeLog 2007-10-28 07:18:43.000000000 +0100
+++ new/ndiswrapper-1.51/ChangeLog 2007-12-18 02:01:34.000000000 +0100
@@ -1,3 +1,17 @@
+Version 1.51 2007-12-17
+=======================
+* Fixed an smp issue that may cause ndiswrapper to stop transmitting packets
+ after a while (noticed with Marvell Pre-N USB driver)
+
+Version 1.50 2007-11-27
+=======================
+* Added support for 2.6.24-rcX kernels
+* Fixed issue with changing mac address (with 'ifconfig <iface> hw ether
+ <mac>') - its broken since 1.45-rc2. Now one can also edit appropriate .conf
+ file to set the NetworkAddress setting to whatever mac address should be
+ used by the driver (e.g., NetworkAddress|0123456789ab)
+* Fixed kernel crash observed with mrv8335 in ad-hoc mode
+
Version 1.49 2007-10-27
=======================
* If a driver returns invalid MAC address (00:00:00:00:00) when
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/iw_ndis.c new/ndiswrapper-1.51/driver/iw_ndis.c
--- old/ndiswrapper-1.49/driver/iw_ndis.c 2007-10-28 07:18:43.000000000 +0100
+++ new/ndiswrapper-1.51/driver/iw_ndis.c 2007-12-18 02:01:34.000000000 +0100
@@ -1974,390 +1974,7 @@
return 0;
}
-#if WIRELESS_EXT <= 17
-/* WPA support through 'ndiswrapper' driver interface */
-
-static int wpa_init(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
-
- ENTER2("");
- if (test_bit(Ndis802_11Encryption1Enabled, &wnd->capa.encr) ||
- test_bit(Ndis802_11Encryption2Enabled, &wnd->capa.encr) ||
- test_bit(Ndis802_11Encryption3Enabled, &wnd->capa.encr))
- EXIT2(return 0);
- else {
- WARNING("driver is not WEP/WPA capable");
- EXIT2(return -1);
- }
-}
-
-static int wpa_deinit(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- ENTER2("");
- EXIT2(return 0);
-}
-
-static int wpa_set_wpa(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
-
- ENTER2("flags = %d, wnd->capa.encr = %ld",
- wrqu->data.flags, wnd->capa.encr);
- if (wrqu->data.flags) {
- if (test_bit(Ndis802_11Encryption2Enabled, &wnd->capa.encr) ||
- test_bit(Ndis802_11Encryption3Enabled, &wnd->capa.encr))
- EXIT2(return 0);
- else {
- WARNING("driver is not WPA capable");
- EXIT2(return -1);
- }
- } else
- EXIT2(return 0);
-}
-
-static int wpa_set_key(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- struct ndis_add_key ndis_key;
- struct wpa_key wpa_key;
- int i, size;
- NDIS_STATUS res;
- mac_address addr;
- u8 seq[IW_ENCODING_TOKEN_MAX];
- u8 key[IW_ENCODING_TOKEN_MAX];
-
- ENTER2("");
- if (wrqu->data.length)
- size = wrqu->data.length;
- else
- size = sizeof(wpa_key);
- if (copy_from_user(&wpa_key, wrqu->data.pointer, size))
- EXIT2(return -EFAULT);
- if (wpa_key.addr && copy_from_user(&addr, wpa_key.addr, ETH_ALEN))
- EXIT2(return -EFAULT);
-
- if (wpa_key.seq && copy_from_user(&seq, wpa_key.seq, wpa_key.seq_len))
- EXIT2(return -EFAULT);
-
- if (wpa_key.key && copy_from_user(&key, wpa_key.key, wpa_key.key_len))
- EXIT2(return -EFAULT);
-
- TRACE2("alg = %d, key_index = %d", wpa_key.alg, wpa_key.key_index);
-
- if (wpa_key.alg == WPA_ALG_WEP) {
- if (!test_bit(Ndis802_11Encryption1Enabled, &wnd->capa.encr))
- EXIT2(return -1);
- if (wpa_key.set_tx)
- wnd->encr_info.tx_key_index = wpa_key.key_index;
- if (add_wep_key(wnd, key, wpa_key.key_len, wpa_key.key_index))
- EXIT2(return -1);
- else
- EXIT2(return 0);
- }
- if (wpa_key.key_len > sizeof(ndis_key.key)) {
- TRACE2("incorrect key length (%u)", (u32)wpa_key.key_len);
- EXIT2(return -1);
- }
- if (wpa_key.seq_len > IW_ENCODING_TOKEN_MAX) {
- TRACE2("incorrect seq? length = (%u)", (u32)wpa_key.seq_len);
- EXIT2(return -1);
- }
- TRACE2("setting key %d, %u", wpa_key.key_index, (u32)wpa_key.key_len);
- memset(&ndis_key, 0, sizeof(ndis_key));
-
- ndis_key.struct_size =
- sizeof(ndis_key) - sizeof(ndis_key.key) + wpa_key.key_len;
- ndis_key.length = wpa_key.key_len;
- ndis_key.index = wpa_key.key_index;
- if (wpa_key.seq && wpa_key.seq_len > 0) {
- for (i = 0, ndis_key.rsc = 0 ; i < wpa_key.seq_len ; i++)
- ndis_key.rsc |= (seq[i] << (i * 8));
-
- ndis_key.index |= 1 << 29;
- }
- TRACE2("infra_mode = %d, key.addr = %p, addr = " MACSTRSEP,
- wnd->infrastructure_mode, wpa_key.addr, MAC2STR(addr));
- if (wpa_key.addr == NULL ||
- memcmp(addr, "\xff\xff\xff\xff\xff\xff", ETH_ALEN) == 0) {
- /* group key */
- if (wnd->infrastructure_mode == Ndis802_11IBSS)
- memset(ndis_key.bssid, 0xff, ETH_ALEN);
- else
- get_ap_address(wnd, ndis_key.bssid);
- } else {
- /* pairwise key */
- ndis_key.index |= (1 << 30);
- memcpy(&ndis_key.bssid, addr, ETH_ALEN);
- }
- TRACE2("bssid " MACSTRSEP, MAC2STR(ndis_key.bssid));
-
- if (wpa_key.set_tx)
- ndis_key.index |= (1 << 31);
- if (wpa_key.alg == WPA_ALG_TKIP && wpa_key.key_len == 32) {
- /* wpa_supplicant gives us the Michael MIC RX/TX keys in
- * different order than NDIS spec, so swap the order here. */
- memcpy(ndis_key.key, key, 16);
- memcpy(ndis_key.key + 16, key + 24, 8);
- memcpy(ndis_key.key + 24, key + 16, 8);
- } else
- memcpy(ndis_key.key, key, wpa_key.key_len);
- if (wpa_key.alg == WPA_ALG_NONE || wpa_key.key_len == 0) {
- /* TI driver crashes kernel if OID_802_11_REMOVE_KEY is
- * called; other drivers seem to not require it, so
- * for now, don't remove the key from drvier */
- wnd->encr_info.keys[wpa_key.key_index].length = 0;
- memset(&wnd->encr_info.keys[wpa_key.key_index].key, 0,
- wpa_key.key_len);
- TRACE2("key %d removed", wpa_key.key_index);
- } else {
- res = mp_set(wnd, OID_802_11_ADD_KEY,
- &ndis_key, ndis_key.struct_size);
- if (res) {
- TRACE2("adding key failed (%08X), %u",
- res, ndis_key.struct_size);
- EXIT2(return -1);
- }
- wnd->encr_info.keys[wpa_key.key_index].length =
- wpa_key.key_len;
- memcpy(&wnd->encr_info.keys[wpa_key.key_index].key,
- &ndis_key.key, wpa_key.key_len);
- if (wpa_key.set_tx)
- wnd->encr_info.tx_key_index = wpa_key.key_index;
- TRACE2("key %d added", wpa_key.key_index);
- }
- EXIT2(return 0);
-}
-
-static int wpa_disassociate(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- disassociate(wnd, 1);
- EXIT2(return 0);
-}
-
-static int wpa_associate(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- struct wpa_assoc_info wpa_assoc_info;
- char ssid[NDIS_ESSID_MAX_SIZE];
- int size, infra_mode, auth_mode, cipher_pairwise, cipher_groupwise;
-
- ENTER2("");
- memset(&wpa_assoc_info, 0, sizeof(wpa_assoc_info));
- wpa_assoc_info.mode = IEEE80211_MODE_INFRA;
-
- if (wrqu->data.length == 0)
- size = (void *)&wpa_assoc_info.auth_alg -
- (void *)&wpa_assoc_info.bssid;
- else
- size = min((size_t)wrqu->data.length, sizeof(wpa_assoc_info));
-
- if (copy_from_user(&wpa_assoc_info, wrqu->data.pointer, size))
- EXIT2(return -EFAULT);
- if (copy_from_user(&ssid, wpa_assoc_info.ssid,
- wpa_assoc_info.ssid_len))
- EXIT2(return -EFAULT);
-
- if (wpa_assoc_info.mode == IEEE80211_MODE_IBSS)
- infra_mode = Ndis802_11IBSS;
- else
- infra_mode = Ndis802_11Infrastructure;
-
- TRACE2("key_mgmt_suite = %d, pairwise_suite = %d, group_suite= %d",
- wpa_assoc_info.key_mgmt_suite, wpa_assoc_info.pairwise_suite,
- wpa_assoc_info.group_suite);
-
- if (wpa_assoc_info.wpa_ie == NULL || wpa_assoc_info.wpa_ie_len == 0) {
- if (wpa_assoc_info.auth_alg & AUTH_ALG_SHARED_KEY) {
- if (wpa_assoc_info.auth_alg & AUTH_ALG_OPEN_SYSTEM)
- auth_mode = Ndis802_11AuthModeAutoSwitch;
- else
- auth_mode = Ndis802_11AuthModeShared;
- } else
- auth_mode = Ndis802_11AuthModeOpen;
- priv_mode = Ndis802_11PrivFilterAcceptAll;
- } else if (wpa_assoc_info.wpa_ie[0] == RSN_INFO_ELEM) {
- if (wpa_assoc_info.key_mgmt_suite == KEY_MGMT_PSK) {
- auth_mode = Ndis802_11AuthModeWPA2PSK;
- else
- auth_mode = Ndis802_11AuthModeWPA2;
- }
- } else {
- if (wpa_assoc_info.key_mgmt_suite == KEY_MGMT_WPA_NONE ||
- wpa_assoc_info.key_mgmt_suite == KEY_MGMT_802_1X_NO_WPA)
- auth_mode = Ndis802_11AuthModeWPANone;
- else {
- if (wpa_assoc_info.key_mgmt_suite == KEY_MGMT_PSK)
- auth_mode = Ndis802_11AuthModeWPAPSK;
- else
- auth_mode = Ndis802_11AuthModeWPA;
- }
- }
-
- cipher_groupwise = IW_AUTH_CIPHER_NONE;
- switch (wpa_assoc_info.pairwise_suite) {
- case CIPHER_CCMP:
- cipher_pairwise = IW_AUTH_CIPHER_CCMP;
- break;
- case CIPHER_TKIP:
- cipher_pairwise = IW_AUTH_CIPHER_TKIP;
- break;
- case CIPHER_WEP40:
- case CIPHER_WEP104:
- cipher_pairwise = IW_AUTH_CIPHER_WEP104;
- break;
- case CIPHER_NONE:
- switch (wpa_assoc_info.group_suite) {
- case CIPHER_CCMP:
- cipher_groupwise = IW_AUTH_CIPHER_CCMP;
- break;
- case CIPHER_TKIP:
- cipher_groupwise = IW_AUTH_CIPHER_CCMP;
- break;
- default:
- cipher_groupwise = IW_AUTH_CIPHER_NONE;
- break;
- }
- default:
- cipher_pairwise = IW_AUTH_CIPHER_NONE;
- break;
- };
-
- set_infra_mode(wnd, infra_mode);
- set_ndis_auth_mode(wnd, auth_mode);
- set_priv_filter(wnd);
- set_encr_mode(wnd, cipher_pairwise, cipher_groupwise);
-
-#if 0
- /* set channel */
- for (i = 0; i < (sizeof(freq_chan)/sizeof(freq_chan[0])); i++) {
- if (wpa_assoc_info.freq == freq_chan[i]) {
- union iwreq_data freq_req;
-
- memset(&freq_req, 0, sizeof(freq_req));
- freq_req.freq.m = i;
- if (iw_set_freq(dev, NULL, &freq_req, NULL))
- EXIT2(return -1);
- }
- }
-#endif
- /* set ssid */
- if (set_essid(wnd, ssid, wpa_assoc_info.ssid_len))
- EXIT2(return -1);
-
- EXIT2(return 0);
-}
-
-static int wpa_set_countermeasures(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- ENTER2("");
- return 0;
-}
-
-static int wpa_deauthenticate(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- EXIT2(return deauthenticate(wnd));
-}
-
-static int wpa_set_priv_filter(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- int mode;
-
- ENTER2("filter: %d", wrqu->param.value);
- if (wrqu->param.value)
- mode = IW_AUTH_WPA_VERSION_WPA;
- else
- mode = IW_AUTH_WPA_VERSION_DISABLED;
- if (set_priv_filter(wnd, mode))
- EXIT2(return -1);
- EXIT2(return 0);
-}
-
-static int wpa_set_auth_alg(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- int mode;
-
- ENTER2("%d", wrqu->param.value);
- if (wrqu->param.value & AUTH_ALG_SHARED_KEY)
- mode = Ndis802_11AuthModeShared;
- else if (wrqu->param.value & AUTH_ALG_OPEN_SYSTEM)
- mode = Ndis802_11AuthModeOpen;
- else
- EXIT2(return -1);
- TRACE2("%d", mode);
- if (set_ndis_auth_mode(wnd, mode))
- EXIT2(return -1);
- EXIT2(return 0);
-}
-
-static int wpa_get_capa(struct net_device *dev, struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- struct wrap_ndis_device *wnd = netdev_priv(dev);
- struct wpa_driver_capa *drv_capa;
-
- ENTER2("%p", wnd);
- drv_capa = (struct wpa_driver_capa *)wrqu->data.pointer;
- if (!drv_capa)
- EXIT2(return -1);
- drv_capa->key_mgmt = 0;
- if (test_bit(Ndis802_11AuthModeWPA, &wnd->capa.auth))
- drv_capa->key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA;
- if (test_bit(Ndis802_11AuthModeWPAPSK, &wnd->capa.auth))
- drv_capa->key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA_PSK;
- if (test_bit(Ndis802_11AuthModeWPA2, &wnd->capa.auth))
- drv_capa->key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA2;
- if (test_bit(Ndis802_11AuthModeWPA2PSK, &wnd->capa.auth))
- drv_capa->key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA2_PSK;
- if (test_bit(Ndis802_11AuthModeWPANone, &wnd->capa.auth))
- drv_capa->key_mgmt |= WPA_DRIVER_CAPA_KEY_MGMT_WPA_NONE;
-
- drv_capa->enc = 0;
- if (test_bit(Ndis802_11Encryption1Enabled, &wnd->capa.encr))
- drv_capa->enc |= WPA_DRIVER_CAPA_ENC_WEP40 |
- WPA_DRIVER_CAPA_ENC_WEP104;
- if (test_bit(Ndis802_11Encryption2Enabled, &wnd->capa.encr))
- drv_capa->enc |= WPA_DRIVER_CAPA_ENC_TKIP;
- if (test_bit(Ndis802_11Encryption3Enabled, &wnd->capa.encr))
- drv_capa->enc |= WPA_DRIVER_CAPA_ENC_CCMP;
-
- /* TODO: how to check if LEAP is supported? */
- drv_capa->auth = WPA_DRIVER_AUTH_OPEN | WPA_DRIVER_AUTH_SHARED;
-
- drv_capa->flags = WPA_DRIVER_FLAGS_DRIVER_IE |
- WPA_DRIVER_FLAGS_SET_KEYS_AFTER_ASSOC;
- EXIT2(return 0);
-}
-
-#endif // WIRELESS_EXT <= 17
-
static const struct iw_priv_args priv_args[] = {
-#if WIRELESS_EXT <= 17
- {WPA_DROP_UNENCRYPTED, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
- "set_priv_filter"},
- {WPA_SET_AUTH_ALG, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
- "auth_alg"},
-#endif
-
{PRIV_RESET, 0, 0, "ndis_reset"},
{PRIV_POWER_PROFILE, IW_PRIV_TYPE_INT | IW_PRIV_SIZE_FIXED | 1, 0,
"power_profile"},
@@ -2373,19 +1990,6 @@
#define WEPRIV(id) [id - SIOCIWFIRSTPRIV]
static const iw_handler priv_handler[] = {
-#if WIRELESS_EXT <= 17
- WEPRIV(WPA_SET_WPA) = wpa_set_wpa,
- WEPRIV(WPA_SET_KEY) = wpa_set_key,
- WEPRIV(WPA_ASSOCIATE) = wpa_associate,
- WEPRIV(WPA_DISASSOCIATE) = wpa_disassociate,
- WEPRIV(WPA_DROP_UNENCRYPTED) = wpa_set_priv_filter,
- WEPRIV(WPA_SET_COUNTERMEASURES) = wpa_set_countermeasures,
- WEPRIV(WPA_DEAUTHENTICATE) = wpa_deauthenticate,
- WEPRIV(WPA_SET_AUTH_ALG) = wpa_set_auth_alg,
- WEPRIV(WPA_INIT) = wpa_init,
- WEPRIV(WPA_DEINIT) = wpa_deinit,
- WEPRIV(WPA_GET_CAPA) = wpa_get_capa,
-#endif
WEPRIV(PRIV_RESET) = priv_reset,
WEPRIV(PRIV_POWER_PROFILE) = priv_power_profile,
WEPRIV(PRIV_DEAUTHENTICATE) = priv_deauthenticate,
diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/Makefile new/ndiswrapper-1.51/driver/Makefile
--- old/ndiswrapper-1.49/driver/Makefile 2007-10-28 07:18:43.000000000 +0100
+++ new/ndiswrapper-1.51/driver/Makefile 2007-12-18 02:01:34.000000000 +0100
@@ -65,58 +65,58 @@
endif
include $(KBUILD)/.config
-CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
+MOD_CFLAGS += $(shell [ -f $(KSRC)/include/linux/modversions.h ] && \
echo -DEXPORT_SYMTAB -DMODVERSIONS \
-include $(KSRC)/include/linux/modversions.h)
ifndef DISABLE_USB
-CFLAGS += $(shell if grep -q 'struct module \*owner;' \
+MOD_CFLAGS += $(shell if grep -q 'struct module \*owner;' \
$(KSRC)/include/linux/usb.h ; then \
echo -DUSB_DRIVER_OWNER; \
fi)
endif
# returns of structs and unions in registers when possible, like Windows
-CFLAGS += -freg-struct-return
+MOD_CFLAGS += -freg-struct-return
# to produce debug trace, add option "DEBUG=<n>" where <n> is 1 to 6
ifdef DEBUG
-CFLAGS += -DDEBUG=$(DEBUG) -g
+MOD_CFLAGS += -DDEBUG=$(DEBUG) -g
endif
# to debug timers, add option "TIMER_DEBUG=1 DEBUG=<n>"
ifdef TIMER_DEBUG
-CFLAGS += -DTIMER_DEBUG
+MOD_CFLAGS += -DTIMER_DEBUG
endif
# to debug event layer, add option "EVENT_DEBUG=1 DEBUG=<n>"
ifdef EVENT_DEBUG
-CFLAGS += -DEVENT_DEBUG
+MOD_CFLAGS += -DEVENT_DEBUG
endif
# to debug USB layer, add option "USB_DEBUG=1 DEBUG=<n>"
ifdef USB_DEBUG
-CFLAGS += -DUSB_DEBUG
+MOD_CFLAGS += -DUSB_DEBUG
endif
# to debug I/O layer, add option "IO_DEBUG=1 DEBUG=<n>"
ifdef IO_DEBUG
-CFLAGS += -DIO_DEBUG
+MOD_CFLAGS += -DIO_DEBUG
endif
# to debug worker threads
ifdef WORK_DEBUG
-CFLAGS += -DWORK_DEBUG
+MOD_CFLAGS += -DWORK_DEBUG
endif
# to debug memory allocation issues
ifdef ALLOC_DEBUG
-CFLAGS += -DALLOC_DEBUG=$(ALLOC_DEBUG)
+MOD_CFLAGS += -DALLOC_DEBUG=$(ALLOC_DEBUG)
endif
# emulate (pseudo) preemption
ifdef WRAP_PREEMPT
-CFLAGS += -DWRAP_PREEMPT
+MOD_CFLAGS += -DWRAP_PREEMPT
endif
.PHONY: prereq_check gen_exports clean dist_clean install stack_check
@@ -133,7 +133,7 @@
ifdef DISABLE_USB
usb_exports.h:
-CFLAGS += -DDISABLE_USB
+MOD_CFLAGS += -DDISABLE_USB
else
usb_exports.h: usb.c
@@ -145,23 +145,18 @@
endif
endif
-ifeq ($(KPSUB),24)
-CFLAGS += -DUSE_OWN_WQ
-OBJS += workqueue.o
-endif
-
-CFLAGS += $(shell if grep -s -A1 'ndiswrapper' $(KSRC)/kernel/module.c | \
+MOD_CFLAGS += $(shell if grep -s -A1 'ndiswrapper' $(KSRC)/kernel/module.c | \
grep -q 'add_taint_module' ; then \
echo -DUSE_OWN_WQ; \
fi)
ifdef WRAP_WQ
-CFLAGS += -DWRAP_WQ
+MOD_CFLAGS += -DWRAP_WQ
OBJS += workqueue.o
endif
ifdef NTOS_WQ
-CFLAGS += -DNTOS_WQ
+MOD_CFLAGS += -DNTOS_WQ
endif
ntoskernel.h: lin2win.h
@@ -281,6 +276,10 @@
echo "static inline void netif_tx_unlock_bh(struct net_device *dev)"; \
echo "{ spin_unlock_bh(&dev->xmit_lock); }"; \
fi >> $@
+ @if ! grep -qw netif_poll_enable $(KSRC)/include/linux/netdevice.h; then \
+ echo "static inline void netif_poll_enable(struct net_device *dev) {}"; \
+ echo "static inline void netif_poll_disable(struct net_device *dev) {}"; \
+ fi >> $@
@if ! grep -qw pci_set_consistent_dma_mask \
$(KSRC)/include/linux/pci.h; then \
echo "static inline int pci_set_consistent_dma_mask" ; \
@@ -295,6 +294,11 @@
@if [ -f $(KSRC)/include/linux/percpu.h ]; then \
echo "#include