ReactOS  0.4.15-dev-1377-ga59cecd
hardware.c File Reference
#include <isapnp.h>
#include <debug.h>
Include dependency graph for hardware.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

static VOID WriteAddress (IN USHORT Address)
 
static VOID WriteData (IN USHORT Data)
 
static UCHAR ReadData (IN PUCHAR ReadDataPort)
 
static VOID WriteByte (IN USHORT Address, IN USHORT Value)
 
static UCHAR ReadByte (IN PUCHAR ReadDataPort, IN USHORT Address)
 
static USHORT ReadWord (IN PUCHAR ReadDataPort, IN USHORT Address)
 
static VOID SetReadDataPort (IN PUCHAR ReadDataPort)
 
static VOID EnterIsolationState (VOID)
 
static VOID WaitForKey (VOID)
 
static VOID ResetCsn (VOID)
 
static VOID Wake (IN USHORT Csn)
 
static USHORT ReadResourceData (IN PUCHAR ReadDataPort)
 
static USHORT ReadStatus (IN PUCHAR ReadDataPort)
 
static VOID WriteCsn (IN USHORT Csn)
 
static VOID WriteLogicalDeviceNumber (IN USHORT LogDev)
 
static VOID ActivateDevice (IN USHORT LogDev)
 
static VOID DeactivateDevice (IN USHORT LogDev)
 
static USHORT ReadIoBase (IN PUCHAR ReadDataPort, IN USHORT Index)
 
static USHORT ReadIrqNo (IN PUCHAR ReadDataPort, IN USHORT Index)
 
static USHORT ReadIrqType (IN PUCHAR ReadDataPort, IN USHORT Index)
 
static USHORT ReadDmaChannel (IN PUCHAR ReadDataPort, IN USHORT Index)
 
static VOID HwDelay (VOID)
 
static UCHAR NextLFSR (IN UCHAR Lfsr, IN UCHAR InputBit)
 
static VOID SendKey (VOID)
 
static USHORT PeekByte (IN PUCHAR ReadDataPort)
 
static VOID Peek (IN PUCHAR ReadDataPort, IN OUT PVOID Buffer, IN ULONG Length)
 
static USHORT IsaPnpChecksum (IN PISAPNP_IDENTIFIER Identifier)
 
static BOOLEAN ReadTags (IN PUCHAR ReadDataPort, IN USHORT LogDev, IN OUT PISAPNP_LOGICAL_DEVICE LogDevice)
 
static INT TryIsolate (IN PUCHAR ReadDataPort)
 
