PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
usbdpriv.h File Reference
#include "irx_imports.h"
#include "defs.h"
#include "types.h"
#include "usbd.h"
+ Include dependency graph for usbdpriv.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _argOption
 
struct  _usbdConfig
 
struct  _timerCbStruct
 
struct  _ioRequest
 
struct  _device
 
struct  _hcTd
 
struct  _hcIsoTd
 
struct  _hcEdHcArea
 
union  _hcEdHcAreaU
 
struct  _hcEd
 
struct  _endpoint
 
struct  _usbHub
 
struct  _hcCA
 
struct  _ohciRegs
 
struct  _memPool
 
struct  _usbdReportDescriptor
 
struct  _usbdKernelResources
 
union  _ioRequest.__unnamed163__
 

Macros

#define OHCI_REG_BASE   0xBF801600
 
#define dbg_printf(a...)   (void)0
 
#define READ_UINT16(a)   (((u8 *)a)[0] | (((u8 *)a)[1] << 8))
 
#define NOTIN_QUEUE   0
 
#define GENTD_QUEUE   1
 
#define ISOTD_QUEUE   2
 
#define TYPE_CONTROL   0x3F
 
#define TYPE_BULK   0x40
 
#define TYPE_ISOCHRON   0x41
 
#define DEVICE_NOTCONNECTED   1
 
#define DEVICE_CONNECTED   3
 
#define DEVICE_RESETDELAYED   4
 
#define DEVICE_RESETPENDING   5
 
#define DEVICE_RESETCOMPLETE   6
 
#define DEVICE_FETCHINGDESCRIPTOR   7
 
#define DEVICE_READY   8
 
#define PORT_CONNECTION   0
 
#define PORT_ENABLE   1
 
#define PORT_SUSPEND   2
 
#define PORT_OVER_CURRENT   3
 
#define PORT_RESET   4
 
#define PORT_POWER   8
 
#define PORT_LOW_SPEED   9
 
#define C_HUB_LOCAL_POWER   0
 
#define C_HUB_OVER_CURRENT   1
 
#define C_PORT_CONNECTION   16
 
#define C_PORT_ENABLE   17
 
#define C_PORT_SUSPEND   18
 
#define C_PORT_OVER_CURRENT   19
 
#define C_PORT_RESET   20
 
#define BIT(x)   (((u32)1) << (x))
 
#define C_PORT_FLAGS    (BIT(C_PORT_CONNECTION) | BIT(C_PORT_ENABLE) | BIT(C_PORT_SUSPEND) | BIT(C_PORT_OVER_CURRENT) | BIT(C_PORT_RESET))
 
#define HCED_DIR_OUT   BIT(11)
 
#define HCED_DIR_IN   BIT(12)
 
#define HCED_SPEED   BIT(13)
 
#define HCED_SKIP   BIT(14)
 
#define HCED_ISOC   BIT(15)
 
#define HCED_DIR_MASK   (HCED_DIR_OUT | HCED_DIR_IN)
 
#define ED_HALTED(a)   ((u32)((a).m_tdHead) & 1)
 
#define ED_SKIPPED(a)   ((u32)((a).m_hcArea.stru.m_hcArea) & HCED_SKIP)
 
#define TD_HCAREA(CC, T, DI, DP, R)   (u32)((((CC) << 12) | ((T) << 8) | ((DI) << 5) | ((DP) << 3) | ((R) << 2)))
 
#define TD_SETUP   0
 
#define TD_OUT   1
 
#define TD_IN   2
 
#define OHCI_INT_SO   BIT(0)
 
#define OHCI_INT_WDH   BIT(1)
 
#define OHCI_INT_SF   BIT(2)
 
#define OHCI_INT_RD   BIT(3)
 
#define OHCI_INT_UE   BIT(4)
 
#define OHCI_INT_FNO   BIT(5)
 
#define OHCI_INT_RHSC   BIT(6)
 
#define OHCI_INT_OC   BIT(30)
 
#define OHCI_INT_MIE   BIT(31)
 
#define OHCI_COM_HCR   BIT(0)
 
#define OHCI_COM_CLF   BIT(1)
 
#define OHCI_COM_BLF   BIT(2)
 
#define OHCI_CTR_CBSR   (3 << 0)
 
#define OHCI_CTR_PLE   BIT(2)
 
#define OHCI_CTR_IE   BIT(3)
 
#define OHCI_CTR_CLE   BIT(4)
 
#define OHCI_CTR_BLE   BIT(5)
 
#define OHCI_CTR_USB_RESET   (0 << 6)
 
#define OHCI_CTR_USB_RESUME   (1 << 6)
 
#define OHCI_CTR_USB_OPERATIONAL   (2 << 6)
 
#define OHCI_CTR_USB_SUSPEND   (3 << 6)
 

Typedefs

typedef struct _argOption UsbdArgOption_t
 
typedef struct _usbdConfig UsbdConfig_t
 
typedef void(* TimerCallback) (void *arg)
 
typedef void(* InternCallback) (struct _ioRequest *arg)
 
typedef struct _timerCbStruct UsbdTimerCbStruct_t
 
typedef struct _ioRequest UsbdIoRequest_t
 
typedef struct _device UsbdDevice_t
 
typedef struct _hcTd UsbdHcTD_t
 
typedef struct _hcIsoTd UsbdHcIsoTD_t
 
typedef struct _hcEd UsbdHcED_t
 
typedef struct _endpoint UsbdEndpoint_t
 
typedef struct _usbHub UsbdUsbHub_t
 
typedef struct _hcCA HcCA
 
typedef struct _ohciRegs OhciRegs
 
typedef struct _memPool UsbdMemoryPool_t
 
typedef struct _usbdReportDescriptor UsbdReportDescriptor_t
 
typedef struct _usbdKernelResources UsbdKernelResources_t
 

Functions

void hubResetDevicePort (UsbdDevice_t *dev)
 
int initHubDriver (void)
 
void deinitHubDriver (void)
 
UsbdDevice_tfetchDeviceById (int devId)
 
UsbdEndpoint_tfetchEndpointById (int id)
 
UsbdDevice_tgetDeviceTreeRoot (void)
 
UsbdDevice_tattachChildDevice (UsbdDevice_t *parent, u32 portNum)
 
void freeDevice (UsbdDevice_t *dev)
 
UsbdIoRequest_tallocIoRequest (void)
 
void freeIoRequest (UsbdIoRequest_t *req)
 
UsbdEndpoint_tallocEndpointForDevice (UsbdDevice_t *dev, u32 align)
 
int cleanUpFunc (UsbdDevice_t *dev, UsbdEndpoint_t *ep)
 
UsbdHcTD_tallocTd (void)
 
void freeTd (UsbdHcTD_t *argTd)
 
UsbdHcIsoTD_tallocIsoTd (void)
 
void freeIsoTd (UsbdHcIsoTD_t *argTd)
 
int addTimerCallback (UsbdTimerCbStruct_t *arg, TimerCallback func, void *cbArg, int delay)
 
int cancelTimerCallback (UsbdTimerCbStruct_t *arg)
 
void handleTimerList (void)
 
UsbdEndpoint_topenDeviceEndpoint (UsbdDevice_t *dev, const UsbEndpointDescriptor *endpDesc, u32 alignFlag)
 
int removeEndpointFromDevice (UsbdDevice_t *dev, UsbdEndpoint_t *ep)
 
void handleIoReqList (UsbdEndpoint_t *ep)
 
void usbdRebootInner (void)
 
void hubResetDevice (UsbdDevice_t *dev)
 
int checkDelayedResets (UsbdDevice_t *dev)
 
void handleRhsc (void)
 
void processDoneQueue_GenTd (UsbdHcTD_t *arg)
 
void processDoneQueue_IsoTd (UsbdHcIsoTD_t *arg)
 
void hcdProcessIntr (void)
 
void PostIntrEnableFunction (void)
 
int initHcdStructs (void)
 
void deinitHcd (void)
 
void * AllocSysMemoryWrap (int size)
 
int FreeSysMemoryWrap (void *ptr)
 
int usbdLock (void)
 
int usbdUnlock (void)
 
void usbdReboot (int ac)
 
int handleStaticDeviceDescriptor (UsbdDevice_t *dev, UsbDeviceDescriptor *devDescStart, UsbDeviceDescriptor *devDescEnd)
 
int callUsbDriverFunc (int(*func)(int devId), int devId, void *gpSeg)
 
int doRegisterDriver (sceUsbdLddOps *drv, void *drvGpSeg)
 
int doRegisterAutoLoader (sceUsbdLddOps *drv, void *drvGpSeg)
 
int doUnregisterDriver (sceUsbdLddOps *drv)
 
int doUnregisterAutoLoader (void)
 
void * doGetDeviceStaticDescriptor (int devId, void *data, u8 type)
 
int doGetDeviceLocation (UsbdDevice_t *dev, u8 *path)
 
UsbdEndpoint_tdoOpenEndpoint (UsbdDevice_t *dev, const UsbEndpointDescriptor *endpDesc, u32 alignFlag)
 
int doCloseEndpoint (UsbdEndpoint_t *ep)
 
int attachIoReqToEndpoint (UsbdEndpoint_t *ep, UsbdIoRequest_t *req, void *destdata, u16 length, void *callback)
 
int doControlTransfer (UsbdEndpoint_t *ep, UsbdIoRequest_t *req, u8 requestType, u8 request, u16 value, u16 index, u16 length, void *destdata, void *callback)
 
int hubTimedSetFuncAddress (UsbdDevice_t *dev)
 
void flushPort (UsbdDevice_t *dev)
 
int usbdInitInner (void)
 

Variables

UsbdConfig_t usbConfig
 
