subr_ndis.c (124165) | subr_ndis.c (124173) |
---|---|
1/* 2 * Copyright (c) 2003 3 * Bill Paul <wpaul@windriver.com>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> | 1/* 2 * Copyright (c) 2003 3 * Bill Paul <wpaul@windriver.com>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 */ 32 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/sys/compat/ndis/subr_ndis.c 124165 2004-01-06 07:09:26Z wpaul $"); | 34__FBSDID("$FreeBSD: head/sys/compat/ndis/subr_ndis.c 124173 2004-01-06 18:06:54Z wpaul $"); |
35 36/* 37 * This file implements a translation layer between the BSD networking 38 * infrasturcture and Windows(R) NDIS network driver modules. A Windows 39 * NDIS driver calls into several functions in the NDIS.SYS Windows 40 * kernel module and exports a table of functions designed to be called 41 * by the NDIS subsystem. Using the PE loader, we can patch our own 42 * versions of the NDIS routines into a given Windows driver module and --- 747 unchanged lines hidden (view full) --- 790 * have to declare it this way. 791 */ 792static void 793ndis_syslog(ndis_handle adapter, ndis_error_code code, 794 uint32_t numerrors, ...) 795{ 796 ndis_miniport_block *block; 797 va_list ap; | 35 36/* 37 * This file implements a translation layer between the BSD networking 38 * infrasturcture and Windows(R) NDIS network driver modules. A Windows 39 * NDIS driver calls into several functions in the NDIS.SYS Windows 40 * kernel module and exports a table of functions designed to be called 41 * by the NDIS subsystem. Using the PE loader, we can patch our own 42 * versions of the NDIS routines into a given Windows driver module and --- 747 unchanged lines hidden (view full) --- 790 * have to declare it this way. 791 */ 792static void 793ndis_syslog(ndis_handle adapter, ndis_error_code code, 794 uint32_t numerrors, ...) 795{ 796 ndis_miniport_block *block; 797 va_list ap; |
798 int i; 799 char *str = NULL; | 798 int i, error; 799 char *str = NULL, *ustr = NULL; 800 uint16_t flags; |
800 801 block = (ndis_miniport_block *)adapter; 802 | 801 802 block = (ndis_miniport_block *)adapter; 803 |
803 pe_get_message(block->nmb_img, code, &str, &i); | 804 error = pe_get_message(block->nmb_img, code, &str, &i, &flags); 805 if (error == 0 && flags & MESSAGE_RESOURCE_UNICODE) { 806 ndis_unicode_to_ascii((uint16_t *)str, i, &ustr); 807 str = ustr; 808 } |
804 device_printf (block->nmb_dev, "NDIS ERROR: %x (%s)\n", code, 805 str == NULL ? "unknown error" : str); 806 device_printf (block->nmb_dev, "NDIS NUMERRORS: %x\n", numerrors); 807 808 va_start(ap, numerrors); 809 for (i = 0; i < numerrors; i++) 810 device_printf (block->nmb_dev, "argptr: %p\n", 811 va_arg(ap, void *)); 812 va_end(ap); 813 | 809 device_printf (block->nmb_dev, "NDIS ERROR: %x (%s)\n", code, 810 str == NULL ? "unknown error" : str); 811 device_printf (block->nmb_dev, "NDIS NUMERRORS: %x\n", numerrors); 812 813 va_start(ap, numerrors); 814 for (i = 0; i < numerrors; i++) 815 device_printf (block->nmb_dev, "argptr: %p\n", 816 va_arg(ap, void *)); 817 va_end(ap); 818 |
819 if (ustr != NULL) 820 free(ustr, M_DEVBUF); |
|
814 return; 815} 816 817static void 818ndis_map_cb(arg, segs, nseg, error) 819 void *arg; 820 bus_dma_segment_t *segs; 821 int nseg; --- 1729 unchanged lines hidden --- | 821 return; 822} 823 824static void 825ndis_map_cb(arg, segs, nseg, error) 826 void *arg; 827 bus_dma_segment_t *segs; 828 int nseg; --- 1729 unchanged lines hidden --- |