if_wi_pci.c (181209) | if_wi_pci.c (254263) |
---|---|
1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * | 1/*- 2 * Copyright (c) 1997, 1998, 1999 3 * Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 15 unchanged lines hidden (view full) --- 24 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 30 * THE POSSIBILITY OF SUCH DAMAGE. 31 * |
32 * $FreeBSD: head/sys/dev/wi/if_wi_pci.c 181209 2008-08-02 20:45:28Z imp $ | 32 * $FreeBSD: head/sys/dev/wi/if_wi_pci.c 254263 2013-08-12 23:30:01Z scottl $ |
33 */ 34 35/* 36 * Lucent WaveLAN/IEEE 802.11 PCMCIA driver for FreeBSD. 37 * 38 * Written by Bill Paul <wpaul@ctr.columbia.edu> 39 * Electrical Engineering Department 40 * Columbia University, New York City --- 91 unchanged lines hidden (view full) --- 132 } 133 return(ENXIO); 134} 135 136static int 137wi_pci_attach(device_t dev) 138{ 139 struct wi_softc *sc; | 33 */ 34 35/* 36 * Lucent WaveLAN/IEEE 802.11 PCMCIA driver for FreeBSD. 37 * 38 * Written by Bill Paul <wpaul@ctr.columbia.edu> 39 * Electrical Engineering Department 40 * Columbia University, New York City --- 91 unchanged lines hidden (view full) --- 132 } 133 return(ENXIO); 134} 135 136static int 137wi_pci_attach(device_t dev) 138{ 139 struct wi_softc *sc; |
140 u_int32_t command, wanted; | 140 u_int32_t command; |
141 u_int16_t reg; 142 int error; 143 int timeout; 144 145 sc = device_get_softc(dev); 146 | 141 u_int16_t reg; 142 int error; 143 int timeout; 144 145 sc = device_get_softc(dev); 146 |
147 command = pci_read_config(dev, PCIR_COMMAND, 4); 148 wanted = PCIM_CMD_PORTEN|PCIM_CMD_MEMEN; 149 command |= wanted; 150 pci_write_config(dev, PCIR_COMMAND, command, 4); 151 command = pci_read_config(dev, PCIR_COMMAND, 4); 152 if ((command & wanted) != wanted) { 153 device_printf(dev, "wi_pci_attach() failed to enable pci!\n"); 154 return (ENXIO); 155 } 156 | |
157 if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) { 158 error = wi_alloc(dev, WI_PCI_IORES); 159 if (error) 160 return (error); 161 162 /* Make sure interrupts are disabled. */ 163 CSR_WRITE_2(sc, WI_INT_EN, 0); 164 CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); --- 107 unchanged lines hidden --- | 147 if (sc->wi_bus_type != WI_BUS_PCI_NATIVE) { 148 error = wi_alloc(dev, WI_PCI_IORES); 149 if (error) 150 return (error); 151 152 /* Make sure interrupts are disabled. */ 153 CSR_WRITE_2(sc, WI_INT_EN, 0); 154 CSR_WRITE_2(sc, WI_EVENT_ACK, 0xFFFF); --- 107 unchanged lines hidden --- |