From WiiBrew
< /dev‎ | stm
Jump to navigation Jump to search

this handles the shutdown/reset button on the front of the Wii, maybe it handles more.

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_iobuf[0x20] ATTRIBUTE_ALIGN(32);
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.

Shutdown To Standby

STM_ShutdownToStandby: ioctl 0x2003

This will power the Wii off (red LED).

Shutdown To Idle

STM_ShutdownToIdle: ioctl 0x2004

This will put the Wii into idle mode (yellow LED). This might be useful, but not for known Homebrew-related purposes.

Hot Reset

STM_HotReset: ioctl 0x2001

This will reset the Wii.

Force Dimming

STM_SetVIForceDimming: ioctl 0x5001

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.

Set Idle LED Mode

STM_SetIdleLEDMode: ioctl 0x6002 

Please figure out what I do and update me! 32-bit parameter is passed in as the first word of inbuf.

Unregister State Event

STM_UnregisterStateEvent: ioctl 0x3002

Please figure out what I do and update me!