PS2SDK
PS2 Homebrew Libraries
modem.h
Go to the documentation of this file.
1 /*
2 # _____ ___ ____ ___ ____
3 # ____| | ____| | | |____|
4 # | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5 #-----------------------------------------------------------------------
6 # Copyright ps2dev - http://www.ps2dev.org
7 # Licenced under Academic Free License version 2.0
8 # Review ps2sdk README & LICENSE files for further details.
9 */
10 
17 #ifndef __MODEM_H__
18 #define __MODEM_H__
19 
20 #include <types.h>
21 #include <irx.h>
22 
23 #define sceModemBus_Unknown 0
24 #define sceModemBus_USB 1
25 #define sceModemBus_1394 2
26 #define sceModemBus_PCMCIA 3
27 #define sceModemBus_PSEUDO 4
28 // The following definition is unofficial.
29 #define sceModemBus_NIC 5
30 
31 #define sceModemProtVer 0
32 #define sceModemProtVerMask 0x00FF
33 #define sceModemProtSkipDLL 0x0100
34 #define sceModemProtOverEther 0x0100
35 #define sceModemProtOverATM 0x0300
36 
37 #define sceModemEFP_StartDone 0x00000001
38 #define sceModemEFP_PlugOut 0x00000002
39 #define sceModemEFP_Connect 0x00000010
40 #define sceModemEFP_Disconnect 0x00000020
41 #define sceModemEFP_Ring 0x00000040
42 #define sceModemEFP_Recv 0x00000100
43 #define sceModemEFP_Send 0x00000200
44 #define sceModemEFP_UpperUse 0xFFFF0000
45 
46 #define sceModemCC_GET_THPRI 0xC0000000
47 #define sceModemCC_SET_THPRI 0xC1000000
48 #define sceModemCC_GET_IF_TYPE 0xC0000100
49 
50 #define sceModemIFT_GENERIC 0x00000000
51 #define sceModemIFT_SERIAL 0x00000001
52 
53 #define sceModemCC_FLUSH_RXBUF 0xC0000110
54 #define sceModemCC_FLUSH_TXBUF 0xC0000111
55 #define sceModemCC_GET_DIALCONF 0xC0000200
56 #define sceModemCC_GET_RX_COUNT 0xC0010000
57 #define sceModemCC_GET_TX_COUNT 0xC0010001
58 #define sceModemCC_GET_OE_COUNT 0xC0010002
59 #define sceModemCC_GET_PE_COUNT 0xC0010003
60 #define sceModemCC_GET_FE_COUNT 0xC0010004
61 #define sceModemCC_GET_BO_COUNT 0xC0010005
62 #define sceModemCC_GET_PARAM 0xC0020000
63 #define sceModemCC_SET_PARAM 0xC1020000
64 
65 #define sceModemPARAM_SPEED 0x003FFFFF
66 #define sceModemPARAM_RESERVED 0x00400000
67 #define sceModemPARAM_XON 0x00800000
68 #define sceModemPARAM_XOFF 0x01000000
69 #define sceModemPARAM_RTSCTS 0x02000000
70 #define sceModemPARAM_STOPS 0x0C000000
71 #define sceModemPARAM_STOP0 0x00000000
72 #define sceModemPARAM_STOP1 0x04000000
73 #define sceModemPARAM_STOP1H 0x08000000
74 #define sceModemPARAM_STOP2 0x0C000000
75 #define sceModemPARAM_CSIZE 0x30000000
76 #define sceModemPARAM_CS5 0x00000000
77 #define sceModemPARAM_CS6 0x10000000
78 #define sceModemPARAM_CS7 0x20000000
79 #define sceModemPARAM_CS8 0x30000000
80 #define sceModemPARAM_PARODD 0x40000000
81 #define sceModemPARAM_PARENB 0x80000000
82 
83 #define sceModemCC_GET_LINE 0xC0030000
84 #define sceModemCC_SET_LINE 0xC1030000
85 
86 #define sceModemLINE_CTS 0x00000001
87 #define sceModemLINE_DSR 0x00000002
88 #define sceModemLINE_RI 0x00000004
89 #define sceModemLINE_DCD 0x00000008
90 #define sceModemLINE_DTR 0x00000010
91 #define sceModemLINE_RTS 0x00000020
92 
93 #define sceModemCC_SET_BREAK 0xC1040000
94 
95 typedef struct sceModemOps
96 {
97  struct sceModemOps *forw;
98  struct sceModemOps *back;
99  char *module_name;
100  char *vendor_name;
101  char *device_name;
102  u8 bus_type;
103  u8 bus_loc[31];
104  u16 prot_ver;
105  u16 impl_ver;
106  void *priv;
107  int evfid;
108  int rcv_len;
109  int snd_len;
110  int (*start)(void *priv, int flags);
111  int (*stop)(void *priv, int flags);
112  int (*recv)(void *priv, void *ptr, int len);
113  int (*send)(void *priv, void *ptr, int len);
114  int (*control)(void *priv, int code, void *ptr, int len);
115  void *reserved[4];
116 } sceModemOps_t;
117 
118 extern int sceModemRegisterDevice(sceModemOps_t *ops);
119 extern int sceModemUnregisterDevice(sceModemOps_t *ops);
120 
121 #define modem_IMPORTS_start DECLARE_IMPORT_TABLE(modem, 1, 1)
122 #define modem_IMPORTS_end END_IMPORT_TABLE
123 
124 #define I_sceModemRegisterDevice DECLARE_IMPORT(4, sceModemRegisterDevice)
125 #define I_sceModemUnregisterDevice DECLARE_IMPORT(5, sceModemUnregisterDevice)
126 
127 #endif
irx.h
sceModemOps
Definition: modem.h:95