XenevaOS
Loading...
Searching...
No Matches
Macros | Enumerations | Functions | Variables
dwhcidevice.c File Reference
#include "uspi/dwhcidevice.h"
#include "uspios.h"
#include "uspi/bcm2835.h"
#include "uspi/synchronize.h"
#include "uspi/macros.h"
#include <Drivers/uart.h>
#include "uspi/assert.h"
Include dependency graph for dwhcidevice.c:

Macros

#define ARM_IRQ_USB   9
 
#define DEVICE_ID_USB_HCD   3
 
#define DWC_CFG_DYNAMIC_FIFO
 
#define DWC_CFG_HOST_RX_FIFO_SIZE   1024
 
#define DWC_CFG_HOST_NPER_TX_FIFO_SIZE   1024
 
#define DWC_CFG_HOST_PER_TX_FIFO_SIZE   1024
 
#define MSEC2HZ(msec)   ((msec) * HZ / 1000)
 

Enumerations

enum  TStageState {
  StageStateNoSplitTransfer , StageStateStartSplit , StageStateCompleteSplit , StageStatePeriodicDelay ,
  StageStateUnknown
}
 
enum  TStageSubState { StageSubStateWaitForChannelDisable , StageSubStateWaitForTransactionComplete , StageSubStateUnknown }
 

Functions