VOID DeviceActivation (IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
 
NTSTATUS ProbeIsaPnpBus (IN PISAPNP_FDO_EXTENSION FdoExt)
 
NTSTATUS NTAPI IsaHwTryReadDataPort (IN PUCHAR ReadDataPort)
 
NTSTATUS NTAPI IsaHwActivateDevice (IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
 
NTSTATUS NTAPI IsaHwDeactivateDevice (IN PISAPNP_LOGICAL_DEVICE LogicalDevice)
 
NTSTATUS NTAPI IsaHwFillDeviceList (IN PISAPNP_FDO_EXTENSION FdoExt)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file hardware.c.

Function Documentation

◆ ActivateDevice()

static VOID ActivateDevice ( IN USHORT  LogDev)
inlinestatic

Definition at line 155 of file hardware.c.

157 {
158  WriteLogicalDeviceNumber(LogDev);
160 }
#define ISAPNP_ACTIVATE
Definition: isapnphw.h:27
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44
static VOID WriteLogicalDeviceNumber(IN USHORT LogDev)
Definition: hardware.c:146

Referenced by DeviceActivation().

◆ DeactivateDevice()

static VOID DeactivateDevice ( IN USHORT  LogDev)
inlinestatic

Definition at line 165 of file hardware.c.

167 {
168  WriteLogicalDeviceNumber(LogDev);
170 }
#define ISAPNP_ACTIVATE
Definition: isapnphw.h:27
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44
static VOID WriteLogicalDeviceNumber(IN USHORT LogDev)
Definition: hardware.c:146

Referenced by DeviceActivation().

◆ DeviceActivation()

VOID DeviceActivation ( IN PISAPNP_LOGICAL_DEVICE  IsaDevice,
IN BOOLEAN  Activate 
)

Definition at line 499 of file hardware.c.

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 }
static VOID ActivateDevice(IN USHORT LogDev)
Definition: hardware.c:155
static VOID SendKey(VOID)
Definition: hardware.c:236
static VOID Wake(IN USHORT Csn)
Definition: hardware.c:110
static VOID DeactivateDevice(IN USHORT LogDev)
Definition: hardware.c:165
static VOID WaitForKey(VOID)
Definition: hardware.c:94
static VOID HwDelay(VOID)
Definition: hardware.c:215

Referenced by IsaHwActivateDevice(), and IsaHwDeactivateDevice().

◆ EnterIsolationState()

static VOID EnterIsolationState ( VOID  )
inlinestatic

Definition at line 86 of file hardware.c.

87 {
89 }
static VOID WriteAddress(IN USHORT Address)
Definition: hardware.c:17
#define ISAPNP_SERIALISOLATION
Definition: isapnphw.h:19

Referenced by TryIsolate().

◆ HwDelay()

static VOID HwDelay ( VOID  )
inlinestatic

Definition at line 215 of file hardware.c.

216 {
218 }
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:95

Referenced by DeviceActivation(), PeekByte(), SendKey(), and TryIsolate().

◆ IsaHwActivateDevice()

NTSTATUS NTAPI IsaHwActivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 599 of file hardware.c.

601 {
602  DeviceActivation(LogicalDevice,
603  TRUE);
604 
605  return STATUS_SUCCESS;
606 }
#define TRUE
Definition: types.h:120
VOID DeviceActivation(IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
Definition: hardware.c:499
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by IsaPdoPnp().

◆ IsaHwDeactivateDevice()

NTSTATUS NTAPI IsaHwDeactivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 610 of file hardware.c.

612 {
613  DeviceActivation(LogicalDevice,
614  FALSE);
615 
616  return STATUS_SUCCESS;
617 }
VOID DeviceActivation(IN PISAPNP_LOGICAL_DEVICE IsaDevice, IN BOOLEAN Activate)
Definition: hardware.c:499
#define FALSE
Definition: types.h:117
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by IsaPdoPnp().

◆ IsaHwFillDeviceList()

NTSTATUS NTAPI IsaHwFillDeviceList ( IN PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 621 of file hardware.c.

623 {
624  return ProbeIsaPnpBus(FdoExt);
625 }
NTSTATUS ProbeIsaPnpBus(IN PISAPNP_FDO_EXTENSION FdoExt)
Definition: hardware.c:518

Referenced by IsaPdoStartReadPort().

◆ IsaHwTryReadDataPort()

NTSTATUS NTAPI IsaHwTryReadDataPort ( IN PUCHAR  ReadDataPort)

Definition at line 591 of file hardware.c.

593 {
594  return TryIsolate(ReadDataPort) > 0 ? STATUS_SUCCESS : STATUS_INSUFFICIENT_RESOURCES;
595 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
static INT TryIsolate(IN PUCHAR ReadDataPort)
Definition: hardware.c:394
#define STATUS_SUCCESS
Definition: shellext.h:65

Referenced by IsaPdoStartReadPort().

◆ IsaPnpChecksum()

static USHORT IsaPnpChecksum ( IN PISAPNP_IDENTIFIER  Identifier)
static

Definition at line 289 of file hardware.c.

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 }
unsigned char * PUCHAR
Definition: retypes.h:3
static UCHAR NextLFSR(IN UCHAR Lfsr, IN UCHAR InputBit)
Definition: hardware.c:223
#define ISAPNP_LFSR_SEED
Definition: isapnphw.h:39
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
unsigned char UCHAR
Definition: xmlstorage.h:181
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
unsigned char Byte
Definition: zlib.h:37

Referenced by TryIsolate().

◆ NextLFSR()

static UCHAR NextLFSR ( IN UCHAR  Lfsr,
IN UCHAR  InputBit 
)
inlinestatic

Definition at line 223 of file hardware.c.

226 {
227  UCHAR NextLfsr = Lfsr >> 1;
228 
229  NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7;
230 
231  return NextLfsr;
232 }
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by IsaPnpChecksum(), and SendKey().

◆ Peek()

static VOID Peek ( IN PUCHAR  ReadDataPort,
IN OUT PVOID  Buffer,
IN ULONG  Length 
)
static

Definition at line 272 of file hardware.c.

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 }
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned char * PUCHAR
Definition: retypes.h:3
static USHORT PeekByte(IN PUCHAR ReadDataPort)
Definition: hardware.c:254
Definition: bufpool.h:45
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
unsigned short USHORT
Definition: pedump.c:61
unsigned char Byte
Definition: zlib.h:37

Referenced by NpReadDataQueue(), ProbeIsaPnpBus(), and ReadTags().

◆ PeekByte()

static USHORT PeekByte ( IN PUCHAR  ReadDataPort)
static

Definition at line 254 of file hardware.c.

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 }
static USHORT ReadStatus(IN PUCHAR ReadDataPort)
Definition: hardware.c:128
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
unsigned short USHORT
Definition: pedump.c:61
static VOID HwDelay(VOID)
Definition: hardware.c:215
static USHORT ReadResourceData(IN PUCHAR ReadDataPort)
Definition: hardware.c:119

Referenced by COMMAND_PROTOTYPE(), Peek(), and ReadTags().

◆ ProbeIsaPnpBus()

NTSTATUS ProbeIsaPnpBus ( IN PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 518 of file hardware.c.

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 }
static USHORT ReadDmaChannel(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:205
static VOID Peek(IN PUCHAR ReadDataPort, IN OUT PVOID Buffer, IN ULONG Length)
Definition: hardware.c:272
UCHAR CurrentNo
Definition: isapnp.h:25
#define RtlUshortByteSwap(_x)
Definition: rtlfuncs.h:3199
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
UCHAR CurrentType
Definition: isapnp.h:26
ISAPNP_IO Io[8]
Definition: isapnp.h:41
#define InsertTailList(ListHead, Entry)
USHORT ProdId
Definition: isapnphw.h:95
static BOOLEAN ReadTags(IN PUCHAR ReadDataPort, IN USHORT LogDev, IN OUT PISAPNP_LOGICAL_DEVICE LogDevice)
Definition: hardware.c:310
ISAPNP_LOGDEVID LogDevId
Definition: isapnp.h:37
static VOID SendKey(VOID)
Definition: hardware.c:236
LIST_ENTRY ListEntry
Definition: isapnp.h:46
UCHAR CurrentChannel
Definition: isapnp.h:31
UCHAR VendorId[3]
Definition: isapnp.h:38
static USHORT ReadIrqNo(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:185
USHORT VendorId
Definition: isapnphw.h:94
static VOID Wake(IN USHORT Csn)
Definition: hardware.c:110
#define ASSERT(a)
Definition: mode.c:45
USHORT CurrentBase
Definition: isapnp.h:20
static USHORT ReadIrqType(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:195
#define ExAllocatePool(type, size)
Definition: fbtusb.h:44
ISAPNP_DMA Dma[2]
Definition: isapnp.h:43
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
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_NO_MEMORY
Definition: ntstatus.h:260
#define DPRINT1
Definition: precomp.h:8
static USHORT ReadIoBase(IN PUCHAR ReadDataPort, IN USHORT Index)
Definition: hardware.c:175
unsigned int ULONG
Definition: retypes.h:1
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
#define STATUS_SUCCESS
Definition: shellext.h:65
static VOID WriteLogicalDeviceNumber(IN USHORT LogDev)
Definition: hardware.c:146
static VOID WaitForKey(VOID)
Definition: hardware.c:94
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
ISAPNP_IRQ Irq[2]
Definition: isapnp.h:42

Referenced by IsaHwFillDeviceList().

◆ ReadByte()

static UCHAR ReadByte ( IN PUCHAR  ReadDataPort,
IN USHORT  Address 
)
inlinestatic

Definition at line 55 of file hardware.c.

58 {
60  return ReadData(ReadDataPort);
61 }
static WCHAR Address[46]
Definition: ping.c:68
static VOID WriteAddress(IN USHORT Address)
Definition: hardware.c:17
static UCHAR ReadData(IN PUCHAR ReadDataPort)
Definition: hardware.c:35

Referenced by ReadDmaChannel(), ReadIrqNo(), ReadIrqType(), ReadResourceData(), ReadStatus(), and ReadWord().

◆ ReadData()

static UCHAR ReadData ( IN PUCHAR  ReadDataPort)
inlinestatic

Definition at line 35 of file hardware.c.

37 {
38  return READ_PORT_UCHAR(ReadDataPort);
39 }
#define READ_PORT_UCHAR(p)
Definition: pc98vid.h:22

Referenced by ReadByte(), and TryIsolate().

◆ ReadDmaChannel()

static USHORT ReadDmaChannel ( IN PUCHAR  ReadDataPort,
IN USHORT  Index 
)
inlinestatic

Definition at line 205 of file hardware.c.

208 {
209  return ReadByte(ReadDataPort, ISAPNP_DMACHANNEL(Index));
210 }
#define ISAPNP_DMACHANNEL(n)
Definition: isapnphw.h:33
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by ProbeIsaPnpBus().

◆ ReadIoBase()

static USHORT ReadIoBase ( IN PUCHAR  ReadDataPort,
IN USHORT  Index 
)
inlinestatic

Definition at line 175 of file hardware.c.

178 {
179  return ReadWord(ReadDataPort, ISAPNP_IOBASE(Index));
180 }
static USHORT ReadWord(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:66
_In_ WDFCOLLECTION _In_ ULONG Index
#define ISAPNP_IOBASE(n)
Definition: isapnphw.h:30

Referenced by ProbeIsaPnpBus().

◆ ReadIrqNo()

static USHORT ReadIrqNo ( IN PUCHAR  ReadDataPort,
IN USHORT  Index 
)
inlinestatic

Definition at line 185 of file hardware.c.

188 {
189  return ReadByte(ReadDataPort, ISAPNP_IRQNO(Index));
190 }
#define ISAPNP_IRQNO(n)
Definition: isapnphw.h:31
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55
_In_ WDFCOLLECTION _In_ ULONG Index

Referenced by ProbeIsaPnpBus().

◆ ReadIrqType()

static USHORT ReadIrqType ( IN PUCHAR  ReadDataPort,
IN USHORT  Index 
)
inlinestatic

Definition at line 195 of file hardware.c.

198 {
199  return ReadByte(ReadDataPort, ISAPNP_IRQTYPE(Index));
200 }
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55
_In_ WDFCOLLECTION _In_ ULONG Index
#define ISAPNP_IRQTYPE(n)
Definition: isapnphw.h:32

Referenced by ProbeIsaPnpBus().

◆ ReadResourceData()

static USHORT ReadResourceData ( IN PUCHAR  ReadDataPort)
inlinestatic

Definition at line 119 of file hardware.c.

121 {
122  return ReadByte(ReadDataPort, ISAPNP_RESOURCEDATA);
123 }
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55
#define ISAPNP_RESOURCEDATA
Definition: isapnphw.h:22

Referenced by PeekByte().

◆ ReadStatus()

static USHORT ReadStatus ( IN PUCHAR  ReadDataPort)
inlinestatic

Definition at line 128 of file hardware.c.

130 {
131  return ReadByte(ReadDataPort, ISAPNP_STATUS);
132 }
#define ISAPNP_STATUS
Definition: isapnphw.h:23
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55

Referenced by _MiSimpleWrite(), MiSimpleRead(), PeekByte(), PitLatchChannelCount(), and PitReadData().

◆ ReadTags()

static BOOLEAN ReadTags ( IN PUCHAR  ReadDataPort,
IN USHORT  LogDev,
IN OUT PISAPNP_LOGICAL_DEVICE  LogDevice 
)
static

Definition at line 310 of file hardware.c.

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 }
#define ISAPNP_IS_SMALL_TAG(t)
Definition: isapnphw.h:41
#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
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define TRUE
Definition: types.h:120
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
static USHORT PeekByte(IN PUCHAR ReadDataPort)
Definition: hardware.c:254
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
Definition: bufpool.h:45
#define ISAPNP_TAG_IRQ
Definition: isapnphw.h:47
#define ISAPNP_SMALL_TAG_LEN(t)
Definition: isapnphw.h:43
#define ISAPNP_TAG_LOGDEVID
Definition: isapnphw.h:45
_Must_inspect_result_ _In_ WDFDEVICE _In_ BOOLEAN _In_opt_ PVOID Tag
Definition: wdfdevice.h:4061
unsigned short USHORT
Definition: pedump.c:61
#define NULL
Definition: types.h:112
#define DPRINT1
Definition: precomp.h:8
#define ISAPNP_TAG_DMA
Definition: isapnphw.h:48
GLuint res
Definition: glext.h:9613
unsigned int ULONG
Definition: retypes.h:1
#define ISAPNP_TAG_IOPORT
Definition: isapnphw.h:51
#define ISAPNP_LARGE_TAG_NAME(t)
Definition: isapnphw.h:61
#define ISAPNP_TAG_END
Definition: isapnphw.h:58

Referenced by ProbeIsaPnpBus().

◆ ReadWord()

static USHORT ReadWord ( IN PUCHAR  ReadDataPort,
IN USHORT  Address 
)
inlinestatic

Definition at line 66 of file hardware.c.

69 {
70  return ((ReadByte(ReadDataPort, Address) << 8) |
71  (ReadByte(ReadDataPort, Address + 1)));
72 }
static WCHAR Address[46]
Definition: ping.c:68
static UCHAR ReadByte(IN PUCHAR ReadDataPort, IN USHORT Address)
Definition: hardware.c:55

Referenced by ReadIoBase().

◆ ResetCsn()

static VOID ResetCsn ( VOID  )
inlinestatic

Definition at line 102 of file hardware.c.

103 {
105 }
#define ISAPNP_CONFIG_RESET_CSN
Definition: isapnphw.h:37
#define ISAPNP_CONFIGCONTROL
Definition: isapnphw.h:20
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44

Referenced by TryIsolate().

◆ SendKey()

static VOID SendKey ( VOID  )
static

Definition at line 236 of file hardware.c.

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 }
static UCHAR NextLFSR(IN UCHAR Lfsr, IN UCHAR InputBit)
Definition: hardware.c:223
#define ISAPNP_LFSR_SEED
Definition: isapnphw.h:39
unsigned char UCHAR
Definition: xmlstorage.h:181
static VOID WriteAddress(IN USHORT Address)
Definition: hardware.c:17
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
static VOID HwDelay(VOID)
Definition: hardware.c:215

Referenced by DeviceActivation(), ProbeIsaPnpBus(), and TryIsolate().

◆ SetReadDataPort()

static VOID SetReadDataPort ( IN PUCHAR  ReadDataPort)
inlinestatic

Definition at line 77 of file hardware.c.

79 {
80  WriteByte(ISAPNP_READPORT, ((ULONG_PTR)ReadDataPort >> 2));
81 }
#define ISAPNP_READPORT
Definition: isapnphw.h:18
uint32_t ULONG_PTR
Definition: typedefs.h:65
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44

Referenced by TryIsolate().

◆ TryIsolate()

static INT TryIsolate ( IN PUCHAR  ReadDataPort)
static

Definition at line 394 of file hardware.c.

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 }
static VOID SetReadDataPort(IN PUCHAR ReadDataPort)
Definition: hardware.c:77
#define TRUE
Definition: types.h:120
unsigned char * PUCHAR
Definition: retypes.h:3
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG _In_opt_ PVOID Data
Definition: wdfdevice.h:4527
int32_t INT
Definition: typedefs.h:58
#define FALSE
Definition: types.h:117
unsigned char BOOLEAN
static VOID SendKey(VOID)
Definition: hardware.c:236
void DPRINT(...)
Definition: polytest.cpp:61
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 VOID WriteCsn(IN USHORT Csn)
Definition: hardware.c:137
static VOID Wake(IN USHORT Csn)
Definition: hardware.c:110
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
unsigned short USHORT
Definition: pedump.c:61
static USHORT IsaPnpChecksum(IN PISAPNP_IDENTIFIER Identifier)
Definition: hardware.c:289
unsigned char Byte
Definition: zlib.h:37
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
static VOID EnterIsolationState(VOID)
Definition: hardware.c:86
static VOID ResetCsn(VOID)
Definition: hardware.c:102
static VOID WaitForKey(VOID)
Definition: hardware.c:94
static UCHAR ReadData(IN PUCHAR ReadDataPort)
Definition: hardware.c:35
static VOID HwDelay(VOID)
Definition: hardware.c:215

Referenced by IsaHwTryReadDataPort().

◆ WaitForKey()

static VOID WaitForKey ( VOID  )
inlinestatic

Definition at line 94 of file hardware.c.

95 {
97 }
#define ISAPNP_CONFIG_WAIT_FOR_KEY
Definition: isapnphw.h:36
#define ISAPNP_CONFIGCONTROL
Definition: isapnphw.h:20
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44

Referenced by DeviceActivation(), IntelStackWalk(), ProbeIsaPnpBus(), and TryIsolate().

◆ Wake()

static VOID Wake ( IN USHORT  Csn)
inlinestatic

Definition at line 110 of file hardware.c.

112 {
113  WriteByte(ISAPNP_WAKE, Csn);
114 }
#define ISAPNP_WAKE
Definition: isapnphw.h:21
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44

Referenced by DECLARE_INTERFACE_(), DeviceActivation(), KsFilterRegisterPowerCallbacks(), KsPinRegisterPowerCallbacks(), ProbeIsaPnpBus(), and TryIsolate().

◆ WriteAddress()

static VOID WriteAddress ( IN USHORT  Address)
inlinestatic

Definition at line 17 of file hardware.c.

19 {
21 }
unsigned char * PUCHAR
Definition: retypes.h:3
static WCHAR Address[46]
Definition: ping.c:68
#define ISAPNP_ADDRESS
Definition: isapnphw.h:7
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21

Referenced by EnterIsolationState(), ReadByte(), SendKey(), and WriteByte().

◆ WriteByte()

static VOID WriteByte ( IN USHORT  Address,
IN USHORT  Value 
)
inlinestatic

Definition at line 44 of file hardware.c.

47 {
50 }
static VOID WriteData(IN USHORT Data)
Definition: hardware.c:26
static WCHAR Address[46]
Definition: ping.c:68
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
static VOID WriteAddress(IN USHORT Address)
Definition: hardware.c:17

Referenced by ActivateDevice(), DeactivateDevice(), ResetCsn(), SetReadDataPort(), WaitForKey(), Wake(), WriteCsn(), and WriteLogicalDeviceNumber().

◆ WriteCsn()

static VOID WriteCsn ( IN USHORT  Csn)
inlinestatic

Definition at line 137 of file hardware.c.

139 {
141 }
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44
#define ISAPNP_CARDSELECTNUMBER
Definition: isapnphw.h:24

Referenced by TryIsolate().

◆ WriteData()

static VOID WriteData ( IN USHORT  Data)
inlinestatic

Definition at line 26 of file hardware.c.

28 {
30 }
unsigned char * PUCHAR
Definition: retypes.h:3
#define WRITE_PORT_UCHAR(p, d)
Definition: pc98vid.h:21
#define ISAPNP_WRITE_DATA
Definition: isapnphw.h:8

Referenced by _MiFlushMappedSection(), DECLARE_INTERFACE_(), and WriteByte().

◆ WriteLogicalDeviceNumber()

static VOID WriteLogicalDeviceNumber ( IN USHORT  LogDev)
inlinestatic

Definition at line 146 of file hardware.c.

148 {
150 }
#define ISAPNP_LOGICALDEVICENUMBER
Definition: isapnphw.h:25
static VOID WriteByte(IN USHORT Address, IN USHORT Value)
Definition: hardware.c:44

Referenced by ActivateDevice(), DeactivateDevice(), and ProbeIsaPnpBus().