Changes

1,841 bytes added ,  18:51, 5 August 2023
no edit summary
Line 6: Line 6:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#RegisterClassDriver]]
+
| 0 || [[#RegisterClassDriver|RegisterClassDriver]]
 
|-
 
|-
| 1 || [[#QueryFunctionsUnregistered]]
+
| 1 || [[#QueryFunctions|QueryFunctions]]
 
|}
 
|}
   Line 14: Line 14:  
Takes an input Process handle and an input [[#ClassDriverConfig]]. Returns an output Event handle and an [[#ISession]].
 
Takes an input Process handle and an input [[#ClassDriverConfig]]. Returns an output Event handle and an [[#ISession]].
   −
== QueryFunctionsUnregistered ==
+
== QueryFunctions ==
Takes a type-0x6 output buffer containing an array of [[#FunctionState]]. Returns an output s32 '''Count'''.
+
Takes a type-0x6 output buffer containing an array of [[#FunctionState]]. Returns an output s32 '''FunctionStateCount'''.
    
== ISession ==
 
== ISession ==
Line 24: Line 24:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 || [[#QueryFunctions]]
+
| 0 || [[#QueryFunctions_2|QueryFunctions]]
 
|-
 
|-
| 1 || [[#AcquireFunction]]
+
| 1 || [[#AcquireFunction|AcquireFunction]]
 
|-
 
|-
| 2 || [[#ReleaseFunction]]
+
| 2 || [[#ReleaseFunction|ReleaseFunction]]
 
|-
 
|-
| 3 || [[#GetFunctionState]]
+
| 3 || [[#GetFunctionState|GetFunctionState]]
 
|-
 
|-
| 4 || [[#GetMappedBar]]
+
| 4 || [[#GetBarProfile|GetBarProfile]]
 
|-
 
|-
| 5 || [[#ReadConfig]]
+
| 5 || [[#ReadConfig|ReadConfig]]
 
|-
 
|-
| 6 || [[#WriteConfig]]
+
| 6 || [[#WriteConfig|WriteConfig]]
 
|-
 
|-
| 7 || [[#ReadBarRegion]]
+
| 7 || [[#ReadBarRegion|ReadBarRegion]]
 
|-
 
|-
| 8 || [[#WriteBarRegion]]
+
| 8 || [[#WriteBarRegion|WriteBarRegion]]
 
|-
 
|-
| 9 || [[#FindCapability]]
+
| 9 || [[#FindCapability|FindCapability]]
 
|-
 
|-
| 10 || [[#FindExtendedCapability]]
+
| 10 || [[#FindExtendedCapability|FindExtendedCapability]]
 
|-
 
|-
| 11 || [[#MapDma]]
+
| 11 || [[#MapDma|MapDma]]
 
|-
 
|-
| 12 || [[#UnmapDma]]
+
| 12 || [[#UnmapDmaByProcVa|UnmapDmaByProcVa]]
 
|-
 
|-
| 13 || [[#UnmapDmaBusAddress]]
+
| 13 || [[#UnmapDmaByBusAddress|UnmapDmaByBusAddress]]
 
|-
 
|-
| 14 || [[#GetDmaBusAddress]]
+
| 14 || [[#GetDmaBusAddress|GetDmaBusAddress]]
 
|-
 
|-
| 15 || [[#GetDmaBusAddressRange]]
+
| 15 || [[#GetDmaBusAddressRange|GetDmaBusAddressRange]]
 
|-
 
|-
| 16 || [[#SetDmaEnable]]
+
| 16 || [[#SetDmaEnable|SetDmaEnable]]
 
|-
 
|-
| 17 || [[#AcquireIrq]]
+
| 17 || [[#AcquireIrq|AcquireIrq]]
 
|-
 
|-
| 18 || [[#ReleaseIrq]]
+
| 18 || [[#ReleaseIrq|ReleaseIrq]]
 
|-
 
|-
| 19 || [[#SetIrqEnable]]
+
| 19 || [[#SetIrqEnable|SetIrqEnable]]
 
|-
 
|-
| 20 || [[#SetAspmEnable]]
+
| 20 || [7.0.0+] [[#GetIrqEvent|GetIrqEvent]] ([1.0.0-6.2.0] SetAspmEnable)
 
|-
 
|-
| 21 || [3.0.0+] [[#SetResetUponResumeEnable]]
+
| 21 || [7.0.0+] [[#SetAspmEnable|SetAspmEnable]] ([3.0.0-6.2.0] SetResetUponResumeEnable)
 
|-
 
|-
| 22 || [4.0.0+] [[#ResetFunction]]
+
| 22 || [7.0.0+] [[#SetResetUponResumeEnable]] ([4.0.0-6.2.0] ResetFunction)
 
|-
 
|-
| 23 || [7.0.0+]
+
| 23 || [7.0.0+] [[#ResetFunction]]
 
|}
 
|}
    
=== QueryFunctions ===
 
=== QueryFunctions ===
Takes a type-0x6 output buffer containing an array of [[#FunctionState]]. Returns an output s32 '''Count'''.
+
Takes a type-0x6 output buffer containing an array of [[#FunctionState]]. Returns an output s32 '''FunctionStateCount'''.
    
=== AcquireFunction ===
 
=== AcquireFunction ===
Line 85: Line 85:  
Takes an input u32 '''FunctionHandle''' and a type-0x6 output buffer containing a [[#FunctionState]]. No output.
 
Takes an input u32 '''FunctionHandle''' and a type-0x6 output buffer containing a [[#FunctionState]]. No output.
   −
=== GetMappedBar ===
+
=== GetBarProfile ===
Takes two input u32s '''FunctionHandle''' and '''Bar'''. Returns an output u64 '''Address''' and an output [[#BarProfile]].
+
Takes two input u32s '''FunctionHandle''' and '''Bar'''. Returns an output [[#BarProfile]].
    
=== ReadConfig ===
 
=== ReadConfig ===
Line 113: Line 113:  
Takes an input u32 '''FunctionHandle''', an input [[#DmaDirection]], an input u64 '''VirtualAddress''' and an input u32 '''Size'''. Returns an output u64 '''PhysicalAddress'''.
 
Takes an input u32 '''FunctionHandle''', an input [[#DmaDirection]], an input u64 '''VirtualAddress''' and an input u32 '''Size'''. Returns an output u64 '''PhysicalAddress'''.
   −
=== UnmapDma ===
+
=== UnmapDmaByProcVa ===
 
Takes an input u32 '''FunctionHandle''' and an input u64 '''PhysicalAddress'''. No output.
 
Takes an input u32 '''FunctionHandle''' and an input u64 '''PhysicalAddress'''. No output.
   −
=== UnmapDmaBusAddress ===
+
=== UnmapDmaByBusAddress ===
 
Takes an input u32 '''FunctionHandle''' and an input u64 '''BusAddress'''. No output.
 
Takes an input u32 '''FunctionHandle''' and an input u64 '''BusAddress'''. No output.
   Line 129: Line 129:     
=== AcquireIrq ===
 
=== AcquireIrq ===
Takes an input u32s '''FunctionHandle''' and an input [[#IrqType]]. Returns an output Event handle.
+
Takes an input u32s '''FunctionHandle''', an input [[#IrqType]] and an input s32 '''IrqCount'''. No output.
 
  −
[7.0.0+] Now takes another input u32 and no longer returns an output Event handle.
      
=== ReleaseIrq ===
 
=== ReleaseIrq ===
Line 138: Line 136:  
=== SetIrqEnable ===
 
=== SetIrqEnable ===
 
Takes an input u32s '''FunctionHandle''', an unknown input u32 and an input bool '''Enable'''. No output.
 
Takes an input u32s '''FunctionHandle''', an unknown input u32 and an input bool '''Enable'''. No output.
 +
 +
=== GetIrqEvent ===
 +
Takes an input u32s '''FunctionHandle''' and an input [[#IrqType]]. Returns an output Event handle.
    
=== SetAspmEnable ===
 
=== SetAspmEnable ===
 
Takes an input u32 '''FunctionHandle''' and an input bool '''Enable'''. No output.
 
Takes an input u32 '''FunctionHandle''' and an input bool '''Enable'''. No output.
  −
[7.0.0+] Now returns an output Event handle.
      
=== SetResetUponResumeEnable ===
 
=== SetResetUponResumeEnable ===
Line 151: Line 150:     
= pcie:log =
 
= pcie:log =
 +
This is "nn::pcie::detail::ILoggedStateManager".
 +
 
This was added with [6.0.0+].
 
This was added with [6.0.0+].
   Line 157: Line 158:  
! Cmd || Name
 
! Cmd || Name
 
|-
 
|-
| 0 ||  
+
| 0 || GetLoggedState
 
|-
 
|-
| 1 ||  
+
| 1 || GetLoggedStateEvent
 
|}
 
|}
   Line 166: Line 167:     
This is a 0x18-byte struct.
 
This is a 0x18-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x00
 +
| 0x04
 +
|
 +
|-
 +
| 0x04
 +
| 0x01
 +
|
 +
|-
 +
| 0x05
 +
| 0x03
 +
| Reserved
 +
|-
 +
| 0x08
 +
| 0x04
 +
| [[#ClassCode|ClassCode]]
 +
|-
 +
| 0x0C
 +
| 0x01
 +
| Function
 +
|-
 +
| 0x0D
 +
| 0x01
 +
| Reserved
 +
|-
 +
| 0x0E
 +
| 0x02
 +
| Vid
 +
|-
 +
| 0x10
 +
| 0x02
 +
| DevId
 +
|-
 +
| 0x12
 +
| 0x01
 +
|
 +
|-
 +
| 0x13
 +
| 0x01
 +
| Reserved
 +
|-
 +
| 0x14
 +
| 0x04
 +
|
 +
|}
 +
 +
= ClassCode =
 +
This is a 0x4-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x00
 +
| 0x01
 +
| ProgrammingInterface
 +
|-
 +
| 0x01
 +
| 0x01
 +
| SubClass
 +
|-
 +
| 0x02
 +
| 0x01
 +
| BaseClass
 +
|-
 +
| 0x03
 +
| 0x01
 +
| Reserved
 +
|}
    
= FunctionState =
 
= FunctionState =
Line 183: Line 261:  
|-
 
|-
 
| 0x04
 
| 0x04
 +
| 0x04
 +
| BusNum
 +
|-
 +
| 0x08
 +
| 0x01
 +
| DevNum
 +
|-
 +
| 0x09
 +
| 0x01
 +
| FuncNum
 +
|-
 +
| 0x0A
 +
| 0x02
 +
| Vid
 +
|-
 +
| 0x0C
 +
| 0x02
 +
| DevId
 +
|-
 +
| 0x0E
 +
| 0x01
 +
| HeaderType
 +
|-
 +
| 0x0F
 +
| 0x01
 +
| Reserved
 +
|-
 +
| 0x10
 +
| 0x04
 +
| [[#ClassCode|ClassCode]]
 +
|-
 +
| 0x14
 +
| 0x01
 +
| RevisionId
 +
|-
 +
| 0x15
 +
| 0x03
 +
| Reserved
 +
|-
 +
| 0x18
 +
| 0x04
 +
|
 +
|-
 +
| 0x1C
 +
| 0x04
 +
|
 +
|-
 +
| 0x20
 +
| 0x04
 +
|
 +
|-
 
| 0x24
 
| 0x24
|  
+
| 0x01
 +
| HasAssignedClient
 +
|-
 +
| 0x25
 +
| 0x03
 +
| Reserved
 
|}
 
|}
   Line 190: Line 324:  
This is "nn::pcie::BarProfile".
 
This is "nn::pcie::BarProfile".
   −
This is a 0xC-byte struct.
+
This is a 0x18-byte struct.
    
{| class="wikitable" border="1"
 
{| class="wikitable" border="1"
Line 199: Line 333:  
|-
 
|-
 
| 0x00
 
| 0x00
 +
| 0x08
 +
| BaseAddress
 +
|-
 +
| 0x08
 
| 0x08
 
| 0x08
 
| Size
 
| Size
 
|-
 
|-
 +
| 0x10
 +
| 0x04
 +
| Flags
 +
|-
 +
| 0x14
 +
| 0x04
 +
| Reserved
 +
|}
 +
 +
[14.0.0+] This is a 0x20-byte struct.
 +
 +
{| class="wikitable" border="1"
 +
|-
 +
! Offset
 +
! Size
 +
! Description
 +
|-
 +
| 0x00
 +
| 0x08
 +
| BaseAddress
 +
|-
 +
| 0x08
 +
| 0x08
 +
|
 +
|-
 +
| 0x10
 
| 0x08
 
| 0x08
 +
| Size
 +
|-
 +
| 0x18
 
| 0x04
 
| 0x04
 
| Flags
 
| Flags
 +
|-
 +
| 0x1C
 +
| 0x04
 +
| Reserved
 
|}
 
|}