Index: stable/12/sys/dev/an/if_an_isa.c =================================================================== --- stable/12/sys/dev/an/if_an_isa.c (revision 365542) +++ stable/12/sys/dev/an/if_an_isa.c (revision 365543) @@ -1,153 +1,154 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /* * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. * * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City */ #include __FBSDID("$FreeBSD$"); #include "opt_inet.h" #ifdef INET #define ANCACHE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static struct isa_pnp_id an_ids[] = { { 0x0100ec06, "Aironet ISA4500/ISA4800" }, { 0, NULL } }; static int an_probe_isa(device_t); static int an_attach_isa(device_t); static int an_probe_isa(device_t dev) { int error = 0; error = ISA_PNP_PROBE(device_get_parent(dev), dev, an_ids); if (error == ENXIO) return(error); error = an_probe(dev); an_release_resources(dev); if (error == 0) return (ENXIO); error = an_alloc_irq(dev, 0, 0); an_release_resources(dev); if (!error) device_set_desc(dev, "Aironet ISA4500/ISA4800"); return (error); } static int an_attach_isa(device_t dev) { struct an_softc *sc = device_get_softc(dev); int flags = device_get_flags(dev); int error; an_alloc_port(dev, sc->port_rid, 1); an_alloc_irq(dev, sc->irq_rid, 0); sc->an_dev = dev; error = an_attach(sc, flags); if (error) { an_release_resources(dev); return (error); } error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, an_intr, sc, &sc->irq_handle); if (error) { an_release_resources(dev); return (error); } + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (0); } static device_method_t an_isa_methods[] = { /* Device interface */ DEVMETHOD(device_probe, an_probe_isa), DEVMETHOD(device_attach, an_attach_isa), DEVMETHOD(device_detach, an_detach), DEVMETHOD(device_shutdown, an_shutdown), { 0, 0 } }; static driver_t an_isa_driver = { "an", an_isa_methods, sizeof(struct an_softc) }; static devclass_t an_isa_devclass; DRIVER_MODULE(an, isa, an_isa_driver, an_isa_devclass, 0, 0); MODULE_DEPEND(an, isa, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); ISA_PNP_INFO(an_ids); Index: stable/12/sys/dev/an/if_an_pccard.c =================================================================== --- stable/12/sys/dev/an/if_an_pccard.c (revision 365542) +++ stable/12/sys/dev/an/if_an_pccard.c (revision 365543) @@ -1,162 +1,162 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /* * Aironet 4500/4800 802.11 PCMCIA/ISA/PCI driver for FreeBSD. * * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City */ #include __FBSDID("$FreeBSD$"); #include "opt_inet.h" #ifdef INET #define ANCACHE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "pccarddevs.h" #include "card_if.h" /* * Support for PCMCIA cards. */ static int an_pccard_probe(device_t); static int an_pccard_attach(device_t); static device_method_t an_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, an_pccard_probe), DEVMETHOD(device_attach, an_pccard_attach), DEVMETHOD(device_detach, an_detach), DEVMETHOD(device_shutdown, an_shutdown), { 0, 0 } }; static driver_t an_pccard_driver = { "an", an_pccard_methods, sizeof(struct an_softc) }; static devclass_t an_pccard_devclass; DRIVER_MODULE(an, pccard, an_pccard_driver, an_pccard_devclass, 0, 0); MODULE_DEPEND(an, wlan, 1, 1, 1); static const struct pccard_product an_pccard_products[] = { PCMCIA_CARD(AIRONET, PC4800), PCMCIA_CARD(AIRONET, PC4500), PCMCIA_CARD(AIRONET, 350), PCMCIA_CARD(XIRCOM, CWE1130), { NULL } }; PCCARD_PNP_INFO(an_pccard_products); static int an_pccard_probe(device_t dev) { const struct pccard_product *pp; if ((pp = pccard_product_lookup(dev, an_pccard_products, sizeof(an_pccard_products[0]), NULL)) != NULL) { if (pp->pp_name != NULL) device_set_desc(dev, pp->pp_name); return (0); } return (ENXIO); } static int an_pccard_attach(device_t dev) { struct an_softc *sc = device_get_softc(dev); int flags = device_get_flags(dev); int error; error = an_probe(dev); /* 0 is failure for now */ if (error == 0) { error = ENXIO; goto fail; } error = an_alloc_irq(dev, 0, 0); if (error != 0) goto fail; an_alloc_irq(dev, sc->irq_rid, 0); error = an_attach(sc, flags); if (error) goto fail; /* * Must setup the interrupt after the an_attach to prevent racing. */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, an_intr, sc, &sc->irq_handle); fail: if (error) an_release_resources(dev); else - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); return (error); } Index: stable/12/sys/dev/an/if_an_pci.c =================================================================== --- stable/12/sys/dev/an/if_an_pci.c (revision 365542) +++ stable/12/sys/dev/an/if_an_pci.c (revision 365543) @@ -1,279 +1,280 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ #include __FBSDID("$FreeBSD$"); /* * This is a PCI shim for the Aironet PC4500/4800 wireless network * driver. Aironet makes PCMCIA, ISA and PCI versions of these devices, * which all have basically the same interface. The ISA and PCI cards * are actually bridge adapters with PCMCIA cards inserted into them, * however they appear as normal PCI or ISA devices to the host. * * All we do here is handle the PCI probe and attach and set up an * interrupt handler entry point. The PCI version of the card uses * a PLX 9050 PCI to "dumb bus" bridge chip, which provides us with * multiple PCI address space mappings. The primary mapping at PCI * register 0x14 is for the PLX chip itself, *NOT* the Aironet card. * The I/O address of the Aironet is actually at register 0x18, which * is the local bus mapping register for bus space 0. There are also * registers for additional register spaces at registers 0x1C and * 0x20, but these are unused in the Aironet devices. To find out * more, you need a datasheet for the 9050 from PLX, but you have * to go through their sales office to get it. Bleh. */ #include "opt_inet.h" #ifdef INET #define ANCACHE #endif #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include struct an_type { u_int16_t an_vid; u_int16_t an_did; char *an_name; }; #define AIRONET_VENDORID 0x14B9 #define AIRONET_DEVICEID_35x 0x0350 #define AIRONET_DEVICEID_4500 0x4500 #define AIRONET_DEVICEID_4800 0x4800 #define AIRONET_DEVICEID_4xxx 0x0001 #define AIRONET_DEVICEID_MPI350 0xA504 #define AN_PCI_PLX_LOIO 0x14 /* PLX chip iobase */ #define AN_PCI_LOIO 0x18 /* Aironet iobase */ static struct an_type an_devs[] = { { AIRONET_VENDORID, AIRONET_DEVICEID_35x, "Cisco Aironet 350 Series" }, { AIRONET_VENDORID, AIRONET_DEVICEID_MPI350, "Cisco Aironet MPI350" }, { AIRONET_VENDORID, AIRONET_DEVICEID_4500, "Aironet PCI4500" }, { AIRONET_VENDORID, AIRONET_DEVICEID_4800, "Aironet PCI4800" }, { AIRONET_VENDORID, AIRONET_DEVICEID_4xxx, "Aironet PCI4500/PCI4800" }, { 0, 0, NULL } }; static int an_probe_pci (device_t); static int an_attach_pci (device_t); static int an_suspend_pci (device_t); static int an_resume_pci (device_t); static int an_probe_pci(device_t dev) { struct an_type *t; uint16_t vid, did; t = an_devs; vid = pci_get_vendor(dev); did = pci_get_device(dev); while (t->an_name != NULL) { if (vid == t->an_vid && did == t->an_did) { device_set_desc(dev, t->an_name); return(BUS_PROBE_DEFAULT); } t++; } return(ENXIO); } static int an_attach_pci(dev) device_t dev; { struct an_softc *sc; 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; sc->port_rid = PCIR_BAR(0); } else { sc->port_rid = AN_PCI_LOIO; } error = an_alloc_port(dev, sc->port_rid, 1); if (error) { device_printf(dev, "couldn't map ports\n"); goto fail; } /* Allocate memory for MPI350 */ if (sc->mpi350) { /* Allocate memory */ sc->mem_rid = PCIR_BAR(1); error = an_alloc_memory(dev, sc->mem_rid, 1); if (error) { device_printf(dev, "couldn't map memory\n"); goto fail; } /* Allocate aux. memory */ sc->mem_aux_rid = PCIR_BAR(2); error = an_alloc_aux_memory(dev, sc->mem_aux_rid, AN_AUX_MEM_SIZE); if (error) { device_printf(dev, "couldn't map aux memory\n"); goto fail; } /* Allocate DMA region */ error = bus_dma_tag_create(bus_get_dma_tag(dev),/* parent */ 1, 0, /* alignment, bounds */ BUS_SPACE_MAXADDR_32BIT, /* lowaddr */ BUS_SPACE_MAXADDR, /* highaddr */ NULL, NULL, /* filter, filterarg */ 0x3ffff, /* maxsize XXX */ 1, /* nsegments */ 0xffff, /* maxsegsize XXX */ BUS_DMA_ALLOCNOW, /* flags */ NULL, /* lockfunc */ NULL, /* lockarg */ &sc->an_dtag); if (error) { device_printf(dev, "couldn't get DMA region\n"); goto fail; } } /* Allocate interrupt */ error = an_alloc_irq(dev, 0, RF_SHAREABLE); if (error) { device_printf(dev, "couldn't get interrupt\n"); goto fail; } sc->an_dev = dev; error = an_attach(sc, flags); if (error) { device_printf(dev, "couldn't attach\n"); goto fail; } /* * Must setup the interrupt after the an_attach to prevent racing. */ error = bus_setup_intr(dev, sc->irq_res, INTR_TYPE_NET, NULL, an_intr, sc, &sc->irq_handle); if (error) device_printf(dev, "couldn't setup interrupt\n"); - + else + gone_in_dev(dev, 13, "pccard removed, an doesn't support modern crypto"); fail: if (error) an_release_resources(dev); return(error); } static int an_suspend_pci(device_t dev) { an_shutdown(dev); return (0); } static int an_resume_pci(device_t dev) { an_resume(dev); return (0); } static device_method_t an_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, an_probe_pci), DEVMETHOD(device_attach, an_attach_pci), DEVMETHOD(device_detach, an_detach), DEVMETHOD(device_shutdown, an_shutdown), DEVMETHOD(device_suspend, an_suspend_pci), DEVMETHOD(device_resume, an_resume_pci), { 0, 0 } }; static driver_t an_pci_driver = { "an", an_pci_methods, sizeof(struct an_softc), }; static devclass_t an_devclass; DRIVER_MODULE(an, pci, an_pci_driver, an_devclass, 0, 0); MODULE_PNP_INFO("U16:vendor;U16:device;D:#", pci, an, an_devs, nitems(an_devs) - 1); MODULE_DEPEND(an, pci, 1, 1, 1); MODULE_DEPEND(an, wlan, 1, 1, 1); Index: stable/12/sys/dev/wi/if_wi_macio.c =================================================================== --- stable/12/sys/dev/wi/if_wi_macio.c (revision 365542) +++ stable/12/sys/dev/wi/if_wi_macio.c (revision 365543) @@ -1,147 +1,149 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 2013 Justin Hibbits * All rights reserved. * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /* * Lucent WaveLAN/IEEE 802.11 MacIO attachment for FreeBSD. * * Based on the PCMCIA driver * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int wi_macio_probe(device_t); static int wi_macio_attach(device_t); static device_method_t wi_macio_methods[] = { /* Device interface */ DEVMETHOD(device_probe, wi_macio_probe), DEVMETHOD(device_attach, wi_macio_attach), DEVMETHOD(device_detach, wi_detach), DEVMETHOD(device_shutdown, wi_shutdown), { 0, 0 } }; static driver_t wi_macio_driver = { "wi", wi_macio_methods, sizeof(struct wi_softc) }; DRIVER_MODULE(wi, macio, wi_macio_driver, wi_devclass, 0, 0); MODULE_DEPEND(wi, wlan, 1, 1, 1); static int wi_macio_probe(device_t dev) { const char *name, *compat; /* Make sure we're a network driver */ name = ofw_bus_get_name(dev); if (name == NULL) return (ENXIO); if (strcmp(name, "radio") != 0) { return ENXIO; } compat = ofw_bus_get_compat(dev); if (strcmp(compat, "wireless") != 0) { return ENXIO; } device_set_desc(dev, "Apple Airport"); return 0; } static int wi_macio_attach(device_t dev) { struct wi_softc *sc; int error; sc = device_get_softc(dev); sc->wi_gone = 0; sc->wi_bus_type = 0; error = wi_alloc(dev, 0); if (error == 0) { macio_enable_wireless(device_get_parent(dev), 1); /* Make sure interrupts are disabled. */ CSR_WRITE_2(sc, WI_INT_EN, 0); CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Index: stable/12/sys/dev/wi/if_wi_pccard.c =================================================================== --- stable/12/sys/dev/wi/if_wi_pccard.c (revision 365542) +++ stable/12/sys/dev/wi/if_wi_pccard.c (revision 365543) @@ -1,206 +1,206 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. */ /* * Lucent WaveLAN/IEEE 802.11 PCMCIA driver for FreeBSD. * * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City */ #include __FBSDID("$FreeBSD$"); #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "card_if.h" #include "pccarddevs.h" static int wi_pccard_probe(device_t); static int wi_pccard_attach(device_t); static device_method_t wi_pccard_methods[] = { /* Device interface */ DEVMETHOD(device_probe, wi_pccard_probe), DEVMETHOD(device_attach, wi_pccard_attach), DEVMETHOD(device_detach, wi_detach), DEVMETHOD(device_shutdown, wi_shutdown), { 0, 0 } }; static driver_t wi_pccard_driver = { "wi", wi_pccard_methods, sizeof(struct wi_softc) }; DRIVER_MODULE(wi, pccard, wi_pccard_driver, wi_devclass, 0, 0); MODULE_DEPEND(wi, wlan, 1, 1, 1); static const struct pccard_product wi_pccard_products[] = { PCMCIA_CARD(3COM, 3CRWE737A), PCMCIA_CARD(3COM, 3CRWE777A), PCMCIA_CARD(ACTIONTEC, PRISM), PCMCIA_CARD(ADAPTEC2, ANW8030), PCMCIA_CARD(ADDTRON, AWP100), PCMCIA_CARD(AIRVAST, WN_100B), PCMCIA_CARD(AIRVAST, WN_100), PCMCIA_CARD(ALLIEDTELESIS, WR211PCM), PCMCIA_CARD(ARTEM, ONAIR), PCMCIA_CARD(ASUS, WL100), PCMCIA_CARD(BAY, EMOBILITY_11B), PCMCIA_CARD(BROMAX, IWN), PCMCIA_CARD(BROMAX, IWN3), PCMCIA_CARD(BROMAX, WCF11), PCMCIA_CARD(BUFFALO, WLI_CF_S11G), PCMCIA_CARD(BUFFALO, WLI_PCM_S11), PCMCIA_CARD(COMPAQ, NC5004), PCMCIA_CARD(CONTEC, FX_DS110_PCC), PCMCIA_CARD(COREGA, WIRELESS_LAN_PCC_11), PCMCIA_CARD(COREGA, WIRELESS_LAN_PCCA_11), PCMCIA_CARD(COREGA, WIRELESS_LAN_PCCB_11), PCMCIA_CARD(COREGA, WIRELESS_LAN_PCCL_11), PCMCIA_CARD(DLINK, DWL650H), PCMCIA_CARD(ELSA, XI300_IEEE), PCMCIA_CARD(ELSA, XI325_IEEE), PCMCIA_CARD(ELSA, APDL325_IEEE), PCMCIA_CARD(ELSA, XI330_IEEE), PCMCIA_CARD(ELSA, XI800_IEEE), PCMCIA_CARD(ELSA, WIFI_FLASH), PCMCIA_CARD(EMTAC, WLAN), PCMCIA_CARD(ERICSSON, WIRELESSLAN), PCMCIA_CARD(GEMTEK, WLAN), PCMCIA_CARD(HWN, AIRWAY80211), PCMCIA_CARD(INTEL, PRO_WLAN_2011), PCMCIA_CARD(INTERSIL, ISL37100P), PCMCIA_CARD(INTERSIL, ISL37110P), PCMCIA_CARD(INTERSIL, ISL37300P), PCMCIA_CARD(INTERSIL2, PRISM2), PCMCIA_CARD(IODATA2, WCF12), PCMCIA_CARD(IODATA2, WNB11PCM), PCMCIA_CARD(FUJITSU, WL110), PCMCIA_CARD(LUCENT, WAVELAN_IEEE), PCMCIA_CARD(MICROSOFT, MN_520), PCMCIA_CARD(NOKIA, C020_WLAN), PCMCIA_CARD(NOKIA, C110_WLAN), PCMCIA_CARD(PLANEX, GWNS11H), PCMCIA_CARD(PROXIM, HARMONY), PCMCIA_CARD(PROXIM, RANGELANDS_8430), PCMCIA_CARD(SAMSUNG, SWL_2000N), PCMCIA_CARD(SIEMENS, SS1021), PCMCIA_CARD(SIEMENS, SS1021A), PCMCIA_CARD(SIMPLETECH, SPECTRUM24_ALT), PCMCIA_CARD(SOCKET, LP_WLAN_CF), PCMCIA_CARD(TDK, LAK_CD011WL), { NULL } }; PCCARD_PNP_INFO(wi_pccard_products); static int wi_pccard_probe(device_t dev) { const struct pccard_product *pp; u_int32_t fcn = PCCARD_FUNCTION_UNSPEC; int error; /* Make sure we're a network driver */ error = pccard_get_function(dev, &fcn); if (error != 0) return error; if (fcn != PCCARD_FUNCTION_NETWORK) return ENXIO; pp = pccard_product_lookup(dev, wi_pccard_products, sizeof(wi_pccard_products[0]), NULL); if (pp != NULL) { if (pp->pp_name != NULL) device_set_desc(dev, pp->pp_name); return 0; } return ENXIO; } static int wi_pccard_attach(device_t dev) { struct wi_softc *sc; int error; sc = device_get_softc(dev); sc->wi_gone = 0; sc->wi_bus_type = WI_BUS_PCCARD; error = wi_alloc(dev, 0); if (error == 0) { /* Make sure interrupts are disabled. */ CSR_WRITE_2(sc, WI_INT_EN, 0); CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); error = wi_attach(dev); if (error != 0) wi_free(dev); - gone_in_dev(dev, 13, "pccard removed"); + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); } return error; } Index: stable/12/sys/dev/wi/if_wi_pci.c =================================================================== --- stable/12/sys/dev/wi/if_wi_pci.c (revision 365542) +++ stable/12/sys/dev/wi/if_wi_pci.c (revision 365543) @@ -1,266 +1,268 @@ /*- * SPDX-License-Identifier: BSD-4-Clause * * Copyright (c) 1997, 1998, 1999 * Bill Paul . All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * 3. All advertising materials mentioning features or use of this software * must display the following acknowledgement: * This product includes software developed by Bill Paul. * 4. Neither the name of the author nor the names of any co-contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE * ARE DISCLAIMED. IN NO EVENT SHALL Bill Paul OR THE VOICES IN HIS HEAD * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * * $FreeBSD$ */ /* * Lucent WaveLAN/IEEE 802.11 PCMCIA driver for FreeBSD. * * Written by Bill Paul * Electrical Engineering Department * Columbia University, New York City */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include static int wi_pci_probe(device_t); static int wi_pci_attach(device_t); static int wi_pci_suspend(device_t); static int wi_pci_resume(device_t); static device_method_t wi_pci_methods[] = { /* Device interface */ DEVMETHOD(device_probe, wi_pci_probe), DEVMETHOD(device_attach, wi_pci_attach), DEVMETHOD(device_detach, wi_detach), DEVMETHOD(device_shutdown, wi_shutdown), DEVMETHOD(device_suspend, wi_pci_suspend), DEVMETHOD(device_resume, wi_pci_resume), { 0, 0 } }; static driver_t wi_pci_driver = { "wi", wi_pci_methods, sizeof(struct wi_softc) }; static struct { unsigned int vendor,device; int bus_type; char *desc; } pci_ids[] = { /* Sorted by description */ {0x10b7, 0x7770, WI_BUS_PCI_PLX, "3Com Airconnect"}, {0x16ab, 0x1101, WI_BUS_PCI_PLX, "GLPRISM2 WaveLAN"}, {0x1260, 0x3872, WI_BUS_PCI_NATIVE, "Intersil Prism3"}, {0x1260, 0x3873, WI_BUS_PCI_NATIVE, "Intersil Prism2.5"}, {0x16ab, 0x1102, WI_BUS_PCI_PLX, "Linksys WDT11"}, {0x1385, 0x4100, WI_BUS_PCI_PLX, "Netgear MA301"}, {0x1638, 0x1100, WI_BUS_PCI_PLX, "PRISM2STA WaveLAN"}, {0x111a, 0x1023, WI_BUS_PCI_PLX, "Siemens SpeedStream"}, {0x10b5, 0x9050, WI_BUS_PCI_PLX, "SMC 2602W"}, {0x16ec, 0x3685, WI_BUS_PCI_PLX, "US Robotics 2415"}, {0x4033, 0x7001, WI_BUS_PCI_PLX, "Addtron AWA-100 PCI"}, {0, 0, 0, NULL} }; DRIVER_MODULE(wi, pci, wi_pci_driver, wi_devclass, 0, 0); MODULE_DEPEND(wi, pci, 1, 1, 1); MODULE_DEPEND(wi, wlan, 1, 1, 1); static int wi_pci_probe(dev) device_t dev; { struct wi_softc *sc; int i; sc = device_get_softc(dev); for(i=0; pci_ids[i].vendor != 0; i++) { if ((pci_get_vendor(dev) == pci_ids[i].vendor) && (pci_get_device(dev) == pci_ids[i].device)) { sc->wi_bus_type = pci_ids[i].bus_type; device_set_desc(dev, pci_ids[i].desc); return (BUS_PROBE_DEFAULT); } } return(ENXIO); } static int wi_pci_attach(device_t dev) { struct wi_softc *sc; u_int32_t command; u_int16_t reg; int error; int timeout; sc = device_get_softc(dev); if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) { error = wi_alloc(dev, WI_PCI_IORES); if (error) return (error); /* Make sure interrupts are disabled. */ CSR_WRITE_2(sc, WI_INT_EN, 0); CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); /* We have to do a magic PLX poke to enable interrupts */ sc->local_rid = WI_PCI_LOCALRES; sc->local = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &sc->local_rid, RF_ACTIVE); sc->wi_localtag = rman_get_bustag(sc->local); sc->wi_localhandle = rman_get_bushandle(sc->local); command = bus_space_read_4(sc->wi_localtag, sc->wi_localhandle, WI_LOCAL_INTCSR); command |= WI_LOCAL_INTEN; bus_space_write_4(sc->wi_localtag, sc->wi_localhandle, WI_LOCAL_INTCSR, command); bus_release_resource(dev, SYS_RES_IOPORT, sc->local_rid, sc->local); sc->local = NULL; sc->mem_rid = WI_PCI_MEMRES; sc->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, RF_ACTIVE); if (sc->mem == NULL) { device_printf(dev, "couldn't allocate memory\n"); wi_free(dev); return (ENXIO); } sc->wi_bmemtag = rman_get_bustag(sc->mem); sc->wi_bmemhandle = rman_get_bushandle(sc->mem); /* * Write COR to enable PC card * This is a subset of the protocol that the pccard bus code * would do. In theory, we should parse the CIS to find the * COR offset. In practice, the COR_OFFSET is always 0x3e0. */ CSM_WRITE_1(sc, WI_COR_OFFSET, WI_COR_VALUE); reg = CSM_READ_1(sc, WI_COR_OFFSET); if (reg != WI_COR_VALUE) { device_printf(dev, "CSM_READ_1(WI_COR_OFFSET) " "wanted %d, got %d\n", WI_COR_VALUE, reg); wi_free(dev); return (ENXIO); } } else { error = wi_alloc(dev, WI_PCI_LMEMRES); if (error) return (error); CSR_WRITE_2(sc, WI_PCICOR_OFF, WI_PCICOR_RESET); DELAY(250000); CSR_WRITE_2(sc, WI_PCICOR_OFF, 0x0000); DELAY(500000); timeout=2000000; while ((--timeout > 0) && (CSR_READ_2(sc, WI_COMMAND) & WI_CMD_BUSY)) DELAY(10); if (timeout == 0) { device_printf(dev, "couldn't reset prism pci core.\n"); wi_free(dev); return(ENXIO); } } CSR_WRITE_2(sc, WI_HFA384X_SWSUPPORT0_OFF, WI_PRISM2STA_MAGIC); reg = CSR_READ_2(sc, WI_HFA384X_SWSUPPORT0_OFF); if (reg != WI_PRISM2STA_MAGIC) { device_printf(dev, "CSR_READ_2(WI_HFA384X_SWSUPPORT0_OFF) " "wanted %d, got %d\n", WI_PRISM2STA_MAGIC, reg); wi_free(dev); return (ENXIO); } error = wi_attach(dev); if (error != 0) wi_free(dev); + else + gone_in_dev(dev, 13, "pccard removed, wi doesn't support modern crypto"); return (error); } static int wi_pci_suspend(device_t dev) { struct wi_softc *sc = device_get_softc(dev); WI_LOCK(sc); wi_stop(sc, 1); WI_UNLOCK(sc); return (0); } static int wi_pci_resume(device_t dev) { struct wi_softc *sc = device_get_softc(dev); struct ieee80211com *ic = &sc->sc_ic; WI_LOCK(sc); if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) { WI_UNLOCK(sc); return (0); } if (ic->ic_nrunning > 0) wi_init(sc); WI_UNLOCK(sc); return (0); } Index: stable/12 =================================================================== --- stable/12 (revision 365542) +++ stable/12 (revision 365543) Property changes on: stable/12 ___________________________________________________________________ Modified: svn:mergeinfo ## -0,0 +0,1 ## Merged /head:r365015