ReactOS  0.4.14-dev-114-gc8cbd56
hardware.c File Reference
#include <isapnp.h>
#include <isapnphw.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 (USHORT Address)
 
static VOID WriteData (USHORT Data)
 
static UCHAR ReadData (PUCHAR ReadDataPort)
 
static VOID WriteByte (USHORT Address, USHORT Value)
 
static UCHAR ReadByte (PUCHAR ReadDataPort, USHORT Address)
 
static USHORT ReadWord (PUCHAR ReadDataPort, USHORT Address)
 
static VOID SetReadDataPort (PUCHAR ReadDataPort)
 
static VOID EnterIsolationState (VOID)
 
static VOID WaitForKey (VOID)
 
static VOID ResetCsn (VOID)
 
static VOID Wake (USHORT Csn)
 
static USHORT ReadResourceData (PUCHAR ReadDataPort)
 
static USHORT ReadStatus (PUCHAR ReadDataPort)
 
static VOID WriteCsn (USHORT Csn)
 
static VOID WriteLogicalDeviceNumber (USHORT LogDev)
 
static VOID ActivateDevice (USHORT LogDev)
 
static VOID DeactivateDevice (USHORT LogDev)
 
static USHORT ReadIoBase (PUCHAR ReadDataPort, USHORT Index)
 
static USHORT ReadIrqNo (PUCHAR ReadDataPort, USHORT Index)
 
static VOID HwDelay (VOID)
 
static USHORT NextLFSR (USHORT Lfsr, USHORT InputBit)
 
static VOID SendKey (VOID)
 
static USHORT PeekByte (PUCHAR ReadDataPort)
 
static VOID Peek (PUCHAR ReadDataPort, PVOID Buffer, ULONG Length)
 
static USHORT IsaPnpChecksum (PISAPNP_IDENTIFIER Identifier)
 
static BOOLEAN FindTag (PUCHAR ReadDataPort, USHORT WantedTag, PVOID Buffer, ULONG Length)
 
static BOOLEAN FindLogDevId (PUCHAR ReadDataPort, USHORT LogDev, PISAPNP_LOGDEVID LogDeviceId)
 
static INT TryIsolate (PUCHAR ReadDataPort)
 
static PUCHAR Isolate (VOID)
 
VOID DeviceActivation (PISAPNP_LOGICAL_DEVICE IsaDevice, BOOLEAN Activate)
 
NTSTATUS ProbeIsaPnpBus (PISAPNP_FDO_EXTENSION FdoExt)
 
NTSTATUS NTAPI IsaHwDetectReadDataPort (IN PISAPNP_FDO_EXTENSION FdoExt)
 
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 ( USHORT  LogDev)
inlinestatic

Definition at line 140 of file hardware.c.

141 {
142  WriteLogicalDeviceNumber(LogDev);
144 }
#define ISAPNP_ACTIVATE
Definition: isapnphw.h:27
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41
static VOID WriteLogicalDeviceNumber(USHORT LogDev)
Definition: hardware.c:132

Referenced by DeviceActivation().

◆ DeactivateDevice()

static VOID DeactivateDevice ( USHORT  LogDev)
inlinestatic

Definition at line 149 of file hardware.c.

150 {
151  WriteLogicalDeviceNumber(LogDev);
153 }
#define ISAPNP_ACTIVATE
Definition: isapnphw.h:27
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41
static VOID WriteLogicalDeviceNumber(USHORT LogDev)
Definition: hardware.c:132

Referenced by DeviceActivation().

◆ DeviceActivation()

VOID DeviceActivation ( PISAPNP_LOGICAL_DEVICE  IsaDevice,
BOOLEAN  Activate 
)

Definition at line 441 of file hardware.c.

