ReactOS  0.4.15-dev-425-gc40b086
hardware.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS ISA PnP Bus driver
3  * FILE: hardware.c
4  * PURPOSE: Hardware support code
5  * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
6  * HervĂ© Poussineau
7  */
8 
9 #include <isapnp.h>
10 
11 #define NDEBUG
12 #include <debug.h>
13 
14 static
15 inline
16 VOID
19 {
21 }
22 
23 static
24 inline
25 VOID
27  IN USHORT Data)
28 {
30 }
31 
32 static
33 inline
34 UCHAR
36  IN PUCHAR ReadDataPort)
37 {
38  return READ_PORT_UCHAR(ReadDataPort);
39 }
40 
41 static
42 inline
43 VOID
46  IN USHORT Value)
47 {
50 }
51 
52 static
53 inline
54 UCHAR
56  IN PUCHAR ReadDataPort,
58 {
60  return ReadData(ReadDataPort);
61 }
62 
63 static
64 inline
65 USHORT
67  IN PUCHAR ReadDataPort,
69 {
70  return ((ReadByte(ReadDataPort, Address) << 8) |
71  (ReadByte(ReadDataPort, Address + 1)));
72 }
73 
74 static
75 inline
76 VOID
78  IN PUCHAR ReadDataPort)
79 {
80  WriteByte(ISAPNP_READPORT, ((ULONG_PTR)ReadDataPort >> 2));
81 }
82 
83 static
84 inline
85 VOID
87 {
89 }
90 
91 static
92 inline
93 VOID
95 {
97 }
98 
99 static
100 inline
101 VOID
103 {
105 }
106 
107 static
108 inline
109 VOID
111  IN USHORT Csn)
112 {
113  WriteByte(ISAPNP_WAKE, Csn);
114 }
115 
116 static
117 inline
118 USHORT
120  IN PUCHAR ReadDataPort)
121 {
122  return ReadByte(ReadDataPort, ISAPNP_RESOURCEDATA);
123 }
124 
125 static
126 inline
127 USHORT
129  IN PUCHAR ReadDataPort)
130 {
131  return ReadByte(ReadDataPort, ISAPNP_STATUS);
132 }
133 
134 static
135 inline
136 VOID
138  IN USHORT Csn)
139 {
141 }
142 
143 static
144 inline
145 VOID
147  IN USHORT LogDev)
148 {
150 }
151 
152 static
153 inline
154 VOID
156  IN USHORT LogDev)
157 {
158  WriteLogicalDeviceNumber(LogDev);
160 }
161 
162 static
163 inline
164 VOID
166  IN USHORT LogDev)
167 {
168  WriteLogicalDeviceNumber(LogDev);
170 }
171 
172 static
173 inline
174 USHORT
176  IN PUCHAR ReadDataPort,
177  IN USHORT Index)
178 {
179  return ReadWord(ReadDataPort, ISAPNP_IOBASE(Index));
180 }
181 
182 static
183 inline
184 USHORT
186  IN PUCHAR ReadDataPort,
187  IN USHORT Index)
188 {
189  return ReadByte(ReadDataPort, ISAPNP_IRQNO(Index));
190 }
191 
192 static
193 inline
194 USHORT
196  IN PUCHAR ReadDataPort,
197  IN USHORT Index)
198 {
199  return ReadByte(ReadDataPort, ISAPNP_IRQTYPE(Index));
200 }
201 
202 static
203 inline
204 USHORT
206  IN PUCHAR ReadDataPort,
207  IN USHORT Index)
208 {
209  return ReadByte(ReadDataPort, ISAPNP_DMACHANNEL(Index));
210 }
211 
212 static
213 inline
214 VOID
216 {
218 }
219 
220 static
221 inline
222 UCHAR
224  IN UCHAR Lfsr,
225  IN UCHAR InputBit)
226 {
227  UCHAR NextLfsr = Lfsr >> 1;
228 
229  NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7;
230 
231  return NextLfsr;
232 }
233 
234 static
235 VOID
237 {
238  UCHAR i, Lfsr;
239 
240  HwDelay();
241  WriteAddress(0x00);
242  WriteAddress(0x00);
243 
244  Lfsr = ISAPNP_LFSR_SEED;
245  for (i = 0; i < 32; i++)
246  {
247  WriteAddress(Lfsr);
248  Lfsr = NextLFSR(Lfsr, 0);
249  }
250 }
251 
252 static
253 USHORT
255  IN PUCHAR ReadDataPort)
256 {
257  USHORT i;
258 
259  for (i = 0; i < 20; i++)
260  {
261  if (ReadStatus(ReadDataPort) & 0x01)
262  return ReadResourceData(ReadDataPort);
263 
264  HwDelay();
265  }
266 
267  return 0xFF;
268 }
269 
270 static
271 VOID
273  IN PUCHAR ReadDataPort,
274  IN OUT PVOID Buffer,
275  IN ULONG Length)
276 {
277  USHORT i, Byte;
278 
279  for (i = 0; i < Length; i++)
280  {
281  Byte = PeekByte(ReadDataPort);
282  if (Buffer)
283  *((PUCHAR)Buffer + i) = Byte;
284  }
285 }
286 
287 static
288 USHORT
290  IN PISAPNP_IDENTIFIER Identifier)
291 {
292  UCHAR i, j, Lfsr, Byte;
293 
294  Lfsr = ISAPNP_LFSR_SEED;
295  for (i = 0; i < 8; i++)
296  {
297  Byte = *(((PUCHAR)Identifier) + i);
298  for (j = 0; j < 8; j++)
299  {
300  Lfsr = NextLFSR(Lfsr, Byte);
301  Byte >>= 1;
302  }
303  }
304 
305  return Lfsr;
306 }
307 
308 static
309 BOOLEAN
311  IN PUCHAR ReadDataPort,
312  IN USHORT LogDev,
313  IN OUT PISAPNP_LOGICAL_DEVICE LogDevice)
314 {
315  BOOLEAN res = FALSE;
316  PVOID Buffer;
317  USHORT Tag, TagLen, MaxLen;
318  ULONG NumberOfIo = 0, NumberOfIrq = 0, NumberOfDma = 0;
319 
320  LogDev += 1;
321 
322  while (TRUE)
323  {
324  Tag = PeekByte(ReadDataPort);
326  {
327  TagLen = ISAPNP_SMALL_TAG_LEN(Tag);
329  }
330  else
331  {
332  TagLen = PeekByte(ReadDataPort) + (PeekByte(ReadDataPort) << 8);
334  }
335  if (Tag == ISAPNP_TAG_END)
336  break;
337 
338  Buffer = NULL;
339  if (Tag == ISAPNP_TAG_LOGDEVID)
340  {
341  MaxLen = sizeof(LogDevice->LogDevId);
342  Buffer = &LogDevice->LogDevId;
343  LogDev--;
344  }
345  else if (Tag == ISAPNP_TAG_IRQ && NumberOfIrq < ARRAYSIZE(LogDevice->Irq))
346  {
347  MaxLen = sizeof(LogDevice->Irq[NumberOfIrq].Description);
348  Buffer = &LogDevice->Irq[NumberOfIrq].Description;
349  NumberOfIrq++;
350  }
351  else if (Tag == ISAPNP_TAG_IOPORT && NumberOfIo < ARRAYSIZE(LogDevice->Io))
352  {
353  MaxLen = sizeof(LogDevice->Io[NumberOfIo].Description);
354  Buffer = &LogDevice->Io[NumberOfIo].Description;
355  NumberOfIo++;
356  }
357  else if (Tag == ISAPNP_TAG_DMA && NumberOfDma < ARRAYSIZE(LogDevice->Dma))
358  {
359  MaxLen = sizeof(LogDevice->Dma[NumberOfDma].Description);
360  Buffer = &LogDevice->Dma[NumberOfDma].Description;
361  NumberOfDma++;
362  }
363  else if (LogDev == 0)
364  {
365  DPRINT1("Found unknown tag 0x%x (len %d)\n", Tag, TagLen);
366  }
367 
368  if (Buffer && LogDev == 0)
369  {
370  res = TRUE;
371  if (MaxLen > TagLen)
372  {
373  Peek(ReadDataPort, Buffer, TagLen);
374  }
375  else
376  {
377  Peek(ReadDataPort, Buffer, MaxLen);
378  Peek(ReadDataPort, NULL, TagLen - MaxLen);
379  }
380  }
381  else
382  {
383  /* We don't want to read informations on this
384  * logical device, or we don't know the tag. */
385  Peek(ReadDataPort, NULL, TagLen);
386  }
387  };
388 
389  return res;
390 }
391 
392 static
393 INT
395  IN PUCHAR ReadDataPort)
396 {
397  ISAPNP_IDENTIFIER Identifier;
398  USHORT i, j;
399  BOOLEAN Seen55aa, SeenLife;
400  INT Csn = 0;
401  USHORT Byte, Data;
402 
403  DPRINT("Setting read data port: 0x%p\n", ReadDataPort);
404 
405  WaitForKey();
406  SendKey();
407 
408  ResetCsn();
409  HwDelay();
410  HwDelay();
411 
412  WaitForKey();
413  SendKey();
414  Wake(0x00);
415 
416  SetReadDataPort(ReadDataPort);
417  HwDelay();
418 
419  while (TRUE)
420  {
422  HwDelay();
423 
424  RtlZeroMemory(&Identifier, sizeof(Identifier));
425 
426  Seen55aa = SeenLife = FALSE;
427  for (i = 0; i < 9; i++)
428  {
429  Byte = 0;
430  for (j = 0; j < 8; j++)
431  {
432  Data = ReadData(ReadDataPort);
433  HwDelay();
434  Data = ((Data << 8) | ReadData(ReadDataPort));
435  HwDelay();
436  Byte >>= 1;
437 
438  if (Data != 0xFFFF)
439  {
440  SeenLife = TRUE;
441  if (Data == 0x55AA)
442  {
443  Byte |= 0x80;
444  Seen55aa = TRUE;
445  }
446  }
447  }
448  *(((PUCHAR)&Identifier) + i) = Byte;
449  }
450 
451  if (!Seen55aa)
452  {
453  if (Csn)
454  {
455  DPRINT("Found no more cards\n");
456  }
457  else
458  {
459  if (SeenLife)
460  {
461  DPRINT("Saw life but no cards, trying new read port\n");
462  Csn = -1;
463  }
464  else
465  {
466  DPRINT("Saw no sign of life, abandoning isolation\n");
467  }
468  }
469  break;
470  }
471 
472  if (Identifier.Checksum != IsaPnpChecksum(&Identifier))
473  {
474  DPRINT("Bad checksum, trying next read data port\n");
475  Csn = -1;
476  break;
477  }
478 
479  Csn++;
480 
481  WriteCsn(Csn);
482  HwDelay();
483 
484  Wake(0x00);
485  HwDelay();
486  }
487 
488  WaitForKey();
489 
490  if (Csn > 0)
491  {
492  DPRINT("Found %d cards at read port 0x%p\n", Csn, ReadDataPort);
493  }
494 
495  return Csn;
496 }
497 
498 VOID
500  IN PISAPNP_LOGICAL_DEVICE IsaDevice,
501  IN BOOLEAN Activate)
502 {
503  WaitForKey();
504  SendKey();
505  Wake(IsaDevice->CSN);
506 
507  if (Activate)
508  ActivateDevice(IsaDevice->LDN);
509  else
510  DeactivateDevice(IsaDevice->LDN);
511 
512  HwDelay();
513 
514  WaitForKey();
515 }
516 
517 NTSTATUS
519  IN PISAPNP_FDO_EXTENSION FdoExt)
520 {
521  PISAPNP_LOGICAL_DEVICE LogDevice;
522  ISAPNP_IDENTIFIER Identifier;
523  USHORT Csn;
524  USHORT LogDev;
525  ULONG i;
526 
527  ASSERT(FdoExt->ReadDataPort);
528 
529  for (Csn = 1; Csn <= 0xFF; Csn++)
530  {
531  for (LogDev = 0; LogDev <= 0xFF; LogDev++)
532  {
533  LogDevice = ExAllocatePool(NonPagedPool, sizeof(ISAPNP_LOGICAL_DEVICE));
534  if (!LogDevice)
535  return STATUS_NO_MEMORY;
536 
537  RtlZeroMemory(LogDevice, sizeof(ISAPNP_LOGICAL_DEVICE));
538 
539  LogDevice->CSN = Csn;
540  LogDevice->LDN = LogDev;
541 
542  WaitForKey();
543  SendKey();
544  Wake(Csn);
545 
546  Peek(FdoExt->ReadDataPort, &Identifier, sizeof(Identifier));
547 
548  if (Identifier.VendorId & 0x80)
549  {
550  ExFreePool(LogDevice);
551  return STATUS_SUCCESS;
552  }
553 
554  if (!ReadTags(FdoExt->ReadDataPort, LogDev, LogDevice))
555  break;
556 
557  WriteLogicalDeviceNumber(LogDev);
558 
559  LogDevice->VendorId[0] = ((LogDevice->LogDevId.VendorId >> 2) & 0x1f) + 'A' - 1,
560  LogDevice->VendorId[1] = (((LogDevice->LogDevId.VendorId & 0x3) << 3) | ((LogDevice->LogDevId.VendorId >> 13) & 0x7)) + 'A' - 1,
561  LogDevice->VendorId[2] = ((LogDevice->LogDevId.VendorId >> 8) & 0x1f) + 'A' - 1,
562  LogDevice->ProdId = RtlUshortByteSwap(LogDevice->LogDevId.ProdId);
563  LogDevice->SerialNumber = Identifier.Serial;
564  for (i = 0; i < ARRAYSIZE(LogDevice->Io); i++)
565  LogDevice->Io[i].CurrentBase = ReadIoBase(FdoExt->ReadDataPort, i);
566  for (i = 0; i < ARRAYSIZE(LogDevice->Irq); i++)
567  {
568  LogDevice->Irq[i].CurrentNo = ReadIrqNo(FdoExt->ReadDataPort, i);
569  LogDevice->Irq[i].CurrentType = ReadIrqType(FdoExt->ReadDataPort, i);
570  }
571  for (i = 0; i < ARRAYSIZE(LogDevice->Dma); i++)
572  {
573  LogDevice->Dma[i].CurrentChannel = ReadDmaChannel(FdoExt->ReadDataPort, i);
574  }
575 
576  DPRINT1("Detected ISA PnP device - VID: '%3s' PID: 0x%x SN: 0x%08x IoBase: 0x%x IRQ:0x%x\n",
577  LogDevice->VendorId, LogDevice->ProdId, LogDevice->SerialNumber, LogDevice->Io[0].CurrentBase, LogDevice->Irq[0].CurrentNo);
578 
579  WaitForKey();
580 
581  InsertTailList(&FdoExt->DeviceListHead, &LogDevice->ListEntry);
582  FdoExt->DeviceCount++;
583  }
584  }
585 
586  return STATUS_SUCCESS;
587 }
588 
589 NTSTATUS
590 NTAPI
592  IN PUCHAR ReadDataPort)
593 {
594  return TryIsolate(ReadDataPort) > 0 ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES;
595 }
596 
597 NTSTATUS
598 NTAPI
600  IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
601 {
602  DeviceActivation(LogicalDevice,
603  TRUE);
604 
605  return STATUS_SUCCESS;
606 }
607 
608 NTSTATUS
609 NTAPI
611  IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
612 {
613  DeviceActivation(LogicalDevice,
614  FALSE);
615 
616  return STATUS_SUCCESS;
617 }
618 
619 NTSTATUS
620 NTAPI
622  IN PISAPNP_FDO_EXTENSION FdoExt)
623 {
624  return ProbeIsaPnpBus(FdoExt);
625 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2373
static VOID SetReadDataPort(IN PUCHAR ReadDataPort)
Definition: hardware.c:77
#define IN
Definition: typedefs.h:39
#define TRUE
Definition: types.h:120
#define ISAPNP_IS_SMALL_TAG(t)
Definition: isapnphw.h:41
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define ISAPNP_CONFIG_RESET_CSN
Definition: isapnphw.h:37
static USHORT ReadDmaChannel(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:205
#define ISAPNP_SMALL_TAG_NAME(t)
Definition: isapnphw.h:42
static VOID Peek(IN PUCHAR ReadDataPort, IN OUT PVOID Buffer, IN ULONG Length)
Definition: hardware.c:272
UCHAR CurrentNo
Definition: isapnp.h:25
unsigned char Byte
Definition: zconf.h:391
#define RtlUshortByteSwap(_x)
Definition: rtlfuncs.h:3199
#define ISAPNP_CONFIG_WAIT_FOR_KEY
Definition: isapnphw.h:36
unsigned char * PUCHAR
Definition: retypes.h:3
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528
LONG NTSTATUS
Definition: precomp.h:26
#define ISAPNP_DMACHANNEL(n)
Definition: isapnphw.h:33
#define ISAPNP_CONFIGCONTROL
Definition: isapnphw.h:20
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static VOID ActivateDevice(IN USHORT LogDev)
Definition: hardware.c:155
UCHAR CurrentType
Definition: isapnp.h:26
static INT TryIsolate(IN PUCHAR ReadDataPort)
Definition: hardware.c:394
ISAPNP_IO Io[8]
Definition: isapnp.h:41
VOID DeviceActivation(IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
Definition: hardware.c:499
static UCHAR NextLFSR(IN UCHAR Lfsr, IN UCHAR InputBit)
Definition: hardware.c:223
#define InsertTailList(ListHead, Entry)
#define ISAPNP_ACTIVATE
Definition: isapnphw.h:27
USHORT ProdId
Definition: isapnphw.h:95
#define ISAPNP_STATUS
Definition: isapnphw.h:23
#define ISAPNP_READPORT
Definition: isapnphw.h:18
int32_t INT
Definition: typedefs.h:57
#define ISAPNP_WAKE
Definition: isapnphw.h:21
static BOOLEAN ReadTags(IN PUCHAR ReadDataPort, IN USHORT LogDev, IN OUT PISAPNP_LOGICAL_DEVICE LogDevice)
Definition: hardware.c:310
uint32_t ULONG_PTR
Definition: typedefs.h:64
static USHORT PeekByte(IN PUCHAR ReadDataPort)
Definition: hardware.c:254
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
ISAPNP_LOGDEVID LogDevId
Definition: isapnp.h:37
#define ISAPNP_IRQNO(n)
Definition: isapnphw.h:31
static VOID WriteData(IN USHORT Data)
Definition: hardware.c:26
NTSTATUS NTAPI IsaHwTryReadDataPort(IN PUCHAR ReadDataPort)
Definition: hardware.c:591
#define ISAPNP_LFSR_SEED
Definition: isapnphw.h:39
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
static WCHAR Address[46]
Definition: ping.c:68
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
static VOID SendKey(VOID)
Definition: hardware.c:236
LIST_ENTRY ListEntry
Definition: isapnp.h:46
void DPRINT(...)
Definition: polytest.cpp:61
#define ISAPNP_ADDRESS
Definition: isapnphw.h:7
Definition: bufpool.h:45
static USHORT ReadWord(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:66
UCHAR CurrentChannel
Definition: isapnp.h:31
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55
UCHAR VendorId[3]
Definition: isapnp.h:38
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static USHORT ReadIrqNo(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:185
USHORT VendorId
Definition: isapnphw.h:94
static VOID WriteCsn(IN USHORT Csn)
Definition: hardware.c:137
#define ISAPNP_LOGICALDEVICENUMBER
Definition: isapnphw.h:25
static VOID Wake(IN USHORT Csn)
Definition: hardware.c:110
#define ISAPNP_TAG_IRQ
Definition: isapnphw.h:47
static USHORT ReadStatus(IN PUCHAR ReadDataPort)
Definition: hardware.c:128
USHORT CurrentBase
Definition: isapnp.h:20
static const UCHAR Index[8]
Definition: usbohci.c:18
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44
static USHORT ReadIrqType(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:195
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ISAPNP_SMALL_TAG_LEN(t)
Definition: isapnphw.h:43
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define ISAPNP_TAG_LOGDEVID
Definition: isapnphw.h:45
unsigned char UCHAR
Definition: xmlstorage.h:181
NTSTATUS NTAPI IsaHwActivateDevice(IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:599
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
static VOID WriteAddress(IN USHORT Address)
Definition: hardware.c:17
ISAPNP_DMA Dma[2]
Definition: isapnp.h:43
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:246
NTSTATUS NTAPI IsaHwDeactivateDevice(IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
Definition: hardware.c:610
#define ISAPNP_IOBASE(n)
Definition: isapnphw.h:30
static USHORT IsaPnpChecksum(IN PISAPNP_IDENTIFIER Identifier)
Definition: hardware.c:289
#define DPRINT1
Definition: precomp.h:8
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define ISAPNP_TAG_DMA
Definition: isapnphw.h:48
static USHORT ReadIoBase(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:175
#define OUT
Definition: typedefs.h:40
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define ISAPNP_SERIALISOLATION
Definition: isapnphw.h:19
#define ISAPNP_RESOURCEDATA
Definition: isapnphw.h:22
static VOID WriteLogicalDeviceNumber(IN USHORT LogDev)
Definition: hardware.c:146
static VOID EnterIsolationState(VOID)
Definition: hardware.c:86
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
NTSTATUS ProbeIsaPnpBus(IN PISAPNP_FDO_EXTENSION FdoExt)
Definition: hardware.c:518
#define ISAPNP_WRITE_DATA
Definition: isapnphw.h:8
return STATUS_SUCCESS
Definition: btrfs.c:3014
NTSTATUS NTAPI IsaHwFillDeviceList(IN PISAPNP_FDO_EXTENSION FdoExt)
Definition: hardware.c:621
static VOID DeactivateDevice(IN USHORT LogDev)
Definition: hardware.c:165
static VOID ResetCsn(VOID)
Definition: hardware.c:102
#define ISAPNP_TAG_IOPORT
Definition: isapnphw.h:51
static VOID WaitForKey(VOID)
Definition: hardware.c:94
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95
#define ISAPNP_LARGE_TAG_NAME(t)
Definition: isapnphw.h:61
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define ISAPNP_CARDSELECTNUMBER
Definition: isapnphw.h:24
#define ISAPNP_IRQTYPE(n)
Definition: isapnphw.h:32
static UCHAR ReadData(IN PUCHAR ReadDataPort)
Definition: hardware.c:35
static VOID HwDelay(VOID)
Definition: hardware.c:215
static USHORT ReadResourceData(IN PUCHAR ReadDataPort)
Definition: hardware.c:119
ISAPNP_IRQ Irq[2]
Definition: isapnp.h:42
#define ISAPNP_TAG_END
Definition: isapnphw.h:58