📄 cpipe.hpp
字号:
// ****************************************************
// Public Variables for CQueuedPipe
// ****************************************************
private:
// ****************************************************
// Private Functions for CQueuedPipe
// ****************************************************
void AbortQueue( void );
// ****************************************************
// Private Variables for CQueuedPipe
// ****************************************************
protected:
// ****************************************************
// Protected Functions for CQueuedPipe
// ****************************************************
BOOL CheckForDoneTransfers( void );
virtual BOOL ProcessShortTransfer( PUHCD_TD pTD );
virtual void UpdateInterruptQHTreeLoad( IN const UCHAR branch,
IN const int deltaLoad );
// ****************************************************
// Protected Variables for CQueuedPipe
// ****************************************************
BOOL m_fIsReclamationPipe; // indicates if this pipe is participating in bandwidth reclamation
PUHCD_QH m_pPipeQH; // queue head for transfer
UCHAR m_dataToggleC; // Data toggle of last completed TD
UCHAR m_dataToggleQ; // Data toggle for next queued TD
CUhcd * const m_pCUhcd;
};
class CBulkPipe : public CQueuedPipe
{
public:
// ****************************************************
// Public Functions for CBulkPipe
// ****************************************************
CBulkPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,
IN CUhcd *const pCUhcd);
~CBulkPipe();
HCD_REQUEST_STATUS OpenPipe( void );
// ****************************************************
// Public variables for CBulkPipe
// ****************************************************
private:
// ****************************************************
// Private Functions for CBulkPipe
// ****************************************************
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Bulk");
return cszPipeType;
}
#endif // DEBUG
USHORT GetNumTDsNeeded( const STransfer *pTransfer = NULL ) const;
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
HCD_REQUEST_STATUS ScheduleTransfer( void );
HCD_REQUEST_STATUS AddTransfer( STransfer *pTransfer );
// ****************************************************
// Private variables for CBulkPipe
// ****************************************************
};
class CControlPipe : public CQueuedPipe
{
public:
// ****************************************************
// Public Functions for CControlPipe
// ****************************************************
CControlPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,
IN CUhcd *const pCUhcd);
~CControlPipe();
HCD_REQUEST_STATUS OpenPipe( void );
void ChangeMaxPacketSize( IN const USHORT wMaxPacketSize );
// ****************************************************
// Public variables for CControlPipe
// ****************************************************
private:
// ****************************************************
// Private Functions for CControlPipe
// ****************************************************
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Control");
return cszPipeType;
}
#endif // DEBUG
USHORT GetNumTDsNeeded( const STransfer *pTransfer = NULL ) const;
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
HCD_REQUEST_STATUS ScheduleTransfer( void );
HCD_REQUEST_STATUS AddTransfer( STransfer *pTransfer );
BOOL ProcessShortTransfer( PUHCD_TD pTD );
// ****************************************************
// Private variables for CControlPipe
// ****************************************************
};
class CInterruptPipe : public CQueuedPipe
{
public:
// ****************************************************
// Public Functions for CInterruptPipe
// ****************************************************
CInterruptPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,
IN CUhcd *const pCUhcd);
~CInterruptPipe();
HCD_REQUEST_STATUS OpenPipe( void );
// ****************************************************
// Public variables for CInterruptPipe
// ****************************************************
private:
// ****************************************************
// Private Functions for CInterruptPipe
// ****************************************************
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Interrupt");
return cszPipeType;
}
#endif // DEBUG
void UpdateInterruptQHTreeLoad( IN const UCHAR branch,
IN const int deltaLoad );
USHORT GetNumTDsNeeded( const STransfer *pTransfer = NULL ) const;
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
HCD_REQUEST_STATUS ScheduleTransfer( void );
HCD_REQUEST_STATUS AddTransfer( STransfer *pTransfer );
// ****************************************************
// Private variables for CInterruptPipe
// ****************************************************
};
class CIsochronousPipe : public CPipe
{
public:
// ****************************************************
// Public Functions for CIsochronousPipe
// ****************************************************
CIsochronousPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,
IN CUhcd *const pCUhcd);
~CIsochronousPipe();
HCD_REQUEST_STATUS OpenPipe( void );
HCD_REQUEST_STATUS ClosePipe( void );
HCD_REQUEST_STATUS AbortTransfer(
IN const LPTRANSFER_NOTIFY_ROUTINE lpCancelAddress,
IN const LPVOID lpvNotifyParameter,
IN LPCVOID lpvCancelId );
void ResetToggle( void ){}
// ****************************************************
// Public variables for CIsochronousPipe
// ****************************************************
private:
// ****************************************************
// Private Functions for CIsochronousPipe
// ****************************************************
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Isochronous");
return cszPipeType;
}
#endif // DEBUG
USHORT GetNumTDsNeeded( const STransfer *pTransfer = NULL ) const;
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
DWORD GetMemoryAllocationFlags( void ) const;
HCD_REQUEST_STATUS ScheduleTransfer( void );
HCD_REQUEST_STATUS AddTransfer( STransfer *pTransfer );
BOOL CheckForDoneTransfers( void );
// static void InsertIsochTDIntoFrameList( IN_OUT PUHCD_TD pTD,
// IN const DWORD dwFrameIndex );
//
// static void RemoveIsochTDFromFrameList( IN_OUT PUHCD_TD pTD,
// IN const DWORD dwFrameIndex );
// ****************************************************
// Private variables for CIsochronousPipe
// ****************************************************
PUHCD_TD m_pWakeupTD; // TD used to schedule transfers far into future
BOOL m_fUsingWakeupTD; // indicates if m_pWakeupTD is being used
#define ISOCH_TD_WAKEUP_INTERVAL DWORD(50) // wakeup TD will be scheduled 50 frames before
// the first real TD should be executed
CUhcd * const m_pCUhcd;
};
// This is the maximum number of frames of isoch data that can be queued
// successfully. These frames can be in one or more distinct transfers.
#define ISOCH_STREAMING_MAX 1000
#endif // __CPIPE_HPP__
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -