PS2SDK
PS2 Homebrew Libraries
netman.h File Reference
#include <tamtypes.h>
+ Include dependency graph for netman.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  NetManNetProtStack
 
struct  NetManEthRuntimeStats
 
struct  NetManEthStatus
 
struct  NetManNetIF
 

Macros

#define NETMAN_NETIF_NAME_MAX_LEN   4
 
#define NETMAN_NETIF_FRAME_SIZE   1514
 
#define NETMAN_FRAME_GROUP_SIZE   8
 
#define NETMAN_NETIF_ETH_LINK_DISABLE_PAUSE   0x40
 
#define NETMAN_NETIF_IN_USE   0x80
 
#define NETMAN_NETIF_ETHERNET   1
 
#define NETMAN_NETIF_DIALUP   2
 
#define NETMAN_NETIF_LINK_UP   4
 
#define NETMAN_NETIF_EVF_UP   0x01
 
#define NETMAN_NETIF_EVF_DOWN   0x02
 
#define NETMAN_MAX_NETIF_COUNT   2
 

Enumerations

enum  NETMAN_NETIF_ETH_LINK_MODE {
  NETMAN_NETIF_ETH_LINK_MODE_AUTO = 0, NETMAN_NETIF_ETH_LINK_MODE_10M_HDX, NETMAN_NETIF_ETH_LINK_MODE_10M_FDX, NETMAN_NETIF_ETH_LINK_MODE_100M_HDX,
  NETMAN_NETIF_ETH_LINK_MODE_100M_FDX, NETMAN_NETIF_ETH_LINK_MODE_COUNT
}
 
enum  NETMAN_NETIF_ETH_LINK_STATE { NETMAN_NETIF_ETH_LINK_STATE_DOWN = 0, NETMAN_NETIF_ETH_LINK_STATE_UP }
 
enum  NETMAN_NETIF_IOCTL_CODES {
  NETMAN_NETIF_IOCTL_ETH_GET_MAC = 0x1000, NETMAN_NETIF_IOCTL_ETH_GET_LINK_MODE, NETMAN_NETIF_IOCTL_ETH_GET_RX_EOVERRUN_CNT, NETMAN_NETIF_IOCTL_ETH_GET_RX_EBADLEN_CNT,
  NETMAN_NETIF_IOCTL_ETH_GET_RX_EBADFCS_CNT, NETMAN_NETIF_IOCTL_ETH_GET_RX_EBADALIGN_CNT, NETMAN_NETIF_IOCTL_ETH_GET_TX_ELOSSCR_CNT, NETMAN_NETIF_IOCTL_ETH_GET_TX_EEDEFER_CNT,
  NETMAN_NETIF_IOCTL_ETH_GET_TX_ECOLL_CNT, NETMAN_NETIF_IOCTL_ETH_GET_TX_EUNDERRUN_CNT, NETMAN_NETIF_IOCTL_ETH_GET_STATUS, NETMAN_NETIF_IOCTL_ETH_SET_LINK_MODE,
  NETMAN_NETIF_IOCTL_GET_LINK_STATUS = 0x3000, NETMAN_NETIF_IOCTL_GET_TX_DROPPED_COUNT, NETMAN_NETIF_IOCTL_GET_RX_DROPPED_COUNT
}
 

Functions

int NetManGetGlobalNetIFLinkState (void)
 
int NetManSetMainIF (const char *name)
 
int NetManQueryMainIF (char *name)
 
int NetManRegisterNetworkStack (const struct NetManNetProtStack *stack)
 
void NetManUnregisterNetworkStack (void)
 
int NetManIoctl (unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length)
 
int NetManSetLinkMode (int mode)
 
void NetManNetIFXmit (void)
 
void * NetManNetProtStackAllocRxPacket (unsigned int length, void **payload)
 
void NetManNetProtStackFreeRxPacket (void *packet)
 
void NetManNetProtStackEnQRxPacket (void *packet)
 
int NetManTxPacketNext (void **payload)
 
void NetManTxPacketDeQ (void)
 
int NetManTxPacketAfter (void **payload)
 
void NetManNetProtStackReallocRxPacket (void *packet, unsigned int length)
 
int NetManRegisterNetIF (struct NetManNetIF *NetIF)
 
void NetManUnregisterNetIF (const char *name)
 
void NetManToggleNetIFLinkState (int NetIFID, unsigned char state)
 

Detailed Description

Netman common definitions

Definition in file netman.h.


Data Structure Documentation

◆ NetManEthRuntimeStats

struct NetManEthRuntimeStats

Definition at line 29 of file netman.h.

Data Fields
u32 RxDroppedFrameCount
u32 RxErrorCount
u16 RxFrameOverrunCount
u16 RxFrameBadLengthCount
u16 RxFrameBadFCSCount
u16 RxFrameBadAlignmentCount
u32 TxDroppedFrameCount
u32 TxErrorCount
u16 TxFrameLOSSCRCount
u16 TxFrameEDEFERCount
u16 TxFrameCollisionCount
u16 TxFrameUnderrunCount
u16 RxAllocFail

◆ NetManEthStatus

struct NetManEthStatus

Definition at line 46 of file netman.h.

+ Collaboration diagram for NetManEthStatus:
Data Fields
u8 LinkStatus
u8 LinkMode
struct NetManEthRuntimeStats stats

Macro Definition Documentation

◆ NETMAN_NETIF_ETH_LINK_DISABLE_PAUSE

#define NETMAN_NETIF_ETH_LINK_DISABLE_PAUSE   0x40

Flow-control

Definition at line 53 of file netman.h.

◆ NETMAN_NETIF_IN_USE

#define NETMAN_NETIF_IN_USE   0x80

Set internally by NETMAN. Do not set externally.

Definition at line 142 of file netman.h.

◆ NETMAN_NETIF_ETHERNET

#define NETMAN_NETIF_ETHERNET   1

Set = network IF is an Ethernet IF.

Definition at line 144 of file netman.h.

◆ NETMAN_NETIF_DIALUP

#define NETMAN_NETIF_DIALUP   2

Set = network IF is a dailup modem.

Definition at line 146 of file netman.h.

◆ NETMAN_NETIF_LINK_UP

#define NETMAN_NETIF_LINK_UP   4

Set = network IF has a link up status.

Definition at line 148 of file netman.h.

Enumeration Type Documentation

◆ NETMAN_NETIF_ETH_LINK_MODE

Enumerator
NETMAN_NETIF_ETH_LINK_MODE_AUTO 

Auto negotiation cannot be reflected by NETMAN_NETIF_IOCTL_ETH_GET_LINK_MODE.

NETMAN_NETIF_ETH_LINK_MODE_10M_HDX 

10Mbit Half-DupleX

NETMAN_NETIF_ETH_LINK_MODE_10M_FDX 

10Mbit Full-DupleX

NETMAN_NETIF_ETH_LINK_MODE_100M_HDX 

100Mbit Half-DupleX

NETMAN_NETIF_ETH_LINK_MODE_100M_FDX 

100Mbit Full-DupleX

Definition at line 55 of file netman.h.

◆ NETMAN_NETIF_IOCTL_CODES

Enumerator
NETMAN_NETIF_IOCTL_ETH_GET_MAC 

Output = 6 bytes of MAC address.

NETMAN_NETIF_IOCTL_ETH_SET_LINK_MODE 

Input = struct NetManIFLinkModeParams. Note: does not wait for the IF to finish. Use NetManSetLinkMode() instead.

Definition at line 75 of file netman.h.