Move some more error codes to the big enum

This commit is contained in:
Henrik Rydgård committed 2025-04-07 22:25:36 +02:00
1 parent 89c0b5f20b
commit b34f34ebde
4 files changed
+31 -21

No files matched your search

+12
View File
@@ -538,4 +538,16 @@ enum PSPErrorCode : u32 {
SCE_NET_RESOLVER_ERROR_RES_SERVER_REFUSED = 0x80410416,
SCE_NET_RESOLVER_ERROR_INTERNAL = 0x80410417,
// pspnet_apctl
SCE_NET_APCTL_ERROR_ALREADY_INITIALIZED = 0x80410a01,
SCE_NET_APCTL_ERROR_INVALID_CODE = 0x80410a02,
SCE_NET_APCTL_ERROR_INVALID_IP = 0x80410a03,
SCE_NET_APCTL_ERROR_NOT_DISCONNECTED = 0x80410a04,
SCE_NET_APCTL_ERROR_NOT_IN_BSS = 0x80410a05,
SCE_NET_APCTL_ERROR_WLAN_SWITCH_OFF = 0x80410a06,
SCE_NET_APCTL_ERROR_WLAN_BEACON_LOST = 0x80410a07,
SCE_NET_APCTL_ERROR_WLAN_DISASSOCIATION = 0x80410a08,
SCE_NET_APCTL_ERROR_INVALID_ID = 0x80410a09,
SCE_NET_APCTL_ERROR_WLAN_SUSPENDED = 0x80410a0a,
SCE_NET_APCTL_ERROR_TIMEOUT = 0x80410a0b,
};
-13
View File
@@ -39,19 +39,6 @@ enum {
ERROR_NET_DHCP_LEASE_TIME = 0x80410504,
ERROR_NET_DHCP_GET_NAK = 0x80410505,
// pspnet_apctl
ERROR_NET_APCTL_ALREADY_INITIALIZED = 0x80410a01,
ERROR_NET_APCTL_INVALID_CODE = 0x80410a02,
ERROR_NET_APCTL_INVALID_IP = 0x80410a03,
ERROR_NET_APCTL_NOT_DISCONNECTED = 0x80410a04,
ERROR_NET_APCTL_NOT_IN_BSS = 0x80410a05,
ERROR_NET_APCTL_WLAN_SWITCH_OFF = 0x80410a06,
ERROR_NET_APCTL_WLAN_BEACON_LOST = 0x80410a07,
ERROR_NET_APCTL_WLAN_DISASSOCIATION = 0x80410a08,
ERROR_NET_APCTL_INVALID_ID = 0x80410a09,
ERROR_NET_APCTL_WLAN_SUSPENDED = 0x80410a0a,
ERROR_NET_APCTL_TIMEOUT = 0x80410a0b,
// wlan errors
ERROR_NET_WLAN_ALREADY_JOINED = 0x80410d01,
ERROR_NET_WLAN_TRY_JOIN = 0x80410d02,
+11
View File
@@ -1536,6 +1536,17 @@ const char *KernelErrorToString(u32 err) {
case SCE_NET_RESOLVER_ERROR_RES_SERVER_REFUSED: return "SCE_NET_RESOLVER_ERROR_RES_SERVER_REFUSED";
case SCE_NET_RESOLVER_ERROR_INTERNAL: return "SCE_NET_RESOLVER_ERROR_INTERNAL";
case SCE_NET_APCTL_ERROR_ALREADY_INITIALIZED: return "SCE_NET_APCTL_ERROR_ALREADY_INITIALIZED";
case SCE_NET_APCTL_ERROR_INVALID_CODE: return "SCE_NET_APCTL_ERROR_INVALID_CODE";
case SCE_NET_APCTL_ERROR_INVALID_IP: return "SCE_NET_APCTL_ERROR_INVALID_IP";
case SCE_NET_APCTL_ERROR_NOT_DISCONNECTED: return "SCE_NET_APCTL_ERROR_NOT_DISCONNECTED";
case SCE_NET_APCTL_ERROR_NOT_IN_BSS: return "SCE_NET_APCTL_ERROR_NOT_IN_BSS";
case SCE_NET_APCTL_ERROR_WLAN_SWITCH_OFF: return "SCE_NET_APCTL_ERROR_WLAN_SWITCH_OFF";
case SCE_NET_APCTL_ERROR_WLAN_BEACON_LOST: return "SCE_NET_APCTL_ERROR_WLAN_BEACON_LOST";
case SCE_NET_APCTL_ERROR_WLAN_DISASSOCIATION: return "SCE_NET_APCTL_ERROR_WLAN_DISASSOCIATION";
case SCE_NET_APCTL_ERROR_INVALID_ID: return "SCE_NET_APCTL_ERROR_INVALID_ID";
case SCE_NET_APCTL_ERROR_WLAN_SUSPENDED: return "SCE_NET_APCTL_ERROR_WLAN_SUSPENDED";
case SCE_NET_APCTL_ERROR_TIMEOUT: return "SCE_NET_APCTL_ERROR_TIMEOUT";
default:
return nullptr;
}
+8 -8
View File
@@ -1123,7 +1123,7 @@ void NetApctl_InitInfo(int confId) {
static int sceNetApctlInit(int stackSize, int initPriority) {
if (g_netApctlInited) {
return hleLogError(Log::sceNet, ERROR_NET_APCTL_ALREADY_INITIALIZED);
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_ALREADY_INITIALIZED);
}
apctlEvents.clear();
@@ -1325,7 +1325,7 @@ static int sceNetApctlGetInfo(int code, u32 pInfoAddr) {
NotifyMemInfo(MemBlockFlags::WRITE, pInfoAddr, 4, "NetApctlGetInfo");
break;
default:
return hleLogError(Log::sceNet, ERROR_NET_APCTL_INVALID_CODE, "apctl invalid code");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_INVALID_CODE, "apctl invalid code");
}
return hleLogDebug(Log::sceNet, 0);
@@ -1392,10 +1392,10 @@ static int sceNetApctlDelHandler(u32 handlerID) {
int sceNetApctlConnect(int confId) {
if (!g_Config.bEnableWlan)
return hleLogError(Log::sceNet, ERROR_NET_APCTL_WLAN_SWITCH_OFF, "apctl wlan off");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_WLAN_SWITCH_OFF);
if (netApctlState != PSP_NET_APCTL_STATE_DISCONNECTED)
return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_DISCONNECTED, "apctl not disconnected");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_NOT_DISCONNECTED);
// Is this confId is the index to the scanning's result data or sceNetApctlGetBSSDescIDListUser result?
netApctlInfoId = confId;
@@ -1439,7 +1439,7 @@ bool __NetApctlConnected() {
}
static int sceNetApctlGetState(u32 pStateAddr) {
//if (!netApctlInited) return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_IN_BSS, "apctl not in bss");
//if (!netApctlInited) return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_NOT_IN_BSS, "apctl not in bss");
// Valid Arguments
if (Memory::IsValidAddress(pStateAddr)) {
@@ -1455,11 +1455,11 @@ static int sceNetApctlGetState(u32 pStateAddr) {
// This one logs like a syscall because it's called at the end of some.
int NetApctl_ScanUser() {
if (!g_Config.bEnableWlan)
return hleLogError(Log::sceNet, ERROR_NET_APCTL_WLAN_SWITCH_OFF, "apctl wlan off");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_WLAN_SWITCH_OFF);
// Scan probably only works when not in connected state, right?
if (netApctlState != PSP_NET_APCTL_STATE_DISCONNECTED)
return hleLogError(Log::sceNet, ERROR_NET_APCTL_NOT_DISCONNECTED, "apctl not disconnected");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_NOT_DISCONNECTED);
__UpdateApctlHandlers(0, PSP_NET_APCTL_STATE_SCANNING, PSP_NET_APCTL_EVENT_SCAN_REQUEST, 0);
return hleLogInfo(Log::sceNet, 0);
@@ -1573,7 +1573,7 @@ int NetApctl_GetBSSDescEntryUser(int entryId, int infoId, u32 resultAddr) {
Memory::Write_U32(netApctlInfo.securityType, resultAddr);
break;
default:
return hleLogError(Log::sceNet, ERROR_NET_APCTL_INVALID_CODE, "unknown info id");
return hleLogError(Log::sceNet, SCE_NET_APCTL_ERROR_INVALID_CODE, "unknown info id");
}
return 0;