443 {
444  WaitForKey();
445  SendKey();
446  Wake(IsaDevice->CSN);
447 
448  if (Activate)
449  ActivateDevice(IsaDevice->LDN);
450  else
451  DeactivateDevice(IsaDevice->LDN);
452 
453  HwDelay();
454 
455  WaitForKey();
456 }
static VOID Wake(USHORT Csn)
Definition: hardware.c:100
static VOID SendKey(VOID)
Definition: hardware.c:193
static VOID DeactivateDevice(USHORT LogDev)
Definition: hardware.c:149
static VOID ActivateDevice(USHORT LogDev)
Definition: hardware.c:140
static VOID WaitForKey(VOID)
Definition: hardware.c:84
static VOID HwDelay(VOID)
Definition: hardware.c:174

Referenced by IsaHwActivateDevice(), and IsaHwDeactivateDevice().

◆ EnterIsolationState()

static VOID EnterIsolationState ( VOID  )
inlinestatic

Definition at line 76 of file hardware.c.

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

Referenced by TryIsolate().

◆ FindLogDevId()

static BOOLEAN FindLogDevId ( PUCHAR  ReadDataPort,
USHORT  LogDev,
PISAPNP_LOGDEVID  LogDeviceId 
)
static

Definition at line 300 of file hardware.c.

301 {
302  USHORT i;
303 
304  for (i = 0; i <= LogDev; i++)
305  {
306  if (!FindTag(ReadDataPort, ISAPNP_TAG_LOGDEVID, LogDeviceId, sizeof(*LogDeviceId)))
307  return FALSE;
308  }
309 
310  return TRUE;
311 }
#define TRUE
Definition: types.h:120
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 BOOLEAN FindTag(PUCHAR ReadDataPort, USHORT WantedTag, PVOID Buffer, ULONG Length)
Definition: hardware.c:262
#define ISAPNP_TAG_LOGDEVID
Definition: isapnphw.h:44
unsigned short USHORT
Definition: pedump.c:61

Referenced by ProbeIsaPnpBus().

◆ FindTag()

static BOOLEAN FindTag ( PUCHAR  ReadDataPort,
USHORT  WantedTag,
PVOID  Buffer,
ULONG  Length 
)
static

Definition at line 262 of file hardware.c.

263 {
264  USHORT Tag, TagLen;
265 
266  do
267  {
268  Tag = PeekByte(ReadDataPort);
270  {
271  TagLen = ISAPNP_SMALL_TAG_LEN(Tag);
273  }
274  else
275  {
276  TagLen = PeekByte(ReadDataPort) + (PeekByte(ReadDataPort) << 8);
278  }
279 
280  if (Tag == WantedTag)
281  {
282  if (Length > TagLen)
283  Length = TagLen;
284 
285  Peek(ReadDataPort, Buffer, Length);
286 
287  return TRUE;
288  }
289  else
290  {
291  Peek(ReadDataPort, NULL, Length);
292  }
293  } while (Tag != ISAPNP_TAG_END);
294 
295  return FALSE;
296 }
#define TRUE
Definition: types.h:120
#define ISAPNP_IS_SMALL_TAG(t)
Definition: isapnphw.h:40
#define ISAPNP_SMALL_TAG_NAME(t)
Definition: isapnphw.h:41
smooth NULL
Definition: ftsmooth.c:416
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
#define ISAPNP_SMALL_TAG_LEN(t)
Definition: isapnphw.h:42
static VOID Peek(PUCHAR ReadDataPort, PVOID Buffer, ULONG Length)
Definition: hardware.c:228
unsigned short USHORT
Definition: pedump.c:61
static USHORT PeekByte(PUCHAR ReadDataPort)
Definition: hardware.c:211
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define ISAPNP_LARGE_TAG_NAME(t)
Definition: isapnphw.h:60
#define ISAPNP_TAG_END
Definition: isapnphw.h:57

Referenced by FindLogDevId().

◆ HwDelay()

static VOID HwDelay ( VOID  )
inlinestatic

Definition at line 174 of file hardware.c.

175 {
177 }
VOID NTAPI KeStallExecutionProcessor(IN ULONG MicroSeconds)
Definition: ntoskrnl.c:99

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

◆ IsaHwActivateDevice()

