PSPSDK 2024-10-31
Loading...
Searching...
No Matches
pspusbbus.h
Go to the documentation of this file.
1/*
2 * PSP Software Development Kit - https://github.com/pspdev
3 * -----------------------------------------------------------------------
4 * Licensed under the BSD license, see LICENSE in PSPSDK root for details.
5 *
6 * pspusbbus.h - Prototypes for the sceUsbBus_driver library
7 *
8 * Copyright (c) 2006 James F
9 *
10 */
11#ifndef __PSPUSBBUS_H__
12#define __PSPUSBBUS_H__
14#ifdef __cplusplus
15extern "C" {
16#endif
24 int unk8;
27};
31{
33 int endpnum;
35 int unk2;
37 int unk3;
38};
39
42{
43 unsigned char bLength;
44 unsigned char bDescriptorType;
45 short bString[32];
47
50{
51 unsigned char bLength;
52 unsigned char bDescriptorType;
53 unsigned short bcdUSB;
54 unsigned char bDeviceClass;
55 unsigned char bDeviceSubClass;
56 unsigned char bDeviceProtocol;
57 unsigned char bMaxPacketSize;
58 unsigned short idVendor;
59 unsigned short idProduct;
60 unsigned short bcdDevice;
61 unsigned char iManufacturer;
62 unsigned char iProduct;
63 unsigned char iSerialNumber;
64 unsigned char bNumConfigurations;
66
69{
70 unsigned char bLength;
71 unsigned char bDescriptorType;
72 unsigned short wTotalLength;
73 unsigned char bNumInterfaces;
74 unsigned char bConfigurationValue;
75 unsigned char iConfiguration;
76 unsigned char bmAttributes;
77 unsigned char bMaxPower;
79
82{
83 unsigned char bLength;
84 unsigned char bDescriptorType;
85 unsigned char bInterfaceNumber;
86 unsigned char bAlternateSetting;
87 unsigned char bNumEndpoints;
88 unsigned char bInterfaceClass;
89 unsigned char bInterfaceSubClass;
90 unsigned char bInterfaceProtocol;
91 unsigned char iInterface;
93
96{
97 unsigned char bLength;
98 unsigned char bDescriptorType;
99 unsigned char bEndpointAddress;
100 unsigned char bmAttributes;
101 unsigned short wMaxPacketSize;
102 unsigned char bInterval;
104
107{
111 unsigned int num;
113
126
129{
130 unsigned char devdesc[20];
131
132 struct Config
133 {
137 void *pendp;
139
140 struct ConfDesc
141 {
142 unsigned char desc[12];
145
146 unsigned char pad1[8];
148 {
149 void *pinterdesc[2];
150 unsigned int intcount;
152
154 {
155 unsigned char desc[12];
156 void *pendp;
157 unsigned char pad[32];
159
160 struct Endp
161 {
162 unsigned char desc[16];
163 } endp[4];
165
168{
169 unsigned char bmRequestType;
170 unsigned char bRequest;
171 unsigned short wValue;
172 unsigned short wIndex;
173 unsigned short wLength;
175
178{
180 const char *name;
188 void *devp_hi;
190 void *confp_hi;
192 void *devp;
194 void *confp;
198 int (*recvctl)(int arg1, int arg2, struct DeviceRequest *req);
200 int (*func28)(int arg1, int arg2, int arg3);
202 int (*attach)(int speed, void *arg2, void *arg3);
204 int (*detach)(int arg1, int arg2, int arg3);
206 int unk34;
208 int (*start_func)(int size, void *args);
210 int (*stop_func)(int size, void *args);
212 struct UsbDriver *link;
213};
214
217{
221 void *data;
223 int size;
225 int unkc;
227 void *func;
233 int unk1c;
235 void *arg;
237 void *link;
238};
239
248
257
266
275
284
293
302
303#ifdef __cplusplus
304}
305#endif
306
307#endif
unsigned char size
Definition pspsysmem_kernel.h:6
float x
Definition psptypes.h:0
int sceUsbbdClearFIFO(struct UsbEndpoint *endp)
Clear the FIFO on an endpoint.
int sceUsbbdReqRecv(struct UsbdDeviceReq *req)
Queue a receive request (OUT from host pov)
struct UsbInterfaces __attribute__
int sceUsbbdReqSend(struct UsbdDeviceReq *req)
Queue a send request (IN from host pov)
int sceUsbbdStall(struct UsbEndpoint *endp)
Stall an endpoint.
int sceUsbbdReqCancelAll(struct UsbEndpoint *endp)
Cancel any pending requests on an endpoint.
int sceUsbbdUnregister(struct UsbDriver *drv)
Unregister a USB driver.
struct Endp endp[4]
int sceUsbbdRegister(struct UsbDriver *drv)
Register a USB driver.
USB configuration descriptor.
Definition pspusbbus.h:69
unsigned char bConfigurationValue
Definition pspusbbus.h:74
unsigned char bLength
Definition pspusbbus.h:70
unsigned char bDescriptorType
Definition pspusbbus.h:71
unsigned short wTotalLength
Definition pspusbbus.h:72
unsigned char bmAttributes
Definition pspusbbus.h:76
unsigned char bNumInterfaces
Definition pspusbbus.h:73
unsigned char iConfiguration
Definition pspusbbus.h:75
unsigned char bMaxPower
Definition pspusbbus.h:77
USB device descriptor.
Definition pspusbbus.h:50
unsigned short idProduct
Definition pspusbbus.h:59
unsigned char bDeviceClass
Definition pspusbbus.h:54
unsigned short bcdUSB
Definition pspusbbus.h:53
unsigned short bcdDevice
Definition pspusbbus.h:60
unsigned char iSerialNumber
Definition pspusbbus.h:63
unsigned char bDeviceSubClass
Definition pspusbbus.h:55
unsigned char bMaxPacketSize
Definition pspusbbus.h:57
unsigned char bDescriptorType
Definition pspusbbus.h:52
unsigned char bDeviceProtocol
Definition pspusbbus.h:56
unsigned char iManufacturer
Definition pspusbbus.h:61
unsigned char iProduct
Definition pspusbbus.h:62
unsigned short idVendor
Definition pspusbbus.h:58
unsigned char bNumConfigurations
Definition pspusbbus.h:64
unsigned char bLength
Definition pspusbbus.h:51
USB EP0 Device Request.
Definition pspusbbus.h:168
unsigned short wIndex
Definition pspusbbus.h:172
unsigned char bmRequestType
Definition pspusbbus.h:169
unsigned short wLength
Definition pspusbbus.h:173
unsigned short wValue
Definition pspusbbus.h:171
unsigned char bRequest
Definition pspusbbus.h:170
USB endpoint descriptor.
Definition pspusbbus.h:96
unsigned char bLength
Definition pspusbbus.h:97
unsigned char bInterval
Definition pspusbbus.h:102
unsigned short wMaxPacketSize
Definition pspusbbus.h:101
unsigned char bmAttributes
Definition pspusbbus.h:100
unsigned char bDescriptorType
Definition pspusbbus.h:98
unsigned char bEndpointAddress
Definition pspusbbus.h:99
USB Interface descriptor.
Definition pspusbbus.h:82
unsigned char bLength
Definition pspusbbus.h:83
unsigned char bInterfaceProtocol
Definition pspusbbus.h:90
unsigned char bInterfaceNumber
Definition pspusbbus.h:85
unsigned char bInterfaceClass
Definition pspusbbus.h:88
unsigned char bDescriptorType
Definition pspusbbus.h:84
unsigned char bInterfaceSubClass
Definition pspusbbus.h:89
unsigned char iInterface
Definition pspusbbus.h:91
unsigned char bAlternateSetting
Definition pspusbbus.h:86
unsigned char bNumEndpoints
Definition pspusbbus.h:87
USB string descriptor.
Definition pspusbbus.h:42
short bString[32]
Definition pspusbbus.h:45
unsigned char bDescriptorType
Definition pspusbbus.h:44
unsigned char bLength
Definition pspusbbus.h:43
USB driver configuration.
Definition pspusbbus.h:116
struct UsbInterfaces * infs
USB driver interfaces pointer.
Definition pspusbbus.h:120
struct EndpointDescriptor * endp
Pointer to the first endpoint descriptor (each should be 16byte aligned)
Definition pspusbbus.h:124
struct InterfaceDescriptor * infp
Pointer to the first interface descriptor.
Definition pspusbbus.h:122
struct ConfigDescriptor * confp
Pointer to the configuration descriptors.
Definition pspusbbus.h:118
Definition pspusbbus.h:141
unsigned char desc[12]
Definition pspusbbus.h:142
void * pinterfaces
Definition pspusbbus.h:143
Definition pspusbbus.h:133
void * pinterfaces
Definition pspusbbus.h:135
void * pendp
Definition pspusbbus.h:137
void * pconfdesc
Definition pspusbbus.h:134
void * pinterdesc
Definition pspusbbus.h:136
Definition pspusbbus.h:161
unsigned char desc[16]
Definition pspusbbus.h:162
Definition pspusbbus.h:154
unsigned char desc[12]
Definition pspusbbus.h:155
unsigned char pad[32]
Definition pspusbbus.h:157
void * pendp
Definition pspusbbus.h:156
Definition pspusbbus.h:148
void * pinterdesc[2]
Definition pspusbbus.h:149
unsigned int intcount
Definition pspusbbus.h:150
Padded data structure, padding is required otherwise the USB hardware crashes.
Definition pspusbbus.h:129
struct UsbData::Endp endp[4]
struct UsbData::InterDesc interdesc
struct UsbData::Config config
struct UsbData::Interfaces interfaces
unsigned char devdesc[20]
Definition pspusbbus.h:130
unsigned char pad1[8]
Definition pspusbbus.h:146
struct UsbData::ConfDesc confdesc
USB driver structure used by sceUsbbdRegister and sceUsbbdUnregister.
Definition pspusbbus.h:178
struct UsbDriver * link
Link to next USB driver in the chain, set to NULL.
Definition pspusbbus.h:212
void * confp
Pointer to full-speed device configuration.
Definition pspusbbus.h:194
void * devp
Pointer to full-speed device descriptor.
Definition pspusbbus.h:192
int(* stop_func)(int size, void *args)
Function called when the driver is stopped.
Definition pspusbbus.h:210
int(* start_func)(int size, void *args)
Function called when the driver is started.
Definition pspusbbus.h:208
void * devp_hi
Pointer to hi-speed device descriptor.
Definition pspusbbus.h:188
void * confp_hi
Pointer to hi-speed device configuration.
Definition pspusbbus.h:190
struct StringDescriptor * str
Default String descriptor.
Definition pspusbbus.h:196
struct UsbEndpoint * endp
List of endpoint structures (used when calling other functions)
Definition pspusbbus.h:184
const char * name
Name of the USB driver.
Definition pspusbbus.h:180
int(* attach)(int speed, void *arg2, void *arg3)
Configuration set (attach) function.
Definition pspusbbus.h:202
int(* detach)(int arg1, int arg2, int arg3)
Configuration unset (detach) function.
Definition pspusbbus.h:204
int unk34
Unknown set to 0.
Definition pspusbbus.h:206
struct UsbInterface * intp
Interface list.
Definition pspusbbus.h:186
int(* recvctl)(int arg1, int arg2, struct DeviceRequest *req)
Received a control request arg0 is endpoint, arg1 is possibly data arg2 is data buffer.
Definition pspusbbus.h:198
int(* func28)(int arg1, int arg2, int arg3)
Unknown.
Definition pspusbbus.h:200
int endpoints
Number of endpoints in this driver (including default control)
Definition pspusbbus.h:182
USB driver endpoint.
Definition pspusbbus.h:31
int unk2
Filled in by the bus driver.
Definition pspusbbus.h:35
int unk3
Filled in by the bus driver.
Definition pspusbbus.h:37
int endpnum
Endpoint number (must be filled in sequentially)
Definition pspusbbus.h:33
USB driver interface.
Definition pspusbbus.h:20
int expect_interface
Expectant interface (0 or -1)
Definition pspusbbus.h:22
int unk8
Unknown.
Definition pspusbbus.h:24
int num_interface
Number of interfaces.
Definition pspusbbus.h:26
USB driver interfaces structure.
Definition pspusbbus.h:107
unsigned int num
Number of interface descriptors.
Definition pspusbbus.h:111
struct InterfaceDescriptor * infp[2]
Pointers to the individual interface descriptors.
Definition pspusbbus.h:109
USB device request, used by sceUsbbdReqSend and sceUsbbdReqRecv.
Definition pspusbbus.h:217
int unk1c
Unknown.
Definition pspusbbus.h:233
void * func
Pointer to the function to call on completion.
Definition pspusbbus.h:227
struct UsbEndpoint * endp
Pointer to the endpoint to queue request on.
Definition pspusbbus.h:219
int unkc
Unknown.
Definition pspusbbus.h:225
int retcode
Return code of the request, 0 == success, -3 == cancelled.
Definition pspusbbus.h:231
void * data
Pointer to the data buffer to use in the request.
Definition pspusbbus.h:221
void * link
Link pointer to next request used by the driver, set it to NULL.
Definition pspusbbus.h:237
int recvsize
Resultant size (send == size of data sent, recv == size of data received)
Definition pspusbbus.h:229
int size
Size of the data buffer (send == size of data, recv == size of max receive)
Definition pspusbbus.h:223
void * arg
A user specified pointer for the device request.
Definition pspusbbus.h:235