boolean DWHCIDeviceInitCore (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceInitHost (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceEnableRootPort (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceReset (TDWHCIDevice *pThis)
 
void DWHCIDeviceEnableGlobalInterrupts (TDWHCIDevice *pThis)
 
void DWHCIDeviceEnableCommonInterrupts (TDWHCIDevice *pThis)
 
void DWHCIDeviceEnableHostInterrupts (TDWHCIDevice *pThis)
 
void DWHCIDeviceEnableChannelInterrupt (TDWHCIDevice *pThis, unsigned nChannel)
 
void DWHCIDeviceDisableChannelInterrupt (TDWHCIDevice *pThis, unsigned nChannel)
 
void DWHCIDeviceFlushTxFIFO (TDWHCIDevice *pThis, unsigned nFIFO)
 
void DWHCIDeviceFlushRxFIFO (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceTransferStage (TDWHCIDevice *pThis, TUSBRequest *pURB, boolean bIn, boolean bStatusStage)
 
void DWHCIDeviceCompletionRoutine (TUSBRequest *pURB, void *pParam, void *pContext)
 
boolean DWHCIDeviceTransferStageAsync (TDWHCIDevice *pThis, TUSBRequest *pURB, boolean bIn, boolean bStatusStage)
 
void DWHCIDeviceStartTransaction (TDWHCIDevice *pThis, TDWHCITransferStageData *pStageData)
 
void DWHCIDeviceStartChannel (TDWHCIDevice *pThis, TDWHCITransferStageData *pStageData)
 
void DWHCIDeviceChannelInterruptHandler (TDWHCIDevice *pThis, unsigned nChannel)
 
void DWHCIDeviceInterruptHandler (void *pParam)
 
void DWHCIDeviceTimerHandler (TKernelTimerHandle hTimer, void *pParam, void *pContext)
 
unsigned DWHCIDeviceAllocateChannel (TDWHCIDevice *pThis)
 
void DWHCIDeviceFreeChannel (TDWHCIDevice *pThis, unsigned nChannel)
 
boolean DWHCIDeviceWaitForBit (TDWHCIDevice *pThis, TDWHCIRegister *pRegister, u32 nMask, boolean bWaitUntilSet, unsigned nMsTimeout)
 
void DWHCIDeviceDumpRegister (TDWHCIDevice *pThis, const char *pName, u32 nAddress)
 
void DWHCIDeviceDumpStatus (TDWHCIDevice *pThis, unsigned nChannel)
 
void DWHCIDevice (TDWHCIDevice *pThis)
 
void _DWHCIDevice (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceInitialize (TDWHCIDevice *pThis)
 
int DWHCIDeviceGetDescriptor (TDWHCIDevice *pThis, TUSBEndpoint *pEndpoint, unsigned char ucType, unsigned char ucIndex, void *pBuffer, unsigned nBufSize, unsigned char ucRequestType)
 
boolean DWHCIDeviceSetAddress (TDWHCIDevice *pThis, TUSBEndpoint *pEndpoint, u8 ucDeviceAddress)
 
boolean DWHCIDeviceSetConfiguration (TDWHCIDevice *pThis, TUSBEndpoint *pEndpoint, u8 ucConfigurationValue)
 
int DWHCIDeviceControlMessage (TDWHCIDevice *pThis, TUSBEndpoint *pEndpoint, u8 ucRequestType, u8 ucRequest, u16 usValue, u16 usIndex, void *pData, u16 usDataSize)
 
int DWHCIDeviceTransfer (TDWHCIDevice *pThis, TUSBEndpoint *pEndpoint, void *pBuffer, unsigned nBufSize)
 
boolean DWHCIDeviceSubmitBlockingRequest (TDWHCIDevice *pThis, TUSBRequest *pURB)
 
boolean DWHCIDeviceSubmitAsyncRequest (TDWHCIDevice *pThis, TUSBRequest *pURB)
 
TUSBSpeed DWHCIDeviceGetPortSpeed (TDWHCIDevice *pThis)
 
boolean DWHCIDeviceOvercurrentDetected (TDWHCIDevice *pThis)
 
void DWHCIDeviceDisableRootPort (TDWHCIDevice *pThis)
 

Variables

bool _dwhcidebug
 

Macro Definition Documentation

◆ ARM_IRQ_USB

#define ARM_IRQ_USB   9

◆ DEVICE_ID_USB_HCD

#define DEVICE_ID_USB_HCD   3

◆ DWC_CFG_DYNAMIC_FIFO

#define DWC_CFG_DYNAMIC_FIFO

◆ DWC_CFG_HOST_NPER_TX_FIFO_SIZE

#define DWC_CFG_HOST_NPER_TX_FIFO_SIZE   1024

◆ DWC_CFG_HOST_PER_TX_FIFO_SIZE

#define DWC_CFG_HOST_PER_TX_FIFO_SIZE   1024

◆ DWC_CFG_HOST_RX_FIFO_SIZE

#define DWC_CFG_HOST_RX_FIFO_SIZE   1024

◆ MSEC2HZ

#define MSEC2HZ (   msec)    ((msec) * HZ / 1000)

Enumeration Type Documentation

◆ TStageState

Enumerator
StageStateNoSplitTransfer 
StageStateStartSplit 
StageStateCompleteSplit 
StageStatePeriodicDelay 
StageStateUnknown 

◆ TStageSubState

Enumerator
StageSubStateWaitForChannelDisable 
StageSubStateWaitForTransactionComplete 
StageSubStateUnknown 

Function Documentation

◆ _DWHCIDevice()

void _DWHCIDevice ( TDWHCIDevice pThis)

◆ DWHCIDevice()

void DWHCIDevice ( TDWHCIDevice pThis)

◆ DWHCIDeviceAllocateChannel()

unsigned DWHCIDeviceAllocateChannel ( TDWHCIDevice pThis)

◆ DWHCIDeviceChannelInterruptHandler()

void DWHCIDeviceChannelInterruptHandler ( TDWHCIDevice pThis,
unsigned  nChannel 
)

◆ DWHCIDeviceCompletionRoutine()

void DWHCIDeviceCompletionRoutine ( TUSBRequest pURB,
void *  pParam,
void *  pContext 
)

◆ DWHCIDeviceControlMessage()

int DWHCIDeviceControlMessage ( TDWHCIDevice pThis,
TUSBEndpoint pEndpoint,
u8  ucRequestType,
u8  ucRequest,
u16  usValue,
u16  usIndex,
void *  pData,
u16  usDataSize 
)

◆ DWHCIDeviceDisableChannelInterrupt()

void DWHCIDeviceDisableChannelInterrupt ( TDWHCIDevice pThis,
unsigned  nChannel 
)

◆ DWHCIDeviceDisableRootPort()

void DWHCIDeviceDisableRootPort ( TDWHCIDevice pThis)

◆ DWHCIDeviceDumpRegister()

void DWHCIDeviceDumpRegister ( TDWHCIDevice pThis,
const char *  pName,
u32  nAddress 
)

◆ DWHCIDeviceDumpStatus()

void DWHCIDeviceDumpStatus ( TDWHCIDevice pThis,
unsigned  nChannel 
)

◆ DWHCIDeviceEnableChannelInterrupt()

void DWHCIDeviceEnableChannelInterrupt ( TDWHCIDevice pThis,
unsigned  nChannel 
)

◆ DWHCIDeviceEnableCommonInterrupts()

void DWHCIDeviceEnableCommonInterrupts ( TDWHCIDevice pThis)

◆ DWHCIDeviceEnableGlobalInterrupts()

void DWHCIDeviceEnableGlobalInterrupts ( TDWHCIDevice pThis)

◆ DWHCIDeviceEnableHostInterrupts()

void DWHCIDeviceEnableHostInterrupts ( TDWHCIDevice pThis)

◆ DWHCIDeviceEnableRootPort()

boolean DWHCIDeviceEnableRootPort ( TDWHCIDevice pThis)

◆ DWHCIDeviceFlushRxFIFO()

void DWHCIDeviceFlushRxFIFO ( TDWHCIDevice pThis)

◆ DWHCIDeviceFlushTxFIFO()

void DWHCIDeviceFlushTxFIFO ( TDWHCIDevice pThis,
unsigned  nFIFO 
)

◆ DWHCIDeviceFreeChannel()

void DWHCIDeviceFreeChannel ( TDWHCIDevice pThis,
unsigned  nChannel 
)

◆ DWHCIDeviceGetDescriptor()

int DWHCIDeviceGetDescriptor ( TDWHCIDevice pThis,
TUSBEndpoint pEndpoint,
unsigned char  ucType,
unsigned char  ucIndex,
void *  pBuffer,
unsigned  nBufSize,
unsigned char  ucRequestType 
)

◆ DWHCIDeviceGetPortSpeed()

TUSBSpeed DWHCIDeviceGetPortSpeed ( TDWHCIDevice pThis)

◆ DWHCIDeviceInitCore()

boolean DWHCIDeviceInitCore ( TDWHCIDevice pThis)

◆ DWHCIDeviceInitHost()

boolean DWHCIDeviceInitHost ( TDWHCIDevice pThis)

◆ DWHCIDeviceInitialize()

boolean DWHCIDeviceInitialize ( TDWHCIDevice pThis)

◆ DWHCIDeviceInterruptHandler()

void DWHCIDeviceInterruptHandler ( void *  pParam)

◆ DWHCIDeviceOvercurrentDetected()

boolean DWHCIDeviceOvercurrentDetected ( TDWHCIDevice pThis)

◆ DWHCIDeviceReset()

boolean DWHCIDeviceReset ( TDWHCIDevice pThis)

◆ DWHCIDeviceSetAddress()

boolean DWHCIDeviceSetAddress ( TDWHCIDevice pThis,
TUSBEndpoint pEndpoint,
u8  ucDeviceAddress 
)

◆ DWHCIDeviceSetConfiguration()

boolean DWHCIDeviceSetConfiguration ( TDWHCIDevice pThis,
TUSBEndpoint pEndpoint,
u8  ucConfigurationValue 
)

◆ DWHCIDeviceStartChannel()

void DWHCIDeviceStartChannel ( TDWHCIDevice pThis,
TDWHCITransferStageData pStageData 
)

◆ DWHCIDeviceStartTransaction()

void DWHCIDeviceStartTransaction ( TDWHCIDevice pThis,
TDWHCITransferStageData pStageData 
)

◆ DWHCIDeviceSubmitAsyncRequest()

boolean DWHCIDeviceSubmitAsyncRequest ( TDWHCIDevice pThis,
TUSBRequest pURB 
)

◆ DWHCIDeviceSubmitBlockingRequest()

boolean DWHCIDeviceSubmitBlockingRequest ( TDWHCIDevice pThis,
TUSBRequest pURB 
)

◆ DWHCIDeviceTimerHandler()

void DWHCIDeviceTimerHandler ( TKernelTimerHandle  hTimer,
void *  pParam,
void *  pContext 
)

◆ DWHCIDeviceTransfer()

int DWHCIDeviceTransfer ( TDWHCIDevice pThis,
TUSBEndpoint pEndpoint,
void *  pBuffer,
unsigned  nBufSize 
)

◆ DWHCIDeviceTransferStage()

boolean DWHCIDeviceTransferStage ( TDWHCIDevice pThis,
TUSBRequest pURB,
boolean  bIn,
boolean  bStatusStage 
)

◆ DWHCIDeviceTransferStageAsync()

boolean DWHCIDeviceTransferStageAsync ( TDWHCIDevice pThis,
TUSBRequest pURB,
boolean  bIn,
boolean  bStatusStage 
)

◆ DWHCIDeviceWaitForBit()

boolean DWHCIDeviceWaitForBit ( TDWHCIDevice pThis,
TDWHCIRegister pRegister,
u32  nMask,
boolean  bWaitUntilSet,
unsigned  nMsTimeout 
)

Variable Documentation

◆ _dwhcidebug

bool _dwhcidebug