UsbdMemoryPool_tmemPool
 
UsbdKernelResources_t usbKernelResources
 
UsbdIoRequest_tcbListStart
 
UsbdIoRequest_tcbListEnd
 
sceUsbdLddOpsdrvListStart
 
sceUsbdLddOpsdrvListEnd
 
sceUsbdLddOpsdrvAutoLoader
 

Detailed Description

USB Driver function prototypes and constants.

Definition in file usbdpriv.h.


Data Structure Documentation

◆ _argOption

struct _argOption

Definition at line 35 of file usbdpriv.h.

Data Fields
const char * param
int * value
int * value2

◆ _usbdConfig

struct _usbdConfig

Definition at line 42 of file usbdpriv.h.

Data Fields
int m_maxDevices
int m_maxEndpoints
int m_maxTransfDesc
int m_maxIsoTransfDesc
int m_maxIoReqs
int m_maxStaticDescSize
int m_maxHubDevices
int m_maxPortsPerHub
int m_allocatedSize_unused
int m_hcdThreadPrio
int m_cbThreadPrio
int m_curDescNum

◆ _timerCbStruct

struct _timerCbStruct

Definition at line 72 of file usbdpriv.h.

+ Collaboration diagram for _timerCbStruct:
Data Fields
u32 m_isActive
struct _timerCbStruct * m_prev
struct _timerCbStruct * m_next
TimerCallback m_callbackProc
void * m_callbackArg
u32 m_delayCount

◆ _ioRequest

struct _ioRequest

Definition at line 82 of file usbdpriv.h.

+ Collaboration diagram for _ioRequest:
Data Fields
u32 m_id
u32 m_busyFlag
struct _ioRequest * m_next
struct _ioRequest * m_prev
struct _endpoint * m_correspEndpoint
UsbDeviceRequest m_devReq
void * m_destPtr
u32 m_length
InternCallback m_callbackProc
u32 m_resultCode
u32 m_transferedBytes
u32 m_waitFrames
void * m_userCallbackArg
union _ioRequest.__unnamed163__ __unnamed__
void * m_gpSeg
sceUsbdMultiIsochronousRequest m_req

◆ _device

struct _device

Definition at line 107 of file usbdpriv.h.

+ Collaboration diagram for _device:
Data Fields
u32 m_id
struct _device * m_next
struct _device * m_prev
struct _endpoint * m_endpointListStart
struct _endpoint * m_endpointListEnd
sceUsbdLddOps * m_devDriver
u8 m_deviceStatus
u8 m_functionAddress
u8 m_isLowSpeedDevice
u8 m_resetFlag
u32 m_magicPowerValue
struct _device * m_childListStart
struct _device * m_childListEnd
struct _device * m_parent
u32 m_attachedToPortNo
void * m_privDataField
UsbdTimerCbStruct_t m_timer
UsbdIoRequest_t m_ioRequest
u32 m_functionDelay
void * m_staticDeviceDescPtr
void * m_staticDeviceDescEndPtr
u32 m_fetchDescriptorCounter
struct _usbdReportDescriptor * m_reportDescriptorCurForFetch
struct _usbdReportDescriptor * m_reportDescriptorStart
struct _usbdReportDescriptor * m_reportDescriptorEnd

◆ _hcTd

struct _hcTd

Definition at line 136 of file usbdpriv.h.

+ Collaboration diagram for _hcTd:
Data Fields
u32 m_hcArea
void * m_curBufPtr
struct _hcTd * m_next
void * m_bufferEnd

◆ _hcIsoTd

struct _hcIsoTd

Definition at line 144 of file usbdpriv.h.

+ Collaboration diagram for _hcIsoTd:
Data Fields
u32 m_hcArea
void * m_bufferPage0
struct _hcIsoTd * m_next
void * m_bufferEnd
u16 m_psw[8]

◆ _hcEdHcArea

struct _hcEdHcArea

Definition at line 153 of file usbdpriv.h.

Data Fields
u16 m_hcArea
u16 m_maxPacketSize

◆ _hcEdHcAreaU

union _hcEdHcAreaU

Definition at line 159 of file usbdpriv.h.

+ Collaboration diagram for _hcEdHcAreaU:
Data Fields
struct _hcEdHcArea stru
u32 asu32

◆ _hcEd

struct _hcEd

Definition at line 165 of file usbdpriv.h.

+ Collaboration diagram for _hcEd:
Data Fields
union _hcEdHcAreaU m_hcArea
UsbdHcTD_t * m_tdTail
UsbdHcTD_t * m_tdHead
struct _hcEd * m_next

◆ _endpoint

struct _endpoint

Definition at line 173 of file usbdpriv.h.

