📄 cpipe.h
字号:
{
return TEXT("Bulk");
}
#endif // DEBUG
protected :
virtual BOOL RemoveQHeadFromQueue();
virtual BOOL InsertQHeadToQueue() ;
private:
// ****************************************************
// Private Functions for CBulkPipe
// ****************************************************
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
// ****************************************************
// Private variables for CBulkPipe
// ****************************************************
};
class CControlPipe : public CQueuedPipe
{
public:
// ****************************************************
// Public Functions for CBulkPipe
// ****************************************************
CControlPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,IN const BOOL fIsHighSpeed,
IN const UCHAR bDeviceAddress,
IN const UCHAR bHubAddress,IN const UCHAR bHubPort,
IN CEhcd * const pCEhcd);
~CControlPipe();
void ChangeMaxPacketSize( IN const USHORT wMaxPacketSize );
HCD_REQUEST_STATUS OpenPipe( void );
HCD_REQUEST_STATUS ClosePipe( void );
// ****************************************************
// Public variables for CBulkPipe
// ****************************************************
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
return TEXT("Control");
}
#endif // DEBUG
HCD_REQUEST_STATUS IssueTransfer(
IN const UCHAR address,
IN LPTRANSFER_NOTIFY_ROUTINE const lpfnCallback,
IN LPVOID const lpvCallbackParameter,
IN const DWORD dwFlags,
IN LPCVOID const lpvControlHeader,
IN const DWORD dwStartingFrame,
IN const DWORD dwFrames,
IN LPCDWORD const aLengths,
IN const DWORD dwBufferSize,
IN_OUT LPVOID const lpvBuffer,
IN const ULONG paBuffer,
IN LPCVOID const lpvCancelId,
OUT LPDWORD const adwIsochErrors,
OUT LPDWORD const adwIsochLengths,
OUT LPBOOL const lpfComplete,
OUT LPDWORD const lpdwBytesTransferred,
OUT LPDWORD const lpdwError ) ;
protected :
virtual BOOL RemoveQHeadFromQueue();
virtual BOOL InsertQHeadToQueue() ;
private:
// ****************************************************
// Private Functions for CBulkPipe
// ****************************************************
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
// ****************************************************
// Private variables for CBulkPipe
// ****************************************************
};
class CInterruptPipe : public CQueuedPipe
{
public:
// ****************************************************
// Public Functions for CInterruptPipe
// ****************************************************
CInterruptPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,IN const BOOL fIsHighSpeed,
IN const UCHAR bDeviceAddress,
IN const UCHAR bHubAddress,IN const UCHAR bHubPort,
IN CEhcd * const pCEhcd);
~CInterruptPipe();
HCD_REQUEST_STATUS OpenPipe( void );
HCD_REQUEST_STATUS ClosePipe( void );
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Interrupt");
return cszPipeType;
}
#endif // DEBUG
protected :
virtual BOOL RemoveQHeadFromQueue() { return TRUE;}; // We do not need for Interrupt
virtual BOOL InsertQHeadToQueue() {return TRUE;} ;
private:
// ****************************************************
// Private Functions for CInterruptPipe
// ****************************************************
void UpdateInterruptQHTreeLoad( IN const UCHAR branch,
IN const int deltaLoad );
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
HCD_REQUEST_STATUS AddTransfer( CQTransfer *pTransfer );
EndpointBuget m_EndptBuget;
BOOL m_bSuccess;
// ****************************************************
// Private variables for CInterruptPipe
// ****************************************************
};
#define MIN_ADVANCED_FRAME 6
class CIsochronousPipe : public CPipe
{
public:
// ****************************************************
// Public Functions for CIsochronousPipe
// ****************************************************
CIsochronousPipe( IN const LPCUSB_ENDPOINT_DESCRIPTOR lpEndpointDescriptor,
IN const BOOL fIsLowSpeed,IN const BOOL fIsHighSpeed,
IN const UCHAR bDeviceAddress,
IN const UCHAR bHubAddress,IN const UCHAR bHubPort,
IN CEhcd *const pCEhcd);
~CIsochronousPipe();
HCD_REQUEST_STATUS OpenPipe( void );
HCD_REQUEST_STATUS ClosePipe( void );
virtual HCD_REQUEST_STATUS IssueTransfer(
IN const UCHAR address,
IN LPTRANSFER_NOTIFY_ROUTINE const lpfnCallback,
IN LPVOID const lpvCallbackParameter,
IN const DWORD dwFlags,
IN LPCVOID const lpvControlHeader,
IN const DWORD dwStartingFrame,
IN const DWORD dwFrames,
IN LPCDWORD const aLengths,
IN const DWORD dwBufferSize,
IN_OUT LPVOID const lpvBuffer,
IN const ULONG paBuffer,
IN LPCVOID const lpvCancelId,
OUT LPDWORD const adwIsochErrors,
OUT LPDWORD const adwIsochLengths,
OUT LPBOOL const lpfComplete,
OUT LPDWORD const lpdwBytesTransferred,
OUT LPDWORD const lpdwError );
HCD_REQUEST_STATUS AbortTransfer(
IN const LPTRANSFER_NOTIFY_ROUTINE lpCancelAddress,
IN const LPVOID lpvNotifyParameter,
IN LPCVOID lpvCancelId );
// ****************************************************
// Public variables for CIsochronousPipe
// ****************************************************
HCD_REQUEST_STATUS ScheduleTransfer( void );
BOOL CheckForDoneTransfers( void );
CITD * AllocateCITD( CITransfer * pTransfer);
CSITD * AllocateCSITD( CSITransfer * pTransfer,CSITD * pPrev);
void FreeCITD(CITD * pITD);
void FreeCSITD(CSITD * pSITD);
#ifdef DEBUG
const TCHAR* GetPipeType( void ) const
{
static const TCHAR* cszPipeType = TEXT("Isochronous");
return cszPipeType;
}
#endif // DEBUG
private:
// ****************************************************
// Private Functions for CIsochronousPipe
// ****************************************************
BOOL AreTransferParametersValid( const STransfer *pTransfer = NULL ) const;
HCD_REQUEST_STATUS AddTransfer( STransfer *pTransfer );
CIsochTransfer * m_pQueuedTransfer;
DWORD m_dwLastValidFrame;
EndpointBuget m_EndptBuget;
BOOL m_bSuccess;
CITD ** m_pArrayOfCITD;
CSITD ** m_pArrayOfCSITD;
DWORD m_dwNumOfTD;
DWORD m_dwNumOfTDAvailable;
};
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -