Deleted Added
full compact
subr_ndis.c (123488) subr_ndis.c (123504)
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 123488 2003-12-12 08:54:48Z wpaul $");
34__FBSDID("$FreeBSD: head/sys/compat/ndis/subr_ndis.c 123504 2003-12-12 22:35:13Z 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

--- 13 unchanged lines hidden (view full) ---

56#include <sys/callout.h>
57#include <sys/kernel.h>
58#include <sys/systm.h>
59#include <sys/malloc.h>
60#include <sys/lock.h>
61#include <sys/mutex.h>
62#include <sys/socket.h>
63#include <sys/sysctl.h>
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

--- 13 unchanged lines hidden (view full) ---

56#include <sys/callout.h>
57#include <sys/kernel.h>
58#include <sys/systm.h>
59#include <sys/malloc.h>
60#include <sys/lock.h>
61#include <sys/mutex.h>
62#include <sys/socket.h>
63#include <sys/sysctl.h>
64#include <sys/timespec.h>
64
65#include <net/if.h>
66#include <net/if_arp.h>
67#include <net/ethernet.h>
68#include <net/if_dl.h>
69#include <net/if_media.h>
70
71#include <machine/bus_memio.h>

--- 130 unchanged lines hidden (view full) ---

202__stdcall static ndis_list_entry *ndis_insert_head(ndis_list_entry *,
203 ndis_list_entry *, ndis_spin_lock *);
204__stdcall static ndis_list_entry *ndis_remove_head(ndis_list_entry *,
205 ndis_spin_lock *);
206__stdcall static ndis_list_entry *ndis_insert_tail(ndis_list_entry *,
207 ndis_list_entry *, ndis_spin_lock *);
208__stdcall static uint8_t ndis_sync_with_intr(ndis_miniport_interrupt *,
209 void *, void *);
65
66#include <net/if.h>
67#include <net/if_arp.h>
68#include <net/ethernet.h>
69#include <net/if_dl.h>
70#include <net/if_media.h>
71
72#include <machine/bus_memio.h>

--- 130 unchanged lines hidden (view full) ---

203__stdcall static ndis_list_entry *ndis_insert_head(ndis_list_entry *,
204 ndis_list_entry *, ndis_spin_lock *);
205__stdcall static ndis_list_entry *ndis_remove_head(ndis_list_entry *,
206 ndis_spin_lock *);
207__stdcall static ndis_list_entry *ndis_insert_tail(ndis_list_entry *,
208 ndis_list_entry *, ndis_spin_lock *);
209__stdcall static uint8_t ndis_sync_with_intr(ndis_miniport_interrupt *,
210 void *, void *);
211__stdcall static void ndis_time(uint64_t *);
210__stdcall static void dummy(void);
211
212
213int
214ndis_libinit()
215{
216 if (ndis_inits) {
217 ndis_inits++;

--- 1616 unchanged lines hidden (view full) ---

1834
1835 if (syncfunc == NULL || syncctx == NULL)
1836 return(0);
1837
1838 sync = syncfunc;
1839 return(sync(syncctx));
1840}
1841
212__stdcall static void dummy(void);
213
214
215int
216ndis_libinit()
217{
218 if (ndis_inits) {
219 ndis_inits++;

--- 1616 unchanged lines hidden (view full) ---

1836
1837 if (syncfunc == NULL || syncctx == NULL)
1838 return(0);
1839
1840 sync = syncfunc;
1841 return(sync(syncctx));
1842}
1843
1844/*
1845 * Return the number of 100 nanosecond intervals since
1846 * January 1, 1601. (?!?!)
1847 */
1842__stdcall static void
1848__stdcall static void
1849ndis_time(tval)
1850 uint64_t *tval;
1851{
1852 struct timespec ts;
1853 nanotime(&ts);
1854 *tval = (ts.tv_nsec / 100) + (ts.tv_nsec * 10000000);
1855 return;
1856}
1857
1858__stdcall static void
1843dummy()
1844{
1845 printf ("NDIS dummy called...\n");
1846 return;
1847}
1848
1849image_patch_table ndis_functbl[] = {
1859dummy()
1860{
1861 printf ("NDIS dummy called...\n");
1862 return;
1863}
1864
1865image_patch_table ndis_functbl[] = {
1866 { "NdisGetCurrentSystemTime", (FUNC)ndis_time },
1850 { "NdisMSynchronizeWithInterrupt", (FUNC)ndis_sync_with_intr },
1851 { "NdisMAllocateSharedMemoryAsync", (FUNC)ndis_alloc_sharedmem_async },
1852 { "NdisInterlockedInsertHeadList", (FUNC)ndis_insert_head },
1853 { "NdisInterlockedInsertTailList", (FUNC)ndis_insert_tail },
1854 { "NdisInterlockedRemoveHeadList", (FUNC)ndis_remove_head },
1855 { "NdisInitializeWrapper", (FUNC)ndis_initwrap },
1856 { "NdisMRegisterMiniport", (FUNC)ndis_register_miniport },
1857 { "NdisAllocateMemoryWithTag", (FUNC)ndis_malloc_withtag },

--- 80 unchanged lines hidden ---
1867 { "NdisMSynchronizeWithInterrupt", (FUNC)ndis_sync_with_intr },
1868 { "NdisMAllocateSharedMemoryAsync", (FUNC)ndis_alloc_sharedmem_async },
1869 { "NdisInterlockedInsertHeadList", (FUNC)ndis_insert_head },
1870 { "NdisInterlockedInsertTailList", (FUNC)ndis_insert_tail },
1871 { "NdisInterlockedRemoveHeadList", (FUNC)ndis_remove_head },
1872 { "NdisInitializeWrapper", (FUNC)ndis_initwrap },
1873 { "NdisMRegisterMiniport", (FUNC)ndis_register_miniport },
1874 { "NdisAllocateMemoryWithTag", (FUNC)ndis_malloc_withtag },

--- 80 unchanged lines hidden ---