summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Long <scottl@FreeBSD.org>2016-05-12 17:47:30 +0000
committerScott Long <scottl@FreeBSD.org>2016-05-12 17:47:30 +0000
commit3934bc5561de24ea02938e73890c309e67ccac5f (patch)
tree3db5bc51a735e9796e9ac7c0c1763231e3fbaa3c
parentfd60718d1742ab8c06c196cb15bab59b0e407083 (diff)
Notes
-rw-r--r--sys/dev/an/if_an.c17
-rw-r--r--sys/dev/an/if_an_pci.c18
-rw-r--r--sys/dev/an/if_anreg.h1
3 files changed, 13 insertions, 23 deletions
diff --git a/sys/dev/an/if_an.c b/sys/dev/an/if_an.c
index a85136bf3a70..4b1891d1be9d 100644
--- a/sys/dev/an/if_an.c
+++ b/sys/dev/an/if_an.c
@@ -304,23 +304,6 @@ SYSCTL_PROC(_hw_an, OID_AUTO, an_cache_mode, CTLTYPE_STRING | CTLFLAG_RW,
0, sizeof(an_conf_cache), sysctl_an_cache_mode, "A", "");
/*
- * Setup the lock for PCI attachment since it skips the an_probe
- * function. We need to setup the lock in an_probe since some
- * operations need the lock. So we might as well create the
- * lock in the probe.
- */
-int
-an_pci_probe(device_t dev)
-{
- struct an_softc *sc = device_get_softc(dev);
-
- mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
- MTX_DEF);
-
- return(0);
-}
-
-/*
* We probe for an Aironet 4500/4800 card by attempting to
* read the default SSID list. On reset, the first entry in
* the SSID list will contain the name "tsunami." If we don't
diff --git a/sys/dev/an/if_an_pci.c b/sys/dev/an/if_an_pci.c
index 1c3032c942e2..db658cfa6139 100644
--- a/sys/dev/an/if_an_pci.c
+++ b/sys/dev/an/if_an_pci.c
@@ -119,16 +119,16 @@ static int
an_probe_pci(device_t dev)
{
struct an_type *t;
- struct an_softc *sc = device_get_softc(dev);
+ uint16_t vid, did;
- bzero(sc, sizeof(struct an_softc));
t = an_devs;
+ vid = pci_get_vendor(dev);
+ did = pci_get_device(dev);
while (t->an_name != NULL) {
- if (pci_get_vendor(dev) == t->an_vid &&
- pci_get_device(dev) == t->an_did) {
+ if (vid == t->an_vid &&
+ did == t->an_did) {
device_set_desc(dev, t->an_name);
- an_pci_probe(dev);
return(BUS_PROBE_DEFAULT);
}
t++;
@@ -145,8 +145,16 @@ an_attach_pci(dev)
int flags, error = 0;
sc = device_get_softc(dev);
+ bzero(sc, sizeof(struct an_softc));
flags = device_get_flags(dev);
+ /*
+ * Setup the lock in PCI attachment since it skips the an_probe
+ * function.
+ */
+ mtx_init(&sc->an_mtx, device_get_nameunit(dev), MTX_NETWORK_LOCK,
+ MTX_DEF);
+
if (pci_get_vendor(dev) == AIRONET_VENDORID &&
pci_get_device(dev) == AIRONET_DEVICEID_MPI350) {
sc->mpi350 = 1;
diff --git a/sys/dev/an/if_anreg.h b/sys/dev/an/if_anreg.h
index 0004e8e66e45..ee69b8856019 100644
--- a/sys/dev/an/if_anreg.h
+++ b/sys/dev/an/if_anreg.h
@@ -500,7 +500,6 @@ int an_alloc_port (device_t, int, int);
int an_alloc_memory (device_t, int, int);
int an_alloc_aux_memory (device_t, int, int);
int an_alloc_irq (device_t, int, int);
-int an_pci_probe (device_t);
int an_probe (device_t);
int an_shutdown (device_t);
void an_resume (device_t);