ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <errno.h>
#include <kernel.h>
#include <sifrpc.h>
#include <string.h>
#include <malloc.h>
#include <netman.h>
#include <netman_rpc.h>
#include "rpc_client.h"
Go to the source code of this file.
Functions | |
static void | deinitCleanup (void) |
static void | NETMAN_TxThread (void *arg) |
int | NetManInitRPCClient (void) |
int | NetManRPCRegisterNetworkStack (void) |
int | NetManRPCUnregisterNetworkStack (void) |
void | NetManDeinitRPCClient (void) |
int | NetManRpcIoctl (unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length) |
void | NetManRpcNetIFXmit (void) |
int | NetManSetMainIF (const char *name) |
int | NetManQueryMainIF (char *name) |
int | NetManSetLinkMode (int mode) |
Variables | |
static SifRpcClientData_t | NETMAN_rpc_cd |
void * | _gp |
union { | |
s32 mode | |
struct NetManIoctl IoctlArgs | |
char netifName [NETMAN_NETIF_NAME_MAX_LEN] | |
struct NetManRegNetworkStack NetStack | |
u8 buffer [128] | |
} | TransmitBuffer |
union { | |
s32 result | |
struct NetManRegNetworkStackResult NetStackResult | |
struct NetManIoctlResult IoctlResult | |
struct NetManQueryMainNetIFResult QueryMainNetIFResult | |
u8 buffer [128] | |
} | ReceiveBuffer |
static int | NetManIOSemaID = -1 |
static int | NETMAN_Tx_threadID = -1 |
static unsigned char | NETMAN_Tx_ThreadStack [0x1000] |
static unsigned short int | IOPFrameBufferWrPtr |
static u8 * | IOPFrameBuffer = NULL |
static struct NetManBD * | IOPFrameBufferStatus = NULL |
static struct NetManBD * | FrameBufferStatus = NULL |
static unsigned char | IsInitialized =0 |
static unsigned char | IsProcessingTx |
|
static |
Definition at line 40 of file rpc_client.c.
References DeleteSema(), DeleteThread(), NETMAN_Tx_threadID, NetManIOSemaID, and TerminateThread().
Referenced by NetManDeinitRPCClient(), and NetManInitRPCClient().
|
static |
Definition at line 197 of file rpc_client.c.
References ALIGNED, SifDmaTransfer_t::attr, SifDmaTransfer_t::dest, FrameBufferStatus, NetManPktCmd::id, IOPFrameBuffer, IOPFrameBufferStatus, IOPFrameBufferWrPtr, IsProcessingTx, NetManPktCmd::length, NetManBD::length, NETMAN_FRAME_GROUP_SIZE, NETMAN_MAX_FRAME_SIZE, NETMAN_RPC_BLOCK_SIZE, NETMAN_SIFCMD_ID, NetManTxPacketAfter(), NetManTxPacketDeQ(), NetManTxPacketNext(), NetManPktCmd::offset, NetManBD::offset, NetManBD::payload, SifDmaStat(), SifSendCmd(), SifSetDma(), SifWriteBackDCache(), SifDmaTransfer_t::size, SleepThread(), SifDmaTransfer_t::src, and UNCACHED_SEG.
Referenced by NetManInitRPCClient().
void NetManDeinitRPCClient | ( | void | ) |
Definition at line 160 of file rpc_client.c.
References deinitCleanup(), IsInitialized, NETMAN_IOP_RPC_FUNC_DEINIT, NETMAN_rpc_cd, NetManIOSemaID, NULL, SifCallRpc(), and WaitSema().
Referenced by NetManDeinit().
int NetManInitRPCClient | ( | void | ) |
Definition at line 57 of file rpc_client.c.
References _gp, ee_sema_t::attr, ee_thread_t::attr, CreateSema(), CreateThread(), deinitCleanup(), ee_thread_t::func, ee_thread_t::gp_reg, ee_sema_t::init_count, ee_thread_t::initial_priority, IsInitialized, IsProcessingTx, ee_sema_t::max_count, NETMAN_IOP_RPC_FUNC_INIT, NETMAN_rpc_cd, NETMAN_RPC_NUMBER, NETMAN_Tx_threadID, NETMAN_Tx_ThreadStack, NETMAN_TxThread(), NetManIOSemaID, nopdelay(), NULL, ee_sema_t::option, ee_thread_t::option, ReceiveBuffer, result, SifRpcClientData_t::server, SifBindRpc(), SifCallRpc(), ee_thread_t::stack, ee_thread_t::stack_size, and StartThread().
Referenced by NetManInit().
int NetManQueryMainIF | ( | char * | name | ) |
Definition at line 309 of file rpc_client.c.
References IsInitialized, NETMAN_IOP_RPC_FUNC_QUERY_MAIN_NETIF, NETMAN_NETIF_NAME_MAX_LEN, NETMAN_rpc_cd, NetManIOSemaID, NULL, ReceiveBuffer, result, SifCallRpc(), SignalSema(), and WaitSema().
int NetManRpcIoctl | ( | unsigned int | command, |
void * | args, | ||
unsigned int | args_len, | ||
void * | output, | ||
unsigned int | length | ||
) |
Definition at line 173 of file rpc_client.c.
References NetManIoctl::args, NetManIoctl::args_len, NetManIoctl::command, command, IoctlArgs, NetManIoctl::length, NETMAN_IOP_RPC_FUNC_IOCTL, NETMAN_rpc_cd, NetManIOSemaID, NULL, NetManIoctl::output, ReceiveBuffer, result, SifCallRpc(), SignalSema(), TransmitBuffer, and WaitSema().
Referenced by NetManIoctl().
void NetManRpcNetIFXmit | ( | void | ) |
Definition at line 284 of file rpc_client.c.
References IsProcessingTx, NETMAN_Tx_threadID, and WakeupThread().
Referenced by NetManNetIFXmit().
int NetManRPCRegisterNetworkStack | ( | void | ) |
Definition at line 109 of file rpc_client.c.
References ENOMEM, FrameBufferStatus, IOPFrameBuffer, IOPFrameBufferStatus, IOPFrameBufferWrPtr, NETMAN_IOP_RPC_FUNC_REG_NETWORK_STACK, NETMAN_RPC_BLOCK_SIZE, NETMAN_rpc_cd, NetManIOSemaID, NULL, ReceiveBuffer, result, SifCallRpc(), SignalSema(), TransmitBuffer, UNCACHED_SEG, and WaitSema().
Referenced by NetManRegisterNetworkStack().
int NetManRPCUnregisterNetworkStack | ( | void | ) |
Definition at line 142 of file rpc_client.c.
References FrameBufferStatus, IOPFrameBuffer, IOPFrameBufferWrPtr, NETMAN_IOP_RPC_FUNC_UNREG_NETWORK_STACK, NETMAN_rpc_cd, NetManIOSemaID, NULL, result, SifCallRpc(), SignalSema(), and WaitSema().
Referenced by NetManUnregisterNetworkStack().
int NetManSetLinkMode | ( | int | mode | ) |
Definition at line 332 of file rpc_client.c.
References IsInitialized, mode, NETMAN_IOP_RPC_FUNC_SET_LINK_MODE, NETMAN_rpc_cd, NetManIOSemaID, NULL, ReceiveBuffer, result, SifCallRpc(), SignalSema(), TransmitBuffer, and WaitSema().
Referenced by ethApplyNetIFConfig().
int NetManSetMainIF | ( | const char * | name | ) |
Definition at line 290 of file rpc_client.c.
References IsInitialized, NETMAN_IOP_RPC_FUNC_SET_MAIN_NETIF, NETMAN_NETIF_NAME_MAX_LEN, NETMAN_rpc_cd, NetManIOSemaID, NULL, ReceiveBuffer, result, SifCallRpc(), SignalSema(), TransmitBuffer, and WaitSema().
|
extern |
Referenced by NetManInitRPCClient().
static { ... } buffer |
Definition at line 19 of file rpc_client.c.
Referenced by _times(), AHX_LoadSong(), audsrv_ee_rpc_handler(), audsrv_load_adpcm(), file_exists(), main(), PowerOff_ee_rpc_handler(), and PS2CamExtractFrame().
Definition at line 36 of file rpc_client.c.
Referenced by NETMAN_TxThread(), NetManRPCRegisterNetworkStack(), and NetManRPCUnregisterNetworkStack().
struct NetManIoctl IoctlArgs |
Definition at line 15 of file rpc_client.c.
Referenced by NetManRpcIoctl().
struct NetManIoctlResult IoctlResult |
Definition at line 23 of file rpc_client.c.
Definition at line 34 of file rpc_client.c.
Referenced by NETMAN_TxThread(), NetManRPCRegisterNetworkStack(), and NetManRPCUnregisterNetworkStack().
Definition at line 35 of file rpc_client.c.
Referenced by NETMAN_TxThread(), and NetManRPCRegisterNetworkStack().
|
static |
Definition at line 33 of file rpc_client.c.
Referenced by NETMAN_TxThread(), NetManRPCRegisterNetworkStack(), and NetManRPCUnregisterNetworkStack().
|
static |
Definition at line 38 of file rpc_client.c.
Referenced by NetManDeinitRPCClient(), NetManInitRPCClient(), NetManQueryMainIF(), NetManSetLinkMode(), and NetManSetMainIF().
|
static |
Definition at line 38 of file rpc_client.c.
Referenced by NETMAN_TxThread(), NetManInitRPCClient(), and NetManRpcNetIFXmit().
s32 mode |
Definition at line 15 of file rpc_client.c.
Referenced by compile_time_check(), draw_primitive_override(), ethApplyNetIFConfig(), ethPrintLinkStatus(), fileXioCopyfile(), fileXioMkdir(), fileXioOpen(), fileXioWaitAsync(), graph_initialize(), graph_make_config(), graph_set_config(), graph_set_mode(), GsDrawSync(), GsHSync(), GsResetGraph(), GsVSync(), mcGetDir(), mcOpen(), mcSync(), mkdir(), NetManSetLinkMode(), packet2_create(), packet2_create_from(), packet2_vif_open_unpack(), packet2_vif_stmod(), pad_open(), pad_set_mode(), PS2CamInit(), PS2CamSetLEDMode(), and sceSdVoiceTrans().
char netifName[NETMAN_NETIF_NAME_MAX_LEN] |
Definition at line 17 of file rpc_client.c.
|
static |
Definition at line 11 of file rpc_client.c.
Referenced by NetManDeinitRPCClient(), NetManInitRPCClient(), NetManQueryMainIF(), NetManRpcIoctl(), NetManRPCRegisterNetworkStack(), NetManRPCUnregisterNetworkStack(), NetManSetLinkMode(), and NetManSetMainIF().
|
static |
Definition at line 30 of file rpc_client.c.
Referenced by deinitCleanup(), NetManInitRPCClient(), and NetManRpcNetIFXmit().
|
static |
Definition at line 31 of file rpc_client.c.
Referenced by NetManInitRPCClient().
|
static |
Definition at line 30 of file rpc_client.c.
Referenced by deinitCleanup(), NetManDeinitRPCClient(), NetManInitRPCClient(), NetManQueryMainIF(), NetManRpcIoctl(), NetManRPCRegisterNetworkStack(), NetManRPCUnregisterNetworkStack(), NetManSetLinkMode(), and NetManSetMainIF().
struct NetManRegNetworkStack NetStack |
Definition at line 17 of file rpc_client.c.
struct NetManRegNetworkStackResult NetStackResult |
Definition at line 23 of file rpc_client.c.
struct NetManQueryMainNetIFResult QueryMainNetIFResult |
Definition at line 23 of file rpc_client.c.
union { ... } ReceiveBuffer |
s32 result |
Definition at line 23 of file rpc_client.c.
Referenced by _start(), checkModelVersion(), ethApplyIPConfig(), ethApplyNetIFConfig(), ethGetDHCPStatus(), ExpandScratchPad(), GetTLBEntry(), main(), NetManInit(), NetManInitRPCClient(), NetManInitRPCServer(), NetManQueryMainIF(), NetManRegisterNetworkStack(), NetManRpcIoctl(), NetManRPCRegisterNetworkStack(), NetManRPCUnregisterNetworkStack(), NetManSetLinkMode(), NetManSetMainIF(), PollMbx(), ProbeTLBEntry(), ps2ip_input(), PutTLBEntry(), ReceiveMbx(), ReleaseAlarm(), sbv_patch_enable_lmb(), SetAlarm(), SetTLBEntry(), SMapLowLevelOutput(), smem_write_word(), sys_arch_mbox_fetch_internal(), sys_arch_sem_wait(), and sys_mbox_trypost().
union { ... } TransmitBuffer |
Referenced by NetManRpcIoctl(), NetManRPCRegisterNetworkStack(), NetManSetLinkMode(), and NetManSetMainIF().