diff options
author | Tim Gardner <tim.gardner@canonical.com> | 2010-05-19 09:17:26 -0600 |
---|---|---|
committer | Tim Gardner <tim.gardner@canonical.com> | 2012-03-19 11:28:01 -0600 |
commit | 82cb732a4f81f4bcc35c89fdb30443e420a5fdf8 (patch) | |
tree | 96c82299045fa35bce815779c5d1200bfc06df41 /ubuntu | |
parent | 653cf4dc80da7052623c89cc88beed5238a2f014 (diff) |
UBUNTU: ubuntu: Updated ndiswrapper to 1.56
BugLink: http://bugs.launchpad.net/bugs/582555
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Signed-off-by: Leann Ogasawara <leann.ogasawara@canonical.com>
Diffstat (limited to 'ubuntu')
-rw-r--r-- | ubuntu/ndiswrapper/loader.c | 2 | ||||
-rw-r--r-- | ubuntu/ndiswrapper/ndiswrapper.h | 2 | ||||
-rw-r--r-- | ubuntu/ndiswrapper/ntoskernel.h | 6 | ||||
-rw-r--r-- | ubuntu/ndiswrapper/pe_linker.c | 64 | ||||
-rw-r--r-- | ubuntu/ndiswrapper/usb.c | 2 | ||||
-rw-r--r-- | 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 e1be090487a..5c231c71a47 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 ae7b9638e11..a7187e8e07b 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 46aeb5322ae..ff0535bc0e9 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 46badd1ce99..b2637ff98b5 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 81a17b36cdb..f2ddfb4353a 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 3de1fbd92f6..404e1e37975 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; |