1 #ifndef POSEIDON_LIBRARY_H
2 #define POSEIDON_LIBRARY_H
5 *----------------------------------------------------------------------------
6 * Includes for poseidon.library
7 *----------------------------------------------------------------------------
8 * By Chris Hodges <chrisly@platon42.de>
11 #define RELEASEVERSION 0x20090807
13 #include LC_LIBDEFS_FILE
15 #include <aros/libcall.h>
16 #include <aros/asmcall.h>
17 #include <aros/symbolsets.h>
21 #include <exec/types.h>
22 #include <exec/lists.h>
23 #include <exec/alerts.h>
24 #include <exec/memory.h>
25 #include <exec/libraries.h>
26 #include <exec/interrupts.h>
27 #include <exec/semaphores.h>
28 #include <exec/execbase.h>
29 #include <exec/devices.h>
31 #include <exec/ports.h>
32 #include <exec/errors.h>
33 #include <exec/resident.h>
34 #include <exec/initializers.h>
36 #include <devices/timer.h>
37 #include <utility/utility.h>
39 #include <dos/dosextens.h>
40 #include <dos/dostags.h>
41 #include <intuition/intuition.h>
48 #include "poseidon_intern.h"
50 #include <devices/usb.h>
51 #include <devices/usb_hub.h>
52 #include <devices/usb_hid.h>
53 #include <devices/usb_massstorage.h>
54 #include <devices/usbhardware.h>
55 #include <libraries/usbclass.h>
56 #include <proto/poseidon.h>
66 void pFreeEndpoint(struct PsdEndpoint
*pep
);
67 struct PsdEndpoint
* pAllocEndpoint(struct PsdInterface
*pif
);
69 void pFreeInterface(struct PsdInterface
*pif
);
70 struct PsdInterface
* pAllocInterface(struct PsdConfig
*pc
);
72 void pFreeConfig(struct PsdConfig
*pc
);
73 struct PsdConfig
* pAllocConfig(struct PsdDevice
*pd
);
75 void pCheckForDeadlock(struct PsdBase
*ps
, struct PsdLockSem
*pls
, BOOL excl
);
76 void pInitSem(struct PsdBase
*ps
, struct PsdLockSem
*pls
, STRPTR name
);
77 void pDeleteSem(struct PsdBase
*ps
, struct PsdLockSem
*pls
);
78 void pLockSemExcl(struct PsdBase
*ps
, struct PsdLockSem
*pls
);
79 void pLockSemShared(struct PsdBase
*ps
, struct PsdLockSem
*pls
);
80 void pUnlockSem(struct PsdBase
*ps
, struct PsdLockSem
*pls
);
82 BOOL
pOpenDOS(struct PsdBase
*ps
);
84 UWORD
pAllocDevAddr(struct PsdDevice
*pd
);
86 BOOL
pFixBrokenConfig(struct PsdPipe
*pp
);
87 BOOL
pGetDevConfig(struct PsdPipe
*pp
);
89 ULONG
pGetFormLength(struct PsdIFFContext
*pic
);
91 struct PsdIFFContext
* pAllocForm(struct PsdBase
*ps
, struct PsdIFFContext
*parent
, ULONG formid
);
92 void pFreeForm(struct PsdBase
*ps
, struct PsdIFFContext
*pic
);
93 ULONG
* pInternalWriteForm(struct PsdIFFContext
*pic
, ULONG
*buf
);
94 struct PsdIFFContext
* pAddCfgChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, APTR chunk
);
95 STRPTR
pGetStringChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, ULONG chunkid
);
96 BOOL
pMatchStringChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, ULONG chunkid
, CONST_STRPTR str
);
98 BOOL
pRemCfgChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, ULONG chnkid
);
99 BOOL
pAddStringChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, ULONG chunkid
, CONST_STRPTR str
);
100 void pUpdateGlobalCfg(struct PsdBase
*ps
, struct PsdIFFContext
*pic
);
101 APTR
pFindCfgChunk(struct PsdBase
*ps
, struct PsdIFFContext
*pic
, ULONG chnkid
);
103 BOOL
pGetDevConfig(struct PsdPipe
*pp
);
105 void pClassScan(struct PsdBase
*ps
);
106 void pReleaseBinding(struct PsdBase
*ps
, struct PsdDevice
*pd
, struct PsdInterface
*pif
);
107 void pReleaseDevBinding(struct PsdBase
*ps
, struct PsdDevice
*pd
);
108 void pReleaseIfBinding(struct PsdBase
*ps
, struct PsdInterface
*pif
);
110 void pGarbageCollectEvents(struct PsdBase
*ps
);
111 BOOL
pStartEventHandler(struct PsdBase
*ps
);
113 BOOL
pCheckCfgChanged(struct PsdBase
*ps
);
115 ULONG
pPowerRecurseDrain(struct PsdBase
*ps
, struct PsdDevice
*pd
);
116 void pPowerRecurseSupply(struct PsdBase
*ps
, struct PsdDevice
*pd
);
118 void pStripString(struct PsdBase
*ps
, STRPTR str
);
119 struct Node
* pFindName(struct PsdBase
*ps
, struct List
*list
, STRPTR name
);
121 #define psdAddErrorMsg0(level, origin, fmtstr) psdAddErrorMsgA(level, origin, fmtstr, NULL)
123 AROS_UFP0(void, pDeviceTask
);
124 AROS_UFP0(void, pPoPoGUITask
);
125 AROS_UFP0(void, pEventHandlerTask
);
127 AROS_UFP2(void, pPutChar
,
128 AROS_UFPA(char, ch
, D0
),
129 AROS_UFPA(struct PsdRawDoFmt
*, rdf
, A3
));
131 AROS_UFP2(void, pRawFmtLength
,
132 AROS_UFPA(char, ch
, D0
),
133 AROS_UFPA(ULONG
*, len
, A3
));
135 AROS_UFP1(void, pQuickForwardRequest
,
136 AROS_UFPA(struct MsgPort
*, msgport
, A1
));
138 AROS_UFP1(void, pQuickReplyRequest
,
139 AROS_UFPA(struct MsgPort
*, msgport
, A1
));
141 #endif /* POSEIDON_LIBRARY_H */