Deleted Added
full compact
emu10kx.c (249587) emu10kx.c (254263)
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * Copyright (c) 2003-2007 Yuriy Tsibizov <yuriy.tsibizov@gfk.ru>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright (c) 1999 Cameron Grant <cg@freebsd.org>
3 * Copyright (c) 2003-2007 Yuriy Tsibizov <yuriy.tsibizov@gfk.ru>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

--- 10 unchanged lines hidden (view full) ---

19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHERIN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/dev/sound/pci/emu10kx.c 249587 2013-04-17 11:48:46Z gabor $
27 * $FreeBSD: head/sys/dev/sound/pci/emu10kx.c 254263 2013-08-12 23:30:01Z scottl $
28 */
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/bus.h>
33#include <machine/bus.h>
34#include <sys/rman.h>
35#include <sys/systm.h>

--- 2999 unchanged lines hidden (view full) ---

3035emu_pci_attach(device_t dev)
3036{
3037 struct sndcard_func *func;
3038 struct emu_sc_info *sc;
3039 struct emu_pcminfo *pcminfo;
3040#if 0
3041 struct emu_midiinfo *midiinfo;
3042#endif
28 */
29
30#include <sys/param.h>
31#include <sys/types.h>
32#include <sys/bus.h>
33#include <machine/bus.h>
34#include <sys/rman.h>
35#include <sys/systm.h>

--- 2999 unchanged lines hidden (view full) ---

3035emu_pci_attach(device_t dev)
3036{
3037 struct sndcard_func *func;
3038 struct emu_sc_info *sc;
3039 struct emu_pcminfo *pcminfo;
3040#if 0
3041 struct emu_midiinfo *midiinfo;
3042#endif
3043 uint32_t data;
3044 int i;
3045 int device_flags;
3046 char status[255];
3047 int error = ENXIO;
3048 int unit;
3049
3050 sc = device_get_softc(dev);
3051 unit = device_get_unit(dev);

--- 125 unchanged lines hidden (view full) ---

3177 sc->num_fxbuses = 8;
3178 sc->num_inputs = 8;
3179 sc->num_outputs = 16;
3180 sc->address_mask = EMU_PTR_ADDR_MASK;
3181 }
3182 if (sc->opcode_shift == 0)
3183 goto bad;
3184
3043 int i;
3044 int device_flags;
3045 char status[255];
3046 int error = ENXIO;
3047 int unit;
3048
3049 sc = device_get_softc(dev);
3050 unit = device_get_unit(dev);

--- 125 unchanged lines hidden (view full) ---

3176 sc->num_fxbuses = 8;
3177 sc->num_inputs = 8;
3178 sc->num_outputs = 16;
3179 sc->address_mask = EMU_PTR_ADDR_MASK;
3180 }
3181 if (sc->opcode_shift == 0)
3182 goto bad;
3183
3185 data = pci_read_config(dev, PCIR_COMMAND, 2);
3186 data |= (PCIM_CMD_PORTEN | PCIM_CMD_BUSMASTEREN);
3187 pci_write_config(dev, PCIR_COMMAND, data, 2);
3188 data = pci_read_config(dev, PCIR_COMMAND, 2);
3189
3190 pci_enable_busmaster(dev);
3191
3192 i = PCIR_BAR(0);
3193 sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &i, RF_ACTIVE);
3194 if (sc->reg == NULL) {
3195 device_printf(dev, "unable to map register space\n");
3196 goto bad;
3197 }

--- 376 unchanged lines hidden ---
3184 pci_enable_busmaster(dev);
3185
3186 i = PCIR_BAR(0);
3187 sc->reg = bus_alloc_resource_any(dev, SYS_RES_IOPORT, &i, RF_ACTIVE);
3188 if (sc->reg == NULL) {
3189 device_printf(dev, "unable to map register space\n");
3190 goto bad;
3191 }

--- 376 unchanged lines hidden ---