From patchwork Wed May 19 16:50:57 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tim Gardner X-Patchwork-Id: 52999 X-Patchwork-Delegate: leann.ogasawara@canonical.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 9F5C3B7D4C for ; Thu, 20 May 2010 02:51:58 +1000 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OEmUq-0000gC-HR; Wed, 19 May 2010 17:51:52 +0100 Received: from mail.tpi.com ([70.99.223.143]) by chlorine.canonical.com with esmtp (Exim 4.69) (envelope-from ) id 1OEmUm-0000g7-HH for kernel-team@lists.ubuntu.com; Wed, 19 May 2010 17:51:49 +0100 Received: from sepang.rtg.net (unknown [10.0.2.5]) by mail.tpi.com (Postfix) with ESMTP id E95802439BF; Wed, 19 May 2010 09:50:48 -0700 (PDT) Received: by sepang.rtg.net (Postfix, from userid 1000) id 18C17F899A; Wed, 19 May 2010 10:50:57 -0600 (MDT) To: leann.ogasawara@canonical.com Subject: Maverick pull request, update ndiswrapper LP582555 Message-Id: <20100519165058.18C17F899A@sepang.rtg.net> Date: Wed, 19 May 2010 10:50:57 -0600 (MDT) From: timg@tpi.com (Tim Gardner) Cc: kernel-team@lists.ubuntu.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.9 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com The following changes since commit 3108c5784e934fecc2a8b16ff6a36df3c461bd40: Leann Ogasawara (1): UBUNTU: Ubuntu-2.6.34-3.10 are available in the git repository at: git://kernel.ubuntu.com/rtg/ubuntu-maverick.git lp582555 Tim Gardner (1): UBUNTU: SAUCE: Updated ndiswrapper to 1.56 ubuntu/ndiswrapper/loader.c | 2 +- ubuntu/ndiswrapper/ndiswrapper.h | 2 +- ubuntu/ndiswrapper/ntoskernel.h | 6 ++-- ubuntu/ndiswrapper/pe_linker.c | 64 ++++++++++++++++---------------------- ubuntu/ndiswrapper/usb.c | 2 +- ubuntu/ndiswrapper/wrapndis.c | 4 +- 6 files changed, 35 insertions(+), 45 deletions(-) From c254875e48a028963fb6663b0e3ed8106cc11710 Mon Sep 17 00:00:00 2001 From: Tim Gardner Date: Wed, 19 May 2010 09:17:26 -0600 Subject: [PATCH] UBUNTU: SAUCE: Updated ndiswrapper to 1.56 BugLink: http://bugs.launchpad.net/bugs/582555 Signed-off-by: Tim Gardner --- ubuntu/ndiswrapper/loader.c | 2 +- ubuntu/ndiswrapper/ndiswrapper.h | 2 +- ubuntu/ndiswrapper/ntoskernel.h | 6 ++-- ubuntu/ndiswrapper/pe_linker.c | 64 ++++++++++++++++---------------------- ubuntu/ndiswrapper/usb.c | 2 +- ubuntu/ndiswrapper/wrapndis.c | 4 +- 6 files changed, 35 insertions(+), 45 deletions(-) diff --git a/ubuntu/ndiswrapper/loader.c b/ubuntu/ndiswrapper/loader.c index e1be090..5c231c7 100644 --- a/ubuntu/ndiswrapper/loader.c +++ b/ubuntu/ndiswrapper/loader.c @@ -847,7 +847,7 @@ int loader_init(void) InitializeListHead(&wrap_drivers); InitializeListHead(&wrap_devices); - init_MUTEX(&loader_mutex); + sema_init(&loader_mutex, 1); init_completion(&loader_complete); if ((err = misc_register(&wrapper_misc)) < 0 ) { ERROR("couldn't register module (%d)", err); diff --git a/ubuntu/ndiswrapper/ndiswrapper.h b/ubuntu/ndiswrapper/ndiswrapper.h index ae7b963..a7187e8 100644 --- a/ubuntu/ndiswrapper/ndiswrapper.h +++ b/ubuntu/ndiswrapper/ndiswrapper.h @@ -16,7 +16,7 @@ #ifndef _NDISWRAPPER_H_ #define _NDISWRAPPER_H_ -#define DRIVER_VERSION "1.55" +#define DRIVER_VERSION "1.56" #define UTILS_VERSION "1.9" #define DRIVER_NAME "ndiswrapper" diff --git a/ubuntu/ndiswrapper/ntoskernel.h b/ubuntu/ndiswrapper/ntoskernel.h index 46aeb53..ff0535b 100644 --- a/ubuntu/ndiswrapper/ntoskernel.h +++ b/ubuntu/ndiswrapper/ntoskernel.h @@ -875,7 +875,7 @@ static inline struct nt_slist *PopEntrySList(nt_slist_header *head, #define u64_low_32(x) ((u32)x) #define u64_high_32(x) ((u32)(x >> 32)) -static inline u64 cmpxchg8b(volatile u64 *ptr, u64 old, u64 new) +static inline u64 nt_cmpxchg8b(volatile u64 *ptr, u64 old, u64 new) { u64 prev; @@ -900,7 +900,7 @@ static inline struct nt_slist *PushEntrySList(nt_slist_header *head, entry->next = old.next; new.next = entry; new.depth = old.depth + 1; - } while (cmpxchg8b(&head->align, old.align, new.align) != old.align); + } while (nt_cmpxchg8b(&head->align, old.align, new.align) != old.align); TRACE4("%p, %p, %p", head, entry, old.next); return old.next; } @@ -917,7 +917,7 @@ static inline struct nt_slist *PopEntrySList(nt_slist_header *head, break; new.next = entry->next; new.depth = old.depth - 1; - } while (cmpxchg8b(&head->align, old.align, new.align) != old.align); + } while (nt_cmpxchg8b(&head->align, old.align, new.align) != old.align); TRACE4("%p, %p", head, entry); return entry; } diff --git a/ubuntu/ndiswrapper/pe_linker.c b/ubuntu/ndiswrapper/pe_linker.c index 46badd1..b2637ff 100644 --- a/ubuntu/ndiswrapper/pe_linker.c +++ b/ubuntu/ndiswrapper/pe_linker.c @@ -73,45 +73,36 @@ extern struct wrap_export ntoskernel_exports[], ntoskernel_io_exports[], extern struct wrap_export usb_exports[]; #endif -static char *get_export(char *name) +static int get_export(char *name, generic_func *func) { - int i; - - for (i = 0 ; ntoskernel_exports[i].name != NULL; i++) - if (strcmp(ntoskernel_exports[i].name, name) == 0) - return (char *)ntoskernel_exports[i].func; - - for (i = 0 ; ntoskernel_io_exports[i].name != NULL; i++) - if (strcmp(ntoskernel_io_exports[i].name, name) == 0) - return (char *)ntoskernel_io_exports[i].func; - - for (i = 0 ; ndis_exports[i].name != NULL; i++) - if (strcmp(ndis_exports[i].name, name) == 0) - return (char *)ndis_exports[i].func; - - for (i = 0 ; crt_exports[i].name != NULL; i++) - if (strcmp(crt_exports[i].name, name) == 0) - return (char *)crt_exports[i].func; - - for (i = 0 ; hal_exports[i].name != NULL; i++) - if (strcmp(hal_exports[i].name, name) == 0) - return (char *)hal_exports[i].func; - - for (i = 0 ; rtl_exports[i].name != NULL; i++) - if (strcmp(rtl_exports[i].name, name) == 0) - return (char *)rtl_exports[i].func; - + int i, j; + + struct wrap_export *exports[] = { + ntoskernel_exports, + ntoskernel_io_exports, + ndis_exports, + crt_exports, + hal_exports, + rtl_exports, #ifdef ENABLE_USB - for (i = 0 ; usb_exports[i].name != NULL; i++) - if (strcmp(usb_exports[i].name, name) == 0) - return (char *)usb_exports[i].func; + usb_exports, #endif + }; + + for (j = 0; j < ARRAY_SIZE(exports); j++) + for (i = 0; exports[j][i].name != NULL; i++) + if (strcmp(exports[j][i].name, name) == 0) { + *func = exports[j][i].func; + return 0; + } for (i = 0; i < num_pe_exports; i++) - if (strcmp(pe_exports[i].name, name) == 0) - return (char *)pe_exports[i].addr; + if (strcmp(pe_exports[i].name, name) == 0) { + *func = pe_exports[i].addr; + return 0; + } - return NULL; + return -1; } #endif // TEST_LOADER @@ -220,7 +211,7 @@ static int import(void *image, IMAGE_IMPORT_DESCRIPTOR *dirent, char *dll) char *symname = NULL; int i; int ret = 0; - void *adr; + generic_func adr; lookup_tbl = RVA2VA(image, dirent->u.OriginalFirstThunk, ULONG_PTR *); address_tbl = RVA2VA(image, dirent->FirstThunk, ULONG_PTR *); @@ -237,10 +228,9 @@ static int import(void *image, IMAGE_IMPORT_DESCRIPTOR *dirent, char *dll) ~IMAGE_ORDINAL_FLAG) + 2), char *); } - adr = get_export(symname); - if (adr == NULL) { + ret = get_export(symname, &adr); + if (ret < 0) { ERROR("unknown symbol: %s:'%s'", dll, symname); - ret = -1; } else { DBGLINKER("found symbol: %s:%s: addr: %p, rva = %Lu", dll, symname, adr, (uint64_t)address_tbl[i]); diff --git a/ubuntu/ndiswrapper/usb.c b/ubuntu/ndiswrapper/usb.c index 81a17b3..f2ddfb4 100644 --- a/ubuntu/ndiswrapper/usb.c +++ b/ubuntu/ndiswrapper/usb.c @@ -234,7 +234,7 @@ wstdcall void wrap_cancel_irp(struct device_object *dev_obj, struct irp *irp) USBTRACE("canceling urb %p", urb); if (wrap_cancel_urb(IRP_WRAP_URB(irp))) { irp->cancel = FALSE; - ERROR("urb %p can't be canceld: %d", urb, + ERROR("urb %p can't be canceled: %d", urb, IRP_WRAP_URB(irp)->state); } else USBTRACE("urb %p canceled", urb); diff --git a/ubuntu/ndiswrapper/wrapndis.c b/ubuntu/ndiswrapper/wrapndis.c index 3de1fbd..404e1e3 100644 --- a/ubuntu/ndiswrapper/wrapndis.c +++ b/ubuntu/ndiswrapper/wrapndis.c @@ -2064,8 +2064,8 @@ static wstdcall NTSTATUS NdisAddDevice(struct driver_object *drv_obj, } nmb->next_device = IoAttachDeviceToDeviceStack(fdo, pdo); spin_lock_init(&wnd->tx_ring_lock); - init_MUTEX(&wnd->tx_ring_mutex); - init_MUTEX(&wnd->ndis_req_mutex); + sema_init(&wnd->tx_ring_mutex, 1); + sema_init(&wnd->ndis_req_mutex, 1); wnd->ndis_req_done = 0; initialize_work(&wnd->tx_work, tx_worker, wnd); wnd->tx_ring_start = 0;