Deleted Added
full compact
if_nve.c (153204) if_nve.c (153333)
1/*-
2 * Copyright (c) 2005 by David E. O'Brien <obrien@FreeBSD.org>.
3 * Copyright (c) 2003,2004 by Quinton Dolan <q@onthenet.com.au>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

67 * as recent versions of DragonFly.
68 *
69 * Written by Quinton Dolan <q@onthenet.com.au>
70 * Portions based on existing FreeBSD network drivers.
71 * NVIDIA API usage derived from distributed NVIDIA NVNET driver source files.
72 */
73
74#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2005 by David E. O'Brien <obrien@FreeBSD.org>.
3 * Copyright (c) 2003,2004 by Quinton Dolan <q@onthenet.com.au>.
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

67 * as recent versions of DragonFly.
68 *
69 * Written by Quinton Dolan <q@onthenet.com.au>
70 * Portions based on existing FreeBSD network drivers.
71 * NVIDIA API usage derived from distributed NVIDIA NVNET driver source files.
72 */
73
74#include <sys/cdefs.h>
75__FBSDID("$FreeBSD: head/sys/dev/nve/if_nve.c 153204 2005-12-07 17:38:03Z obrien $");
75__FBSDID("$FreeBSD: head/sys/dev/nve/if_nve.c 153333 2005-12-12 06:23:43Z bz $");
76
77#include <sys/param.h>
78#include <sys/systm.h>
79#include <sys/sockio.h>
80#include <sys/mbuf.h>
81#include <sys/malloc.h>
82#include <sys/kernel.h>
83#include <sys/socket.h>

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

638
639 /* Do nothing if already running */
640 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
641 return;
642
643 nve_stop(sc);
644 DEBUGOUT(NVE_DEBUG_INIT, "nve: do pfnInit\n");
645
76
77#include <sys/param.h>
78#include <sys/systm.h>
79#include <sys/sockio.h>
80#include <sys/mbuf.h>
81#include <sys/malloc.h>
82#include <sys/kernel.h>
83#include <sys/socket.h>

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

638
639 /* Do nothing if already running */
640 if (ifp->if_drv_flags & IFF_DRV_RUNNING)
641 return;
642
643 nve_stop(sc);
644 DEBUGOUT(NVE_DEBUG_INIT, "nve: do pfnInit\n");
645
646 nve_ifmedia_upd_locked(ifp);
647
646 /* Setup Hardware interface and allocate memory structures */
647 error = sc->hwapi->pfnInit(sc->hwapi->pADCX,
648 0, /* force speed */
649 0, /* force full duplex */
650 0, /* force mode */
651 0, /* force async mode */
652 &sc->linkup);
653

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

658 }
659 /* Set the MAC address */
660 sc->hwapi->pfnSetNodeAddress(sc->hwapi->pADCX, IF_LLADDR(sc->ifp));
661 sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
662 sc->hwapi->pfnStart(sc->hwapi->pADCX);
663
664 /* Setup multicast filter */
665 nve_setmulti(sc);
648 /* Setup Hardware interface and allocate memory structures */
649 error = sc->hwapi->pfnInit(sc->hwapi->pADCX,
650 0, /* force speed */
651 0, /* force full duplex */
652 0, /* force mode */
653 0, /* force async mode */
654 &sc->linkup);
655

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

660 }
661 /* Set the MAC address */
662 sc->hwapi->pfnSetNodeAddress(sc->hwapi->pADCX, IF_LLADDR(sc->ifp));
663 sc->hwapi->pfnEnableInterrupts(sc->hwapi->pADCX);
664 sc->hwapi->pfnStart(sc->hwapi->pADCX);
665
666 /* Setup multicast filter */
667 nve_setmulti(sc);
666 nve_ifmedia_upd_locked(ifp);
667
668 /* Update interface parameters */
669 ifp->if_drv_flags |= IFF_DRV_RUNNING;
670 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
671
672 callout_reset(&sc->stat_callout, hz, nve_tick, sc);
673
674 DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_init - exit\n");

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

1301 struct nve_softc *sc;
1302 bus_addr_t mem_physical;
1303
1304 DEBUGOUT(NVE_DEBUG_API, "nve: nve_osalloc - %d\n", mem->uiLength);
1305
1306 sc = (struct nve_softc *)ctx;
1307
1308 mem->pLogical = (PVOID)contigmalloc(mem->uiLength, M_DEVBUF,
668
669 /* Update interface parameters */
670 ifp->if_drv_flags |= IFF_DRV_RUNNING;
671 ifp->if_drv_flags &= ~IFF_DRV_OACTIVE;
672
673 callout_reset(&sc->stat_callout, hz, nve_tick, sc);
674
675 DEBUGOUT(NVE_DEBUG_INIT, "nve: nve_init - exit\n");

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

1302 struct nve_softc *sc;
1303 bus_addr_t mem_physical;
1304
1305 DEBUGOUT(NVE_DEBUG_API, "nve: nve_osalloc - %d\n", mem->uiLength);
1306
1307 sc = (struct nve_softc *)ctx;
1308
1309 mem->pLogical = (PVOID)contigmalloc(mem->uiLength, M_DEVBUF,
1309 M_NOWAIT | M_ZERO, 0, ~0, PAGE_SIZE, 0);
1310 M_NOWAIT | M_ZERO, 0, 0xffffffff, PAGE_SIZE, 0);
1310
1311 if (!mem->pLogical) {
1312 device_printf(sc->dev, "memory allocation failed\n");
1313 return (0);
1314 }
1315 memset(mem->pLogical, 0, (ulong)mem->uiLength);
1316 mem_physical = vtophys(mem->pLogical);
1317 mem->pPhysical = (PVOID)mem_physical;

--- 426 unchanged lines hidden ---
1311
1312 if (!mem->pLogical) {
1313 device_printf(sc->dev, "memory allocation failed\n");
1314 return (0);
1315 }
1316 memset(mem->pLogical, 0, (ulong)mem->uiLength);
1317 mem_physical = vtophys(mem->pLogical);
1318 mem->pPhysical = (PVOID)mem_physical;

--- 426 unchanged lines hidden ---