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 <linux/percpu.h>"; \ fi >> $@ + @if grep -qw proc_net $(KSRC)/include/linux/proc_fs.h; then \ + echo "#define proc_net_root proc_net"; \ + else \ + echo "#define proc_net_root init_net.proc_net"; \ + fi >> $@ prereq_check: @if [ ! -f $(KBUILD)/include/linux/version.h ]; then \ @@ -318,19 +322,14 @@ distclean: clean rm -f *_exports.h .\#* win2lin_stubs.h built-in.o -ifeq ($(KPSUB),24) +wflags := $(shell if grep -qw "EXTRA_CFLAGS" $(KSRC)/scripts/Makefile.build; \ + then echo "EXTRA_CFLAGS"; else echo "CFLAGS"; fi) -MODULE := ndiswrapper.o -CFLAGS += -DLINUX -D__KERNEL__ -DMODULE -I$(KSRC)/include \ - -Wall -Wstrict-prototypes -fomit-frame-pointer \ - -fno-strict-aliasing -pipe -O2 - -ifneq ($(CONFIG_X86_64),y) -CFLAGS += -mpreferred-stack-boundary=2 -endif -default: $(OBJS) - $(LD) -r -o $(MODULE) $(OBJS) +ifeq ($(wflags), CFLAGS) +CFLAGS += $(MOD_CFLAGS) else +EXTRA_CFLAGS += $(MOD_CFLAGS) +endif MODULE := ndiswrapper.ko obj-m := ndiswrapper.o @@ -340,7 +339,6 @@ default: $(MAKE) -C $(KBUILD) SUBDIRS=$(SRC_DIR) -endif stack_check: @if [ "x$(CONFIG_X86_64)" = "x" -a $(KPSUB) -eq 26 ] && \ diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/ndis.c new/ndiswrapper-1.51/driver/ndis.c --- old/ndiswrapper-1.49/driver/ndis.c 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/ndis.c 2007-12-18 02:01:34.000000000 +0100 @@ -525,9 +525,8 @@ } } up(&loader_mutex); - setting = kmalloc(sizeof(*setting), GFP_KERNEL); + setting = kzalloc(sizeof(*setting), GFP_KERNEL); if (setting) { - memset(setting, 0, sizeof(*setting)); if (ansi.length == ansi.max_length) ansi.length--; memcpy(setting->name, keyname, ansi.length); @@ -548,6 +547,56 @@ EXIT2(return); } +wstdcall void WIN_FUNC(NdisReadNetworkAddress,4) + (NDIS_STATUS *status, void **addr, UINT *len, + struct ndis_mp_block *nmb) +{ + struct wrap_ndis_device *wnd = nmb->wnd; + struct ndis_configuration_parameter *param; + struct unicode_string key; + struct ansi_string ansi; + typeof(wnd->mac) mac; + int i, ret; + + ENTER2("%p", nmb); + RtlInitAnsiString(&ansi, "NetworkAddress"); + *status = NDIS_STATUS_FAILURE; + if (RtlAnsiStringToUnicodeString(&key, &ansi, TRUE) != STATUS_SUCCESS) + EXIT1(return); + + NdisReadConfiguration(&ret, ¶m, nmb, &key, NdisParameterString); + RtlFreeUnicodeString(&key); + if (ret != NDIS_STATUS_SUCCESS) + EXIT1(return); + ret = RtlUnicodeStringToAnsiString(&ansi, ¶m->data.string, TRUE); + if (ret != STATUS_SUCCESS) + EXIT1(return); + + i = 0; + if (ansi.length >= 2 * sizeof(mac)) { + for (i = 0; i < sizeof(mac); i++) { + char c[3]; + int x; + c[0] = ansi.buf[i*2]; + c[1] = ansi.buf[i*2+1]; + c[2] = 0; + ret = sscanf(c, "%x", &x); + if (ret != 1) + break; + mac[i] = x; + } + } + TRACE2("%s, %d, " MACSTR, ansi.buf, i, MAC2STR(mac)); + RtlFreeAnsiString(&ansi); + if (i == sizeof(mac)) { + memcpy(wnd->mac, mac, sizeof(wnd->mac)); + *len = sizeof(mac); + *addr = wnd->mac; + *status = NDIS_STATUS_SUCCESS; + } + EXIT1(return); +} + wstdcall void WIN_FUNC(NdisInitializeString,2) (struct unicode_string *dest, UCHAR *src) { @@ -559,6 +608,7 @@ dest->buf = NULL; } else { RtlInitAnsiString(&ansi, src); + /* the string is freed with NdisFreeMemory */ RtlAnsiStringToUnicodeString(dest, &ansi, TRUE); } EXIT2(return); @@ -1135,7 +1185,7 @@ { ndis_buffer *descr; - ENTER4("pool: %p, allocated: %d", pool, pool->num_allocated_descr); + ENTER4("pool: %p (%d)", pool, pool->num_allocated_descr); /* NDIS drivers should call this at DISPATCH_LEVEL, but * alloc_tx_packet calls at SOFT_IRQL */ assert_irql(_irql_ <= SOFT_LEVEL); @@ -1197,16 +1247,15 @@ EXIT4(return); } pool = buffer->pool; - spin_lock_bh(&pool->lock); if (pool->num_allocated_descr > MAX_ALLOCATED_NDIS_BUFFERS) { /* NB NB NB: set mdl's 'pool' field to NULL before * calling free_mdl; otherwise free_mdl calls - * NdisFreeBuffer causing deadlock (for spinlock) */ - pool->num_allocated_descr--; + * NdisFreeBuffer back */ + atomic_dec_var(pool->num_allocated_descr); buffer->pool = NULL; - spin_unlock_bh(&pool->lock); free_mdl(buffer); } else { + spin_lock_bh(&pool->lock); buffer->next = pool->free_descr; pool->free_descr = buffer; spin_unlock_bh(&pool->lock); @@ -1480,7 +1529,7 @@ } atomic_inc_var(pool->num_allocated_descr); } - TRACE4("%p, %p, %p", pool, packet, pool->free_descr); + TRACE4("%p, %p", pool, packet); atomic_inc_var(pool->num_used_descr); memset(packet, 0, packet_length); packet->private.oob_offset = @@ -1504,30 +1553,31 @@ { struct ndis_packet_pool *pool; - ENTER4("packet: %p, pool: %p", packet, packet->private.pool); + ENTER4("%p, %p", packet, packet->private.pool); pool = packet->private.pool; if (!pool) { - ERROR("pool for descriptor %p is invalid", packet); + ERROR("invalid pool %p", packet); EXIT4(return); } - spin_lock_bh(&pool->lock); - pool->num_used_descr--; + assert((int)pool->num_used_descr > 0); + atomic_dec_var(pool->num_used_descr); if (packet->reserved[1]) { TRACE3("%p, %p", packet, (void *)packet->reserved[1]); kfree((void *)packet->reserved[1]); packet->reserved[1] = 0; } if (pool->num_allocated_descr > MAX_ALLOCATED_NDIS_PACKETS) { - TRACE3("%p", packet); - pool->num_allocated_descr--; + TRACE3("%p", pool); + atomic_dec_var(pool->num_allocated_descr); kfree(packet); } else { TRACE4("%p, %p, %p", pool, packet, pool->free_descr); + spin_lock_bh(&pool->lock); packet->reserved[0] = (typeof(packet->reserved[0]))pool->free_descr; pool->free_descr = packet; + spin_unlock_bh(&pool->lock); } - spin_unlock_bh(&pool->lock); EXIT4(return); } @@ -1786,47 +1836,6 @@ TIMEREXIT(return); } -wstdcall void WIN_FUNC(NdisReadNetworkAddress,4) - (NDIS_STATUS *status, void **addr, UINT *len, - struct ndis_mp_block *nmb) -{ - struct wrap_ndis_device *wnd = nmb->wnd; - struct ndis_configuration_parameter *param; - struct unicode_string key; - struct ansi_string ansi; - int int_mac[ETH_ALEN]; - int ret; - - ENTER2("%p", nmb); - RtlInitAnsiString(&ansi, "NetworkAddress"); - *len = 0; - *status = NDIS_STATUS_FAILURE; - if (RtlAnsiStringToUnicodeString(&key, &ansi, TRUE) != STATUS_SUCCESS) - EXIT1(return); - - NdisReadConfiguration(status, ¶m, nmb, &key, NdisParameterString); - RtlFreeUnicodeString(&key); - if (*status != NDIS_STATUS_SUCCESS) - EXIT1(return); - ret = RtlUnicodeStringToAnsiString(&ansi, ¶m->data.string, TRUE); - if (ret != STATUS_SUCCESS) - EXIT1(return); - - ret = sscanf(ansi.buf, MACSTR, MACINTADR(int_mac)); - RtlFreeAnsiString(&ansi); - if (ret == ETH_ALEN) { - int i; - for (i = 0; i < ETH_ALEN; i++) - wnd->mac[i] = int_mac[i]; - printk(KERN_INFO "%s: %s ethernet device " MACSTRSEP "\n", - wnd->net_dev->name, DRIVER_NAME, MAC2STR(wnd->mac)); - *len = ETH_ALEN; - *addr = wnd->mac; - *status = NDIS_STATUS_SUCCESS; - } - EXIT1(return); -} - wstdcall void WIN_FUNC(NdisMRegisterAdapterShutdownHandler,3) (struct ndis_mp_block *nmb, void *ctx, void *func) { @@ -2506,12 +2515,13 @@ NDIS_STATUS status) { struct wrap_ndis_device *wnd = nmb->wnd; + typeof(wnd->ndis_req_task) task; ENTER2("nmb: %p, wnd: %p, %08X", nmb, wnd, status); wnd->ndis_req_status = status; wnd->ndis_req_done = 1; - if (wnd->ndis_req_task) - wake_up_process(wnd->ndis_req_task); + if ((task = xchg(&wnd->ndis_req_task, NULL))) + wake_up_process(task); else WARNING("invalid task"); EXIT2(return); @@ -2522,12 +2532,13 @@ NDIS_STATUS status) { struct wrap_ndis_device *wnd = nmb->wnd; + typeof(wnd->ndis_req_task) task; ENTER2("status = %08X", status); wnd->ndis_req_status = status; wnd->ndis_req_done = 1; - if (wnd->ndis_req_task) - wake_up_process(wnd->ndis_req_task); + if ((task = xchg(&wnd->ndis_req_task, NULL))) + wake_up_process(task); else WARNING("invalid task"); EXIT2(return); @@ -2538,12 +2549,13 @@ NDIS_STATUS status, BOOLEAN address_reset) { struct wrap_ndis_device *wnd = nmb->wnd; + typeof(wnd->ndis_req_task) task; ENTER2("status: %08X, %u", status, address_reset); wnd->ndis_req_status = status; wnd->ndis_req_done = address_reset + 1; - if (wnd->ndis_req_task) - wake_up_process(wnd->ndis_req_task); + if ((task = xchg(&wnd->ndis_req_task, NULL))) + wake_up_process(task); else WARNING("invalid task"); EXIT2(return); @@ -2832,12 +2844,13 @@ struct ndis_request *ndis_request) { struct wrap_ndis_device *wnd = nmb->wnd; + typeof(wnd->ndis_req_task) task; ENTER3("%08X", status); wnd->ndis_req_status = status; wnd->ndis_req_done = 1; - if (wnd->ndis_req_task) - wake_up_process(wnd->ndis_req_task); + if ((task = xchg(&wnd->ndis_req_task, NULL))) + wake_up_process(task); else WARNING("invalid task"); EXIT3(return); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/ndis.h new/ndiswrapper-1.51/driver/ndis.h --- old/ndiswrapper-1.49/driver/ndis.h 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/ndis.h 2007-12-18 02:01:34.000000000 +0100 @@ -612,7 +612,7 @@ enum wrapper_work { LINK_STATUS_OFF, LINK_STATUS_ON, SET_MULTICAST_LIST, COLLECT_IW_STATS, - HANGCHECK, NETIF_WAKEQ, SHUTDOWN, + HANGCHECK, NETIF_WAKEQ, }; struct encr_info { diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/ndiswrapper.h new/ndiswrapper-1.51/driver/ndiswrapper.h --- old/ndiswrapper-1.49/driver/ndiswrapper.h 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/ndiswrapper.h 2007-12-18 02:01:34.000000000 +0100 @@ -16,7 +16,7 @@ #ifndef _NDISWRAPPER_H_ #define _NDISWRAPPER_H_ -#define DRIVER_VERSION "1.49" +#define DRIVER_VERSION "1.51" #define UTILS_VERSION "1.9" #define DRIVER_NAME "ndiswrapper" diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/ntoskernel.c new/ndiswrapper-1.51/driver/ntoskernel.c --- old/ndiswrapper-1.49/driver/ntoskernel.c 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/ntoskernel.c 2007-12-18 02:01:34.000000000 +0100 @@ -1129,8 +1129,8 @@ DBG_BLOCK(2) { KIRQL irql = current_irql(); if (irql >= DISPATCH_LEVEL) { - TRACE2("wait in atomic context: %Lu, %lu, %d, %ld", - *timeout, wait_hz, in_atomic(), in_interrupt()); + TRACE2("wait in atomic context: %lu, %d, %ld", + wait_hz, in_atomic(), in_interrupt()); } } assert_irql(_irql_ < DISPATCH_LEVEL); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/ntoskernel.h new/ndiswrapper-1.51/driver/ntoskernel.h --- old/ndiswrapper-1.49/driver/ntoskernel.h 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/ntoskernel.h 2007-12-18 02:01:34.000000000 +0100 @@ -612,7 +612,9 @@ #define NTOS_WQ 1 #endif +#ifndef NTOS_WQ #define NTOS_WQ 1 +#endif #ifdef NTOS_WQ extern workqueue_struct_t *ntos_wq; @@ -714,6 +716,9 @@ typedef struct { int count; struct mutex lock; +#ifdef CONFIG_SMP + typeof(current->cpus_allowed) cpus_allowed; +#endif struct task_struct *task; } irql_info_t; @@ -743,6 +748,7 @@ /* TODO: is this enough to pin down to current cpu? */ #ifdef CONFIG_SMP assert(task_cpu(current) == smp_processor_id()); + info->cpus_allowed = current->cpus_allowed; current->cpus_allowed = cpumask_of_cpu(smp_processor_id()); #endif put_cpu_var(irql_info); @@ -765,10 +771,10 @@ assert(info->count > 0); if (--info->count == 0) { info->task = NULL; - mutex_unlock(&info->lock); #ifdef CONFIG_SMP - current->cpus_allowed = CPU_MASK_ALL; + current->cpus_allowed = info->cpus_allowed; #endif + mutex_unlock(&info->lock); } put_cpu_var(irql_info); } @@ -845,12 +851,12 @@ "1:\t" " xchgl %1, %0\n\t" " testl %1, %1\n\t" - " je 3f\n" + " jz 3f\n" "2:\t" " rep; nop\n\t" " cmpl %2, %0\n\t" - " jne 2b\n\t" - " jmp 1b\n" + " je 1b\n\t" + " jmp 2b\n" "3:\n\t" : "+m" (*lock) : "r" (NT_SPIN_LOCK_LOCKED), "i" (NT_SPIN_LOCK_UNLOCKED)); diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/proc.c new/ndiswrapper-1.51/driver/proc.c --- old/ndiswrapper-1.49/driver/proc.c 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/proc.c 2007-12-18 02:01:34.000000000 +0100 @@ -357,6 +357,33 @@ res = mp_set_int(wnd, OID_GEN_CURRENT_PACKET_FILTER, i); if (res) WARNING("setting packet_filter failed: %08X", res); + } else if (!strcmp(setting, "reinit")) { + if (ndis_reinit(wnd) != NDIS_STATUS_SUCCESS) + return -EFAULT; + } else { + struct ndis_configuration_parameter param; + struct unicode_string key; + struct ansi_string ansi; + + if (!p) + return -EINVAL; + p++; + RtlInitAnsiString(&ansi, p); + if (RtlAnsiStringToUnicodeString(¶m.data.string, &ansi, + TRUE) != STATUS_SUCCESS) + EXIT1(return -EFAULT); + param.type = NdisParameterString; + RtlInitAnsiString(&ansi, setting); + if (RtlAnsiStringToUnicodeString(&key, &ansi, + TRUE) != STATUS_SUCCESS) { + RtlFreeUnicodeString(¶m.data.string); + EXIT1(return -EINVAL); + } + NdisWriteConfiguration(&res, wnd->nmb, &key, ¶m); + RtlFreeUnicodeString(&key); + RtlFreeUnicodeString(¶m.data.string); + if (res != NDIS_STATUS_SUCCESS) + return -EFAULT; } return count; } @@ -508,7 +535,7 @@ { struct proc_dir_entry *procfs_entry; - wrap_procfs_entry = proc_mkdir(DRIVER_NAME, proc_net); + wrap_procfs_entry = proc_mkdir(DRIVER_NAME, proc_net_root); if (wrap_procfs_entry == NULL) { ERROR("couldn't create procfs directory"); return -ENOMEM; @@ -535,5 +562,5 @@ if (wrap_procfs_entry == NULL) return; remove_proc_entry("debug", wrap_procfs_entry); - remove_proc_entry(DRIVER_NAME, proc_net); + remove_proc_entry(DRIVER_NAME, proc_net_root); } diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/driver/wrapndis.c new/ndiswrapper-1.51/driver/wrapndis.c --- old/ndiswrapper-1.49/driver/wrapndis.c 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/driver/wrapndis.c 2007-12-18 02:01:34.000000000 +0100 @@ -398,20 +398,22 @@ TRACE1("new mac: %s", mac_string); RtlInitAnsiString(&ansi, mac_string); - if (RtlAnsiStringToUnicodeString(¶m.data.string, &ansi, TRUE)) { - RtlFreeUnicodeString(&key); + if (RtlAnsiStringToUnicodeString(¶m.data.string, &ansi, + TRUE) != STATUS_SUCCESS) EXIT1(return -EINVAL); - } + param.type = NdisParameterString; RtlInitAnsiString(&ansi, "NetworkAddress"); - if (RtlAnsiStringToUnicodeString(&key, &ansi, TRUE)) + if (RtlAnsiStringToUnicodeString(&key, &ansi, TRUE) != STATUS_SUCCESS) { + RtlFreeUnicodeString(¶m.data.string); EXIT1(return -EINVAL); + } NdisWriteConfiguration(&res, wnd->nmb, &key, ¶m); RtlFreeUnicodeString(&key); RtlFreeUnicodeString(¶m.data.string); if (res != NDIS_STATUS_SUCCESS) - EXIT1(return -EINVAL); + EXIT1(return -EFAULT); if (ndis_reinit(wnd) == NDIS_STATUS_SUCCESS) { res = mp_query(wnd, OID_802_3_CURRENT_ADDRESS, mac, sizeof(mac)); @@ -456,9 +458,9 @@ sg_element->address = PCI_DMA_MAP_SINGLE(wnd->wd->pci.pdev, skb->data, skb_headlen(skb), PCI_DMA_TODEVICE); - sg_element++; - for (i = 0; i < skb_shinfo(skb)->nr_frags; i++, sg_element++) { + for (i = 0; i < skb_shinfo(skb)->nr_frags; i++) { skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; + sg_element++; sg_element->length = frag->size; sg_element->address = pci_map_page(wnd->wd->pci.pdev, frag->page, @@ -971,10 +973,6 @@ union iwreq_data wrqu; NDIS_STATUS res; const int assoc_size = sizeof(*ndis_assoc_info) + IW_CUSTOM_MAX + 32; -#if WIRELESS_EXT <= 17 - unsigned char *wpa_assoc_info, *ies; - unsigned char *p; -#endif #endif ENTER2(""); @@ -1008,41 +1006,6 @@ ((char *)ndis_assoc_info) + ndis_assoc_info->offset_resp_ies); } -#else - /* we need 28 extra bytes for the format strings */ - if ((ndis_assoc_info->req_ie_length + - ndis_assoc_info->resp_ie_length + 28) > IW_CUSTOM_MAX) { - WARNING("information element is too long! (%u,%u)," - "association information dropped", - ndis_assoc_info->req_ie_length, - ndis_assoc_info->resp_ie_length); - kfree(ndis_assoc_info); - goto send_assoc_event; - } - - wpa_assoc_info = kmalloc(IW_CUSTOM_MAX, GFP_KERNEL); - if (!wpa_assoc_info) { - ERROR("couldn't allocate memory"); - kfree(ndis_assoc_info); - goto send_assoc_event; - } - p = wpa_assoc_info; - p += sprintf(p, "ASSOCINFO(ReqIEs="); - memcpy(p, ((char *)ndis_assoc_info) + ndis_assoc_info->offset_req_ies, - ndis_assoc_info->req_ie_length); - p += ndis_assoc_info->req_ie_length; - - p += sprintf(p, " RespIEs="); - memcpy(p, ((char *)ndis_assoc_info) + ndis_assoc_info->offset_resp_ies, - ndis_assoc_info->resp_ie_length); - p += ndis_assoc_info->resp_ie_length; - - p += sprintf(p, ")"); - - wrqu.data.length = p - wpa_assoc_info; - wireless_send_event(wnd->net_dev, IWEVCUSTOM, &wrqu, wpa_assoc_info); - - kfree(wpa_assoc_info); #endif kfree(ndis_assoc_info); @@ -1132,9 +1095,6 @@ wnd = worker_param_data(param, struct wrap_ndis_device, wrap_ndis_work); WORKTRACE("0x%lx", wnd->wrap_ndis_pending_work); - if (test_bit(SHUTDOWN, &wnd->wrap_ndis_pending_work)) - WORKEXIT(return); - if (test_and_clear_bit(NETIF_WAKEQ, &wnd->wrap_ndis_pending_work)) { netif_tx_lock_bh(wnd->net_dev); netif_wake_queue(wnd->net_dev); @@ -1770,9 +1730,9 @@ net_dev = wnd->net_dev; get_supported_oids(wnd); + memset(mac, 0, sizeof(mac)); status = mp_query(wnd, OID_802_3_CURRENT_ADDRESS, mac, sizeof(mac)); - if (status != NDIS_STATUS_SUCCESS || - memcmp(mac, "\x00\x00\x00\x00\x00\x00", sizeof(mac)) == 0) { + if (memcmp(mac, "\x00\x00\x00\x00\x00\x00", sizeof(mac)) == 0) { status = mp_query(wnd, OID_802_3_PERMANENT_ADDRESS, mac, sizeof(mac)); if (status != NDIS_STATUS_SUCCESS) { @@ -1781,10 +1741,10 @@ } } TRACE1("mac:" MACSTRSEP, MAC2STR(mac)); - memcpy(&net_dev->dev_addr, mac, ETH_ALEN); + memcpy(net_dev->dev_addr, mac, ETH_ALEN); strncpy(net_dev->name, if_name, IFNAMSIZ - 1); - net_dev->name[IFNAMSIZ - 1] = '\0'; + net_dev->name[IFNAMSIZ - 1] = 0; wnd->packet_filter = NDIS_PACKET_TYPE_DIRECTED | NDIS_PACKET_TYPE_BROADCAST | NDIS_PACKET_TYPE_MULTICAST; @@ -1952,7 +1912,6 @@ /* prevent setting essid during disassociation */ memset(&wnd->essid, 0, sizeof(wnd->essid)); - set_bit(SHUTDOWN, &wnd->wrap_ndis_pending_work); wnd->tx_ok = 0; if (wnd->max_tx_packets) unregister_netdev(wnd->net_dev); @@ -1968,13 +1927,12 @@ tx_pending = TX_RING_SIZE - 1; wnd->is_tx_ring_full = 0; /* throw away pending packets */ - while (tx_pending > 0) { + while (tx_pending-- > 0) { struct ndis_packet *packet; packet = wnd->tx_ring[wnd->tx_ring_start]; free_tx_packet(wnd, packet, NDIS_STATUS_CLOSING); wnd->tx_ring_start = (wnd->tx_ring_start + 1) % TX_RING_SIZE; - tx_pending--; } spin_unlock_bh(&wnd->tx_ring_lock); up(&wnd->tx_ring_mutex); @@ -2022,7 +1980,6 @@ } wd = pdo->reserved; #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) - SET_MODULE_OWNER(net_dev); if (wrap_is_pci_bus(wd->dev_bus)) SET_NETDEV_DEV(net_dev, &wd->pci.pdev->dev); if (wrap_is_usb_bus(wd->dev_bus)) diff -urN --exclude=CVS --exclude=.cvsignore --exclude=.svn --exclude=.svnignore old/ndiswrapper-1.49/ndiswrapper.spec new/ndiswrapper-1.51/ndiswrapper.spec --- old/ndiswrapper-1.49/ndiswrapper.spec 2007-10-28 07:18:44.000000000 +0100 +++ new/ndiswrapper-1.51/ndiswrapper.spec 2007-12-18 02:01:34.000000000 +0100 @@ -1,5 +1,5 @@ # Define ndiswrapper_version only if it is not already defined. -%{!?ndiswrapper_version: %define ndiswrapper_version 1.49} +%{!?ndiswrapper_version: %define ndiswrapper_version 1.51} %{!?ndiswrapper_release: %define ndiswrapper_release 1} # Define kernel version if not already defined ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... --------------------------------------------------------------------- To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-commit+help@opensuse.org
participants (1)
-
root@Hilbert.suse.de