summaryrefslogtreecommitdiffstats
path: root/private/ntos/ndis/digi/pcimac/io_pub.h
blob: 080fef7fb5245f35f68073aa061146be8f88cb24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
/*
 * IO_PUB.H - include file for all IO modules
 */

#ifndef _IO_PUB_
#define _IO_PUB_

#define		BRI_MAX_NAMELEN		64			/* anything that can be named < 64 chars */

/* error codes */
#define     IO_E_SUCC       0           /* success */
#define     IO_E_NOROOM     1           /* no room in local tables */
#define     IO_E_NOSUCH     2           /* no such object */
#define     IO_E_BADSIG     3           /* bad signature */
#define     IO_E_BADVER     4           /* bad version */
#define     IO_E_BADCMD     5           /* bad command opcode */
#define     IO_E_BADIDD     6
#define     IO_E_BADCM      7
#define     IO_E_PENDING    0xFF        /* command is pending */

/* IO commands available listed here */
#define     IO_CMD_ENUM_ADAPTERS    0x100   /* enumerate network interfaces */
#define     IO_CMD_ENUM_IDD         0x101   /* enumerate isdn device drivers */
#define     IO_CMD_ENUM_CM          0x102   /* enumerate connection managers */

#define     IO_CMD_TRC_RESET    0x300   /* reset trace */
#define     IO_CMD_TRC_STOP     0x301   /* stop trace */
#define     IO_CMD_TRC_START    0x302   /* start trace */
#define     IO_CMD_TRC_SET_FILT 0x305   /* set filter for trace context */
#define     IO_CMD_TRC_GET_STAT 0x306   /* get status of trace context */
#define     IO_CMD_TRC_GET_ENT  0x307   /* get a trace entry */
#define     IO_CMD_TRC_CREATE   0x30A   /* create trc object */
#define     IO_CMD_TRC_DESTROY  0x30B   /* destroy trc object */

#define     IO_CMD_DO_ADP_CMD       0x400
#define     MAX_ADP_OPERATIONS      8
#define     GET_ADP_UCHAR           1
#define     GET_ADP_USHORT          2
#define     GET_ADP_ULONG           3
#define     GET_ADP_BUFFER          4
#define     SET_ADP_UCHAR           5
#define     SET_ADP_USHORT          6
#define     SET_ADP_ULONG           7
#define     SET_ADP_BUFFER          8

#define     IO_CMD_DO_IDP_CMD       0x401
#define     MAX_IDP_OPERATIONS      4
#define     GET_IDP_IO_VALUE        1
#define     GET_IDP_BUFFER          2
#define     SET_IDP_IO_VALUE        3
#define     SET_IDP_BUFFER          4

#define     IO_CMD_IDD_GET_AREA     0x900   /* get idd area */
#define     IO_CMD_IDD_RESET_AREA   0x901   /* reset idd area state */
#define     IO_CMD_IDD_GET_STAT     0x902   /* get area state */

#define     IO_CMD_DBG_LEVEL    0xF00   /* set debug level */

typedef struct _ENUM_ADAPTERS_
{
    USHORT  num;
    ULONG   BaseIO[MAX_ADAPTERS_IN_SYSTEM];
    ULONG   BaseMem[MAX_ADAPTERS_IN_SYSTEM];
    ULONG   BoardType[MAX_ADAPTERS_IN_SYSTEM];
    CHAR    Name[MAX_ADAPTERS_IN_SYSTEM][BRI_MAX_NAMELEN];
    VOID    *tbl[MAX_ADAPTERS_IN_SYSTEM];
} ENUM_ADAPTERS, *PENUM_ADAPTERS;

typedef struct ENUM_CM
{
    USHORT  num;
    CHAR    name[MAX_CM_IN_SYSTEM][BRI_MAX_NAMELEN];
    VOID   *tbl[MAX_CM_IN_SYSTEM];
} ENUM_CM, *PENUM_CM;

typedef struct _ENUM_IDD_
{
    USHORT  num;
    VOID    *tbl[MAX_IDD_IN_SYSTEM];
    CHAR    name[MAX_IDD_IN_SYSTEM][BRI_MAX_NAMELEN];
} ENUM_IDD, *PENUM_IDD;

typedef struct _DBG_LEVEL_
{
    INT     cmplen;
    CHAR    filestr[9];
} DBG_LEVEL, *PDBG_LEVEL;

typedef struct _ADPRAW_
{
    UCHAR   uc;
    USHORT  us;
    ULONG   ul;
    ULONG   Address;
    USHORT  Length;
    UCHAR   Buffer[ADP_RAM_SIZE];
} ADPRAW, *PADPRAW;

typedef struct _IDPRAW_
{
    UCHAR   uc;
    USHORT  us;
    ULONG   ul;
    USHORT  Bank;
    USHORT  Page;
    ULONG   Address;
    USHORT  Length;
    UCHAR   Buffer[IDP_RAM_PAGE_SIZE];
} IDPRAW, *PIDPRAW;

/* master descriptor structure for ioctl commands to IO module */
typedef struct
{
    ULONG       sig;                    /* identifing signature */
#define     IO_CMD_SIG      0x321B71B7

    USHORT      ver_major, ver_minor;   /* interface version (curr: 0.1) */
#define     IO_VER_MAJOR    0
#define     IO_VER_MINOR    1

    ULONG       opcode;                 /* command opcode, IO_CMD_* */

    ULONG       status;                 /* completion status, ok: 0 */

    VOID        *cm;                    /* related connection object */
    VOID        *idd;                   /* related idd */
    ULONG       arg[4];                 /* 4 general purpose args */

    union                               /* opcode specific data */
    {
        ENUM_ADAPTERS enum_adapters;    /* IO_CMD_ENUM_ADAPTERS */

        ENUM_CM enum_cm;                /* IO_CMD_ENUM_MTL */

        ENUM_IDD enum_idd;              /* IO_CMD_ENUM_IDD */

        DBG_LEVEL dbg_level;

        CM_STATUS   cm_stat;            /* IO_CMD_CM_GET_STAT */

        TRC_STATUS  trc_stat;           /* IO_CMD_TRC_GET_STAT */
        TRC_ENTRY   trc_ent;            /* IO_CMD_TRC_GET_ENT */
        IDD_AREA    IddStat;            // IO_CMD_GET_IDD_STAT

        ADPRAW AdpRaw;

        IDPRAW IdpRaw;
    } val;

} IO_CMD;

#endif      /* _IO_PUB_ */