Call CloseDevice() before DeleteIORequest(), and don't call
[AROS.git] / rom / hidds / hidd / include / hidd.h
blob882998dcb72f89cf772f86be0c697bac8a6b2bb5
1 #ifndef HIDD_HIDD_H
2 #define HIDD_HIDD_H
4 /*
5 Copyright © 1995-2001, The AROS Development Team. All rights reserved.
6 $Id$
8 Desc: Main HIDD Include File
9 Lang: english
12 #ifndef EXEC_TYPES_H
13 # include <exec/types.h>
14 #endif
15 #ifndef UTILITY_TAGITEM_H
16 # include <utility/tagitem.h>
17 #endif
19 /* ---------------------------------------------------------------------
20 Main HIDD Class Interface
21 --------------------------------------------------------------------- */
23 /* The name of the topmost HIDD class */
24 #define CLID_Hidd "hiddclass"
25 #define IID_Hidd "I_Hidd"
27 /* Meta class for the HIDDs */
29 /* Just set it to the mimetaclass for now */
30 #define CLID_HiddMeta "simetaclass"
32 #ifndef __typedef_HIDD
33 # define __typedef_HIDD
34 typedef APTR HIDD;
35 #endif
38 Attributes for the root HIDD class "hiddclass".
39 See the HIDD documentation for information on their use.
41 enum {
42 aoHidd_Type = 0, /* [..G] (UWORD) Major type of HIDD */
43 aoHidd_SubType, /* [..G] (UWORD) Sub-type of HIDD */
44 aoHidd_Producer, /* [I.G] (ULONG) Hardware manufacturer ID */
45 aoHidd_Name, /* [I.G] (STRPTR) Name of HIDD */
46 aoHidd_HardwareName, /* [I.G] (STRPTR) Hardware description */
47 aoHidd_Active, /* [ISG] (BOOL) Current active status */
48 aoHidd_Status, /* [..G] (ULONG) Status change */
49 aoHidd_ErrorCode, /* [..G] (ULONG) Error code */
50 aoHidd_Locking, /* [..G] (UBYTE) Type of locking supported */
51 aoHidd_Product, /* [I.G] (ULONG) Hardware product ID */
52 aoHidd_ProducerName, /* [I.G] (STRPTR) Hardware manufacturer name */
54 num_Hidd_Attrs
57 #define aHidd_Type (HiddAttrBase + aoHidd_Type )
58 #define aHidd_SubType (HiddAttrBase + aoHidd_SubType )
59 #define aHidd_Producer (HiddAttrBase + aoHidd_Producer )
60 #define aHidd_Name (HiddAttrBase + aoHidd_Name )
61 #define aHidd_HardwareName (HiddAttrBase + aoHidd_HardwareName)
62 #define aHidd_Active (HiddAttrBase + aoHidd_Active )
63 #define aHidd_Status (HiddAttrBase + aoHidd_Status )
64 #define aHidd_ErrorCode (HiddAttrBase + aoHidd_ErrorCode)
65 #define aHidd_Locking (HiddAttrBase + aoHidd_Locking )
66 #define aHidd_Product (HiddAttrBase + aoHidd_Product )
67 #define aHidd_ProducerName (HiddAttrBase + aoHidd_ProducerName)
69 /* Values for the HIDD_Type Tag */
70 #define vHidd_Type_Any -1 /* match any type */
72 #define vHidd_Type_Root 0 /* hiddclass */
73 #define vHidd_Type_Config 1 /* configuration plugins */
74 #define vHidd_Type_Timer 2 /* clocks and alarms */
76 /* Values for the aHidd_Subtype Tag */
77 #define vHidd_Subtype_Any -1 /* match any subtype */
78 #define vHidd_Subtype_Root 0 /* main class of a type */
80 /* Values for the aHidd_Locking tag */
81 #define vHidd_LockShared 0
82 #define vHidd_LockExclusive 1
83 #define vHidd_Try 0x80 /* Flag */
85 /* Values for aHidd_Status tag */
86 #define vHidd_StatusUnknown -1
88 /* Error codes defined for the HIDD */
89 enum {
90 HIDDE_NotInList, /* HIDD wasn't in a list */
93 enum {
94 moHidd_Class_Get, /* Get a value from a Class */
95 moHidd_Class_MGet, /* Get a number of values from a Class */
96 moHidd_BeginIO, /* Send a device like command */
97 moHidd_AbortIO, /* Abort a device like command */
99 moHidd_LoadConfigPlugin, /* HIDDT_Config M ( hmPlugin *) */
100 moHidd_Lock, /* Lock a HIDD */
101 moHidd_Unlock, /* UnLock a HIDD */
102 moHidd_AddHIDD, /* Add a subclass HIDD */
103 moHidd_RemoveHIDD, /* Remove a subclass HIDD */
104 moHidd_FindHIDD /* Find a suitable HIDD */
108 /* Used for HIDDM_BeginIO, HIDDM_AbortIO */
109 typedef struct hmIO
111 STACKED ULONG MethodID;
112 STACKED struct IORequest *hmi_ioRequest;
113 } hmIO;
115 #if 0
116 /* Used for HIDDM_LoadConfigPlugin */
117 typedef struct hmPlugin
119 STACKED ULONG MethodID;
120 STACKED IPTR hmp_PluginData;
121 } hmPlugin;
122 #endif
124 /* Combined structure for HIDDM_Lock, HIDDM_Unlock */
125 typedef struct hmLock
127 STACKED ULONG MethodID;
128 STACKED ULONG hml_LockMode;
129 STACKED IPTR hml_LockData;
130 } hmLock;
132 /* Used for HIDDM_AddHidd, HIDDM_RemoveHidd */
133 typedef struct hmAdd
135 STACKED ULONG MethodID;
136 STACKED APTR *hma_Class;
137 } hmAdd;
139 /* Used for HIDDM_FindHIDD */
140 typedef struct hmFind
142 STACKED ULONG MethodID;
143 STACKED UWORD hmf_Type; /* Use vHidd_Type_Any to match all */
144 STACKED UWORD hmf_Subtype; /* Use vHidd_Subtype_Any to match all */
145 } hmFind;
147 #endif /* HIDD_HIDD_H */