Skip to content

Commit

Permalink
Merge pull request #661 from uyjulian/usbd_feature_update
Browse files Browse the repository at this point in the history
usbd feature update
  • Loading branch information
rickgaiser authored Sep 24, 2024
2 parents 1d61154 + aca5416 commit e8ae9b6
Show file tree
Hide file tree
Showing 29 changed files with 4,466 additions and 3,339 deletions.
22 changes: 18 additions & 4 deletions iop/usb/usbd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,27 @@
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright 2001-2004, ps2dev - http://www.ps2dev.org
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

# IOP_CFLAGS += -DDEBUG

IOP_OBJS = hcd.o hub.o interface.o mem.o usbd.o usbio.o driver.o imports.o exports.o
IOP_OBJS = \
hub.o \
mem.o \
timer.o \
endpoint.o \
io_request.o \
hub_resets.o \
td_queue.o \
hcd.o \
usbd_sys.o \
usbd_api.o \
usbd_main.o \
report_descriptor_init.o \
device_driver.o \
device.o \
imports.o \
exports.o
IOP_PREFER_GPOPT = 16384

include $(PS2SDKSRC)/Defs.make
Expand Down
23 changes: 20 additions & 3 deletions iop/usb/usbd/include/usbd.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typedef struct
u8 wHubCharacteristicsHb;
u8 bPwrOn2PwrGood;
u8 bHubContrCurrent;
u8 deviceRemovable[8]; // arbitrary number, depends on number of ports
u8 deviceRemovable[32]; // arbitrary number, depends on number of ports
} UsbHubDescriptor;


Expand Down Expand Up @@ -123,6 +123,23 @@ typedef struct
u16 wData[1];
} UsbStringDescriptor;

typedef struct _usbHidDescriptorItem
{
u8 bDescriptorType;
u8 wDescriptorLengthLb;
u8 wDescriptorLengthHb;
} UsbHidDescriptorItem;

typedef struct _usbHidDescriptor
{
u8 bLength;
u8 bDescriptorType;
u16 bcdHID;
u8 bCountryCode;
u8 bNumDescriptors;
UsbHidDescriptorItem items[];
} UsbHidDescriptor;

typedef struct
{
u16 bLength : 11;
Expand Down Expand Up @@ -291,7 +308,7 @@ int sceUsbdRegisterAutoloader(sceUsbdLddOps *drv); // Arbitrarily named
int sceUsbdUnregisterAutoloader(void); // Arbitrarily named
int sceUsbdChangeThreadPriority(int prio1, int prio2);

// these aren't implemented:
// These have been added in 1.2 export version
int sceUsbdGetReportDescriptor(int devId, int cfgNum, int ifNum, void **desc, u32 *len);
int sceUsbdMultiIsochronousTransfer(int pipeId, sceUsbdMultiIsochronousRequest *request, sceUsbdMultiIsochronousDoneCallback callback, void *cbArg);

Expand All @@ -317,7 +334,7 @@ int sceUsbdMultiIsochronousTransfer(int pipeId, sceUsbdMultiIsochronousRequest *
#define UsbGetReportDescriptor sceUsbdGetReportDescriptor
#define UsbMultiIsochronousTransfer sceUsbdMultiIsochronousTransfer

#define usbd_IMPORTS_start DECLARE_IMPORT_TABLE(usbd, 1, 1)
#define usbd_IMPORTS_start DECLARE_IMPORT_TABLE(usbd, 1, 2)
#define usbd_IMPORTS_end END_IMPORT_TABLE

#define I_sceUsbdRegisterLdd DECLARE_IMPORT(4, sceUsbdRegisterLdd)
Expand Down
Loading

0 comments on commit e8ae9b6

Please sign in to comment.