t4dwave.c (d95502a8381196524939cc458b2ab90d76ac85a4) | t4dwave.c (733a4ea771adb552fffe9b1e1d1d1ee654384dcf) |
---|---|
1/* 2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.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 --- 705 unchanged lines hidden (view full) --- 714tr_pci_attach(device_t dev) 715{ 716 u_int32_t data; 717 struct tr_info *tr; 718 struct ac97_info *codec = 0; 719 int i; 720 char status[SND_STATUSLEN]; 721 | 1/* 2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.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 --- 705 unchanged lines hidden (view full) --- 714tr_pci_attach(device_t dev) 715{ 716 u_int32_t data; 717 struct tr_info *tr; 718 struct ac97_info *codec = 0; 719 int i; 720 char status[SND_STATUSLEN]; 721 |
722 if ((tr = malloc(sizeof(*tr), M_DEVBUF, M_NOWAIT)) == NULL) { | 722 if ((tr = malloc(sizeof(*tr), M_DEVBUF, M_NOWAIT | M_ZERO)) == NULL) { |
723 device_printf(dev, "cannot allocate softc\n"); 724 return ENXIO; 725 } 726 | 723 device_printf(dev, "cannot allocate softc\n"); 724 return ENXIO; 725 } 726 |
727 bzero(tr, sizeof(*tr)); | |
728 tr->type = pci_get_devid(dev); 729 tr->lock = snd_mtxcreate(device_get_nameunit(dev)); 730 731 data = pci_read_config(dev, PCIR_COMMAND, 2); 732 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); 733 pci_write_config(dev, PCIR_COMMAND, data, 2); 734 data = pci_read_config(dev, PCIR_COMMAND, 2); 735 --- 99 unchanged lines hidden --- | 727 tr->type = pci_get_devid(dev); 728 tr->lock = snd_mtxcreate(device_get_nameunit(dev)); 729 730 data = pci_read_config(dev, PCIR_COMMAND, 2); 731 data |= (PCIM_CMD_PORTEN|PCIM_CMD_MEMEN|PCIM_CMD_BUSMASTEREN); 732 pci_write_config(dev, PCIR_COMMAND, data, 2); 733 data = pci_read_config(dev, PCIR_COMMAND, 2); 734 --- 99 unchanged lines hidden --- |