/dev/net/kd/request: Difference between revisions
Jump to navigation
Jump to search
fill in some gaps |
m That's not uid my baddddd |
||
(19 intermediate revisions by 10 users not shown) | |||
Line 1: | Line 1: | ||
The main [[WiiConnect24]] calls are done through this device. | |||
== Ioctl listing == | == Ioctl listing == | ||
Inbuf addr & 3 is written to outbuf for most or all ioctls. | |||
{| class="wikitable" | {| class="wikitable" | ||
Line 12: | Line 14: | ||
|- | |- | ||
| 1 | | 1 | ||
| | | ExecSuspendScheduler | ||
| none | | none | ||
| 4 bytes | | 4 bytes | ||
Line 30: | Line 32: | ||
|- | |- | ||
| 4 | | 4 | ||
| KD_GetTimeTriggers | |||
| ? | | ? | ||
| 12 bytes | |||
| 12 | | Writes the time triggers for the minutes of the hour for when KD_Download and KD_CheckMail are triggered to outbuf + 4. | ||
| | |||
|- | |- | ||
| 5 | | 5 | ||
| | | KD_SetTimeTriggers{{check}} | ||
| | | 8+ bytes | ||
| 4+ bytes | | 4+ bytes | ||
| | | Sets the time triggers mentioned above to the two u32's in inbuf. Both values must be under 259200. | ||
|- | |- | ||
| 6 | | 6 | ||
Line 87: | Line 89: | ||
| none | | none | ||
| 32 bytes | | 32 bytes | ||
| | | Saves temporary [[:/shared2/wc24/mbox/dlcnt.bin|dlcnt.bin]] mail content to [[:/shared2/wc24/mbox/wc24recv.mbx|wc24recv.mbx]] immediately. Actual outbuf size is 4, outbuf+0 is KD_SaveMail/KD_ProcessMail retval. | ||
|- | |- | ||
| 0xe | | 0xe | ||
Line 94: | Line 95: | ||
| 32 bytes | | 32 bytes | ||
| 32 bytes | | 32 bytes | ||
| | | inbuf + 0 u32 is flags, inbuf + 6 u16 is nwc24dl.bin entry index, inbuf + 8 u32 is subTask bitmask. Starting at outbuf + 8 is a buffer of unknown size. Flags bit 1 must be set to manually specify a task/entry. When clear, a task is chosen automatically with the same mechanism used for choosing a task in the background.(When bit 1 is clear with this ioctl from Broadway, nothing will be downloaded since no entries will be ready for download due to dl frequencies fields.) subTask bitmap is a bitmap of subTasks to download when flags bit 2 is set, so setting bit 0 will download subTask zero, and so on. When flags is negative with bit 31 set, KD will sync the current UTC time with the time [[WiiConnect24|server]]. Outbuf+0 is KD_Download retval. | ||
|- | |- | ||
| 0xf | | 0xf | ||
Line 127: | Line 128: | ||
|- | |- | ||
| 0x21 | | 0x21 | ||
| | | KD_SetNextWakeup | ||
| | | 4 bytes | ||
| | | 4 bytes | ||
| | | Input is a u32 determining the seconds till next time STM_Wakeup is called. | ||
|- | |- | ||
| 0x22 | | 0x22 | ||
Line 140: | Line 141: | ||
| 0x28 (async?) | | 0x28 (async?) | ||
| NWC24iRequestShutdown | | NWC24iRequestShutdown | ||
| | | 8 bytes | ||
| | | 4 bytes | ||
| | | Input is a u32 for the event type. | ||
Set a shutdown event flag. | |||
If the type is 3, this simply turns off the USB keyboard LEDs and returns 0. | |||
Otherwise, this calls KD_ForceCleanupSoCtrl internally and the flag that is set will cause all KD processes that are running (downloading, mail, NAND writing, etc.) to stop. | |||
STM calls this ioctl in the Wakeup function to "shut down KD", which can happen in the following cases: | |||
* /dev/stm/immediate ioctl 0x2005 is used. | |||
* The console is idle and the DI cover polling thread has detected that the cover was closed (i.e. a disc was inserted). | |||
* The console is idle and a GPIO event handler is triggered (i.e. the POWER button was pressed). | |||
|} | |} | ||
[[Category:Wii Filesystem]] |
Latest revision as of 20:04, 21 April 2025
The main WiiConnect24 calls are done through this device.
Ioctl listing
Inbuf addr & 3 is written to outbuf for most or all ioctls.
Request number | Name | Input | Output | Notes |
---|---|---|---|---|
1 | ExecSuspendScheduler | none | 4 bytes | |
2 | ExecTrySuspendScheduler | 32 bytes | 32 bytes | |
3 | ExecResumeScheduler | none | 4+ bytes | |
4 | KD_GetTimeTriggers | ? | 12 bytes | Writes the time triggers for the minutes of the hour for when KD_Download and KD_CheckMail are triggered to outbuf + 4. |
5 | KD_SetTimeTriggers[check] | 8+ bytes | 4+ bytes | Sets the time triggers mentioned above to the two u32's in inbuf. Both values must be under 259200. |
6 | NWC24iStartupSocket | none | 32 bytes | |
7 | NWC24iCleanupSocket | none | 32 bytes | |
8 | NWC24iLockSocket | none | 32 bytes | |
9 | NWC24iUnlockSocket | none | 32 bytes | |
0xa | NWC24iCheckMailNow | none | 32 bytes | |
0xb | NWC24iSendMailNow | none | 8+ bytes | Connect and send mail? |
0xc | NWC24iReceiveMailNow | ? | 8+ bytes | |
0xd | NWC24iSaveMailNow | none | 32 bytes | Saves temporary dlcnt.bin mail content to wc24recv.mbx immediately. Actual outbuf size is 4, outbuf+0 is KD_SaveMail/KD_ProcessMail retval. |
0xe | NWC24iDownloadNowEx | 32 bytes | 32 bytes | inbuf + 0 u32 is flags, inbuf + 6 u16 is nwc24dl.bin entry index, inbuf + 8 u32 is subTask bitmask. Starting at outbuf + 8 is a buffer of unknown size. Flags bit 1 must be set to manually specify a task/entry. When clear, a task is chosen automatically with the same mechanism used for choosing a task in the background.(When bit 1 is clear with this ioctl from Broadway, nothing will be downloaded since no entries will be ready for download due to dl frequencies fields.) subTask bitmap is a bitmap of subTasks to download when flags bit 2 is set, so setting bit 0 will download subTask zero, and so on. When flags is negative with bit 31 set, KD will sync the current UTC time with the time server. Outbuf+0 is KD_Download retval. |
0xf | NWC24iRequestGenerateUserId | none | 32 bytes | |
0x10 | NWC24iRequestRegisterUserId | none | 32 bytes | |
0x1e | NWC24iGetSchedulerStat | none | none | |
0x1f | NWC24iSetFilterMode | 32 bytes | 32 bytes | |
0x20 | NWC24iSetDebugMode | 32 bytes | 32 bytes | |
0x21 | KD_SetNextWakeup | 4 bytes | 4 bytes | Input is a u32 determining the seconds till next time STM_Wakeup is called. |
0x22 | NWC24iSetScriptMode | 32 bytes | 32 bytes | |
0x28 (async?) | NWC24iRequestShutdown | 8 bytes | 4 bytes | Input is a u32 for the event type.
Set a shutdown event flag. If the type is 3, this simply turns off the USB keyboard LEDs and returns 0. Otherwise, this calls KD_ForceCleanupSoCtrl internally and the flag that is set will cause all KD processes that are running (downloading, mail, NAND writing, etc.) to stop. STM calls this ioctl in the Wakeup function to "shut down KD", which can happen in the following cases:
|