ps2sdk
1.1
A collection of Open Source libraries used for developing applications on Sony's PlayStation 2® (PS2).
|
#include <stdio.h>
#include <string.h>
#include <netman.h>
#include <lwip/memp.h>
#include "lwip/sys.h"
#include "lwip/tcp.h"
#include "lwip/tcpip.h"
#include "lwip/netif.h"
#include "lwip/dhcp.h"
#include "lwip/prot/dhcp.h"
#include "lwip/inet.h"
#include "netif/etharp.h"
#include "ps2ip_internal.h"
Go to the source code of this file.
Functions | |
int | ps2ip_getconfig (char *pszName, t_ip_info *pInfo) |
int | ps2ip_setconfig (const t_ip_info *pInfo) |
static void | EnQTxPacket (struct pbuf *tx) |
static err_t | SMapLowLevelOutput (struct netif *pNetIF, struct pbuf *pOutput) |
static void | LinkStateUp (void) |
static void | LinkStateDown (void) |
static void * | AllocRxPacket (unsigned int size, void **payload) |
static void | ReallocRxPacket (void *packet, unsigned int size) |
static void | FreeRxPacket (void *packet) |
static void | EnQRxPacket (void *packet) |
static int | NextTxPacket (void **payload) |
static void | DeQTxPacket (void) |
static int | AfterTxPacket (void **payload) |
static void | InitDone (void *pvArg) |
static err_t | SMapIFInit (struct netif *pNetIF) |
err_t | ps2ip_input (PBuf *pInput, NetIF *pNetIF) |
static void | InitializeLWIP (void) |
int | ps2ipInit (struct ip4_addr *ip_address, struct ip4_addr *subnet_mask, struct ip4_addr *gateway) |
void | ps2ipDeinit (void) |
void | ps2ipSetHsyncTicksPerMSec (unsigned char ticks) |
Variables | |
static struct netif | NIF |
static struct pbuf * | TxHead |
static struct pbuf * | TxTail |
unsigned short int | hsyncTicksPerMSec = 16 |
PS2 TCP/IP STACK FOR EE
Definition in file ps2ip.c.
|
static |
Definition at line 248 of file ps2ip.c.
References PBuf::len, PBuf::next, NULL, PBuf::payload, and TxTail.
Referenced by ps2ipInit().
|
static |
Definition at line 181 of file ps2ip.c.
References NULL, PBuf::payload, pbuf_alloc(), PBUF_POOL, and PBUF_RAW.
Referenced by ps2ipInit().
|
static |
Definition at line 220 of file ps2ip.c.
References DI, EI, PBuf::next, NULL, pbuf_free(), TxHead, and TxTail.
Referenced by ps2ipInit().
|
static |
Definition at line 201 of file ps2ip.c.
References NIF, packet, and ps2ip_input().
Referenced by ps2ipInit().
|
static |
Definition at line 131 of file ps2ip.c.
References DI, EI, PBuf::next, NULL, TxHead, and TxTail.
Referenced by SMapLowLevelOutput().
|
static |
Definition at line 196 of file ps2ip.c.
References packet, and pbuf_free().
Referenced by ps2ipInit().
|
static |
Definition at line 262 of file ps2ip.c.
References dbgprintf, and sys_sem_signal().
Referenced by InitializeLWIP().
|
inlinestatic |
Definition at line 300 of file ps2ip.c.
References dbgprintf, InitDone(), sys_arch_sem_wait(), sys_sem_free(), and sys_sem_new().
Referenced by ps2ipInit().
|
static |
|
static |
|
static |
int ps2ip_getconfig | ( | char * | pszName, |
t_ip_info * | pInfo | ||
) |
Definition at line 41 of file ps2ip.c.
Referenced by ethApplyIPConfig(), ethGetDHCPStatus(), and ethPrintIPConfig().
err_t ps2ip_input | ( | PBuf * | pInput, |
NetIF * | pNetIF | ||
) |
Definition at line 290 of file ps2ip.c.
References pbuf_free(), and result.
Referenced by EnQRxPacket().
int ps2ip_setconfig | ( | const t_ip_info * | pInfo | ) |
Definition at line 79 of file ps2ip.c.
References t_ip_info::dhcp_enabled, DHCP_STATE_OFF, t_ip_info::gw, t_ip_info::ipaddr, netif_dhcp_data, netif_find(), t_ip_info::netif_name, netif_set_gw(), netif_set_ipaddr(), netif_set_netmask(), t_ip_info::netmask, and NULL.
Referenced by ethApplyIPConfig().
void ps2ipDeinit | ( | void | ) |
Definition at line 342 of file ps2ip.c.
References NetManUnregisterNetworkStack().
Referenced by main().
int ps2ipInit | ( | struct ip4_addr * | ip_address, |
struct ip4_addr * | subnet_mask, | ||
struct ip4_addr * | gateway | ||
) |
Initializes PS2IP. Specify a dummy address like "169.254.0.1" if DHCP is to be used, before enabling DHCP via ps2ip_setconfig().
Definition at line 316 of file ps2ip.c.
References AfterTxPacket(), AllocRxPacket(), DeQTxPacket(), EnQRxPacket(), FreeRxPacket(), InitializeLWIP(), LinkStateDown(), LinkStateUp(), netif_add(), netif_set_default(), netif_set_up(), NetManInit(), NetManRegisterNetworkStack(), NextTxPacket(), NIF, NULL, ReallocRxPacket(), SMapIFInit(), and tcpip_input().
Referenced by main().
void ps2ipSetHsyncTicksPerMSec | ( | unsigned char | ticks | ) |
Use to specify the number of H-sync ticks per milisecond (Default: 16). Use this function to keep timings accurate, if a mode like 480P (~31KHz H-sync) is used instead of NTSC/PAL (~16KHz H-sync).
Definition at line 346 of file ps2ip.c.
References hsyncTicksPerMSec.
|
static |
Definition at line 191 of file ps2ip.c.
References packet, and pbuf_realloc().
Referenced by ps2ipInit().
Should be called at the beginning of the program to set up the network interface.
Definition at line 269 of file ps2ip.c.
References dbgprintf, etharp_output(), NetIF::flags, NetIF::hwaddr, NetIF::hwaddr_len, NetIF::linkoutput, NetIF::mtu, NetIF::name, NETIF_FLAG_BROADCAST, NETIF_FLAG_ETHARP, NETIF_MAX_HWADDR_LEN, NETMAN_NETIF_IOCTL_ETH_GET_MAC, NetManIoctl(), NULL, NetIF::output, SMapLowLevelOutput(), TxHead, and TxTail.
Referenced by ps2ipInit().
Definition at line 147 of file ps2ip.c.
References EnQTxPacket(), PBuf::len, NetManNetIFXmit(), pbuf_coalesce(), PBUF_RAW, pbuf_ref(), result, and PBuf::tot_len.
Referenced by SMapIFInit().
unsigned short int hsyncTicksPerMSec = 16 |
Definition at line 39 of file ps2ip.c.
Referenced by mSec2HSyncTicks(), and ps2ipSetHsyncTicksPerMSec().
|
static |
Definition at line 1 of file ps2ip.c.
Referenced by EnQRxPacket(), LinkStateDown(), LinkStateUp(), and ps2ipInit().
|
static |
Definition at line 37 of file ps2ip.c.
Referenced by DeQTxPacket(), EnQTxPacket(), and SMapIFInit().
|
static |
Definition at line 37 of file ps2ip.c.
Referenced by AfterTxPacket(), DeQTxPacket(), EnQTxPacket(), NextTxPacket(), and SMapIFInit().