summaryrefslogtreecommitdiffstats
path: root/sys/dev/nve
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2005-12-05 20:49:45 +0000
committerjhb <jhb@FreeBSD.org>2005-12-05 20:49:45 +0000
commit7bb88a772a30446af67a12d5695731078cb24d5a (patch)
tree3516faf4c0751906abc16e74de03d55deffb6820 /sys/dev/nve
parent7e42aad088c7090a024a859d5153e4c0f82086ad (diff)
downloadFreeBSD-src-7bb88a772a30446af67a12d5695731078cb24d5a.zip
FreeBSD-src-7bb88a772a30446af67a12d5695731078cb24d5a.tar.gz
- Don't make the driver lock recursive, it shouldn't be recursively
acquired anywhere in the driver now. - Axe the spin mutex used for the nve_oslock*() routines. The driver lock already provides sufficient synchronization. - Don't mess around with IFF_UP when the link state changes. IFF_UP is an administrative flag, not a link status indicator. MFC after: 1 week
Diffstat (limited to 'sys/dev/nve')
-rw-r--r--sys/dev/nve/if_nve.c16
-rw-r--r--sys/dev/nve/if_nvereg.h3
2 files changed, 1 insertions, 18 deletions
diff --git a/sys/dev/nve/if_nve.c b/sys/dev/nve/if_nve.c
index ce8d6b8..54c12de 100644
--- a/sys/dev/nve/if_nve.c
+++ b/sys/dev/nve/if_nve.c
@@ -315,8 +315,7 @@ nve_attach(device_t dev)
/* Allocate mutex */
mtx_init(&sc->mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
- MTX_DEF | MTX_RECURSE);
- mtx_init(&sc->osmtx, device_get_nameunit(dev), NULL, MTX_SPIN);
+ MTX_DEF);
callout_init_mtx(&sc->stat_callout, &sc->mtx, 0);
sc->dev = dev;
@@ -603,7 +602,6 @@ nve_detach(device_t dev)
if (ifp)
if_free(ifp);
mtx_destroy(&sc->mtx);
- mtx_destroy(&sc->osmtx);
DEBUGOUT(NVE_DEBUG_DEINIT, "nve: nve_detach - exit\n");
@@ -1589,17 +1587,9 @@ static NV_SINT32
nve_oslinkchg(PNV_VOID ctx, NV_SINT32 enabled)
{
struct nve_softc *sc = (struct nve_softc *)ctx;
- struct ifnet *ifp;
DEBUGOUT(NVE_DEBUG_API, "nve: nve_oslinkchg\n");
- ifp = sc->ifp;
-
- if (enabled)
- ifp->if_flags |= IFF_UP;
- else
- ifp->if_flags &= ~IFF_UP;
-
return (1);
}
@@ -1720,8 +1710,6 @@ nve_oslockacquire(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
DEBUGOUT(NVE_DEBUG_LOCK, "nve: nve_oslockacquire\n");
- NVE_OSLOCK((struct nve_softc *)lock);
-
return (1);
}
@@ -1732,8 +1720,6 @@ nve_oslockrelease(PNV_VOID ctx, NV_SINT32 type, PNV_VOID lock)
DEBUGOUT(NVE_DEBUG_LOCK, "nve: nve_oslockrelease\n");
- NVE_OSUNLOCK((struct nve_softc *)lock);
-
return (1);
}
diff --git a/sys/dev/nve/if_nvereg.h b/sys/dev/nve/if_nvereg.h
index a90e426..88c5a4a 100644
--- a/sys/dev/nve/if_nvereg.h
+++ b/sys/dev/nve/if_nvereg.h
@@ -140,7 +140,6 @@ struct nve_softc {
u_int32_t pending_txs;
struct mtx mtx;
- struct mtx osmtx;
/* Stuff for dealing with the NVIDIA OS API */
struct callout ostimer;
@@ -165,8 +164,6 @@ struct nve_type {
#define NVE_LOCK(_sc) mtx_lock(&(_sc)->mtx)
#define NVE_UNLOCK(_sc) mtx_unlock(&(_sc)->mtx)
#define NVE_LOCK_ASSERT(_sc) mtx_assert(&(_sc)->mtx, MA_OWNED)
-#define NVE_OSLOCK(_sc) mtx_lock_spin(&(_sc)->osmtx)
-#define NVE_OSUNLOCK(_sc) mtx_unlock_spin(&(_sc)->osmtx)
#define IF_Kbps(x) ((x) * 1000) /* kilobits/sec. */
#define IF_Mbps(x) (IF_Kbps((x) * 1000)) /* megabits/sec. */
OpenPOWER on IntegriCloud