| 1 | /* $Id: rmioctl.h,v 1.1.1.1 2003/07/02 13:56:56 eleph Exp $ */ | 
|---|
| 2 | /* | 
|---|
| 3 | * OS/2 Resource Manager IOCTL definitions | 
|---|
| 4 | * | 
|---|
| 5 | * (C) 2000-2002 InnoTek Systemberatung GmbH | 
|---|
| 6 | * | 
|---|
| 7 | * This program is free software; you can redistribute it and/or | 
|---|
| 8 | * modify it under the terms of the GNU General Public License as | 
|---|
| 9 | * published by the Free Software Foundation; either version 2 of | 
|---|
| 10 | * the License, or (at your option) any later version. | 
|---|
| 11 | * | 
|---|
| 12 | * This program is distributed in the hope that it will be useful, | 
|---|
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 15 | * GNU General Public License for more details. | 
|---|
| 16 | * | 
|---|
| 17 | * You should have received a copy of the GNU General Public | 
|---|
| 18 | * License along with this program; if not, write to the Free | 
|---|
| 19 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, | 
|---|
| 20 | * USA. | 
|---|
| 21 | * | 
|---|
| 22 | */ | 
|---|
| 23 |  | 
|---|
| 24 | #ifndef __RM_HEADER__ | 
|---|
| 25 | #include "rmbase.h" | 
|---|
| 26 | #endif | 
|---|
| 27 |  | 
|---|
| 28 | #ifndef __RM_IOCTL__ | 
|---|
| 29 | #define __RM_IOCTL__ | 
|---|
| 30 |  | 
|---|
| 31 | #define CAT_RM                    0x80      /* Resource Manager Category  */ | 
|---|
| 32 | #define FUNC_RM_GET_NODEINFO      0x01      /* Get RM Structure           */ | 
|---|
| 33 | #define FUNC_RM_ENUM_NODES        0x02      /* Get Physical Topology      */ | 
|---|
| 34 | #define FUNC_RM_ENUM_DRIVERS      0x03      /* Get DriverHandles          */ | 
|---|
| 35 |  | 
|---|
| 36 |  | 
|---|
| 37 | /******************************************/ | 
|---|
| 38 | /* RM_NODE   Ring 3 Super Structure       */ | 
|---|
| 39 | /******************************************/ | 
|---|
| 40 |  | 
|---|
| 41 | typedef struct { | 
|---|
| 42 | ULONG          Count; | 
|---|
| 43 | RESOURCESTRUCT Resource[1]; | 
|---|
| 44 | } RESOURCELIST, NEAR *NPRESOURCELIST, FAR48 *LPRESOURCELIST; | 
|---|
| 45 |  | 
|---|
| 46 | typedef struct { | 
|---|
| 47 |  | 
|---|
| 48 | ULONG             VersionInfo; | 
|---|
| 49 | ULONG             NodeType; | 
|---|
| 50 | RMHANDLE          DriverHandle; | 
|---|
| 51 | union { | 
|---|
| 52 | FARPTR16  pAdapterNode; | 
|---|
| 53 | FARPTR16   pDeviceNode; | 
|---|
| 54 | FARPTR16     pLDevNode; | 
|---|
| 55 | FARPTR16  pSysNameNode; | 
|---|
| 56 | FARPTR16   pDriverNode; | 
|---|
| 57 | FARPTR16 pDetectedNode; | 
|---|
| 58 | FARPTR16 pResourceNode; | 
|---|
| 59 | }; | 
|---|
| 60 | FARPTR16     pResourceList; | 
|---|
| 61 | } RM_NODE, NEAR *NPRM_NODE; | 
|---|
| 62 |  | 
|---|
| 63 | /* pRM_NODE->NodeType */ | 
|---|
| 64 |  | 
|---|
| 65 | #define RMTYPE_ADAPTER    0x0000 | 
|---|
| 66 | #define RMTYPE_DEVICE     0x0001 | 
|---|
| 67 | #define RMTYPE_LDEV       0x0002 | 
|---|
| 68 | #define RMTYPE_SYSNAME    0x0003 | 
|---|
| 69 | #define RMTYPE_DRIVER     0x0004 | 
|---|
| 70 | #define RMTYPE_DETECTED   0x0005 | 
|---|
| 71 | #define RMTYPE_RESOURCE   0x0006 | 
|---|
| 72 |  | 
|---|
| 73 | /**************************/ | 
|---|
| 74 | /* FUNC_RM_GETNODEINFO    */ | 
|---|
| 75 | /**************************/ | 
|---|
| 76 |  | 
|---|
| 77 | typedef struct { | 
|---|
| 78 | RMHANDLE RMHandle; | 
|---|
| 79 | ULONG    Linaddr; | 
|---|
| 80 | } RM_GETNODE_PARM,  NEAR *NPRM_GETNODE_PARM; | 
|---|
| 81 |  | 
|---|
| 82 | typedef struct { | 
|---|
| 83 | ULONG          RMNodeSize; | 
|---|
| 84 | RM_NODE        RMNode; | 
|---|
| 85 | } RM_GETNODE_DATA,  NEAR *NPRM_GETNODE_DATA, FAR48 *LPRM_GETNODE_DATA; | 
|---|
| 86 |  | 
|---|
| 87 |  | 
|---|
| 88 | #define MAX_RESOURCES  10 | 
|---|
| 89 | #define MAX_TEXT_DATA 128 | 
|---|
| 90 |  | 
|---|
| 91 | #define MAX_RM_NODE_SIZE ( sizeof(RM_NODE) +                          \ | 
|---|
| 92 | sizeof(ADAPTERSTRUCT)  + MAX_TEXT_DATA +  \ | 
|---|
| 93 | sizeof(DRIVERSTRUCT)   + MAX_TEXT_DATA +  \ | 
|---|
| 94 | sizeof(RESOURCESTRUCT) * MAX_RESOURCES       ) | 
|---|
| 95 |  | 
|---|
| 96 |  | 
|---|
| 97 | /**************************/ | 
|---|
| 98 | /* FUNC_RM_ENUM_NODE      */ | 
|---|
| 99 | /**************************/ | 
|---|
| 100 |  | 
|---|
| 101 | typedef struct { | 
|---|
| 102 | USHORT   Command;       /* Size of Data Packet      */ | 
|---|
| 103 | } RM_ENUMNODES_PARM,  NEAR *NPRM_ENUMNODES_PARM; | 
|---|
| 104 |  | 
|---|
| 105 | /* pRM_ENUMNODES_PARM->Command */ | 
|---|
| 106 | #define RM_COMMAND_PHYS    0 | 
|---|
| 107 | #define RM_COMMAND_LOG     1 | 
|---|
| 108 | #define RM_COMMAND_DRVR    2 | 
|---|
| 109 | #define RM_COMMAND_PREVIOUS_DETECT  3 | 
|---|
| 110 | #define RM_COMMAND_CURRENT_DETECT   4 | 
|---|
| 111 |  | 
|---|
| 112 | typedef struct { | 
|---|
| 113 | RMHANDLE RMHandle; | 
|---|
| 114 | ULONG    Depth; | 
|---|
| 115 | } NODEENTRY, NEAR *NPNODEENTRY; | 
|---|
| 116 |  | 
|---|
| 117 | typedef struct { | 
|---|
| 118 | ULONG     NumEntries;        /* Number of Topology Entries       */ | 
|---|
| 119 | NODEENTRY NodeEntry[1];      /* First Entry in Map of Nodes      */ | 
|---|
| 120 | } RM_ENUMNODES_DATA, NEAR *NPRM_ENUMNODES_DATA; | 
|---|
| 121 |  | 
|---|
| 122 |  | 
|---|
| 123 | #endif  /* __RM_IOCTL__ */ | 
|---|