PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
dev9.h
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#ifndef __DEV9_H__
17#define __DEV9_H__
18
19#include <types.h>
20#include <irx.h>
21
22#include <hdd-ioctl.h>
23
24typedef int (*dev9_intr_cb_t)(int flag);
25typedef void (*dev9_shutdown_cb_t)(void);
26typedef void (*dev9_dma_cb_t)(int bcr, int dir);
27
28void SpdRegisterIntrHandler(int intr, dev9_intr_cb_t cb);
29
30int SpdDmaTransfer(int ctrl, void *buf, int bcr, int dir);
31
32void Dev9CardStop(void);
33void SpdIntrEnable(int mask);
34void SpdIntrDisable(int mask);
35
36int SpdGetEthernetID(u16 *buf);
37
38void SpdSetLED(int ctl);
39void dev9LED2Ctl(int ctl);
40void dev9ControlPIO3(int ctl);
41
42int Dev9RegisterPowerOffHandler(int idx, dev9_shutdown_cb_t cb);
43
44void dev9RegisterPreDmaCb(int ctrl, dev9_dma_cb_t cb);
45
46void dev9RegisterPostDmaCb(int ctrl, dev9_dma_cb_t cb);
47
48#define dev9_IMPORTS_start DECLARE_IMPORT_TABLE(dev9, 1, 9)
49#define dev9_IMPORTS_end END_IMPORT_TABLE
50
51#define I_SpdRegisterIntrHandler DECLARE_IMPORT(4, SpdRegisterIntrHandler)
52#define I_SpdDmaTransfer DECLARE_IMPORT(5, SpdDmaTransfer)
53#define I_Dev9CardStop DECLARE_IMPORT(6, Dev9CardStop)
54#define I_SpdIntrEnable DECLARE_IMPORT(7, SpdIntrEnable)
55#define I_SpdIntrDisable DECLARE_IMPORT(8, SpdIntrDisable)
56#define I_SpdGetEthernetID DECLARE_IMPORT(9, SpdGetEthernetID)
57#define I_SpdSetLED DECLARE_IMPORT(10, SpdSetLED)
58#define I_Dev9RegisterPowerOffHandler DECLARE_IMPORT(11, Dev9RegisterPowerOffHandler)
59#define I_dev9RegisterPreDmaCb DECLARE_IMPORT(12, dev9RegisterPreDmaCb)
60#define I_dev9RegisterPostDmaCb DECLARE_IMPORT(13, dev9RegisterPostDmaCb)
61#define I_dev9ControlPIO3 DECLARE_IMPORT(14, dev9ControlPIO3)
62#define I_dev9LED2Ctl DECLARE_IMPORT(15, dev9LED2Ctl)
63
64// Backwards-compatibility defines
65
66#define dev9RegisterIntrCb SpdRegisterIntrHandler
67#define dev9DmaTransfer SpdDmaTransfer
68#define dev9Shutdown Dev9CardStop
69#define dev9IntrEnable SpdIntrEnable
70#define dev9IntrDisable SpdIntrDisable
71#define dev9GetEEPROM SpdGetEthernetID
72#define dev9LEDCtl SpdSetLED
73#define dev9RegisterShutdownCb Dev9RegisterPowerOffHandler
74
75#define I_dev9RegisterIntrCb I_SpdRegisterIntrHandler
76#define I_dev9DmaTransfer I_SpdDmaTransfer
77#define I_dev9Shutdown I_Dev9CardStop
78#define I_dev9IntrEnable I_SpdIntrEnable
79#define I_dev9IntrDisable I_SpdIntrDisable
80#define I_dev9GetEEPROM I_SpdGetEthernetID
81#define I_dev9LEDCtl I_SpdSetLED
82#define I_dev9RegisterShutdownCb I_Dev9RegisterPowerOffHandler
83
84#endif /* __DEV9_H__ */