+ Collaboration diagram for _endpoint:
Data Fields
u32 m_id
u32 m_inTdQueue
struct _endpoint * m_next
struct _endpoint * m_prev
struct _endpoint * m_busyNext
struct _endpoint * m_busyPrev
UsbdDevice_t * m_correspDevice
UsbdIoRequest_t * m_ioReqListStart
UsbdIoRequest_t * m_ioReqListEnd
UsbdHcED_t * m_hcEd
u32 m_endpointType
u32 m_isochronLastFrameNum
UsbdTimerCbStruct_t m_timer
u32 m_alignFlag
u8 m_schedulingIndex
u8 m_waitHigh
u8 m_waitLow
u8 m_packetSizeForScheduling

◆ _usbHub

struct _usbHub

Definition at line 195 of file usbdpriv.h.

+ Collaboration diagram for _usbHub:
Data Fields
struct _usbHub * m_next
u32 m_pad1[1]
u32 m_curAllocatedCount
UsbdDevice_t * m_dev
UsbdEndpoint_t * m_controlEp
UsbdEndpoint_t * m_statusChangeEp
UsbdIoRequest_t m_controlIoReq
UsbdIoRequest_t m_statusIoReq
u32 m_maxPower
u32 m_isSelfPowered
UsbHubDescriptor m_desc
u32 m_pad2[6]
u32 m_numChildDevices
u32 m_portCounter
u32 m_hubStatusCounter
u16 m_hubStatus
u16 m_hubStatusChange
u32 m_portStatusChange
u8 m_statusChangeInfo[8]
u32 m_pad3[6]

◆ _hcCA

struct _hcCA

Definition at line 219 of file usbdpriv.h.

+ Collaboration diagram for _hcCA:
Data Fields
volatile UsbdHcED_t * InterruptTable[32]
volatile u16 FrameNumber
volatile u16 pad
volatile UsbdHcTD_t * DoneHead
volatile u8 reserved[116]
volatile u32 pad2

◆ _ohciRegs

struct _ohciRegs

Definition at line 229 of file usbdpriv.h.

+ Collaboration diagram for _ohciRegs:
Data Fields
volatile u32 HcRevision
volatile u32 HcControl
volatile u32 HcCommandStatus
volatile u32 HcInterruptStatus
volatile u32 HcInterruptEnable
volatile u32 HcInterruptDisable
volatile HcCA * HcHCCA
volatile UsbdHcED_t * HcPeriodCurrentEd
volatile UsbdHcED_t * HcControlHeadEd
volatile UsbdHcED_t * HcControlCurrentEd
volatile UsbdHcED_t * HcBulkHeadEd
volatile UsbdHcED_t * HcBulkCurrentEd
volatile u32 HcDoneHead
volatile u32 HcFmInterval
volatile u32 HcFmRemaining
volatile u32 HcFmNumber
volatile u32 HcPeriodicStart
volatile u32 HcLsThreshold
volatile u32 HcRhDescriptorA
volatile u32 HcRhDescriptorB
volatile u32 HcRhStatus
volatile u32 HcRhPortStatus[2]

◆ _memPool

struct _memPool

Definition at line 255 of file usbdpriv.h.

+ Collaboration diagram for _memPool:
Data Fields
volatile OhciRegs * m_ohciRegs
volatile HcCA * m_hcHCCA
struct _hcEd * m_hcEdBuf
struct _hcTd * m_freeHcTdList
struct _hcTd * m_hcTdBuf
struct _hcTd * m_hcTdBufEnd
struct _hcIsoTd * m_freeHcIsoTdList
struct _hcIsoTd * m_hcIsoTdBuf
struct _hcIsoTd * m_hcIsoTdBufEnd
struct _ioRequest ** m_hcTdToIoReqLUT
struct _ioRequest ** m_hcIsoTdToIoReqLUT
struct _ioRequest * m_ioReqBufPtr
struct _ioRequest * m_freeIoReqList
struct _ioRequest * m_freeIoReqListEnd
struct _device * m_deviceTreeBuf
struct _device * m_freeDeviceListStart
struct _device * m_freeDeviceListEnd
struct _endpoint * m_endpointBuf
struct _endpoint * m_freeEpListStart
struct _endpoint * m_freeEpListEnd
struct _endpoint * m_tdQueueStart
struct _endpoint * m_tdQueueEnd
u32 m_interruptBandwidthSchedulingValues[32]
u32 m_delayResets
int m_interruptCounters[9]
struct _timerCbStruct * m_timerListStart
struct _timerCbStruct * m_timerListEnd
struct _device * m_deviceTreeRoot

◆ _usbdReportDescriptor

struct _usbdReportDescriptor

Definition at line 298 of file usbdpriv.h.

+ Collaboration diagram for _usbdReportDescriptor:
Data Fields
struct _usbdReportDescriptor * m_next
struct _usbdReportDescriptor * m_prev
u32 m_cfgNum
u32 m_ifNum
u32 m_length
u8 m_data[]

◆ _usbdKernelResources

struct _usbdKernelResources

Definition at line 308 of file usbdpriv.h.

