Deleted Added
sdiff udiff text old ( 151606 ) new ( 151691 )
full compact
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 151691 2005-10-26 06:52:57Z 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

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

1252 */
1253static void
1254NdisMInitializeTimer(timer, handle, func, ctx)
1255 ndis_miniport_timer *timer;
1256 ndis_handle handle;
1257 ndis_timer_function func;
1258 void *ctx;
1259{
1260 /* Save the driver's funcptr and context */
1261
1262 timer->nmt_timerfunc = func;
1263 timer->nmt_timerctx = ctx;
1264 timer->nmt_block = handle;
1265
1266 /*
1267 * Set up the timer so it will call our intermediate DPC.
1268 * Be sure to use the wrapped entry point, since
1269 * ntoskrnl_run_dpc() expects to invoke a function with
1270 * Microsoft calling conventions.
1271 */
1272 KeInitializeTimer(&timer->nmt_ktimer);
1273 KeInitializeDpc(&timer->nmt_kdpc,
1274 ndis_findwrap((funcptr)ndis_timercall), timer);
1275 timer->nmt_ktimer.k_dpc = &timer->nmt_kdpc;
1276
1277 return;
1278}
1279
1280/*
1281 * In Windows, there's both an NdisMSetTimer() and an NdisSetTimer(),
1282 * but the former is just a macro wrapper around the latter.
1283 */
1284static void

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

1736
1737static ndis_status
1738NdisMMapIoSpace(vaddr, adapter, paddr, len)
1739 void **vaddr;
1740 ndis_handle adapter;
1741 ndis_physaddr paddr;
1742 uint32_t len;
1743{
1744 if (adapter == NULL)
1745 return(NDIS_STATUS_FAILURE);
1746
1747 *vaddr = MmMapIoSpace(paddr.np_quad, len, 0);
1748
1749 if (*vaddr == NULL)
1750 return(NDIS_STATUS_FAILURE);
1751
1752 return(NDIS_STATUS_SUCCESS);
1753}
1754
1755static void
1756NdisMUnmapIoSpace(adapter, vaddr, len)
1757 ndis_handle adapter;
1758 void *vaddr;
1759 uint32_t len;
1760{
1761 MmUnmapIoSpace(vaddr, len);
1762 return;
1763}
1764
1765static uint32_t
1766NdisGetCacheFillSize(void)
1767{
1768 return(128);
1769}

--- 1754 unchanged lines hidden ---