Home | Info | Community | Development | myReactOS | Contact Us
ReactOS Development > Doxygensound.c
Go to the documentation of this file.
00001 /* 00002 * COPYRIGHT: See COPYING in the top level directory 00003 * PROJECT: ReactOS kernel 00004 * FILE: mkernel/modules/sound/sound.c 00005 * PURPOSE: SoundBlaster 16 Driver 00006 * PROGRAMMER: Snatched from David Welch (welch@mcmail.com) 00007 * Modified for Soundblaster by Robert Bergkvist (fragdance@hotmail.com) 00008 * UPDATE HISTORY: 00009 * ??/??/??: Created 00010 * 00011 */ 00012 00013 /* FUNCTIONS **************************************************************/ 00014 00015 #include <ntddk.h> 00016 #include <string.h> 00017 #include <devices.h> 00018 #include "sb16.h" 00019 #include "dsp.h" 00020 #include "mixer.h" 00021 #include "wave.h" 00022 00023 #define NDEBUG 00024 #include <debug.h> 00025 00026 SB16 sb16; 00027 sb_status sb16_getenvironment(void); 00028 00029 #if 0 00030 static NTSTATUS NTAPI Dispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp) 00031 /* 00032 * FUNCTION: Handles user mode requests 00033 * ARGUMENTS: 00034 * DeviceObject = Device for request 00035 * Irp = I/O request packet describing request 00036 * RETURNS: Success or failure 00037 */ 00038 { 00039 PIO_STACK_LOCATION Stack = IoGetCurrentIrpStackLocation(Irp); 00040 NTSTATUS status; 00041 00042 switch (Stack->MajorFunction) 00043 { 00044 case IRP_MJ_CREATE: 00045 DPRINT1("(SoundBlaster 16 Driver WaveOut) Creating\n"); 00046 reset_dsp(sb16.base); 00047 status = STATUS_SUCCESS; 00048 break; 00049 00050 case IRP_MJ_CLOSE: 00051 status = STATUS_SUCCESS; 00052 break; 00053 00054 case IRP_MJ_WRITE: 00055 DPRINT1("(SoundBlaster 16 Driver) Writing %d bytes\n",Stack->Parameters.Write.Length); 00056 sb16_play((WAVE_HDR*)Irp->UserBuffer); 00057 status = STATUS_SUCCESS; 00058 break; 00059 00060 default: 00061 status = STATUS_NOT_IMPLEMENTED; 00062 break; 00063 } 00064 00065 Irp->IoStatus.Status = status; 00066 Irp->IoStatus.Information = 0; 00067 00068 IoCompleteRequest(Irp, IO_NO_INCREMENT); 00069 return(status); 00070 } 00071 00072 NTSTATUS ModuleEntry(PDRIVER_OBJECT DriverObject, PUNICODE_STRING RegistryPath) 00073 /* 00074 * FUNCTION: Called by the system to initalize the driver 00075 * ARGUMENTS: 00076 * DriverObject = object describing this driver 00077 * RegistryPath = path to our configuration entries 00078 * RETURNS: Success or failure 00079 */ 00080 { 00081 #if 0 00082 PDEVICE_OBJECT DeviceObject; 00083 NTSTATUS ret; 00084 00085 DPRINT1("SoundBlaster 16 Driver 0.0.1\n"); 00086 if(sb16_getenvironment()!=SB_TRUE) 00087 { 00088 DPRINT1("Soundblaster 16 not found\n"); 00089 return 0; 00090 } 00091 ret = IoCreateDevice(DriverObject,0,L"\\Device\\WaveOut",FILE_DEVICE_WAVE_OUT,0,FALSE,&DeviceObject); 00092 if (ret!=STATUS_SUCCESS) 00093 return(ret); 00094 00095 DeviceObject->Flags=0; 00096 DriverObject->MajorFunction[IRP_MJ_CLOSE] = Dispatch; 00097 DriverObject->MajorFunction[IRP_MJ_CREATE] =Dispatch; 00098 DriverObject->MajorFunction[IRP_MJ_WRITE] = Dispatch; 00099 DriverObject->MajorFunction[IRP_MJ_WRITE] = Dispatch; 00100 DriverObject->DriverUnload = NULL; 00101 #endif 00102 return(STATUS_SUCCESS); 00103 } 00104 #endif 00105 00106 sb_status sb16_getenvironment(void) 00107 { 00108 if(detect_dsp(&sb16)!=SB_TRUE) 00109 { 00110 DPRINT1("Detect DSP failed!!!\n"); 00111 return SB_FALSE; 00112 } 00113 DPRINT1("DSP base address 0x%x\n",sb16.base); 00114 get_irq(&sb16); 00115 DPRINT1("IRQ: %d\n",sb16.irq); 00116 get_dma(&sb16); 00117 DPRINT1("DMA8: 0x%x DMA16: 0x%x\n",sb16.dma8,sb16.dma16); 00118 return SB_TRUE; 00119 } 00120 Generated on Sat May 26 2012 04:15:37 for ReactOS by
1.7.6.1
|