summaryrefslogtreecommitdiffstats
path: root/sys/dev/if_ndis/if_ndis.c
diff options
context:
space:
mode:
authorwpaul <wpaul@FreeBSD.org>2003-12-24 21:21:18 +0000
committerwpaul <wpaul@FreeBSD.org>2003-12-24 21:21:18 +0000
commit26d06d73267a9c6f0d0d324117810e0f07dc8fee (patch)
tree6b1ede72a6517823f33bfc1ecb0ca75aa8b68eab /sys/dev/if_ndis/if_ndis.c
parent207029e7f4fe639aadb4ad0cab98a06dd0e38a95 (diff)
downloadFreeBSD-src-26d06d73267a9c6f0d0d324117810e0f07dc8fee.zip
FreeBSD-src-26d06d73267a9c6f0d0d324117810e0f07dc8fee.tar.gz
- Fix some compiler warnings in subr_pe.c
- Add explicit cardbus attachment in if_ndis.c - Clean up after moving bus_setup_intr() in ndis_attach(). - When setting an ssid, program an empty ssid as a 1-byte string with a single 0 byte. The Microsoft documentation says this is how you're supposed to tell the NIC to attach to 'any' ssid. - Keep trace of callout handles for timers externally from the ndis_miniport_timer structs, and run through and clobber them all after invoking the haltfunc just in case the driver left one running. (We need to make sure all timers are cancelled on driver unload.) - Handle the 'cancelled' argument in ndis_cancel_timer() correctly.
Diffstat (limited to 'sys/dev/if_ndis/if_ndis.c')
-rw-r--r--sys/dev/if_ndis/if_ndis.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/sys/dev/if_ndis/if_ndis.c b/sys/dev/if_ndis/if_ndis.c
index cc1ee9c..4ece1be 100644
--- a/sys/dev/if_ndis/if_ndis.c
+++ b/sys/dev/if_ndis/if_ndis.c
@@ -150,6 +150,7 @@ static driver_t ndis_driver = {
static devclass_t ndis_devclass;
DRIVER_MODULE(ndis, pci, ndis_driver, ndis_devclass, 0, 0);
+DRIVER_MODULE(ndis, cardbus, ndis_driver, ndis_devclass, 0, 0);
/*
* Program the 64-bit multicast hash filter.
@@ -292,12 +293,12 @@ ndis_attach(dev)
* Hook interrupt early, since calling the driver's
* init routine may trigger an interrupt.
*/
+
error = bus_setup_intr(dev, sc->ndis_irq, INTR_TYPE_NET,
ndis_intr, sc, &sc->ndis_intrhand);
if (error) {
- printf("ndis%d: couldn't register interrupt\n", unit);
- error = ENXIO;
+ printf("ndis%d: couldn't set up irq\n", unit);
goto fail;
}
@@ -561,12 +562,6 @@ ndis_attach(dev)
/* Override the status handler so we can detect link changes. */
sc->ndis_block.nmb_status_func = ndis_linksts;
- if (error) {
- printf("ndis%d: couldn't set up irq\n", unit);
- ether_ifdetach(ifp);
- goto fail;
- }
-
fail:
if (error)
ndis_detach(dev);
@@ -605,7 +600,6 @@ ndis_detach(dev)
} else
NDIS_UNLOCK(sc);
-
bus_generic_detach(dev);
if (sc->ndis_intrhand)
@@ -1139,7 +1133,10 @@ ndis_setstate_80211(sc)
len = sizeof(ssid);
bzero((char *)&ssid, len);
ssid.ns_ssidlen = ic->ic_des_esslen;
- bcopy(ic->ic_des_essid, ssid.ns_ssid, ssid.ns_ssidlen);
+ if (ssid.ns_ssidlen == 0) {
+ ssid.ns_ssidlen = 1;
+ } else
+ bcopy(ic->ic_des_essid, ssid.ns_ssid, ssid.ns_ssidlen);
rval = ndis_set_info(sc, OID_802_11_SSID, &ssid, &len);
if (rval)
OpenPOWER on IntegriCloud