Ejemplo n.º 1
0
NTSTATUS
SbDspGetVersion(
    IN  PUCHAR BasePort,
    OUT PUCHAR MajorVersion,
    OUT PUCHAR MinorVersion,
    IN  ULONG Timeout)
{
    NTSTATUS Status;

    /* Make sure our parameters are sane */
    if ( ! MajorVersion )
        return STATUS_INVALID_PARAMETER_2;

    if ( ! MinorVersion )
        return STATUS_INVALID_PARAMETER_3;

    /* Send version request */
    Status = SbDspWrite(BasePort, SB_DSP_VERSION, Timeout);
    if ( Status != STATUS_SUCCESS )
        return Status;

    /* Get the major version */
    Status = SbDspRead(BasePort, MajorVersion, Timeout);
    if ( Status != STATUS_SUCCESS )
        return FALSE;

    /* Get the minor version */
    Status = SbDspRead(BasePort, MinorVersion, Timeout);
    return Status;
}
Ejemplo n.º 2
0
// [fold]  [
int     SbDetect(void)
{
        int     old;

        if (!SbDspReset())
                return FALSE ;

                // Detecte la puce MIXER.
        audio.mixer = FALSE;
        old=SbMixerRead(0x22);
        SbMixerWrite(0x22,243);
        if (SbMixerRead(0x22)==243) {
                SbMixerWrite(0x22,old);
                audio.mixer = TRUE;
        }
                // Detecte la version du DSP sur la carte
        audio.dspversion=0;
        SbDspWrite(0xe1);       // Get version number.
        audio.dspversion =  SbDspRead()<<8;
        audio.dspversion |= SbDspRead();
                // Determine le type de carte (8,PRO ou 16)
        if (!audio.mixer) audio.type=SB8;
        else {
                if (audio.dspversion<0x0400) audio.type=SBPRO;
                else audio.type=SB16;
        }
                // DEBUG: Pour l'instant on sucre la SB-PRO !!
        if (audio.type==SBPRO) {
                audio.type=SB8;
                audio.mixer=FALSE;
        }
        return TRUE ;
}