Deleted Added
full compact
kern_ndis.c (123846) kern_ndis.c (123848)
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 123846 2003-12-26 02:20:54Z green $");
34__FBSDID("$FreeBSD: head/sys/compat/ndis/kern_ndis.c 123848 2003-12-26 03:31:34Z wpaul $");
35
36#include <sys/param.h>
37#include <sys/types.h>
38#include <sys/errno.h>
39#include <sys/callout.h>
40#include <sys/socket.h>
41#include <sys/queue.h>
42#include <sys/sysctl.h>

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

76#define NDIS_DUMMY_PATH "\\\\some\\bogus\\path"
77
78__stdcall static void ndis_status_func(ndis_handle, ndis_status,
79 void *, uint32_t);
80__stdcall static void ndis_statusdone_func(ndis_handle);
81__stdcall static void ndis_setdone_func(ndis_handle, ndis_status);
82__stdcall static void ndis_getdone_func(ndis_handle, ndis_status);
83__stdcall static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t);
35
36#include <sys/param.h>
37#include <sys/types.h>
38#include <sys/errno.h>
39#include <sys/callout.h>
40#include <sys/socket.h>
41#include <sys/queue.h>
42#include <sys/sysctl.h>

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

76#define NDIS_DUMMY_PATH "\\\\some\\bogus\\path"
77
78__stdcall static void ndis_status_func(ndis_handle, ndis_status,
79 void *, uint32_t);
80__stdcall static void ndis_statusdone_func(ndis_handle);
81__stdcall static void ndis_setdone_func(ndis_handle, ndis_status);
82__stdcall static void ndis_getdone_func(ndis_handle, ndis_status);
83__stdcall static void ndis_resetdone_func(ndis_handle, ndis_status, uint8_t);
84static void ndis_free_packet_and_bufs(ndis_packet *);
85
86/*
87 * This allows us to export our symbols to other modules.
88 * Note that we call ourselves 'ndisapi' to avoid a namespace
89 * collision with if_ndis.ko, which internally calls itself
90 * 'ndis.'
91 */
92static int

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

324 free(cfg->ndis_cfg.nc_cfgdesc, M_DEVBUF);
325 free(cfg, M_DEVBUF);
326 }
327
328 return(0);
329}
330
331void
84
85/*
86 * This allows us to export our symbols to other modules.
87 * Note that we call ourselves 'ndisapi' to avoid a namespace
88 * collision with if_ndis.ko, which internally calls itself
89 * 'ndis.'
90 */
91static int

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

323 free(cfg->ndis_cfg.nc_cfgdesc, M_DEVBUF);
324 free(cfg, M_DEVBUF);
325 }
326
327 return(0);
328}
329
330void
332ndis_free_bufs(b0)
333 ndis_buffer *b0;
334{
335 ndis_buffer *next;
336
337 if (b0 == NULL)
338 return;
339
340 while(b0 != NULL) {
341 next = b0->nb_next;
342 ndis_free_buf(b0);
343 b0 = next;
344 }
345
346 return;
347}
348
349static void
350ndis_free_packet_and_bufs(p)
351 ndis_packet *p;
352{
353 if (p == NULL)
354 return;
355
356 ndis_free_bufs(p->np_private.npp_head);
357 p->np_private.npp_head = NULL;
358 ndis_free_packet(p);
359
360 return;
361}
362
363void
364ndis_return_packet(buf, arg)
365 void *buf; /* not used */
366 void *arg;
367{
368 struct ndis_softc *sc;
369 ndis_handle adapter;
370 ndis_packet *p;
371 __stdcall ndis_return_handler returnfunc;

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

380
381 /* Release packet when refcount hits zero, otherwise return. */
382 if (p->np_refcnt)
383 return;
384
385 sc = p->np_softc;
386 returnfunc = sc->ndis_chars.nmc_return_packet_func;
387 adapter = sc->ndis_block.nmb_miniportadapterctx;
331ndis_return_packet(buf, arg)
332 void *buf; /* not used */
333 void *arg;
334{
335 struct ndis_softc *sc;
336 ndis_handle adapter;
337 ndis_packet *p;
338 __stdcall ndis_return_handler returnfunc;

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

347
348 /* Release packet when refcount hits zero, otherwise return. */
349 if (p->np_refcnt)
350 return;
351
352 sc = p->np_softc;
353 returnfunc = sc->ndis_chars.nmc_return_packet_func;
354 adapter = sc->ndis_block.nmb_miniportadapterctx;
388 if (returnfunc == NULL || p->np_oob.npo_status != NDIS_STATUS_PENDING)
389 ndis_free_packet_and_bufs(p);
355 if (returnfunc == NULL)
356 ndis_free_packet(p);
390 else
391 returnfunc(adapter, p);
392 return;
393}
394
357 else
358 returnfunc(adapter, p);
359 return;
360}
361
362void
363ndis_free_bufs(b0)
364 ndis_buffer *b0;
365{
366 ndis_buffer *next;
367
368 if (b0 == NULL)
369 return;
370
371 while(b0 != NULL) {
372 next = b0->nb_next;
373 free (b0, M_DEVBUF);
374 b0 = next;
375 }
376
377 return;
378}
379
380void
381ndis_free_packet(p)
382 ndis_packet *p;
383{
384 if (p == NULL)
385 return;
386
387 ndis_free_bufs(p->np_private.npp_head);
388 free(p, M_DEVBUF);
389
390 return;
391}
392
395int
396ndis_convert_res(arg)
397 void *arg;
398{
399 struct ndis_softc *sc;
400 ndis_resource_list *rl = NULL;
401 cm_partial_resource_desc *prd = NULL;
402 ndis_miniport_block *block;

--- 699 unchanged lines hidden ---
393int
394ndis_convert_res(arg)
395 void *arg;
396{
397 struct ndis_softc *sc;
398 ndis_resource_list *rl = NULL;
399 cm_partial_resource_desc *prd = NULL;
400 ndis_miniport_block *block;

--- 699 unchanged lines hidden ---