LOCAL void _HTC_ReturnBuffersList(htc_handle_t htcHandle,
				  HTC_ENDPOINT_ID EndpointID,
				  adf_nbuf_queue_t bufHead)
{
	HTC_CONTEXT *pHTC = (HTC_CONTEXT *)htcHandle;
	adf_nbuf_t netbuf, tmpNbuf;

	/* retrieve each nbuf in the queue */
	netbuf = adf_nbuf_queue_first(&bufHead);

	while (netbuf) {

		tmpNbuf = netbuf;
		netbuf = adf_nbuf_queue_next(netbuf);

		ReturnBuffers(htcHandle, EndpointID, tmpNbuf, FALSE);
	}

	HTCCheckAndSendCreditReport(pHTC, (1 << EndpointID),&pHTC->Endpoints[EndpointID],EndpointID);
}
Exemple #2
0
ULONG  WAVESTREAM::StopStream(PCONTROL_PARM pControl)
{
   if(ulStreamState == STREAM_STOPPED) {
   	dprintf(("WAVESTREAM::StopStream %lx (already stopped)", ulStreamId));
   	fUnderrun = FALSE;
   	pControl->ulTime = GetCurrentTime();
	return NO_ERROR;
   }
   pahw->Stop(this);
   //Reset cleans up waveout instance
   OSS16_StreamReset(this);

   ulStreamState = STREAM_STOPPED;
   fUnderrun = FALSE;
   dprintf(("WAVESTREAM::StopStream %lx", ulStreamId));
   ReturnBuffers();
   pControl->ulTime = GetCurrentTime();
   _ulTimeBase = GetCurrentTime();
   return NO_ERROR;

}
LOCAL void _HTC_ReturnBuffers(htc_handle_t htcHandle, HTC_ENDPOINT_ID EndpointID,
			      adf_nbuf_t pBuffers)
{
	ReturnBuffers(htcHandle, EndpointID, pBuffers, TRUE);
}
Exemple #4
0
ULONG STREAM::Control(PDDCMDCONTROL p)
{
   switch (p->ulCmd) {
      case DDCMD_START:
         Trace(TRACE_DDCMD_CNTRL_START, 0);
         if (!Start())
            return ERROR_START_STREAM;
         fPaused = FALSE;
         fActive = TRUE;
         break;
      case DDCMD_STOP:
         Trace(TRACE_DDCMD_CNTRL_STOP, 0);
         Stop();
         ReturnBuffers();
         fPaused = FALSE;
         fActive = FALSE;
         p->pParm = &ulCurrentTime;
         p->ulParmSize = sizeof(ULONG);
         break;
      case DDCMD_PAUSE:
         Trace(TRACE_DDCMD_CNTRL_PAUSE, fPaused);
         if (fPaused) return ERROR_INVALID_SEQUENCE;
         Pause();
         fPaused = TRUE;
         fActive = FALSE;
         p->pParm = &ulCurrentTime;
         p->ulParmSize = sizeof(ULONG);
         break;
      case DDCMD_RESUME:
         Trace(TRACE_DDCMD_CNTRL_RESUME, fPaused);
         if (!fPaused) return ERROR_INVALID_SEQUENCE;
         Resume();
         fPaused = FALSE;
         fActive = TRUE;
         break;
      case DDCMD_ENABLE_EVENT: {
         Trace(TRACE_DDCMD_CNTRL_EVENT_ON, p->hEvent);
         EVENT *pevent = FindEvent(p->hEvent);
         if (pevent)
            pevent = new (pevent) EVENT(this,p->hEvent,(PCONTROL_PARM) p->pParm);
         else
            pevent = new EVENT(this,p->hEvent,(PCONTROL_PARM) p->pParm);
         if (!pevent)
            return ERROR_TOO_MANY_EVENTS;
         break;
      }
      case DDCMD_DISABLE_EVENT: {
         Trace(TRACE_DDCMD_CNTRL_EVENT_OFF, p->hEvent);
         EVENT *pevent=FindEvent(p->hEvent);
         if (!pevent)
            return ERROR_INVALID_EVENT;
         delete pevent;
         break;
      }
      case DDCMD_PAUSE_TIME:
         Trace(TRACE_DDCMD_CNTRL_PAUSE_TIME, ulCurrentTime);
         fIncrementCounter = FALSE;
         break;
      case DDCMD_RESUME_TIME:
         Trace(TRACE_DDCMD_CNTRL_RESUME_TIME, ulCurrentTime);
         fIncrementCounter = TRUE;
         break;
   }
   return 0;
}