sdk-core v2026.11.05
PS2 SDK - core tier (build-critical EE/IOP modules)
Loading...
Searching...
No Matches
Packet2 library

Topics

 Chain
 Types
 Utils
 VIF

Functions

packet2_t * packet2_create (u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte)
packet2_t * packet2_create_from (qword_t *base, qword_t *next, u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte)
void packet2_free (packet2_t *packet2)
void packet2_reset (packet2_t *packet2, u8 clear_mem)
void packet2_print (packet2_t *packet2, u32 qw_count)
void packet2_print_qw_count (packet2_t *packet2)
void packet2_add (packet2_t *a, packet2_t *b)

Detailed Description

Successor of packet_t. Main goal of this library is to create simple API for packet management. Library is splitted into several parts:

  • This - core functionality of libpacket2
  • "_types" - Enums and structures used in libpacket2
  • "_chain" - DMA tags
  • "_vif" - VU related
  • "_utils" - useful functions, and examples

Function Documentation

◆ packet2_add()

void packet2_add ( packet2_t * a,
packet2_t * b )
extern

Copy data from b packet into a packet with memcpy()

Definition at line 101 of file packet2.c.

◆ packet2_create()

packet2_t * packet2_create ( u16 qwords,
enum Packet2Type type,
enum Packet2Mode mode,
u8 tte )
extern

Allocate new packet2.

Parameters
qwordsMaximum data size in qwords (128bit).
typeMemory mapping type.
modePacket mode. Normal or chain.
tteTag transfer enable. Used only for CHAIN mode! If >0 transfer tag is set during packet sending and add_dma_tag() (so also every open_tag()) will move buffer by DWORD, so remember to align memory!
Returns
Pointer to packet2 on success or NULL if memory allocation fail.

Definition at line 25 of file packet2.c.

◆ packet2_create_from()

packet2_t * packet2_create_from ( qword_t * base,
qword_t * next,
u16 qwords,
enum Packet2Type type,
enum Packet2Mode mode,
u8 tte )
extern

Create new packet2 with given data pointer.

Parameters
basePointer to base (start of buffer).
nextPointer to next (current position of buffer).
qwordsMaximum data size in qwords (128bit).
typeMemory mapping type.
modePacket mode. Normal or chain (so also vif/vu).
tteTag transfer enable. Used only for CHAIN mode! If >0 transfer tag is set during packet sending and add_dma_tag() (so also every open_tag()) will move buffer by DWORD, so remember to align memory!
Returns
Pointer to packet2 on success or NULL if memory allocation fail.

Definition at line 60 of file packet2.c.

◆ packet2_free()

void packet2_free ( packet2_t * packet2)
extern

Free packet2 memory.

Parameters
packet2Pointer to packet2.

Definition at line 81 of file packet2.c.

◆ packet2_print()

void packet2_print ( packet2_t * packet2,
u32 qw_count )
extern

Print data of packet.

Parameters
packet2Pointer to packet.
clear_memCount of qwords, type 0 for all.

Definition at line 108 of file packet2.c.

◆ packet2_print_qw_count()

void packet2_print_qw_count ( packet2_t * packet2)
extern

Print amount of qwords of packet.

Parameters
packet2Pointer to packet.

Definition at line 127 of file packet2.c.

◆ packet2_reset()

void packet2_reset ( packet2_t * packet2,
u8 clear_mem )
extern

Reset packet. Move next pointer back to base pointer, Make all "openedAt" vars to NULL Do memset on data if required.

Parameters
packet2Pointer to packet.
clear_memIf >0, data is cleared via memset(). SLOW!

Definition at line 88 of file packet2.c.