Skip to content

Instantly share code, notes, and snippets.

@GaryOderNichts
Created April 18, 2025 16:01
Show Gist options
  • Save GaryOderNichts/357df4dcf4ba69962b10c91c6f1d7240 to your computer and use it in GitHub Desktop.
Save GaryOderNichts/357df4dcf4ba69962b10c91c6f1d7240 to your computer and use it in GitHub Desktop.
wafel_nowifi_patch

wifi patches

When no wifi module is connected to the system, all nn::ac::Connect calls will fail, since /dev/net/ifmgr/ncl cannot be opened without /dev/net/ifmgr/wd being opened successfully. This is done to ensure that the wifi driver (wifi24) has finished successfully, which will of course never happen without a wifi module.
This causes some funny issues in /dev/emd, since it will abort and go into an endless loop causing the console to freeze due to the cooperative thread model in IOS. This patch simply allows opening /dev/net/ifmgr/ncl without /dev/net/ifmgr/wd, maybe don't use this on a console with an actual wifi module installed though.

#include <wafel/patch.h>
__attribute__((target("arm"))) void kern_main()
{
debug_printf("Applying ifmgr wifi patches\n");
// Make opening /dev/net/ifmgr/ncl not depend on /dev/net/ifmgr/wd
ASM_PATCH_K(0x12309ad4,
"mov r1, r5\n"
"nop"
);
}
void mcp_main()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment