summaryrefslogtreecommitdiffstats
path: root/private/ntos/ndis/madge/driver/head_def/ftk_adap.h
blob: b5f982bc7c2cee6b9af582c0ee7289a57b38f5a5 (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
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
/****************************************************************************/
/****************************************************************************/
/*                                                                          */
/*      THE ADAPTER DEFINITIONS                                             */
/*      =======================                                             */
/*                                                                          */
/*      FTK_ADAP.H : Part of the FASTMAC TOOL-KIT (FTK)                     */
/*                                                                          */
/*      Copyright (c) Madge Networks Ltd. 1991-1994                         */
/*      Developed by MF                                                     */
/*      CONFIDENTIAL                                                        */
/*                                                                          */
/*                                                                          */
/****************************************************************************/
/*                                                                          */
/* This header file contains the definitions for  the  structure  which  is */
/* used  to  maintain  information  on an adapter that is being used by the */
/* FTK.                                                                     */
/*                                                                          */
/****************************************************************************/

/****************************************************************************/
/*                                                                          */
/* VERSION_NUMBER of FTK to which this FTK_ADAP.H belongs :                 */
/*                                                                          */

#define FTK_VERSION_NUMBER_FTK_ADAP_H 221


/****************************************************************************/
/*                                                                          */
/* TYPEDEFs for all structures defined within this header file :            */
/*                                                                          */

typedef struct STRUCT_ADAPTER                     ADAPTER;


/****************************************************************************/
/*                                                                          */
/* Structure type : ADAPTER                                                 */
/*                                                                          */
/* The adapter structure is used to maintain  all  the  information  for  a */
/* single adapter.  This  includes  information  on  the  Fastmac  for  the */
/* adapter. Most of the fields are filled in from the user supplied adapter */
/* information to driver_prepare_adapter and driver_start_adapter.          */
/*                                                                          */

struct STRUCT_ADAPTER
    {
    void                   (*set_dio_address) (struct STRUCT_ADAPTER*, DWORD);
    void                   (*interrupt_handler) (struct STRUCT_ADAPTER*);
    void                   (*remove_card) (struct STRUCT_ADAPTER*);
    UINT                   adapter_card_bus_type;
    UINT                   adapter_card_type;
    UINT                   adapter_card_revision;
    UINT                   adapter_ram_size;    /* Depends on card type.    */
#ifdef PCMCIA_POINT_ENABLE
    UINT                   socket;              /* Socket passed to point
                                                   enabler. */
    BOOLEAN                drop_int;            /* Flag used to stop a 
                                                   spurious interrupt being
                                                   claimed.                 */
#endif
    WORD                   io_location;
    WORD                   io_range;
    WORD                   interrupt_number;    /* 0 == Polling mode        */
    WBOOLEAN               edge_triggered_ints;
    WORD                   nselout_bits;        /* IRQ select on Smart16    */
    WORD                   dma_channel; 
    UINT                   transfer_mode;       /* DMA/MMIO/PIO             */
    WBOOLEAN               EaglePsDMA;
    WORD                   mc32_config;         /* special config info      */
    NODE_ADDRESS           permanent_address;   /* BIA PROM node address    */
    UINT                   ring_speed;
    WBOOLEAN               speed_detect;        /* Card is capable of detecting ring speed */
    WORD                   max_frame_size;      /* determined by ring speed */
    UINT                   set_ring_speed;      /* Force ring speed to this */
    DWORD                  mmio_base_address;   /* MMIO base address        */
    DWORD                  pci_handle;          /* PCI slot handle.         */
    WBOOLEAN               use_32bit_pio; 
    WORD                   sif_dat;             /* SIF register IO locations*/
    WORD                   sif_datinc;
    WORD                   sif_adr;
    WORD                   sif_int;
    WORD                   sif_acl;
    WORD                   sif_adr2;
    WORD                   sif_adx;
    WORD                   sif_dmalen;
    WORD                   sif_sdmadat;
    WORD                   sif_sdmaadr;
    WORD                   sif_sdmaadx;     
    WORD                   c46_bits;            /* Bits we must remember in */
                                                /* the AT93C46 control reg. */


    WBOOLEAN               set_irq;             /* set IRQ if possible      */
    WBOOLEAN               set_dma;             /* set DMA if possible      */

    SRB_GENERAL            srb_general;         /* SRB for this adapter     */
    WORD                   size_of_srb;         /* size of current SRB      */

    DOWNLOAD_IMAGE *       download_image;      /* ptr Fastmac binary image */
    INITIALIZATION_BLOCK * init_block;          /* ptr Fastmac init block   */
    SRB_HEADER *           srb_dio_addr;        /* addr of SRB in DIO space */
    FASTMAC_STATUS_BLOCK * stb_dio_addr;        /* addr of STB in DIO space */

    WBOOLEAN               interrupts_on;       /* for this adapter         */
    WBOOLEAN               dma_on;              /* for this adapter         */

    UINT                   adapter_status;      /* prepared or running      */
    UINT                   srb_status;          /* free or in use           */
    ERROR_RECORD           error_record;        /* error type and value     */
    ERROR_MESSAGE          error_message;       /* error message string     */

    STATUS_INFORMATION *   status_info;         /* ptr adapter status info  */

    void *                 user_information;    /* User's private data.     */

    ADAPTER_HANDLE         adapter_handle;

#ifdef FMPLUS

    DWORD                  dma_test_buf_phys;
    DWORD                  dma_test_buf_virt;


    RX_SLOT *              rx_slot_array[FMPLUS_MAX_RX_SLOTS];  
                                                /* Rx slot DIO addresses    */
    TX_SLOT *              tx_slot_array[FMPLUS_MAX_TX_SLOTS];  
                                                /* Tx slot DIO addresses    */

    void *                 rx_slot_mgmnt;       /* pointer to user slot     */
    void *                 tx_slot_mgmnt;       /* management structures.   */

#else
  
    DWORD                  rx_buffer_phys;     /* RX buffer physical address*/
    DWORD                  rx_buffer_virt;     /* RX buffer virtual address */
    DWORD                  tx_buffer_phys;     /* TX buffer physical address*/
    DWORD                  tx_buffer_virt;     /* TX buffer virtual address */

#endif
    };


/****************************************************************************/
/*                                                                          */
/* Values : ADAPTER - WORD adapter_card_type                                */
/*                                                                          */
/* The following are the different types of adapter cards supported by  the */
/* FTK (and their subtypes).                                                */
/*                                                                          */

#define ADAPTER_CARD_TYPE_16_4_AT       2

#define ADAPTER_CARD_16_4_PC            0
#define ADAPTER_CARD_16_4_MAXY          1
#define ADAPTER_CARD_16_4_AT            2
#define ADAPTER_CARD_16_4_FIBRE         3
#define ADAPTER_CARD_16_4_BRIDGE        4
#define ADAPTER_CARD_16_4_ISA_C         5
#define ADAPTER_CARD_16_4_AT_P_REV      6
#define ADAPTER_CARD_16_4_FIBRE_P       7
#define ADAPTER_CARD_16_4_ISA_C_P       8
#define ADAPTER_CARD_16_4_AT_P          9

#define ADAPTER_CARD_TYPE_16_4_MC       3

#define ADAPTER_CARD_TYPE_16_4_MC_32    4

#define ADAPTER_CARD_TYPE_16_4_EISA     5

#define ADAPTER_CARD_16_4_EISA_MK1      1
#define ADAPTER_CARD_16_4_EISA_MK2      2
#define ADAPTER_CARD_16_4_EISA_BRIDGE   3
#define ADAPTER_CARD_16_4_EISA_MK3      4

#define ADAPTER_CARD_TYPE_SMART_16      6
#define ADAPTER_CARD_SMART_16           1

#define ADAPTER_CARD_TYPE_16_4_PCI      7
#define ADAPTER_CARD_16_4_PCI           0

#define ADAPTER_CARD_TYPE_16_4_PCMCIA   8
#define ADAPTER_CARD_16_4_PCMCIA        1

#define ADAPTER_CARD_TYPE_16_4_PNP      9
#define ADAPTER_CARD_PNP                0

#define ADAPTER_CARD_TYPE_16_4_PCIT     10
#define ADAPTER_CARD_16_4_PCIT          0

#define ADAPTER_CARD_TYPE_16_4_PCI2     11
#define ADAPTER_CARD_16_4_PCI2          0

#define ADAPTER_CARD_UNKNOWN            255

/****************************************************************************/
/*                                                                          */
/* Values : ADAPTER - WORD adapter_status                                   */
/*                                                                          */
/* These values are for the different required states of the  adapter  when */
/* using the FTK.                                                           */
/*                                                                          */

#define ADAPTER_PREPARED_FOR_START      0
#define ADAPTER_RUNNING                 1


/****************************************************************************/
/*                                                                          */
/* Values : ADAPTER - WORD srb_status                                       */
/*                                                                          */
/* These  values  are  for  the  different  required  states  of  the  SRB, */
/* associated with an adapter, when using the FTK.                          */
/*                                                                          */

#define SRB_ANY_STATE           0
#define SRB_FREE                1
#define SRB_NOT_FREE            2


/****************************************************************************/
/*                                                                          */
/* Value : Number of Adapters supported                                     */
/*                                                                          */
/* The FTK supports a specified maximum number  of  adapters.  The  smaller */
/* this  value  is,  the  less memory that is used. This is especially true */
/* when considering system specific parts such  as  the  DOS  example  code */
/* within  this  FTK.  It  uses  the  maximum  number of adapters value for */
/* determining  the  size  of  static  arrays  of  adapter  structures  and */
/* initialization  blocks.  It  also  uses it for determining the number of */
/* interrupt stubs required given that :                                    */
/*                                                                          */
/* NOTE : If using the DOS example system specific code, then  it  must  be */
/* the    case    that    MAX_NUMBER_OF_ADAPTERS    defined   here   equals */
/* MAX_NUMBER_OF_ADAPTERS as defined in SYS_IRQ.ASM.                        */
/*                                                                          */

#define MAX_NUMBER_OF_ADAPTERS  8


#define ISA_IO_LOCATIONS        4
#define MAX_ISA_ADAPATERS       ISA_IO_LOCATIONS

#define MC_IO_LOCATIONS         8
#define MAX_MC_ADAPATERS        MC_IO_LOCATIONS

#define MC32_IO_LOCATIONS       8
#define MAX_MC32_ADAPATERS      MC32_IO_LOCATIONS


/****************************************************************************/
/*                                                                          */
/* Varaibles : adapter_record array                                         */
/*                                                                          */
/* The FTK maintains an array of pointers to the adapter structures used to */
/* maintain information on the different adapters being used. This array is */
/* exported by DRV_INIT.C.                                                  */
/*                                                                          */

extern ADAPTER *        adapter_record[MAX_NUMBER_OF_ADAPTERS];

/****************************************************************************/
/*                                                                          */
/* Macro: FTK_ADAPTER_USER_INFORMATION                                      */
/*                                                                          */
/* A macro to let FTK users get at their private adapter information from   */
/* an adapter handle.                                                       */
/*                                                                          */

#define FTK_ADAPTER_USER_INFORMATION(adapter_handle) \
    (adapter_record[(adapter_handle)]->user_information)    


/*                                                                          */
/*                                                                          */
/************** End of FTK_ADAP.H file **************************************/
/*                                                                          */
/*                                                                          */