vibes.c (46700f12593fc9ea939b09ed621c63de8d9ed01c) | vibes.c (733a4ea771adb552fffe9b1e1d1d1ee654384dcf) |
---|---|
1/* 2 * Copyright (c) 2001 Orion Hodson <O.Hodson@cs.ucl.ac.uk> 3 * 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 --- 700 unchanged lines hidden (view full) --- 709 struct snddev_info *d; 710 struct sc_info *sc; 711 u_int32_t data; 712 char status[SND_STATUSLEN]; 713 u_long midi_start, games_start, count, sdmaa, sdmac; 714 715 d = device_get_softc(dev); 716 | 1/* 2 * Copyright (c) 2001 Orion Hodson <O.Hodson@cs.ucl.ac.uk> 3 * 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 --- 700 unchanged lines hidden (view full) --- 709 struct snddev_info *d; 710 struct sc_info *sc; 711 u_int32_t data; 712 char status[SND_STATUSLEN]; 713 u_long midi_start, games_start, count, sdmaa, sdmac; 714 715 d = device_get_softc(dev); 716 |
717 sc = malloc(sizeof(struct sc_info), M_DEVBUF, M_NOWAIT); | 717 sc = malloc(sizeof(struct sc_info), M_DEVBUF, M_NOWAIT | M_ZERO); |
718 if (sc == NULL) { 719 device_printf(dev, "cannot allocate softc"); 720 return ENXIO; 721 } | 718 if (sc == NULL) { 719 device_printf(dev, "cannot allocate softc"); 720 return ENXIO; 721 } |
722 bzero(sc, sizeof(sc)); | |
723 sc->dev = dev; 724 725 data = pci_read_config(dev, PCIR_COMMAND, 2); 726 data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN); 727 pci_write_config(dev, PCIR_COMMAND, data, 2); 728 data = pci_read_config(dev, PCIR_COMMAND, 2); 729 730#if __FreeBSD_version > 500000 --- 198 unchanged lines hidden --- | 722 sc->dev = dev; 723 724 data = pci_read_config(dev, PCIR_COMMAND, 2); 725 data |= (PCIM_CMD_PORTEN|PCIM_CMD_BUSMASTEREN); 726 pci_write_config(dev, PCIR_COMMAND, data, 2); 727 data = pci_read_config(dev, PCIR_COMMAND, 2); 728 729#if __FreeBSD_version > 500000 --- 198 unchanged lines hidden --- |