NTSTATUS NTAPI IsaHwActivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 554 of file hardware.c.

556 {
557  DeviceActivation(LogicalDevice,
558  TRUE);
559 
560  return STATUS_SUCCESS;
561 }
#define TRUE
Definition: types.h:120
VOID DeviceActivation(PISAPNP_LOGICAL_DEVICE IsaDevice, BOOLEAN Activate)
Definition: hardware.c:441
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by IsaPdoPnp().

◆ IsaHwDeactivateDevice()

NTSTATUS NTAPI IsaHwDeactivateDevice ( IN PISAPNP_LOGICAL_DEVICE  LogicalDevice)

Definition at line 565 of file hardware.c.

567 {
568  DeviceActivation(LogicalDevice,
569  FALSE);
570 
571  return STATUS_SUCCESS;
572 }
VOID DeviceActivation(PISAPNP_LOGICAL_DEVICE IsaDevice, BOOLEAN Activate)
Definition: hardware.c:441
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by IsaPdoPnp().

◆ IsaHwDetectReadDataPort()

NTSTATUS NTAPI IsaHwDetectReadDataPort ( IN PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 537 of file hardware.c.

539 {
540  FdoExt->ReadDataPort = Isolate();
541  if (!FdoExt->ReadDataPort)
542  {
543  DPRINT1("No read data port found\n");
544  return STATUS_UNSUCCESSFUL;
545  }
546 
547  DPRINT1("Detected read data port at 0x%p\n", FdoExt->ReadDataPort);
548 
549  return STATUS_SUCCESS;
550 }
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
static PUCHAR Isolate(VOID)
Definition: hardware.c:420
#define DPRINT1
Definition: precomp.h:8
return STATUS_SUCCESS
Definition: btrfs.c:2966

Referenced by IsaFdoStartDevice().

◆ IsaHwFillDeviceList()

NTSTATUS NTAPI IsaHwFillDeviceList ( IN PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 576 of file hardware.c.

578 {
579  return ProbeIsaPnpBus(FdoExt);
580 }
NTSTATUS ProbeIsaPnpBus(PISAPNP_FDO_EXTENSION FdoExt)
Definition: hardware.c:459

Referenced by IsaFdoQueryDeviceRelations().

◆ IsaPnpChecksum()

static USHORT IsaPnpChecksum ( PISAPNP_IDENTIFIER  Identifier)
static

Definition at line 242 of file hardware.c.

243 {
244  USHORT i,j, Lfsr, Byte;
245 
246  Lfsr = ISAPNP_LFSR_SEED;
247  for (i = 0; i < 8; i++)
248  {
249  Byte = *(((PUCHAR)Identifier) + i);
250  for (j = 0; j < 8; j++)
251  {
252  Lfsr = NextLFSR(Lfsr, Byte);
253  Byte >>= 1;
254  }
255  }
256 
257  return Lfsr;
258 }
unsigned char Byte
Definition: zconf.h:391
unsigned char * PUCHAR
Definition: retypes.h:3
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
#define ISAPNP_LFSR_SEED
Definition: isapnphw.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
unsigned short USHORT
Definition: pedump.c:61
static USHORT NextLFSR(USHORT Lfsr, USHORT InputBit)
Definition: hardware.c:182

Referenced by TryIsolate().

◆ Isolate()

static PUCHAR Isolate ( VOID  )
static

Definition at line 420 of file hardware.c.

421 {
423 
427  {
428  /* Avoid the NE2000 probe space */
429  if ((ULONG_PTR)ReadPort >= 0x280 &&
430  (ULONG_PTR)ReadPort <= 0x380)
431  continue;
432 
433  if (TryIsolate(ReadPort) > 0)
434  return ReadPort;
435  }
436 
437  return 0;
438 }
#define ISAPNP_READ_PORT_MAX
Definition: isapnphw.h:12
unsigned char * PUCHAR
Definition: retypes.h:3
#define ISAPNP_READ_PORT_STEP
Definition: isapnphw.h:13
BOOL WINAPI ReadPort(_In_ HANDLE hPort, _Out_writes_bytes_(cbBuffer) LPBYTE pBuffer, _In_ DWORD cbBuffer, _Out_ LPDWORD pcbRead)
uint32_t ULONG_PTR
Definition: typedefs.h:63
static INT TryIsolate(PUCHAR ReadDataPort)
Definition: hardware.c:315
#define ISAPNP_READ_PORT_START
Definition: isapnphw.h:11
#define ULONG_PTR
Definition: config.h:101

Referenced by IsaHwDetectReadDataPort().

◆ NextLFSR()

static USHORT NextLFSR ( USHORT  Lfsr,
USHORT  InputBit 
)
inlinestatic

Definition at line 182 of file hardware.c.

183 {
184  ULONG NextLfsr = Lfsr >> 1;
185 
186  NextLfsr |= (((Lfsr ^ NextLfsr) ^ InputBit)) << 7;
187 
188  return NextLfsr;
189 }
unsigned int ULONG
Definition: retypes.h:1

Referenced by IsaPnpChecksum(), and SendKey().

◆ Peek()

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

Definition at line 228 of file hardware.c.

229 {
230  USHORT i, byte;
231 
232  for (i = 0; i < Length; i++)
233  {
234  byte = PeekByte(ReadDataPort);
235  if (Buffer)
236  *((PUCHAR)Buffer + i) = byte;
237  }
238 }
unsigned char * PUCHAR
Definition: retypes.h:3
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
Definition: bufpool.h:45
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
unsigned short USHORT
Definition: pedump.c:61
#define byte(x, n)
Definition: tomcrypt.h:118
static USHORT PeekByte(PUCHAR ReadDataPort)
Definition: hardware.c:211

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

◆ PeekByte()

static USHORT PeekByte ( PUCHAR  ReadDataPort)
static

Definition at line 211 of file hardware.c.

212 {
213  USHORT i;
214 
215  for (i = 0; i < 20; i++)
216  {
217  if (ReadStatus(ReadDataPort) & 0x01)
218  return ReadResourceData(ReadDataPort);
219 
220  HwDelay();
221  }
222 
223  return 0xFF;
224 }
static USHORT ReadResourceData(PUCHAR ReadDataPort)
Definition: hardware.c:108
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 ReadStatus(PUCHAR ReadDataPort)
Definition: hardware.c:116
static VOID HwDelay(VOID)
Definition: hardware.c:174

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

◆ ProbeIsaPnpBus()

NTSTATUS ProbeIsaPnpBus ( PISAPNP_FDO_EXTENSION  FdoExt)

Definition at line 459 of file hardware.c.

460 {
461  PISAPNP_LOGICAL_DEVICE LogDevice;
462  ISAPNP_IDENTIFIER Identifier;
463  ISAPNP_LOGDEVID LogDevId;
464  USHORT Csn;
465  USHORT LogDev;
468 
469  ASSERT(FdoExt->ReadDataPort);
470 
471  for (Csn = 1; Csn <= 0xFF; Csn++)
472  {
473  for (LogDev = 0; LogDev <= 0xFF; LogDev++)
474  {
475  Status = IoCreateDevice(FdoExt->Common.Self->DriverObject,
476  sizeof(ISAPNP_LOGICAL_DEVICE),
477  NULL,
480  FALSE,
481  &Pdo);
482  if (!NT_SUCCESS(Status))
483  return Status;
484 
486 
487  LogDevice = Pdo->DeviceExtension;
488 
489  RtlZeroMemory(LogDevice, sizeof(ISAPNP_LOGICAL_DEVICE));
490 
491  LogDevice->Common.Self = Pdo;
492  LogDevice->Common.IsFdo = FALSE;
493  LogDevice->Common.State = dsStopped;
494 
495  LogDevice->CSN = Csn;
496  LogDevice->LDN = LogDev;
497 
498  WaitForKey();
499  SendKey();
500  Wake(Csn);
501 
502  Peek(FdoExt->ReadDataPort, &Identifier, sizeof(Identifier));
503 
504  if (Identifier.VendorId & 0x80)
505  {
506  IoDeleteDevice(LogDevice->Common.Self);
507  return STATUS_SUCCESS;
508  }
509 
510  if (!FindLogDevId(FdoExt->ReadDataPort, LogDev, &LogDevId))
511  break;
512 
513  WriteLogicalDeviceNumber(LogDev);
514 
515  LogDevice->VendorId = LogDevId.VendorId;
516  LogDevice->ProdId = LogDevId.ProdId;
517  LogDevice->IoAddr = ReadIoBase(FdoExt->ReadDataPort, 0);
518  LogDevice->IrqNo = ReadIrqNo(FdoExt->ReadDataPort, 0);
519 
520  DPRINT1("Detected ISA PnP device - VID: 0x%x PID: 0x%x IoBase: 0x%x IRQ:0x%x\n",
521  LogDevice->VendorId, LogDevice->ProdId, LogDevice->IoAddr, LogDevice->IrqNo);
522 
523  WaitForKey();
524 
526 
527  InsertTailList(&FdoExt->DeviceListHead, &LogDevice->ListEntry);
528  FdoExt->DeviceCount++;
529  }
530  }
531 
532  return STATUS_SUCCESS;
533 }
#define DO_DEVICE_INITIALIZING
Definition: env_spec_w32.h:399
_In_ PDEVICE_OBJECT Pdo
Definition: classpnp.h:301
LIST_ENTRY DeviceListHead
Definition: isapnp.h:27
LONG NTSTATUS
Definition: precomp.h:26
#define InsertTailList(ListHead, Entry)
USHORT ProdId
Definition: isapnphw.h:94
static USHORT ReadIrqNo(PUCHAR ReadDataPort, USHORT Index)
Definition: hardware.c:166
static VOID Wake(USHORT Csn)
Definition: hardware.c:100
#define FILE_DEVICE_CONTROLLER
Definition: winioctl.h:109
PVOID DeviceExtension
Definition: env_spec_w32.h:418
smooth NULL
Definition: ftsmooth.c:416
#define DO_BUS_ENUMERATED_DEVICE
static VOID SendKey(VOID)
Definition: hardware.c:193
LIST_ENTRY ListEntry
Definition: isapnp.h:41
ISAPNP_DEVICE_STATE State
Definition: isapnp.h:20
static USHORT ReadIoBase(PUCHAR ReadDataPort, USHORT Index)
Definition: hardware.c:158
USHORT VendorId
Definition: isapnphw.h:93
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
static BOOLEAN FindLogDevId(PUCHAR ReadDataPort, USHORT LogDev, PISAPNP_LOGDEVID LogDeviceId)
Definition: hardware.c:300
ISAPNP_COMMON_EXTENSION Common
Definition: isapnp.h:24
static VOID WriteLogicalDeviceNumber(USHORT LogDev)
Definition: hardware.c:132
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
ISAPNP_COMMON_EXTENSION Common
Definition: isapnp.h:34
static VOID Peek(PUCHAR ReadDataPort, PVOID Buffer, ULONG Length)
Definition: hardware.c:228
Status
Definition: gdiplustypes.h:24
VOID NTAPI IoDeleteDevice(IN PDEVICE_OBJECT DeviceObject)
Definition: device.c:1251
unsigned short USHORT
Definition: pedump.c:61
PUCHAR ReadDataPort
Definition: isapnp.h:29
#define DPRINT1
Definition: precomp.h:8
NTSTATUS NTAPI IoCreateDevice(IN PDRIVER_OBJECT DriverObject, IN ULONG DeviceExtensionSize, IN PUNICODE_STRING DeviceName, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics, IN BOOLEAN Exclusive, OUT PDEVICE_OBJECT *DeviceObject)
Definition: device.c:1031
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
#define FILE_DEVICE_SECURE_OPEN
Definition: cdrw_usr.h:46
return STATUS_SUCCESS
Definition: btrfs.c:2966
PDEVICE_OBJECT Self
Definition: isapnp.h:18
static VOID WaitForKey(VOID)
Definition: hardware.c:84

Referenced by IsaHwFillDeviceList().

◆ ReadByte()

static UCHAR ReadByte ( PUCHAR  ReadDataPort,
USHORT  Address 
)
inlinestatic

Definition at line 50 of file hardware.c.

51 {
53  return ReadData(ReadDataPort);
54 }
static VOID WriteAddress(USHORT Address)
Definition: hardware.c:17
static WCHAR Address[46]
Definition: ping.c:68
static UCHAR ReadData(PUCHAR ReadDataPort)
Definition: hardware.c:33

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

◆ ReadData()

static UCHAR ReadData ( PUCHAR  ReadDataPort)
inlinestatic

Definition at line 33 of file hardware.c.

34 {
35  return READ_PORT_UCHAR(ReadDataPort);
36 }
UCHAR NTAPI READ_PORT_UCHAR(PUCHAR Address)
Definition: mach.c:528

Referenced by ReadByte(), and TryIsolate().

◆ ReadIoBase()

static USHORT ReadIoBase ( PUCHAR  ReadDataPort,
USHORT  Index 
)
inlinestatic

Definition at line 158 of file hardware.c.

159 {
160  return ReadWord(ReadDataPort, ISAPNP_IOBASE(Index));
161 }
static USHORT ReadWord(PUCHAR ReadDataPort, USHORT Address)
Definition: hardware.c:59
static const UCHAR Index[8]
Definition: usbohci.c:18
#define ISAPNP_IOBASE(n)
Definition: isapnphw.h:30

Referenced by ProbeIsaPnpBus().

◆ ReadIrqNo()

static USHORT ReadIrqNo ( PUCHAR  ReadDataPort,
USHORT  Index 
)
inlinestatic

Definition at line 166 of file hardware.c.

167 {
168  return ReadByte(ReadDataPort, ISAPNP_IRQNO(Index));
169 }
#define ISAPNP_IRQNO(n)
Definition: isapnphw.h:31
static UCHAR ReadByte(PUCHAR ReadDataPort, USHORT Address)
Definition: hardware.c:50
static const UCHAR Index[8]
Definition: usbohci.c:18

Referenced by ProbeIsaPnpBus().

◆ ReadResourceData()

static USHORT ReadResourceData ( PUCHAR  ReadDataPort)
inlinestatic

Definition at line 108 of file hardware.c.

109 {
110  return ReadByte(ReadDataPort, ISAPNP_RESOURCEDATA);
111 }
static UCHAR ReadByte(PUCHAR ReadDataPort, USHORT Address)
Definition: hardware.c:50
#define ISAPNP_RESOURCEDATA
Definition: isapnphw.h:22

Referenced by PeekByte().

◆ ReadStatus()

static USHORT ReadStatus ( PUCHAR  ReadDataPort)
inlinestatic

Definition at line 116 of file hardware.c.

117 {
118  return ReadByte(ReadDataPort, ISAPNP_STATUS);
119 }
#define ISAPNP_STATUS
Definition: isapnphw.h:23
static UCHAR ReadByte(PUCHAR ReadDataPort, USHORT Address)
Definition: hardware.c:50

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

◆ ReadWord()

static USHORT ReadWord ( PUCHAR  ReadDataPort,
USHORT  Address 
)
inlinestatic

Definition at line 59 of file hardware.c.

60 {
61  return ((ReadByte(ReadDataPort, Address) << 8) |
62  (ReadByte(ReadDataPort, Address + 1)));
63 }
static UCHAR ReadByte(PUCHAR ReadDataPort, USHORT Address)
Definition: hardware.c:50
static WCHAR Address[46]
Definition: ping.c:68

Referenced by ReadIoBase().

◆ ResetCsn()

static VOID ResetCsn ( VOID  )
inlinestatic

Definition at line 92 of file hardware.c.

93 {
95 }
#define ISAPNP_CONFIG_RESET_CSN
Definition: isapnphw.h:36
#define ISAPNP_CONFIGCONTROL
Definition: isapnphw.h:20
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41

Referenced by TryIsolate().

◆ SendKey()

static VOID SendKey ( VOID  )
static

Definition at line 193 of file hardware.c.

194 {
195  USHORT i, Lfsr;
196 
197  HwDelay();
198  WriteAddress(0x00);
199  WriteAddress(0x00);
200 
201  Lfsr = ISAPNP_LFSR_SEED;
202  for (i = 0; i < 32; i++)
203  {
204  WriteAddress(Lfsr);
205  Lfsr = NextLFSR(Lfsr, 0);
206  }
207 }
static VOID WriteAddress(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
#define ISAPNP_LFSR_SEED
Definition: isapnphw.h:38
unsigned short USHORT
Definition: pedump.c:61
static USHORT NextLFSR(USHORT Lfsr, USHORT InputBit)
Definition: hardware.c:182
static VOID HwDelay(VOID)
Definition: hardware.c:174

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

◆ SetReadDataPort()

static VOID SetReadDataPort ( PUCHAR  ReadDataPort)
inlinestatic

Definition at line 68 of file hardware.c.

69 {
70  WriteByte(ISAPNP_READPORT, ((ULONG_PTR)ReadDataPort >> 2));
71 }
#define ISAPNP_READPORT
Definition: isapnphw.h:18
uint32_t ULONG_PTR
Definition: typedefs.h:63
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41

Referenced by TryIsolate().

◆ TryIsolate()

static INT TryIsolate ( PUCHAR  ReadDataPort)
static

Definition at line 315 of file hardware.c.

316 {
317  ISAPNP_IDENTIFIER Identifier;
318  USHORT i, j;
319  BOOLEAN Seen55aa, SeenLife;
320  INT Csn = 0;
321  USHORT Byte, Data;
322 
323  DPRINT("Setting read data port: 0x%p\n", ReadDataPort);
324 
325  WaitForKey();
326  SendKey();
327 
328  ResetCsn();
329  HwDelay();
330  HwDelay();
331 
332  WaitForKey();
333  SendKey();
334  Wake(0x00);
335 
336  SetReadDataPort(ReadDataPort);
337  HwDelay();
338 
339  while (TRUE)
340  {
342  HwDelay();
343 
344  RtlZeroMemory(&Identifier, sizeof(Identifier));
345 
346  Seen55aa = SeenLife = FALSE;
347  for (i = 0; i < 9; i++)
348  {
349  Byte = 0;
350  for (j = 0; j < 8; j++)
351  {
352  Data = ReadData(ReadDataPort);
353  HwDelay();
354  Data = ((Data << 8) | ReadData(ReadDataPort));
355  HwDelay();
356  Byte >>= 1;
357 
358  if (Data != 0xFFFF)
359  {
360  SeenLife = TRUE;
361  if (Data == 0x55AA)
362  {
363  Byte |= 0x80;
364  Seen55aa = TRUE;
365  }
366  }
367  }
368  *(((PUCHAR)&Identifier) + i) = Byte;
369  }
370 
371  if (!Seen55aa)
372  {
373  if (Csn)
374  {
375  DPRINT("Found no more cards\n");
376  }
377  else
378  {
379  if (SeenLife)
380  {
381  DPRINT("Saw life but no cards, trying new read port\n");
382  Csn = -1;
383  }
384  else
385  {
386  DPRINT("Saw no sign of life, abandoning isolation\n");
387  }
388  }
389  break;
390  }
391 
392  if (Identifier.Checksum != IsaPnpChecksum(&Identifier))
393  {
394  DPRINT("Bad checksum, trying next read data port\n");
395  Csn = -1;
396  break;
397  }
398 
399  Csn++;
400 
401  WriteCsn(Csn);
402  HwDelay();
403 
404  Wake(0x00);
405  HwDelay();
406  }
407 
408  WaitForKey();
409 
410  if (Csn > 0)
411  {
412  DPRINT("Found %d cards at read port 0x%p\n", Csn, ReadDataPort);
413  }
414 
415  return Csn;
416 }
#define TRUE
Definition: types.h:120
unsigned char Byte
Definition: zconf.h:391
unsigned char * PUCHAR
Definition: retypes.h:3
int32_t INT
Definition: typedefs.h:56
static VOID Wake(USHORT Csn)
Definition: hardware.c:100
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 SetReadDataPort(PUCHAR ReadDataPort)
Definition: hardware.c:68
unsigned char BOOLEAN
_In_ LPGUID _In_ PVOID Data
Definition: classpnp.h:778
static VOID SendKey(VOID)
Definition: hardware.c:193
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(USHORT Csn)
Definition: hardware.c:124
static USHORT IsaPnpChecksum(PISAPNP_IDENTIFIER Identifier)
Definition: hardware.c:242
unsigned short USHORT
Definition: pedump.c:61
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
static VOID EnterIsolationState(VOID)
Definition: hardware.c:76
static UCHAR ReadData(PUCHAR ReadDataPort)
Definition: hardware.c:33
static VOID ResetCsn(VOID)
Definition: hardware.c:92
static VOID WaitForKey(VOID)
Definition: hardware.c:84
static VOID HwDelay(VOID)
Definition: hardware.c:174

Referenced by Isolate().

◆ WaitForKey()

static VOID WaitForKey ( VOID  )
inlinestatic

Definition at line 84 of file hardware.c.

85 {
87 }
#define ISAPNP_CONFIG_WAIT_FOR_KEY
Definition: isapnphw.h:35
#define ISAPNP_CONFIGCONTROL
Definition: isapnphw.h:20
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41

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

◆ Wake()

static VOID Wake ( USHORT  Csn)
inlinestatic

Definition at line 100 of file hardware.c.

101 {
102  WriteByte(ISAPNP_WAKE, Csn);
103 }
#define ISAPNP_WAKE
Definition: isapnphw.h:21
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41

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

◆ WriteAddress()

static VOID WriteAddress ( USHORT  Address)
inlinestatic

Definition at line 17 of file hardware.c.

18 {
20 }
unsigned char * PUCHAR
Definition: retypes.h:3
static WCHAR Address[46]
Definition: ping.c:68
#define ISAPNP_ADDRESS
Definition: isapnphw.h:7
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532

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

◆ WriteByte()

static VOID WriteByte ( USHORT  Address,
USHORT  Value 
)
inlinestatic

Definition at line 41 of file hardware.c.

42 {
45 }
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
static VOID WriteAddress(USHORT Address)
Definition: hardware.c:17
static WCHAR Address[46]
Definition: ping.c:68
static VOID WriteData(USHORT Data)
Definition: hardware.c:25

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

◆ WriteCsn()

static VOID WriteCsn ( USHORT  Csn)
inlinestatic

Definition at line 124 of file hardware.c.

125 {
127 }
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41
#define ISAPNP_CARDSELECTNUMBER
Definition: isapnphw.h:24

Referenced by TryIsolate().

◆ WriteData()

static VOID WriteData ( USHORT  Data)
inlinestatic

Definition at line 25 of file hardware.c.

26 {
28 }
unsigned char * PUCHAR
Definition: retypes.h:3
void WRITE_PORT_UCHAR(PUCHAR Address, UCHAR Value)
Definition: mach.c:532
#define ISAPNP_WRITE_DATA
Definition: isapnphw.h:8

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

◆ WriteLogicalDeviceNumber()

static VOID WriteLogicalDeviceNumber ( USHORT  LogDev)
inlinestatic

Definition at line 132 of file hardware.c.

133 {
135 }
static VOID WriteByte(USHORT Address, USHORT Value)
Definition: hardware.c:41
#define ISAPNP_LOGICALDEVICENUMBER
Definition: isapnphw.h:25

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