Data Fields
int m_usbdSema
int m_hcdTid
int m_hcdIrqEvent
int m_callbackTid
int m_callbackEvent

◆ _ioRequest.__unnamed163__

union _ioRequest.__unnamed163__

Definition at line 97 of file usbdpriv.h.

Data Fields
void * m_userCallbackProc
sceUsbdDoneCallback m_userCallbackProcRegular
sceUsbdMultiIsochronousDoneCallback m_userCallbackProcMultiIsochronous

Macro Definition Documentation

◆ OHCI_REG_BASE

#define OHCI_REG_BASE   0xBF801600

Definition at line 25 of file usbdpriv.h.

◆ dbg_printf

#define dbg_printf (   a...)    (void)0

Definition at line 30 of file usbdpriv.h.

◆ READ_UINT16

#define READ_UINT16 (   a)    (((u8 *)a)[0] | (((u8 *)a)[1] << 8))

Definition at line 33 of file usbdpriv.h.

◆ NOTIN_QUEUE

#define NOTIN_QUEUE   0

Definition at line 317 of file usbdpriv.h.

◆ GENTD_QUEUE

#define GENTD_QUEUE   1

Definition at line 318 of file usbdpriv.h.

◆ ISOTD_QUEUE

#define ISOTD_QUEUE   2

Definition at line 319 of file usbdpriv.h.

◆ TYPE_CONTROL

#define TYPE_CONTROL   0x3F

Definition at line 321 of file usbdpriv.h.

◆ TYPE_BULK

#define TYPE_BULK   0x40

Definition at line 322 of file usbdpriv.h.

◆ TYPE_ISOCHRON

#define TYPE_ISOCHRON   0x41

Definition at line 323 of file usbdpriv.h.

◆ DEVICE_NOTCONNECTED

#define DEVICE_NOTCONNECTED   1

Definition at line 325 of file usbdpriv.h.

◆ DEVICE_CONNECTED

#define DEVICE_CONNECTED   3

Definition at line 326 of file usbdpriv.h.

◆ DEVICE_RESETDELAYED

#define DEVICE_RESETDELAYED   4

Definition at line 327 of file usbdpriv.h.

◆ DEVICE_RESETPENDING

#define DEVICE_RESETPENDING   5

Definition at line 328 of file usbdpriv.h.

◆ DEVICE_RESETCOMPLETE

#define DEVICE_RESETCOMPLETE   6

Definition at line 329 of file usbdpriv.h.

◆ DEVICE_FETCHINGDESCRIPTOR

#define DEVICE_FETCHINGDESCRIPTOR   7

Definition at line 330 of file usbdpriv.h.

◆ DEVICE_READY

#define DEVICE_READY   8

Definition at line 331 of file usbdpriv.h.

◆ PORT_CONNECTION

#define PORT_CONNECTION   0

Definition at line 333 of file usbdpriv.h.

◆ PORT_ENABLE

#define PORT_ENABLE   1

Definition at line 334 of file usbdpriv.h.

◆ PORT_SUSPEND

#define PORT_SUSPEND   2

Definition at line 335 of file usbdpriv.h.

◆ PORT_OVER_CURRENT

#define PORT_OVER_CURRENT   3

Definition at line 336 of file usbdpriv.h.

◆ PORT_RESET

#define PORT_RESET   4

Definition at line 337 of file usbdpriv.h.

◆ PORT_POWER

#define PORT_POWER   8

Definition at line 338 of file usbdpriv.h.

◆ PORT_LOW_SPEED

#define PORT_LOW_SPEED   9

Definition at line 339 of file usbdpriv.h.

◆ C_HUB_LOCAL_POWER

#define C_HUB_LOCAL_POWER   0

Definition at line 341 of file usbdpriv.h.

◆ C_HUB_OVER_CURRENT

#define C_HUB_OVER_CURRENT   1

Definition at line 342 of file usbdpriv.h.

◆ C_PORT_CONNECTION

#define C_PORT_CONNECTION   16

Definition at line 344 of file usbdpriv.h.

◆ C_PORT_ENABLE

#define C_PORT_ENABLE   17

Definition at line 345 of file usbdpriv.h.

◆ C_PORT_SUSPEND

#define C_PORT_SUSPEND   18

Definition at line 346 of file usbdpriv.h.

◆ C_PORT_OVER_CURRENT

#define C_PORT_OVER_CURRENT   19

Definition at line 347 of file usbdpriv.h.

◆ C_PORT_RESET

#define C_PORT_RESET   20

Definition at line 348 of file usbdpriv.h.

◆ BIT

#define BIT (   x)    (((u32)1) << (x))

Definition at line 350 of file usbdpriv.h.

◆ C_PORT_FLAGS

#define C_PORT_FLAGS    (BIT(C_PORT_CONNECTION) | BIT(C_PORT_ENABLE) | BIT(C_PORT_SUSPEND) | BIT(C_PORT_OVER_CURRENT) | BIT(C_PORT_RESET))

