Deleted Added
full compact
kern_ndis.c (151451) kern_ndis.c (151691)
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/kern_ndis.c 151451 2005-10-18 19:52:15Z wpaul $");
34__FBSDID("$FreeBSD: head/sys/compat/ndis/kern_ndis.c 151691 2005-10-26 06:52:57Z wpaul $");
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/unistd.h>
39#include <sys/types.h>
40#include <sys/errno.h>
41#include <sys/callout.h>
42#include <sys/socket.h>

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

1103 KeResetEvent(&sc->ndis_block->nmb_resetevent);
1104 KeWaitForSingleObject(&sc->ndis_block->nmb_resetevent,
1105 0, 0, FALSE, NULL);
1106 }
1107
1108 return(0);
1109}
1110
35
36#include <sys/param.h>
37#include <sys/systm.h>
38#include <sys/unistd.h>
39#include <sys/types.h>
40#include <sys/errno.h>
41#include <sys/callout.h>
42#include <sys/socket.h>

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

1103 KeResetEvent(&sc->ndis_block->nmb_resetevent);
1104 KeWaitForSingleObject(&sc->ndis_block->nmb_resetevent,
1105 0, 0, FALSE, NULL);
1106 }
1107
1108 return(0);
1109}
1110
1111#undef NDIS_REAP_TIMERS
1112
1113int
1114ndis_halt_nic(arg)
1115 void *arg;
1116{
1117 struct ndis_softc *sc;
1118 ndis_handle adapter;
1119 ndis_halt_handler haltfunc;
1111int
1112ndis_halt_nic(arg)
1113 void *arg;
1114{
1115 struct ndis_softc *sc;
1116 ndis_handle adapter;
1117 ndis_halt_handler haltfunc;
1120#ifdef NDIS_REAP_TIMERS
1121 ndis_miniport_timer *t, *n;
1122#endif
1123 ndis_miniport_block *block;
1124 int empty = 0;
1125 uint8_t irql;
1126
1127 sc = arg;
1128 block = sc->ndis_block;
1129
1118 ndis_miniport_block *block;
1119 int empty = 0;
1120 uint8_t irql;
1121
1122 sc = arg;
1123 block = sc->ndis_block;
1124
1130#ifdef NDIS_REAP_TIMERS
1131 /*
1132 * Drivers are sometimes very lax about cancelling all
1133 * their timers. Cancel them all ourselves, just to be
1134 * safe. We must do this before invoking MiniportHalt(),
1135 * since if we wait until after, the memory in which
1136 * the timers reside will no longer be valid.
1137 */
1138
1139 t = sc->ndis_block->nmb_timerlist;
1140 while (t != NULL) {
1141 KeCancelTimer(&t->nmt_ktimer);
1142 n = t;
1143 t = t->nmt_nexttimer;
1144 n->nmt_nexttimer = NULL;
1145 }
1146 sc->ndis_block->nmb_timerlist = NULL;
1147#endif
1148 if (!cold)
1149 KeFlushQueuedDpcs();
1150
1151 /*
1152 * Wait for all packets to be returned.
1153 */
1154
1155 while (1) {

--- 401 unchanged lines hidden ---
1125 if (!cold)
1126 KeFlushQueuedDpcs();
1127
1128 /*
1129 * Wait for all packets to be returned.
1130 */
1131
1132 while (1) {

--- 401 unchanged lines hidden ---