Line 1:
Line 1:
The State Transition Manager handles transitioning between power states (idle, on, standby, reset, etc).
The State Transition Manager handles transitioning between power states (idle, on, standby, reset, etc).
−
<!-- this isn't true .. fixme
+
Unless otherwise noted, ioctls take in an input buffer of 0x20 bytes and an io buffer of 0x20 bytes, e.g.
−
In all code that has been studied, the ioctls take in an input buffer of 0x20 bytes and an io buffer of 0x20 bytes, e.g.
static u8 stm_inbuf[0x20] ATTRIBUTE_ALIGN(32);
static u8 stm_inbuf[0x20] ATTRIBUTE_ALIGN(32);
Line 9:
Line 8:
retval = IOS_Ioctl(fd, ioctl_no, inbuf, 0x20, outbuf, 0x20);
retval = IOS_Ioctl(fd, ioctl_no, inbuf, 0x20, outbuf, 0x20);
−
The contents of the buffers do not seem to matter for the shutdown / reset functions. You should not expect to actually receive a return code, due to the nature of the functions -- any return value can then be treated as some sort of error.
+
The contents of the buffers do not matter.
−
-->
−
=== Ioctls ===
+
=== Ioctls (/dev/stm/eventhook) ===
+
{| class="wikitable"
+
|-
+
! Ioctl
+
! Function
+
! Notes
+
|-
+
| 0x1000
+
| STM_EventHook
+
| This async ioctl will block until the next event happens, at which point the async callback will be called.
+
|}
+
+
=== Ioctls (/dev/stm/immediate) ===
{| class="wikitable"
{| class="wikitable"
|-
|-
Line 29:
Line 39:
| 0x2004
| 0x2004
| STM_ShutdownToIdle
| STM_ShutdownToIdle
−
| This will power the Wii off (yellow LED), leaving IOS running to service WC24 events.
+
| This will power the Wii off (yellow LED), leaving IOS running to service WC24 events. First four bytes of stm_inbuf should be 0xFCA08280 {{check}}
|-
|-
| 0x2005
| 0x2005
| STM_Wakeup
| STM_Wakeup
−
| This will turn the Wii on (green LED), generally launching the System Menu.
+
| This will turn the Wii on (green LED), generally launching the System Menu. This would generally be called by another IOS module that was running while the Wii was in Idle mode.
|-
|-
| 0x3001
| 0x3001
Line 41:
Line 51:
| 0x3002
| 0x3002
| STM_UnregisterStateEvent
| STM_UnregisterStateEvent
−
| tbd
+
| Cancels the EventHook callback set by STM_EventHook
|-
|-
| 0x4001
| 0x4001
| STM_ReadDDRReg
| STM_ReadDDRReg
−
|
+
| Reads some DDR registers
|-
|-
| 0x4002
| 0x4002
| STM_ReadDDRReg2
| STM_ReadDDRReg2
−
|
+
| Reads some moar DDR registers
|-
|-
| 0x5001
| 0x5001
| STM_SetVIForceDimming
| STM_SetVIForceDimming
−
| The 32-bit parameter changes the brightness it sets the screen to. The parameter is the first word of inbuf. The brightness change stays until either the Wii reboots, or it is changed back.
+
| The 32-bit parameter (first 4 bytes of inbuf) changes the brightness of the entire screen. This is used to implement "Screen Saver" functionality (screen dimming).
|-
|-
| 0x6001
| 0x6001