Definition at line 352 of file usbdpriv.h.

◆ HCED_DIR_OUT

#define HCED_DIR_OUT   BIT(11)

Definition at line 355 of file usbdpriv.h.

◆ HCED_DIR_IN

#define HCED_DIR_IN   BIT(12)

Definition at line 356 of file usbdpriv.h.

◆ HCED_SPEED

#define HCED_SPEED   BIT(13)

Definition at line 357 of file usbdpriv.h.

◆ HCED_SKIP

#define HCED_SKIP   BIT(14)

Definition at line 358 of file usbdpriv.h.

◆ HCED_ISOC

#define HCED_ISOC   BIT(15)

Definition at line 359 of file usbdpriv.h.

◆ HCED_DIR_MASK

#define HCED_DIR_MASK   (HCED_DIR_OUT | HCED_DIR_IN)

Definition at line 360 of file usbdpriv.h.

◆ ED_HALTED

#define ED_HALTED (   a)    ((u32)((a).m_tdHead) & 1)

Definition at line 362 of file usbdpriv.h.

◆ ED_SKIPPED

#define ED_SKIPPED (   a)    ((u32)((a).m_hcArea.stru.m_hcArea) & HCED_SKIP)

Definition at line 363 of file usbdpriv.h.

◆ TD_HCAREA

#define TD_HCAREA (   CC,
  T,
  DI,
  DP,
 
)    (u32)((((CC) << 12) | ((T) << 8) | ((DI) << 5) | ((DP) << 3) | ((R) << 2)))

Definition at line 365 of file usbdpriv.h.

◆ TD_SETUP

#define TD_SETUP   0

Definition at line 367 of file usbdpriv.h.

◆ TD_OUT

#define TD_OUT   1

Definition at line 368 of file usbdpriv.h.

◆ TD_IN

#define TD_IN   2

Definition at line 369 of file usbdpriv.h.

◆ OHCI_INT_SO

#define OHCI_INT_SO   BIT(0)

Definition at line 371 of file usbdpriv.h.

◆ OHCI_INT_WDH

#define OHCI_INT_WDH   BIT(1)

Definition at line 372 of file usbdpriv.h.

◆ OHCI_INT_SF

#define OHCI_INT_SF   BIT(2)

Definition at line 373 of file usbdpriv.h.

◆ OHCI_INT_RD

#define OHCI_INT_RD   BIT(3)

Definition at line 374 of file usbdpriv.h.

◆ OHCI_INT_UE

#define OHCI_INT_UE   BIT(4)

Definition at line 375 of file usbdpriv.h.

◆ OHCI_INT_FNO

#define OHCI_INT_FNO   BIT(5)

Definition at line 376 of file usbdpriv.h.

◆ OHCI_INT_RHSC

#define OHCI_INT_RHSC   BIT(6)

Definition at line 377 of file usbdpriv.h.

◆ OHCI_INT_OC

#define OHCI_INT_OC   BIT(30)

Definition at line 378 of file usbdpriv.h.

◆ OHCI_INT_MIE

#define OHCI_INT_MIE   BIT(31)

Definition at line 379 of file usbdpriv.h.

◆ OHCI_COM_HCR

#define OHCI_COM_HCR   BIT(0)

Definition at line 381 of file usbdpriv.h.

◆ OHCI_COM_CLF

#define OHCI_COM_CLF   BIT(1)

Definition at line 382 of file usbdpriv.h.

◆ OHCI_COM_BLF

#define OHCI_COM_BLF   BIT(2)

Definition at line 383 of file usbdpriv.h.

◆ OHCI_CTR_CBSR

#define OHCI_CTR_CBSR   (3 << 0)

Definition at line 385 of file usbdpriv.h.

◆ OHCI_CTR_PLE

#define OHCI_CTR_PLE   BIT(2)

Definition at line 386 of file usbdpriv.h.

◆ OHCI_CTR_IE

#define OHCI_CTR_IE   BIT(3)

Definition at line 387 of file usbdpriv.h.

◆ OHCI_CTR_CLE

#define OHCI_CTR_CLE   BIT(4)

Definition at line 388 of file usbdpriv.h.

◆ OHCI_CTR_BLE

#define OHCI_CTR_BLE   BIT(5)

Definition at line 389 of file usbdpriv.h.

◆ OHCI_CTR_USB_RESET

#define OHCI_CTR_USB_RESET   (0 << 6)

Definition at line 390 of file usbdpriv.h.

◆ OHCI_CTR_USB_RESUME

#define OHCI_CTR_USB_RESUME   (1 << 6)

Definition at line 391 of file usbdpriv.h.

◆ OHCI_CTR_USB_OPERATIONAL

#define OHCI_CTR_USB_OPERATIONAL   (2 << 6)

Definition at line 392 of file usbdpriv.h.

◆ OHCI_CTR_USB_SUSPEND

