mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-04-02 11:01:50 -04:00
Added some network-related missing error codes.
This commit is contained in:
parent
b3cf097e77
commit
59e2bab7ec
4 changed files with 131 additions and 23 deletions
|
@ -118,7 +118,7 @@ inline bool isDisconnected(int errcode) { return (errcode == EPIPE || errcode ==
|
|||
#define ADHOCCTL_MODE_GAMEMODE 1
|
||||
|
||||
// Event Types for Event Handler
|
||||
#define ADHOCCTL_EVENT_ERROR 0
|
||||
#define ADHOCCTL_EVENT_ERROR 0 // Used to pass error code to Adhocctl Handler?
|
||||
#define ADHOCCTL_EVENT_CONNECT 1
|
||||
#define ADHOCCTL_EVENT_DISCONNECT 2
|
||||
#define ADHOCCTL_EVENT_SCAN 3
|
||||
|
@ -557,19 +557,24 @@ typedef struct SceNetAdhocMatchingContext {
|
|||
// End of psp definitions
|
||||
|
||||
enum {
|
||||
// pspnet_adhoc_auth
|
||||
ERROR_NET_ADHOC_AUTH_ALREADY_INITIALIZED = 0x80410601,
|
||||
|
||||
// pspnet_adhoc
|
||||
ERROR_NET_ADHOC_INVALID_SOCKET_ID = 0x80410701,
|
||||
ERROR_NET_ADHOC_INVALID_ADDR = 0x80410702,
|
||||
ERROR_NET_ADHOC_INVALID_PORT = 0x80410703,
|
||||
ERROR_NET_ADHOC_INVALID_BUFLEN = 0x80410704,
|
||||
ERROR_NET_ADHOC_INVALID_DATALEN = 0x80410705,
|
||||
ERROR_NET_ADHOC_NOT_ENOUGH_SPACE = 0x80400706,
|
||||
ERROR_NET_ADHOC_NOT_ENOUGH_SPACE = 0x80400706, // not a typo
|
||||
ERROR_NET_ADHOC_SOCKET_DELETED = 0x80410707,
|
||||
ERROR_NET_ADHOC_SOCKET_ALERTED = 0x80410708,
|
||||
ERROR_NET_ADHOC_WOULD_BLOCK = 0x80410709, //ERROR_NET_ADHOC_NO_DATA_AVAILABLE
|
||||
ERROR_NET_ADHOC_PORT_IN_USE = 0x8041070a,
|
||||
ERROR_NET_ADHOC_NOT_CONNECTED = 0x8041070B,
|
||||
ERROR_NET_ADHOC_DISCONNECTED = 0x8041070c,
|
||||
ERROR_NET_ADHOC_NOT_OPENED = 0x8040070D,
|
||||
ERROR_NET_ADHOC_NOT_LISTENED = 0x8040070E,
|
||||
ERROR_NET_ADHOC_NOT_OPENED = 0x8040070D, // not a typo
|
||||
ERROR_NET_ADHOC_NOT_LISTENED = 0x8040070E, // not a typo
|
||||
ERROR_NET_ADHOC_SOCKET_ID_NOT_AVAIL = 0x8041070F,
|
||||
ERROR_NET_ADHOC_PORT_NOT_AVAIL = 0x80410710,
|
||||
ERROR_NET_ADHOC_INVALID_ARG = 0x80410711,
|
||||
|
@ -585,7 +590,9 @@ enum {
|
|||
ERROR_NET_ADHOC_NOT_IN_GAMEMODE = 0x8041071B,
|
||||
ERROR_NET_ADHOC_NOT_CREATED = 0x8041071C,
|
||||
|
||||
// pspnet_adhoc_matching
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_MODE = 0x80410801,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_PORT = 0x80410802,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_MAXNUM = 0x80410803,
|
||||
ERROR_NET_ADHOC_MATCHING_RXBUF_TOO_SHORT = 0x80410804,
|
||||
ERROR_NET_ADHOC_MATCHING_INVALID_OPTLEN = 0x80410805,
|
||||
|
@ -609,21 +616,26 @@ enum {
|
|||
ERROR_NET_ADHOC_MATCHING_NOT_ESTABLISHED = 0x80410817,
|
||||
ERROR_NET_ADHOC_MATCHING_DATA_BUSY = 0x80410818,
|
||||
|
||||
// pspnet_adhocctl
|
||||
ERROR_NET_ADHOCCTL_NOT_LEFT_IBSS = 0x80410b01,
|
||||
ERROR_NET_ADHOCCTL_ALREADY_CONNECTED = 0x80410b02,
|
||||
ERROR_NET_ADHOCCTL_WLAN_SWITCH_OFF = 0x80410b03,
|
||||
ERROR_NET_ADHOCCTL_INVALID_ARG = 0x80410B04,
|
||||
ERROR_NET_ADHOCCTL_TIMEOUT = 0x80410b05,
|
||||
ERROR_NET_ADHOCCTL_ID_NOT_FOUND = 0x80410B06,
|
||||
ERROR_NET_ADHOCCTL_ALREADY_INITIALIZED = 0x80410b07,
|
||||
ERROR_NET_ADHOCCTL_NOT_INITIALIZED = 0x80410b08,
|
||||
ERROR_NET_ADHOCCTL_DISCONNECTED = 0x80410b09,
|
||||
ERROR_NET_ADHOCCTL_NO_SCAN_INFO = 0x80410b0a,
|
||||
ERROR_NET_ADHOCCTL_INVALID_IBSS = 0x80410b0b,
|
||||
ERROR_NET_ADHOCCTL_NOT_ENTER_GAMEMODE = 0x80410B0C,
|
||||
ERROR_NET_ADHOCCTL_CHANNEL_NOT_AVAILABLE = 0x80410B0D,
|
||||
ERROR_NET_ADHOCCTL_WLAN_BEACON_LOST = 0x80410b0e,
|
||||
ERROR_NET_ADHOCCTL_WLAN_SUSPENDED = 0x80410b0f,
|
||||
ERROR_NET_ADHOCCTL_BUSY = 0x80410b10,
|
||||
ERROR_NET_ADHOCCTL_CHANNEL_NOT_MATCH = 0x80410b11,
|
||||
ERROR_NET_ADHOCCTL_TOO_MANY_HANDLERS = 0x80410b12,
|
||||
ERROR_NET_ADHOCCTL_STACKSIZE_TOO_SHORT = 0x80410B13,
|
||||
|
||||
ERROR_NET_WLAN_INVALID_ARG = 0x80410D13,
|
||||
|
||||
ERROR_NET_NO_SPACE = 0x80410001
|
||||
};
|
||||
|
||||
const size_t MAX_ADHOCCTL_HANDLERS = 32; //4
|
||||
|
|
|
@ -674,6 +674,8 @@ static u32 sceWlanGetEtherAddr(u32 addrAddr) {
|
|||
return hleLogError(SCENET, SCE_KERNEL_ERROR_ILLEGAL_ADDR, "illegal address");
|
||||
}
|
||||
|
||||
// FIXME: Return 0x80410180 (pspnet[_core] error code?) when Adhocctl not connected to a group (ie. ADHOCCTL_STATE_DISCONNECTED)?
|
||||
|
||||
u8 *addr = Memory::GetPointer(addrAddr);
|
||||
if (PPSSPP_ID > 1) {
|
||||
Memory::Memset(addrAddr, PPSSPP_ID, 6);
|
||||
|
|
|
@ -49,14 +49,80 @@
|
|||
const size_t MAX_APCTL_HANDLERS = 32;
|
||||
|
||||
enum {
|
||||
ERROR_NET_BUFFER_TOO_SMALL = 0x80400706,
|
||||
// net common errors
|
||||
ERROR_NET_NO_SPACE = 0x80410001,
|
||||
ERROR_NET_INTERNAL = 0x80410002,
|
||||
ERROR_NET_INVALID_ARG = 0x80410003,
|
||||
ERROR_NET_NO_ENTRY = 0x80410004,
|
||||
|
||||
// pspnet_core
|
||||
ERROR_NET_CORE_NOT_TERMINATED = 0x80410101,
|
||||
ERROR_NET_CORE_INTERFACE_BUSY = 0x80410102,
|
||||
ERROR_NET_CORE_INVALID_ARG = 0x80410103,
|
||||
ERROR_NET_CORE_THREAD_NOT_FOUND = 0x80410104,
|
||||
ERROR_NET_CORE_THREAD_BUSY = 0x80410105,
|
||||
ERROR_NET_CORE_80211_NO_BSS = 0x80410106,
|
||||
ERROR_NET_CORE_80211_NO_AVAIL_BSS = 0x80410107,
|
||||
|
||||
// pspnet_inet
|
||||
ERROR_NET_INET_ALREADY_INITIALIZED = 0x80410201,
|
||||
ERROR_NET_INET_SOCKET_BUSY = 0x80410202,
|
||||
ERROR_NET_INET_CONFIG_INVALID_ARG = 0x80410203,
|
||||
ERROR_NET_INET_GET_IFADDR = 0x80410204,
|
||||
ERROR_NET_INET_SET_IFADDR = 0x80410205,
|
||||
ERROR_NET_INET_DEL_IFADDR = 0x80410206,
|
||||
ERROR_NET_INET_NO_DEFAULT_ROUTE = 0x80410207,
|
||||
ERROR_NET_INET_GET_ROUTE = 0x80410208,
|
||||
ERROR_NET_INET_SET_ROUTE = 0x80410209,
|
||||
ERROR_NET_INET_FLUSH_ROUTE = 0x8041020a,
|
||||
ERROR_NET_INET_INVALID_ARG = 0x8041020b,
|
||||
|
||||
ERROR_NET_RESOLVER_BAD_ID = 0x80410408,
|
||||
// pspnet_poeclient
|
||||
ERROR_NET_POECLIENT_INIT = 0x80410301,
|
||||
ERROR_NET_POECLIENT_NO_PADO = 0x80410302,
|
||||
ERROR_NET_POECLIENT_NO_PADS = 0x80410303,
|
||||
ERROR_NET_POECLIENT_GET_PADT = 0x80410304,
|
||||
ERROR_NET_POECLIENT_SERVICE_NAME = 0x80410305,
|
||||
ERROR_NET_POECLIENT_AC_SYSTEM = 0x80410306,
|
||||
ERROR_NET_POECLIENT_GENERIC = 0x80410307,
|
||||
ERROR_NET_POECLIENT_AUTH = 0x80410308,
|
||||
ERROR_NET_POECLIENT_NETWORK = 0x80410309,
|
||||
ERROR_NET_POECLIENT_TERMINATE = 0x8041030a,
|
||||
ERROR_NET_POECLIENT_NOT_STARTED = 0x8041030b,
|
||||
|
||||
// pspnet_resolver
|
||||
ERROR_NET_RESOLVER_NOT_TERMINATED = 0x80410401,
|
||||
ERROR_NET_RESOLVER_NO_DNS_SERVER = 0x80410402,
|
||||
ERROR_NET_RESOLVER_INVALID_PTR = 0x80410403,
|
||||
ERROR_NET_RESOLVER_INVALID_BUFLEN = 0x80410404,
|
||||
ERROR_NET_RESOLVER_INVALID_ID = 0x80410405,
|
||||
ERROR_NET_RESOLVER_ID_MAX = 0x80410406,
|
||||
ERROR_NET_RESOLVER_NO_MEM = 0x80410407,
|
||||
ERROR_NET_RESOLVER_BAD_ID = 0x80410408, // ERROR_NET_RESOLVER_ID_NOT_FOUND
|
||||
ERROR_NET_RESOLVER_CTX_BUSY = 0x80410409,
|
||||
ERROR_NET_RESOLVER_ALREADY_STOPPED = 0x8041040a,
|
||||
ERROR_NET_RESOLVER_INVALID_HOST = 0x80410414,
|
||||
ERROR_NET_RESOLVER_NOT_SUPPORTED = 0x8041040b,
|
||||
ERROR_NET_RESOLVER_BUF_NO_SPACE = 0x8041040c,
|
||||
ERROR_NET_RESOLVER_INVALID_PACKET = 0x8041040d,
|
||||
ERROR_NET_RESOLVER_STOPPED = 0x8041040e,
|
||||
ERROR_NET_RESOLVER_SOCKET = 0x8041040f,
|
||||
ERROR_NET_RESOLVER_TIMEOUT = 0x80410410,
|
||||
ERROR_NET_RESOLVER_NO_RECORD = 0x80410411,
|
||||
ERROR_NET_RESOLVER_RES_PACKET_FORMAT = 0x80410412,
|
||||
ERROR_NET_RESOLVER_RES_SERVER_FAILURE = 0x80410413,
|
||||
ERROR_NET_RESOLVER_INVALID_HOST = 0x80410414, // ERROR_NET_RESOLVER_NO_HOST
|
||||
ERROR_NET_RESOLVER_RES_NOT_IMPLEMENTED = 0x80410415,
|
||||
ERROR_NET_RESOLVER_RES_SERVER_REFUSED = 0x80410416,
|
||||
ERROR_NET_RESOLVER_INTERNAL = 0x80410417,
|
||||
|
||||
// pspnet_dhcp
|
||||
ERROR_NET_DHCP_INVALID_PACKET = 0x80410501,
|
||||
ERROR_NET_DHCP_NO_SERVER = 0x80410502,
|
||||
ERROR_NET_DHCP_SENT_DECLINE = 0x80410503,
|
||||
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,
|
||||
|
@ -68,6 +134,30 @@ enum {
|
|||
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,
|
||||
ERROR_NET_WLAN_SCANNING = 0x80410d03,
|
||||
ERROR_NET_WLAN_INVALID_PARAMETER = 0x80410d04,
|
||||
ERROR_NET_WLAN_NOT_SUPPORTED = 0x80410d05,
|
||||
ERROR_NET_WLAN_NOT_JOIN_BSS = 0x80410d06,
|
||||
ERROR_NET_WLAN_ASSOC_TIMEOUT = 0x80410d07,
|
||||
ERROR_NET_WLAN_ASSOC_REFUSED = 0x80410d08,
|
||||
ERROR_NET_WLAN_ASSOC_FAIL = 0x80410d09,
|
||||
ERROR_NET_WLAN_DISASSOC_FAIL = 0x80410d0a,
|
||||
ERROR_NET_WLAN_JOIN_FAIL = 0x80410d0b,
|
||||
ERROR_NET_WLAN_POWER_OFF = 0x80410d0c,
|
||||
ERROR_NET_WLAN_INTERNAL_FAIL = 0x80410d0d,
|
||||
ERROR_NET_WLAN_DEVICE_NOT_READY = 0x80410d0e,
|
||||
ERROR_NET_WLAN_ALREADY_ATTACHED = 0x80410d0f,
|
||||
ERROR_NET_WLAN_NOT_SET_WEP = 0x80410d10,
|
||||
ERROR_NET_WLAN_TIMEOUT = 0x80410d11,
|
||||
ERROR_NET_WLAN_NO_SPACE = 0x80410d12,
|
||||
ERROR_NET_WLAN_INVALID_ARG = 0x80410D13,
|
||||
ERROR_NET_WLAN_NOT_IN_GAMEMODE = 0x80410d14,
|
||||
ERROR_NET_WLAN_LEAVE_FAIL = 0x80410d15,
|
||||
ERROR_NET_WLAN_SUSPENDED = 0x80410d16,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
|
@ -1022,6 +1022,9 @@ u32 sceNetAdhocInit() {
|
|||
static u32 sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr) {
|
||||
INFO_LOG(SCENET, "sceNetAdhocctlInit(%i, %i, %08x) at %08x", stackSize, prio, productAddr, currentMIPS->pc);
|
||||
|
||||
// FIXME: Returning 0x8002013a (SCE_KERNEL_ERROR_LIBRARY_NOT_YET_LINKED) without adhoc module loaded first?
|
||||
// FIXME: Sometimes returning 0x80410601 (ERROR_NET_ADHOC_AUTH_ALREADY_INITIALIZED / Library module is already initialized ?) when AdhocctlTerm is not fully done?
|
||||
|
||||
if (netAdhocctlInited)
|
||||
return ERROR_NET_ADHOCCTL_ALREADY_INITIALIZED;
|
||||
|
||||
|
@ -1913,7 +1916,7 @@ static int sceNetAdhocPdpDelete(int id, int unknown) {
|
|||
}
|
||||
|
||||
static int sceNetAdhocctlGetAdhocId(u32 productStructAddr) {
|
||||
ERROR_LOG(SCENET, "UNIMPL sceNetAdhocctlGetAdhocId(%08x)", productStructAddr);
|
||||
INFO_LOG(SCENET, "sceNetAdhocctlGetAdhocId(%08x) at %08x", productStructAddr, currentMIPS->pc);
|
||||
|
||||
// Library initialized
|
||||
if (netAdhocctlInited)
|
||||
|
@ -1921,21 +1924,19 @@ static int sceNetAdhocctlGetAdhocId(u32 productStructAddr) {
|
|||
// Valid Arguments
|
||||
if (Memory::IsValidAddress(productStructAddr))
|
||||
{
|
||||
SceNetAdhocctlAdhocId * adhoc_id = (SceNetAdhocctlAdhocId *)Memory::GetPointer(productStructAddr);
|
||||
// Copy Product ID
|
||||
*adhoc_id = product_code;
|
||||
//Memory::WriteStruct(productStructAddr, &product_code);
|
||||
Memory::WriteStruct(productStructAddr, &product_code);
|
||||
|
||||
// Return Success
|
||||
return 0;
|
||||
return hleLogDebug(SCENET, 0, "type = %d, code = %s", product_code.type, product_code.data);
|
||||
}
|
||||
|
||||
// Invalid Arguments
|
||||
return ERROR_NET_ADHOCCTL_INVALID_ARG;
|
||||
return hleLogDebug(SCENET, ERROR_NET_ADHOCCTL_INVALID_ARG, "invalid arg");
|
||||
}
|
||||
|
||||
// Library uninitialized
|
||||
return ERROR_NET_ADHOCCTL_NOT_INITIALIZED;
|
||||
return hleLogDebug(SCENET, ERROR_NET_ADHOCCTL_NOT_INITIALIZED, "not initialized");
|
||||
}
|
||||
|
||||
// FIXME: Scan probably not a blocking function since there is ADHOCCTL_STATE_SCANNING state that can be polled by the game, right? But apparently it need to be delayed for Naruto Shippuden Ultimate Ninja Heroes 3
|
||||
|
@ -1989,8 +1990,8 @@ int sceNetAdhocctlScan() {
|
|||
return ERROR_NET_ADHOCCTL_BUSY;
|
||||
|
||||
// Already connected to a group. Should we fake a success?
|
||||
// We need to notify the handler on success, even if it was faked
|
||||
notifyAdhocctlHandlers(ADHOCCTL_EVENT_SCAN, 0);
|
||||
// We need to notify the handler on success, even if it was faked. Using flag = 0/ADHOCCTL_EVENT_ERROR for error?
|
||||
notifyAdhocctlHandlers(ADHOCCTL_EVENT_ERROR, ERROR_NET_ADHOCCTL_ALREADY_CONNECTED);
|
||||
// FIXME: returning ERROR_NET_ADHOCCTL_BUSY may trigger the game (ie. Ford Street Racing) to call sceNetAdhocctlDisconnect, But Not returning a Success(0) will cause Valhalla Knights 2 not working properly
|
||||
hleEatMicro(us);
|
||||
return 0;
|
||||
|
@ -5256,7 +5257,8 @@ void __NetTriggerCallbacks()
|
|||
newState = ADHOCCTL_STATE_WOL;
|
||||
break;
|
||||
case ADHOCCTL_EVENT_ERROR:
|
||||
newState = ADHOCCTL_STATE_DISCONNECTED;
|
||||
// FIXME: Should we change the state on error or leave it alone? for example after Creating/Joining a group, doing Scan could trigger an error through handler, what about the AdhocctlState after this error?
|
||||
//newState = ADHOCCTL_STATE_DISCONNECTED;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -5413,6 +5415,8 @@ static int sceNetAdhocctlGetPeerList(u32 sizeAddr, u32 bufAddr) {
|
|||
if (netAdhocctlInited) {
|
||||
// Minimum Arguments
|
||||
if (buflen != NULL) {
|
||||
// FIXME: Sometimes returing 0x80410682 before AdhocctlGetState became ADHOCCTL_STATE_CONNECTED or related to Auth/Library ?
|
||||
|
||||
// Multithreading Lock
|
||||
peerlock.lock();
|
||||
|
||||
|
@ -5481,11 +5485,11 @@ static int sceNetAdhocctlGetPeerList(u32 sizeAddr, u32 bufAddr) {
|
|||
}
|
||||
|
||||
// Invalid Arguments
|
||||
return ERROR_NET_ADHOCCTL_INVALID_ARG;
|
||||
return hleLogDebug(SCENET, ERROR_NET_ADHOCCTL_INVALID_ARG, "invalid arg");
|
||||
}
|
||||
|
||||
// Uninitialized Library
|
||||
return ERROR_NET_ADHOCCTL_NOT_INITIALIZED;
|
||||
return hleLogDebug(SCENET, ERROR_NET_ADHOCCTL_NOT_INITIALIZED, "not initialized");
|
||||
}
|
||||
|
||||
static int sceNetAdhocctlGetAddrByName(const char *nickName, u32 sizeAddr, u32 bufAddr) {
|
||||
|
|
Loading…
Add table
Reference in a new issue