USB services: Difference between revisions

No edit summary
Line 86: Line 86:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#OpenDsService]]
| 0 || [[#CreateDsService]]
|}
|}


== OpenDsService ==
== CreateDsService ==
Unofficial name.
 
No input. Returns an [[#IDsService]].
No input. Returns an [[#IDsService]].


Line 101: Line 99:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 || [[#BindComplex]]
| 0 || [[#Initialize]]
|-
|-
| 1 || [11.0.0+] [[#RegisterInterface]] ([1.0.0-10.2.0] [[#BindClientProcess]]))
| 1 || [11.0.0+] [[#RegisterInterface]] ([1.0.0-10.2.0] [[#BindClientProcess]]))
Line 119: Line 117:
| 8 || [11.0.0+] SetBinaryObjectStore ([5.0.0-10.2.0] SetUsbDeviceDescriptor)
| 8 || [11.0.0+] SetBinaryObjectStore ([5.0.0-10.2.0] SetUsbDeviceDescriptor)
|-
|-
| 9 || [11.0.0+] Enable ([5.0.0-10.2.0] SetBinaryObjectStore)
| 9 || [11.0.0+] EnableDevice ([5.0.0-10.2.0] SetBinaryObjectStore)
|-
|-
| 10 || [11.0.0+] Disable ([5.0.0-10.2.0] Enable)
| 10 || [11.0.0+] DisableDevice ([5.0.0-10.2.0] EnableDevice)
|-
|-
| 11 || [11.0.0+] [[#GetUsbDeviceSpeed]] ([5.0.0-10.2.0] Disable)
| 11 || [11.0.0+] [[#GetSpeed]] ([5.0.0-10.2.0] DisableDevice)
|-
|-
| 12 || [8.0.0-10.2.0] [[#GetUsbDeviceSpeed]]
| 12 || [8.0.0-10.2.0] [[#GetSpeed]]
|}
|}


== BindComplex ==
== Initialize ==
Takes an input u32 '''ComplexId'''. No output.
Takes an input u32 '''ComplexId'''. No output.


Line 151: Line 149:
When the strlen output for the second buffer is >=0x40, size 0x40 is used instead for copying the string. This is the interface name, it's not sent over USB.
When the strlen output for the second buffer is >=0x40, size 0x40 is used instead for copying the string. This is the interface name, it's not sent over USB.


Returns an error when [[#BindComplex]] wasn't used.
Returns an error when [[#Initialize]] wasn't used.


Up to 4 interfaces can be used and [[#EnableInterface|enabled]].
Up to 4 interfaces can be used and [[#EnableInterface|enabled]].
Line 163: Line 161:
No input. Returns an output [[#UsbState]].
No input. Returns an output [[#UsbState]].


Returns an error when [[#BindComplex]] wasn't used.
Returns an error when [[#Initialize]] wasn't used.


== SetVidPidBcd ==
== SetVidPidBcd ==
Takes a type-0x5 input buffer containing an [[#UsbVidPidBcd]]. No output.
Takes a type-0x5 input buffer containing an [[#UsbVidPidBcd]]. No output.


== GetUsbDeviceSpeed ==
== GetSpeed ==
Unofficial name.
 
No input. Returns an output [[#UsbDeviceSpeed]].
No input. Returns an output [[#UsbDeviceSpeed]].


Line 186: Line 182:
| 2 || [[#GetSetupPacket]]
| 2 || [[#GetSetupPacket]]
|-
|-
| 3 || [11.0.0+] [[#CtrlIn]] ([1.0.0-10.2.0] [[#Enable]])
| 3 || [11.0.0+] [[#CtrlInAsync]] ([1.0.0-10.2.0] [[#Enable]])
|-
|-
| 4 || [11.0.0+] [[#CtrlOut]] ([1.0.0-10.2.0] [[#Disable]])
| 4 || [11.0.0+] [[#CtrlOutAsync]] ([1.0.0-10.2.0] [[#Disable]])
|-
|-
| 5 || [11.0.0+] [[#GetCtrlInCompletionEvent]] ([1.0.0-10.2.0] [[#CtrlIn]])
| 5 || [11.0.0+] [[#GetCtrlInCompletionEvent]] ([1.0.0-10.2.0] [[#CtrlInAsync]])
|-
|-
| 6 || [11.0.0+] [[#GetCtrlInUrbReport]] ([1.0.0-10.2.0] [[#CtrlOut]])
| 6 || [11.0.0+] [[#GetCtrlInUrbReport]] ([1.0.0-10.2.0] [[#CtrlOutAsync]])
|-
|-
| 7 || [11.0.0+] [[#GetCtrlOutCompletionEvent]] ([1.0.0-10.2.0] [[#GetCtrlInCompletionEvent]])
| 7 || [11.0.0+] [[#GetCtrlOutCompletionEvent]] ([1.0.0-10.2.0] [[#GetCtrlInCompletionEvent]])
Line 202: Line 198:
| 10 || [11.0.0+] [[#AppendConfigurationData]] ([1.0.0-10.2.0] [[#GetCtrlOutUrbReport]])
| 10 || [11.0.0+] [[#AppendConfigurationData]] ([1.0.0-10.2.0] [[#GetCtrlOutUrbReport]])
|-
|-
| 11 || [13.0.0+] [[#AppendDeviceInterfaceGUID]] ([1.0.0-10.2.0] [[#CtrlStall]])
| 11 || [13.0.0+] [[#SetGuid]] ([1.0.0-10.2.0] [[#CtrlStall]])
|-
|-
| 12 || [15.0.0+] ([5.0.0-10.2.0] [[#AppendConfigurationData]])
| 12 || [15.0.0+] [[#RegisterTransferMemory]] ([5.0.0-10.2.0] [[#AppendConfigurationData]])
|}
|}


Line 257: Line 253:
Disables the current interface.
Disables the current interface.


=== CtrlIn ===
=== CtrlInAsync ===
Same as [[#PostBufferAsync]], except this uses control input endpoint 0x80.
Same as [[#PostBufferAsync]], except this uses control input endpoint 0x80.


Throws an error if the interface is not [[#EnableInterface|enabled]].
Throws an error if the interface is not [[#EnableInterface|enabled]].


=== CtrlOut ===
=== CtrlOutAsync ===
Same as [[#PostBufferAsync]], except this uses control output endpoint 0x00.
Same as [[#PostBufferAsync]], except this uses control output endpoint 0x00.


Line 291: Line 287:
[5.0.0+] This now only takes an input [[#UsbDeviceSpeed]] and a type-0x5 input buffer.
[5.0.0+] This now only takes an input [[#UsbDeviceSpeed]] and a type-0x5 input buffer.


=== AppendDeviceInterfaceGUID ===
=== SetGuid ===
Unofficial name.
 
Takes a type-0x5 input buffer. No output.
Takes a type-0x5 input buffer. No output.


=== Cmd12 ===
=== RegisterTransferMemory ===
Takes an input u64 and an input handle. No output.
Takes an input u64 and an input handle. No output.


Line 318: Line 312:
| 4 || [[#Stall]]
| 4 || [[#Stall]]
|-
|-
| 5 || [[#SetZeroLengthTransfer]]
| 5 || [[#SetZlt]]
|-
|-
| 6 || [7.0.0+] [[#IsHalted]]
| 6 || [7.0.0+] [[#IsStalled]]
|-
|-
| 7 || [7.0.0+] [[#GetCtrlHandlerEvent]]
| 7 || [7.0.0+] [[#GetStallClearedEvent]]
|-
|-
| 8 || [11.0.0-14.1.2]
| 8 || [11.0.0-14.1.2]
Line 362: Line 356:
Stops in-progress data-transfer done by [[#PostBufferAsync]].
Stops in-progress data-transfer done by [[#PostBufferAsync]].


==== SetZeroLengthTransfer ====
==== SetZlt ====
Takes an input bool. No output.
Takes an input bool. No output.


==== IsHalted ====
==== IsStalled ====
Unofficial name.
 
No input. Returns an output bool.
No input. Returns an output bool.


==== GetCtrlHandlerEvent ====
==== GetStallClearedEvent ====
Unofficial name.
 
No input. Returns an output Event handle.
No input. Returns an output Event handle.


Line 394: Line 384:
! Cmd || Name
! Cmd || Name
|-
|-
| [2.0.0+] 0 || [[#BindClientProcess_2|#BindClientProcess]]
| 0 || [2.0.0+] [[#BindClientProcess_2|#BindClientProcess]] ([1.0.0] [[#QueryAllInterfaces]])
|-
|-
| 1 ([1.0.0] 0) || [[#QueryAllInterfaces]]
| 1 || [[#QueryAllInterfaces]] ([1.0.0] [[#QueryAvailableInterfaces]])
|-
|-
| 2 ([1.0.0] 1) || [[#QueryAvailableInterfaces]]
| 2 || [[#QueryAvailableInterfaces]] ([1.0.0] [[#QueryAcquiredInterfaces]])
|-
|-
| 3 ([1.0.0] 2) || [[#QueryAcquiredInterfaces]]
| 3 || [[#QueryAcquiredInterfaces]] ([1.0.0] [[#CreateInterfaceAvailableEvent]])
|-
|-
| 4 ([1.0.0] 3) || [[#CreateInterfaceAvailableEvent]]
| 4 || [[#CreateInterfaceAvailableEvent]] ([1.0.0] [[#DestroyInterfaceAvailableEvent]])
|-
|-
| 5 ([1.0.0] 4) || [[#DestroyInterfaceAvailableEvent]]
| 5 || [[#DestroyInterfaceAvailableEvent]] ([1.0.0] [[#GetInterfaceStateChangeEvent]])
|-
|-
| 6 ([1.0.0] 5) || [[#GetInterfaceStateChangeEvent]]
| 6 || [[#GetInterfaceStateChangeEvent]] ([1.0.0] [[#AcquireUsbIf]])
|-
|-
| 7 ([1.0.0] 6) || [[#AcquireUsbIf]]
| 7 || [[#AcquireUsbIf]] ([1.0.0] [[#GetDescriptorString]])
|-
|-
| 8 ([1.0.0] 7) || [6.0.0+] SetTestMode ([1.0.0] [[#GetDescriptorString]])
| 8 || [6.0.0+] SetTestMode ([1.0.0] [[#ResetDevice]])
|-
| [1.0.0] 8 || [[#ResetDevice]]
|}
|}


Line 473: Line 461:


== ResetDevice ==
== ResetDevice ==
[1.0.0] Takes an input u32, no output. Stubbed, just returns 0.
Takes an input u32, no output. Stubbed, just returns 0.


== IClientIfSession ==
== IClientIfSession ==
Line 490: Line 478:
| 3 || [[#GetAlternateInterface]]
| 3 || [[#GetAlternateInterface]]
|-
|-
| 4 ([1.0.0] 5) || [[#GetCurrentFrame]]
| 4 || [[#GetCurrentFrame]] ([1.0.0] [[#CtrlXferAsync]])
|-
|-
| [2.0.0+] 5 || [[#CtrlXferAsync]]
| 5 || [2.0.0+] [[#CtrlXferAsync]]
|-
|-
| 6 || [[#GetCtrlXferCompletionEvent]] ([1.0.0] [[#SubmitControlInRequest]])
| 6 || [[#GetCtrlXferCompletionEvent]] ([1.0.0] [[#SubmitControlInRequest]])
Line 500: Line 488:
| 8 || [[#ResetDevice]]
| 8 || [[#ResetDevice]]
|-
|-
| 9 ([1.0.0] 4) || [[#OpenUsbEp]]  
| 9 || [[#OpenUsbEp]] ([1.0.0] [[#GetCurrentFrame]])
|}
|}


Line 640: Line 628:


==== BatchBufferAsync ====
==== BatchBufferAsync ====
Takes 3 input u32s ('''urbCount''', '''unk1''', and '''unk2'''), an input u64 '''buffer''' and u64 '''Id''', and a type-0x5 ([3.0.0+] type-0x21) input buffer, returns an output u32 '''xferId'''.
Takes 3 input u32s ('''urbCount''', '''unk1''', and '''unk2'''), an input u64 '''buffer''' and u64 '''Id''', and a type-0x5 ([3.0.0+] type-0x21) input buffer, returns an output u32 '''xferId'''.


Line 877: Line 864:
! Cmd || Name
! Cmd || Name
|-
|-
| 0 ||  
| 0 || GetTopologyChangeEvent
|-
|-
| 1 ||  
| 1 || GetFlattenedTopology
|}
|}