#define OHCI_CTR_USB_SUSPEND   (3 << 6)

Definition at line 393 of file usbdpriv.h.

Typedef Documentation

◆ TimerCallback

typedef void(* TimerCallback) (void *arg)

Definition at line 69 of file usbdpriv.h.

◆ InternCallback

typedef void(* InternCallback) (struct _ioRequest *arg)

Definition at line 70 of file usbdpriv.h.

Function Documentation

◆ hubResetDevicePort()

void hubResetDevicePort ( UsbdDevice_t dev)
extern

Definition at line 209 of file hub.c.

◆ initHubDriver()

int initHubDriver ( void  )
extern

Definition at line 546 of file hub.c.

◆ deinitHubDriver()

void deinitHubDriver ( void  )
extern

Definition at line 577 of file hub.c.

◆ fetchDeviceById()

UsbdDevice_t * fetchDeviceById ( int  devId)
extern

Definition at line 13 of file mem.c.

◆ fetchEndpointById()

UsbdEndpoint_t * fetchEndpointById ( int  id)
extern

Definition at line 31 of file mem.c.

◆ getDeviceTreeRoot()

UsbdDevice_t * getDeviceTreeRoot ( void  )
extern

Definition at line 49 of file mem.c.

◆ attachChildDevice()

UsbdDevice_t * attachChildDevice ( UsbdDevice_t parent,
u32  portNum 
)
extern

Definition at line 54 of file mem.c.

◆ freeDevice()

void freeDevice ( UsbdDevice_t dev)
extern

Definition at line 96 of file mem.c.

◆ allocIoRequest()

UsbdIoRequest_t * allocIoRequest ( void  )
extern

Definition at line 113 of file mem.c.

◆ freeIoRequest()

void freeIoRequest ( UsbdIoRequest_t req)
extern

Definition at line 134 of file mem.c.

◆ allocEndpointForDevice()

UsbdEndpoint_t * allocEndpointForDevice ( UsbdDevice_t dev,
u32  align 
)
extern

Definition at line 165 of file mem.c.

◆ cleanUpFunc()

int cleanUpFunc ( UsbdDevice_t dev,
UsbdEndpoint_t ep 
)
extern

Definition at line 199 of file mem.c.

◆ allocTd()

UsbdHcTD_t * allocTd ( void  )
extern

Definition at line 236 of file mem.c.

◆ freeTd()

void freeTd ( UsbdHcTD_t argTd)
extern

Definition at line 250 of file mem.c.

◆ allocIsoTd()

UsbdHcIsoTD_t * allocIsoTd ( void  )
extern

Definition at line 270 of file mem.c.

◆ freeIsoTd()

void freeIsoTd ( UsbdHcIsoTD_t argTd)
extern

Definition at line 284 of file mem.c.

◆ addTimerCallback()

int addTimerCallback ( UsbdTimerCbStruct_t arg,
TimerCallback  func,
void *  cbArg,
int  delay 
)
extern

Definition at line 13 of file timer.c.

◆ cancelTimerCallback()

int cancelTimerCallback ( UsbdTimerCbStruct_t arg)
extern

Definition at line 54 of file timer.c.

◆ handleTimerList()

void handleTimerList ( void  )
extern

Definition at line 74 of file timer.c.

◆ openDeviceEndpoint()

UsbdEndpoint_t * openDeviceEndpoint ( UsbdDevice_t dev,
const UsbEndpointDescriptor endpDesc,
u32  alignFlag 
)
extern

Definition at line 146 of file endpoint.c.

◆ removeEndpointFromDevice()

int removeEndpointFromDevice ( UsbdDevice_t dev,
UsbdEndpoint_t ep 
)
extern

Definition at line 311 of file endpoint.c.

◆ handleIoReqList()

void handleIoReqList ( UsbdEndpoint_t ep)
extern

Definition at line 345 of file io_request.c.

◆ usbdRebootInner()

void usbdRebootInner ( void  )
extern

Definition at line 13 of file hub_resets.c.

◆ hubResetDevice()

void hubResetDevice ( UsbdDevice_t dev)
extern

Definition at line 19 of file hub_resets.c.

◆ checkDelayedResets()

int checkDelayedResets ( UsbdDevice_t dev)
extern

Definition at line 60 of file hub_resets.c.

◆ handleRhsc()

void handleRhsc ( void  )
extern

Definition at line 68 of file hub_resets.c.

◆ processDoneQueue_GenTd()

void processDoneQueue_GenTd ( UsbdHcTD_t arg)
extern

Definition at line 29 of file td_queue.c.

◆ processDoneQueue_IsoTd()

void processDoneQueue_IsoTd ( UsbdHcIsoTD_t arg)
extern

Definition at line 143 of file td_queue.c.

◆ hcdProcessIntr()

void hcdProcessIntr ( void  )
extern

Definition at line 19 of file hcd.c.

◆ PostIntrEnableFunction()

