PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
ps2ip.c File Reference
#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"
+ Include dependency graph for ps2ip.c:

Go to the source code of this file.

Typedefs

typedef struct pbuf PBuf
 
typedef struct netif NetIF
 
typedef struct ip4_addr IPAddr
 

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)
 
void _ps2sdk_ps2ipee_init (void)
 
void _ps2sdk_ps2ipee_deinit (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 pbufTxHead
 
static struct pbufTxTail
 
unsigned short int hsyncTicksPerMSec = 16
 

Detailed Description

PS2 TCP/IP STACK FOR EE

Definition in file ps2ip.c.

Typedef Documentation

◆ PBuf

typedef struct pbuf PBuf

Definition at line 32 of file ps2ip.c.

◆ NetIF

typedef struct netif NetIF

Definition at line 33 of file ps2ip.c.

◆ IPAddr

typedef struct ip4_addr IPAddr

Definition at line 34 of file ps2ip.c.

Function Documentation

◆ ps2ip_getconfig()

int ps2ip_getconfig ( char *  pszName,
t_ip_info pInfo 
)

Definition at line 41 of file ps2ip.c.

◆ ps2ip_setconfig()

int ps2ip_setconfig ( const t_ip_info pInfo)

Definition at line 79 of file ps2ip.c.

◆ EnQTxPacket()

static void EnQTxPacket ( struct pbuf tx)
static

Definition at line 131 of file ps2ip.c.

◆ SMapLowLevelOutput()

static err_t SMapLowLevelOutput ( struct netif pNetIF,
struct pbuf pOutput 
)
static

Definition at line 147 of file ps2ip.c.

◆ LinkStateUp()

static void LinkStateUp ( void  )
static

Definition at line 174 of file ps2ip.c.

◆ LinkStateDown()

static void LinkStateDown ( void  )
static

Definition at line 179 of file ps2ip.c.

◆ AllocRxPacket()

static void * AllocRxPacket ( unsigned int  size,
void **  payload 
)
static

Definition at line 184 of file ps2ip.c.

◆ ReallocRxPacket()

static void ReallocRxPacket ( void *  packet,
unsigned int  size 
)
static

Definition at line 194 of file ps2ip.c.

◆ FreeRxPacket()

static void FreeRxPacket ( void *  packet)
static

Definition at line 199 of file ps2ip.c.

◆ EnQRxPacket()

static void EnQRxPacket ( void *  packet)
static

Definition at line 204 of file ps2ip.c.

◆ NextTxPacket()

static int NextTxPacket ( void **  payload)
static

Definition at line 209 of file ps2ip.c.

◆ DeQTxPacket()

static void DeQTxPacket ( void  )
static

Definition at line 223 of file ps2ip.c.

◆ AfterTxPacket()

static int AfterTxPacket ( void **  payload)
static

Definition at line 251 of file ps2ip.c.

◆ InitDone()

static void InitDone ( void *  pvArg)
static

Definition at line 265 of file ps2ip.c.

◆ SMapIFInit()

static err_t SMapIFInit ( struct netif pNetIF)
static

Should be called at the beginning of the program to set up the network interface.

Definition at line 272 of file ps2ip.c.

References 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, and netif::output.

Referenced by ps2ipInit().

◆ ps2ip_input()

err_t ps2ip_input ( PBuf pInput,
NetIF pNetIF 
)

Definition at line 293 of file ps2ip.c.

◆ InitializeLWIP()

static void InitializeLWIP ( void  )
inlinestatic

Definition at line 303 of file ps2ip.c.

◆ _ps2sdk_ps2ipee_init()

void _ps2sdk_ps2ipee_init ( void  )
extern

Definition at line 461 of file ps2ip_ps2sdk.c.

◆ _ps2sdk_ps2ipee_deinit()

void _ps2sdk_ps2ipee_deinit ( void  )
extern

Definition at line 467 of file ps2ip_ps2sdk.c.

◆ ps2ipInit()

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 323 of file ps2ip.c.

References SMapIFInit().

◆ ps2ipDeinit()

void ps2ipDeinit ( void  )

Definition at line 351 of file ps2ip.c.

◆ ps2ipSetHsyncTicksPerMSec()

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).
This function is obsolete, so it is stubbed for compatibility purposes.

Definition at line 358 of file ps2ip.c.

Variable Documentation

◆ NIF

struct netif NIF
static

Definition at line 36 of file ps2ip.c.

◆ TxHead

struct pbuf* TxHead
static

Definition at line 37 of file ps2ip.c.

◆ TxTail

struct pbuf * TxTail
static

Definition at line 37 of file ps2ip.c.

◆ hsyncTicksPerMSec

unsigned short int hsyncTicksPerMSec = 16

Definition at line 39 of file ps2ip.c.