PS2SDK
PS2 Homebrew Libraries
ps2dev9.c File Reference
#include <types.h>
#include <defs.h>
#include <loadcore.h>
#include <intrman.h>
#include <iomanX.h>
#include <dmacman.h>
#include <thbase.h>
#include <thsemap.h>
#include <stdio.h>
#include <sysclib.h>
#include <dev9.h>
#include <aifregs.h>
#include <dev9regs.h>
#include <speedregs.h>
#include <smapregs.h>
+ Include dependency graph for ps2dev9.c:

Go to the source code of this file.

Macros

#define MODNAME   "dev9"
 
#define DRIVERNAME   "dev9"
 
#define M_PRINTF(format, args...)   printf(MODNAME ": " format, ##args)
 
#define VERSION   "1.0"
 
#define BANNER   "\nDEV9 device driver v%s - Copyright (c) 2003 Marcus R. Brown\n\n"
 
#define SSBUS_R_1418   0xbf801418
 
#define SSBUS_R_141c   0xbf80141c
 
#define SSBUS_R_1420   0xbf801420
 

Typedefs

typedef int(* dev9IntrDispatchCb_t) (int flag)
 

Enumerations

enum  PC_CARD_TYPE { PC_CARD_TYPE_NONE = 0, PC_CARD_TYPE_PCMCIA, PC_CARD_TYPE_CARDBUS }
 
enum  PC_CARD_VOLTAGE { PC_CARD_VOLTAGE_INVALID = 0, PC_CARD_VOLTAGE_3V, PC_CARD_VOLTAGE_5V, PC_CARD_VOLTAGE_04h }
 

Functions

 IRX_ID (MODNAME, 2, 8)
 
static void dev9RegisterIntrDispatchCb (dev9IntrDispatchCb_t callback)
 
static int dev9_intr_dispatch (int flag)
 
static void dev9_set_stat (int stat)
 
static int dev9_ssbus_mode (int mode)
 
static int dev9_device_probe (void)
 
static int dev9_device_reset (void)
 
static int dev9_card_find_manfid (u32 manfid)
 
static int read_eeprom_data (void)
 
static int dev9_init (int sema_attr)
 
static int speed_device_init (void)
 
static void pcmcia_set_stat (int stat)
 
static int pcic_ssbus_mode (int mode)
 
static int pcmcia_device_probe (void)
 
static int pcmcia_device_reset (void)
 
static int card_find_manfid (u32 manfid)
 
static int pcmcia_init (int sema_attr)
 
static void expbay_set_stat (int stat)
 
static int expbay_device_probe (void)
 
static int expbay_device_reset (void)
 
static int expbay_init (int sema_attr)
 
static int dev9x_devctl (iop_file_t *f, const char *name, int cmd, void *args, unsigned int arglen, void *buf, unsigned int buflen)
 
 IOMANX_RETURN_VALUE_IMPL (0)
 
static int print_help (void)
 
int _start (int argc, char *argv[])
 
int _exit (void)
 
void SpdRegisterIntrHandler (int intr, dev9_intr_cb_t cb)
 
void dev9RegisterPreDmaCb (int ctrl, dev9_dma_cb_t cb)
 
void dev9RegisterPostDmaCb (int ctrl, dev9_dma_cb_t cb)
 
void Dev9CardStop (void)
 
void SpdIntrEnable (int mask)
 
void SpdIntrDisable (int mask)
 
int SpdDmaTransfer (int device, void *buf, int bcr, int dir)
 
int SpdGetEthernetID (u16 *buf)
 
void SpdSetLED (int ctl)
 
void dev9LED2Ctl (int ctl)
 
void dev9ControlPIO3 (int ctl)
 
int Dev9RegisterPowerOffHandler (int idx, dev9_shutdown_cb_t cb)
 
static int dev9_smap_read_phy (volatile u8 *emac3_regbase, unsigned int address, unsigned int *data)
 
static int dev9_smap_write_phy (volatile u8 *emac3_regbase, unsigned char address, unsigned short int value)
 
static int dev9_smap_init (void)
 
static int pcic_get_cardtype (void)
 
static int pcic_get_voltage (void)
 
static int pcic_power (int voltage, int flag)
 
static int pcmcia_intr (void *unused)
 
static int expbay_intr (void *unused)
 

Variables

static int semaAttrGlobal
 
static const char * mod_name
 
static int dev9type = -1
 
static int using_aif = 0
 
static int dma_lock_sem
 
static int pcic_cardtype
 
static int pcic_voltage
 
static s16 eeprom_data [5]
 
static dev9IntrDispatchCb_t p_dev9_intr_cb = NULL
 
static dev9_intr_cb_t dev9_intr_cbs [16]
 
static dev9_shutdown_cb_t dev9_shutdown_cbs [16]
 
static dev9_dma_cb_t dev9_predma_cbs [4]
 
static dev9_dma_cb_t dev9_postdma_cbs [4]
 
static u8 dev9_has_dvr_capability = 0
 
struct irx_export_table _exp_dev9
 
static iop_device_ops_t dev9x_ops
 
static iop_device_t dev9x_device
 

Detailed Description

DEV9 Device Driver.

Definition in file ps2dev9.c.

Variable Documentation

◆ dev9x_ops

iop_device_ops_t dev9x_ops
static
Initial value:
=
{
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE_S64(0),
&dev9x_devctl,
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
IOMANX_RETURN_VALUE(0),
}

Definition at line 151 of file ps2dev9.c.

◆ dev9x_device

iop_device_t dev9x_device
static
Initial value:
=
{
"dev9x",
IOP_DT_FS | IOP_DT_FSEXT,
1,
"DEV9",
&dev9x_ops,
}

Definition at line 182 of file ps2dev9.c.

IOP_DT_FSEXT
#define IOP_DT_FSEXT
Definition: iomanX.h:66