void PostIntrEnableFunction ( void  )
extern

Definition at line 119 of file hcd.c.

◆ initHcdStructs()

int initHcdStructs ( void  )
extern

Definition at line 167 of file hcd.c.

◆ deinitHcd()

void deinitHcd ( void  )
extern

Definition at line 319 of file hcd.c.

◆ AllocSysMemoryWrap()

void * AllocSysMemoryWrap ( int  size)
extern

Definition at line 13 of file usbd_sys.c.

◆ FreeSysMemoryWrap()

int FreeSysMemoryWrap ( void *  ptr)
extern

Definition at line 24 of file usbd_sys.c.

◆ usbdLock()

int usbdLock ( void  )
extern

Definition at line 35 of file usbd_sys.c.

◆ usbdUnlock()

int usbdUnlock ( void  )
extern

Definition at line 40 of file usbd_sys.c.

◆ usbdReboot()

void usbdReboot ( int  ac)
extern

Definition at line 149 of file usbd_main.c.

◆ handleStaticDeviceDescriptor()

int handleStaticDeviceDescriptor ( UsbdDevice_t dev,
UsbDeviceDescriptor devDescStart,
UsbDeviceDescriptor devDescEnd 
)
extern

Definition at line 13 of file report_descriptor_init.c.

◆ callUsbDriverFunc()

int callUsbDriverFunc ( int(*)(int devId)  func,
int  devId,
void *  gpSeg 
)
extern

Definition at line 13 of file device_driver.c.

◆ doRegisterDriver()

int doRegisterDriver ( sceUsbdLddOps drv,
void *  drvGpSeg 
)
extern

Definition at line 57 of file device_driver.c.

◆ doRegisterAutoLoader()

int doRegisterAutoLoader ( sceUsbdLddOps drv,
void *  drvGpSeg 
)
extern

Definition at line 82 of file device_driver.c.

◆ doUnregisterDriver()

int doUnregisterDriver ( sceUsbdLddOps drv)
extern

Definition at line 127 of file device_driver.c.

◆ doUnregisterAutoLoader()

int doUnregisterAutoLoader ( void  )
extern

Definition at line 148 of file device_driver.c.

◆ doGetDeviceStaticDescriptor()

void * doGetDeviceStaticDescriptor ( int  devId,
void *  data,
u8  type 
)
extern

Definition at line 19 of file device.c.

◆ doGetDeviceLocation()

int doGetDeviceLocation ( UsbdDevice_t dev,
u8 *  path 
)
extern

Definition at line 40 of file device.c.

◆ doOpenEndpoint()

UsbdEndpoint_t * doOpenEndpoint ( UsbdDevice_t dev,
const UsbEndpointDescriptor endpDesc,
u32  alignFlag 
)
extern

Definition at line 63 of file device.c.

◆ doCloseEndpoint()

int doCloseEndpoint ( UsbdEndpoint_t ep)
extern

Definition at line 74 of file device.c.

◆ attachIoReqToEndpoint()

int attachIoReqToEndpoint ( UsbdEndpoint_t ep,
UsbdIoRequest_t req,
void *  destdata,
u16  length,
void *  callback 
)
extern

Definition at line 81 of file device.c.

◆ doControlTransfer()

int doControlTransfer ( UsbdEndpoint_t ep,
UsbdIoRequest_t req,
u8  requestType,
u8  request,
u16  value,
u16  index,
u16  length,
void *  destdata,
void *  callback 
)
extern

Definition at line 108 of file device.c.

◆ hubTimedSetFuncAddress()

int hubTimedSetFuncAddress ( UsbdDevice_t dev)
extern

Definition at line 357 of file device.c.

◆ flushPort()

void flushPort ( UsbdDevice_t dev)
extern

Definition at line 364 of file device.c.

◆ usbdInitInner()

int usbdInitInner ( void  )
extern

Definition at line 416 of file device.c.

Variable Documentation

◆ usbConfig

UsbdConfig_t usbConfig
extern

Definition at line 488 of file usbdpriv.h.

◆ memPool

UsbdMemoryPool_t* memPool
extern

Definition at line 35 of file usbd_main.c.

◆ usbKernelResources

UsbdKernelResources_t usbKernelResources
extern

Definition at line 36 of file usbd_main.c.

◆ cbListStart

UsbdIoRequest_t* cbListStart
extern

Definition at line 37 of file usbd_main.c.

◆ cbListEnd

UsbdIoRequest_t* cbListEnd
extern

Definition at line 38 of file usbd_main.c.

◆ drvListStart

sceUsbdLddOps* drvListStart
extern

Definition at line 70 of file usbd_main.c.

◆ drvListEnd

sceUsbdLddOps* drvListEnd
extern

Definition at line 71 of file usbd_main.c.

◆ drvAutoLoader

sceUsbdLddOps* drvAutoLoader
extern

Definition at line 72 of file usbd_main.c.