mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-31 06:32:41 +00:00
Merge pull request #719 from tambry/cellnetctl
Additions and improvements to cellNetCtl
This commit is contained in:
commit
fc122630d4
@ -4,59 +4,12 @@
|
||||
#include "Emu/System.h"
|
||||
#include "Emu/SysCalls/Modules.h"
|
||||
|
||||
#include "cellNetCtl.h"
|
||||
|
||||
//void cellNetCtl_init();
|
||||
//Module cellNetCtl(0x0014, cellNetCtl_init);
|
||||
Module *cellNetCtl;
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_ERROR_NOT_INITIALIZED = 0x80130101,
|
||||
CELL_NET_CTL_ERROR_NOT_TERMINATED = 0x80130102,
|
||||
CELL_NET_CTL_ERROR_HANDLER_MAX = 0x80130103,
|
||||
CELL_NET_CTL_ERROR_ID_NOT_FOUND = 0x80130104,
|
||||
CELL_NET_CTL_ERROR_INVALID_ID = 0x80130105,
|
||||
CELL_NET_CTL_ERROR_INVALID_CODE = 0x80130106,
|
||||
CELL_NET_CTL_ERROR_INVALID_ADDR = 0x80130107,
|
||||
CELL_NET_CTL_ERROR_NOT_CONNECTED = 0x80130108,
|
||||
CELL_NET_CTL_ERROR_NOT_AVAIL = 0x80130109,
|
||||
CELL_NET_CTL_ERROR_INVALID_TYPE = 0x8013010a,
|
||||
CELL_NET_CTL_ERROR_INVALID_SIZE = 0x8013010b,
|
||||
CELL_NET_CTL_ERROR_NET_DISABLED = 0x80130181,
|
||||
CELL_NET_CTL_ERROR_NET_NOT_CONNECTED = 0x80130182,
|
||||
CELL_NET_CTL_ERROR_NP_NO_ACCOUNT = 0x80130183,
|
||||
CELL_NET_CTL_ERROR_NP_RESERVED1 = 0x80130184,
|
||||
CELL_NET_CTL_ERROR_NP_RESERVED2 = 0x80130185,
|
||||
CELL_NET_CTL_ERROR_NET_CABLE_NOT_CONNECTED = 0x80130186,
|
||||
CELL_NET_CTL_ERROR_DIALOG_CANCELED = 0x80130190,
|
||||
CELL_NET_CTL_ERROR_DIALOG_ABORTED = 0x80130191,
|
||||
|
||||
CELL_NET_CTL_ERROR_WLAN_DEAUTHED = 0x80130137,
|
||||
CELL_NET_CTL_ERROR_WLAN_KEYINFO_EXCHNAGE_TIMEOUT = 0x8013013d,
|
||||
CELL_NET_CTL_ERROR_WLAN_ASSOC_FAILED = 0x8013013e,
|
||||
CELL_NET_CTL_ERROR_WLAN_AP_DISAPPEARED = 0x8013013f,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_INIT = 0x80130409,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_NO_PADO = 0x8013040a,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_NO_PADS = 0x8013040b,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_GET_PADT = 0x8013040d,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_SERVICE_NAME = 0x8013040f,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_AC_SYSTEM = 0x80130410,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_GENERIC = 0x80130411,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_AUTH = 0x80130412,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_NETWORK = 0x80130413,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_TERMINATE = 0x80130414,
|
||||
CELL_NET_CTL_ERROR_DHCP_LEASE_TIME = 0x80130504,
|
||||
};
|
||||
|
||||
// Network connection states
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_STATE_Disconnected = 0,
|
||||
CELL_NET_CTL_STATE_Connecting = 1,
|
||||
CELL_NET_CTL_STATE_IPObtaining = 2,
|
||||
CELL_NET_CTL_STATE_IPObtained = 3,
|
||||
};
|
||||
|
||||
int cellNetCtlInit()
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
@ -74,7 +27,10 @@ int cellNetCtlGetState(mem32_t state)
|
||||
cellNetCtl->Log("cellNetCtlGetState(state_addr=0x%x)", state.GetAddr());
|
||||
|
||||
if (!state.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetState : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
state = CELL_NET_CTL_STATE_Disconnected; // TODO: Allow other states
|
||||
return CELL_OK;
|
||||
@ -98,9 +54,16 @@ int cellNetCtlGetInfo()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellNetCtlNetStartDialogLoadAsync()
|
||||
int cellNetCtlNetStartDialogLoadAsync(mem_ptr_t<CellNetCtlNetStartDialogParam> param)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogLoadAsync(param_addr=0x%x)", param.GetAddr());
|
||||
|
||||
if (!param.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
@ -110,15 +73,35 @@ int cellNetCtlNetStartDialogAbortAsync()
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellNetCtlNetStartDialogUnloadAsync()
|
||||
int cellNetCtlNetStartDialogUnloadAsync(mem_ptr_t<CellNetCtlNetStartDialogResult> result)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
cellNetCtl->Todo("cellNetCtlNetStartDialogUnloadAsync(result_addr=0x%x)", result.GetAddr());
|
||||
|
||||
if (!result.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlNetStartDialogLoadAsync : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
int cellNetCtlGetNatInfo()
|
||||
int cellNetCtlGetNatInfo(mem_ptr_t<CellNetCtlNatInfo> natInfo)
|
||||
{
|
||||
UNIMPLEMENTED_FUNC(cellNetCtl);
|
||||
cellNetCtl->Todo("cellNetCtlGetNatInfo(natInfo_addr=0x%x)", natInfo.GetAddr());
|
||||
|
||||
if (!natInfo.IsGood())
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_ADDR");
|
||||
return CELL_NET_CTL_ERROR_INVALID_ADDR;
|
||||
}
|
||||
|
||||
if (natInfo->size == 0)
|
||||
{
|
||||
cellNetCtl->Error("cellNetCtlGetNatInfo : CELL_NET_CTL_ERROR_INVALID_SIZE");
|
||||
return CELL_NET_CTL_ERROR_INVALID_SIZE;
|
||||
}
|
||||
|
||||
return CELL_OK;
|
||||
}
|
||||
|
||||
|
258
rpcs3/Emu/SysCalls/Modules/cellNetCtl.h
Normal file
258
rpcs3/Emu/SysCalls/Modules/cellNetCtl.h
Normal file
@ -0,0 +1,258 @@
|
||||
#pragma once
|
||||
|
||||
// Error Codes
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_ERROR_NOT_INITIALIZED = 0x80130101,
|
||||
CELL_NET_CTL_ERROR_NOT_TERMINATED = 0x80130102,
|
||||
CELL_NET_CTL_ERROR_HANDLER_MAX = 0x80130103,
|
||||
CELL_NET_CTL_ERROR_ID_NOT_FOUND = 0x80130104,
|
||||
CELL_NET_CTL_ERROR_INVALID_ID = 0x80130105,
|
||||
CELL_NET_CTL_ERROR_INVALID_CODE = 0x80130106,
|
||||
CELL_NET_CTL_ERROR_INVALID_ADDR = 0x80130107,
|
||||
CELL_NET_CTL_ERROR_NOT_CONNECTED = 0x80130108,
|
||||
CELL_NET_CTL_ERROR_NOT_AVAIL = 0x80130109,
|
||||
CELL_NET_CTL_ERROR_INVALID_TYPE = 0x8013010a,
|
||||
CELL_NET_CTL_ERROR_INVALID_SIZE = 0x8013010b,
|
||||
CELL_NET_CTL_ERROR_NET_DISABLED = 0x80130181,
|
||||
CELL_NET_CTL_ERROR_NET_NOT_CONNECTED = 0x80130182,
|
||||
CELL_NET_CTL_ERROR_NP_NO_ACCOUNT = 0x80130183,
|
||||
CELL_NET_CTL_ERROR_NP_RESERVED1 = 0x80130184,
|
||||
CELL_NET_CTL_ERROR_NP_RESERVED2 = 0x80130185,
|
||||
CELL_NET_CTL_ERROR_NET_CABLE_NOT_CONNECTED = 0x80130186,
|
||||
CELL_NET_CTL_ERROR_DIALOG_CANCELED = 0x80130190,
|
||||
CELL_NET_CTL_ERROR_DIALOG_ABORTED = 0x80130191,
|
||||
|
||||
CELL_NET_CTL_ERROR_WLAN_DEAUTHED = 0x80130137,
|
||||
CELL_NET_CTL_ERROR_WLAN_KEYINFO_EXCHNAGE_TIMEOUT = 0x8013013d,
|
||||
CELL_NET_CTL_ERROR_WLAN_ASSOC_FAILED = 0x8013013e,
|
||||
CELL_NET_CTL_ERROR_WLAN_AP_DISAPPEARED = 0x8013013f,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_INIT = 0x80130409,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_NO_PADO = 0x8013040a,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_NO_PADS = 0x8013040b,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_GET_PADT = 0x8013040d,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_SERVICE_NAME = 0x8013040f,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_AC_SYSTEM = 0x80130410,
|
||||
CELL_NET_CTL_ERROR_PPPOE_SESSION_GENERIC = 0x80130411,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_AUTH = 0x80130412,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_NETWORK = 0x80130413,
|
||||
CELL_NET_CTL_ERROR_PPPOE_STATUS_TERMINATE = 0x80130414,
|
||||
CELL_NET_CTL_ERROR_DHCP_LEASE_TIME = 0x80130504,
|
||||
};
|
||||
|
||||
// Network connection states
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_STATE_Disconnected = 0,
|
||||
CELL_NET_CTL_STATE_Connecting = 1,
|
||||
CELL_NET_CTL_STATE_IPObtaining = 2,
|
||||
CELL_NET_CTL_STATE_IPObtained = 3,
|
||||
};
|
||||
|
||||
// Transition connection states
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_EVENT_CONNECT_REQ = 0,
|
||||
CELL_NET_CTL_EVENT_ESTABLISH = 1,
|
||||
CELL_NET_CTL_EVENT_GET_IP = 2,
|
||||
CELL_NET_CTL_EVENT_DISCONNECT_REQ = 3,
|
||||
CELL_NET_CTL_EVENT_ERROR = 4,
|
||||
CELL_NET_CTL_EVENT_LINK_DISCONNECTED = 5,
|
||||
CELL_NET_CTL_EVENT_AUTO_RETRY = 6,
|
||||
};
|
||||
|
||||
// Network connection devices
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_DEVICE_WIRED = 0,
|
||||
CELL_NET_CTL_DEVICE_WIRELESS = 1,
|
||||
};
|
||||
|
||||
// Cable connection types
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_LINK_TYPE_AUTO = 0,
|
||||
CELL_NET_CTL_LINK_TYPE_10BASE_HALF = 1,
|
||||
CELL_NET_CTL_LINK_TYPE_10BASE_FULL = 2,
|
||||
CELL_NET_CTL_LINK_TYPE_100BASE_HALF = 3,
|
||||
CELL_NET_CTL_LINK_TYPE_100BASE_FULL = 4,
|
||||
CELL_NET_CTL_LINK_TYPE_1000BASE_HALF = 5,
|
||||
CELL_NET_CTL_LINK_TYPE_1000BASE_FULL = 6,
|
||||
};
|
||||
|
||||
// Link connection states
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_LINK_DISCONNECTED = 0,
|
||||
CELL_NET_CTL_LINK_CONNECTED = 1,
|
||||
};
|
||||
|
||||
// Wireless connection security measures
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_WLAN_SECURITY_NOAUTH = 0,
|
||||
CELL_NET_CTL_WLAN_SECURITY_WEP = 1,
|
||||
CELL_NET_CTL_WLAN_SECURITY_WPAPSK_TKIP = 2,
|
||||
CELL_NET_CTL_WLAN_SECURITY_WPAPSK_AES = 3,
|
||||
CELL_NET_CTL_WLAN_SECURITY_UNSUPPORTED = 4,
|
||||
};
|
||||
|
||||
// 802.1X settings
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_8021X_NONE = 0,
|
||||
CELL_NET_CTL_8021X_EAP_MD5 = 1,
|
||||
};
|
||||
|
||||
// IP settings
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_IP_DHCP = 0,
|
||||
CELL_NET_CTL_IP_STATIC = 1,
|
||||
CELL_NET_CTL_IP_PPPOE = 2,
|
||||
};
|
||||
|
||||
// HTTP proxy settings
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_HTTP_PROXY_OFF = 0,
|
||||
CELL_NET_CTL_HTTP_PROXY_ON = 1,
|
||||
};
|
||||
|
||||
// UPnP settings
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_UPNP_ON = 0,
|
||||
CELL_NET_CTL_UPNP_OFF = 1,
|
||||
};
|
||||
|
||||
// Codes for information
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_INFO_DEVICE = 1,
|
||||
CELL_NET_CTL_INFO_ETHER_ADDR = 2,
|
||||
CELL_NET_CTL_INFO_MTU = 3,
|
||||
CELL_NET_CTL_INFO_LINK = 4,
|
||||
CELL_NET_CTL_INFO_LINK_TYPE = 5,
|
||||
CELL_NET_CTL_INFO_BSSID = 6,
|
||||
CELL_NET_CTL_INFO_SSID = 7,
|
||||
CELL_NET_CTL_INFO_WLAN_SECURITY = 8,
|
||||
CELL_NET_CTL_INFO_8021X_TYPE = 9,
|
||||
CELL_NET_CTL_INFO_8021X_AUTH_NAME = 10,
|
||||
CELL_NET_CTL_INFO_RSSI = 11,
|
||||
CELL_NET_CTL_INFO_CHANNEL = 12,
|
||||
CELL_NET_CTL_INFO_IP_CONFIG = 13,
|
||||
CELL_NET_CTL_INFO_DHCP_HOSTNAME = 14,
|
||||
CELL_NET_CTL_INFO_PPPOE_AUTH_NAME = 15,
|
||||
CELL_NET_CTL_INFO_IP_ADDRESS = 16,
|
||||
CELL_NET_CTL_INFO_NETMASK = 17,
|
||||
CELL_NET_CTL_INFO_DEFAULT_ROUTE = 18,
|
||||
CELL_NET_CTL_INFO_PRIMARY_DNS = 19,
|
||||
CELL_NET_CTL_INFO_SECONDARY_DNS = 20,
|
||||
CELL_NET_CTL_INFO_HTTP_PROXY_CONFIG = 21,
|
||||
CELL_NET_CTL_INFO_HTTP_PROXY_SERVER = 22,
|
||||
CELL_NET_CTL_INFO_HTTP_PROXY_PORT = 23,
|
||||
CELL_NET_CTL_INFO_UPNP_CONFIG = 24,
|
||||
};
|
||||
|
||||
// Network start dialogs
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_NETSTART_TYPE_NET = 0,
|
||||
CELL_NET_CTL_NETSTART_TYPE_NP = 1,
|
||||
};
|
||||
|
||||
// Network start dialog statuses
|
||||
enum
|
||||
{
|
||||
CELL_SYSUTIL_NET_CTL_NETSTART_LOADED = 0x0801,
|
||||
CELL_SYSUTIL_NET_CTL_NETSTART_FINISHED = 0x0802,
|
||||
CELL_SYSUTIL_NET_CTL_NETSTART_UNLOADED = 0x0803,
|
||||
};
|
||||
|
||||
// UPnP NAT statuses
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_NATINFO_UPNP_UNCHECKED = 0,
|
||||
CELL_NET_CTL_NATINFO_UPNP_NO = 1,
|
||||
CELL_NET_CTL_NATINFO_UPNP_USED = 2,
|
||||
};
|
||||
|
||||
// STUN NAT statuses
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_NATINFO_STUN_UNCHECKED = 0,
|
||||
CELL_NET_CTL_NATINFO_STUN_FAILED = 1,
|
||||
CELL_NET_CTL_NATINFO_STUN_OK = 2,
|
||||
};
|
||||
|
||||
// NAT types
|
||||
enum
|
||||
{
|
||||
CELL_NET_CTL_NATINFO_NAT_TYPE_1 = 1,
|
||||
CELL_NET_CTL_NATINFO_NAT_TYPE_2 = 2,
|
||||
CELL_NET_CTL_NATINFO_NAT_TYPE_3 = 3,
|
||||
};
|
||||
|
||||
struct CellNetCtlEtherAddr
|
||||
{
|
||||
u8 data[6];
|
||||
u8 padding[2];
|
||||
};
|
||||
|
||||
struct CellNetCtlSSID
|
||||
{
|
||||
u8 data[32];
|
||||
u8 term;
|
||||
u8 padding[3];
|
||||
};
|
||||
|
||||
struct CellNetCtlInfo
|
||||
{
|
||||
be_t<u32> device;
|
||||
struct CellNetCtlEtherAddr ether_addr;
|
||||
be_t<u32> mtu;
|
||||
be_t<u32> link;
|
||||
be_t<u32> link_type;
|
||||
struct CellNetCtlEtherAddr bssid;
|
||||
struct CellNetCtlSSID ssid;
|
||||
be_t<u32> wlan_security;
|
||||
be_t<u32> auth_8021x_type;
|
||||
s8 auth_8021x_auth_name[128];
|
||||
u8 rssi;
|
||||
u8 channel;
|
||||
be_t<u32> ip_config;
|
||||
s8 dhcp_hostname[256];
|
||||
s8 pppoe_auth_name[128];
|
||||
s8 ip_address[16];
|
||||
s8 netmask[16];
|
||||
s8 default_route[16];
|
||||
s8 primary_dns[16];
|
||||
s8 secondary_dns[16];
|
||||
be_t<u32> http_proxy_config;
|
||||
s8 http_proxy_server[256];
|
||||
be_t<u16> http_proxy_port;
|
||||
be_t<u32> upnp_config;
|
||||
};
|
||||
|
||||
struct CellNetCtlNetStartDialogParam
|
||||
{
|
||||
be_t<u32> size;
|
||||
be_t<s32> type;
|
||||
be_t<u32> cid;
|
||||
};
|
||||
|
||||
struct CellNetCtlNetStartDialogResult
|
||||
{
|
||||
be_t<u32> size;
|
||||
be_t<s32> result;
|
||||
};
|
||||
|
||||
struct CellNetCtlNatInfo
|
||||
{
|
||||
be_t<u32> size;
|
||||
be_t<s32> upnp_status;
|
||||
be_t<s32> stun_status;
|
||||
be_t<s32> nat_type;
|
||||
struct in_addr mapped_addr;
|
||||
};
|
@ -347,6 +347,7 @@
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellGame.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellGifDec.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellJpgDec.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellMsgDialog.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h" />
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellPngDec.h" />
|
||||
|
@ -649,6 +649,9 @@
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellJpgDec.h">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellNetCtl.h">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Emu\SysCalls\Modules\cellPamf.h">
|
||||
<Filter>Emu\SysCalls\Modules</Filter>
|
||||
</ClInclude>
|
||||
|
Loading…
x
Reference in New Issue
Block a user