2021-03-04 12:42:42 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS ISA PnP Bus driver
|
|
|
|
* LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
|
|
|
|
* PURPOSE: Hardware definitions
|
|
|
|
* COPYRIGHT: Copyright 2010 Cameron Gutman <cameron.gutman@reactos.org>
|
|
|
|
* Copyright 2020 Hervé Poussineau <hpoussin@reactos.org>
|
2021-03-20 14:50:34 +00:00
|
|
|
* Copyright 2021 Dmitry Borisov <di.sean@protonmail.com>
|
2021-03-04 12:42:42 +00:00
|
|
|
*/
|
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2024-10-07 14:10:08 +00:00
|
|
|
#define ISAPNP_ADDRESS_PCAT 0x279
|
|
|
|
#define ISAPNP_WRITE_DATA_PCAT 0xA79
|
|
|
|
|
|
|
|
#define ISAPNP_ADDRESS_PC98 0x259
|
|
|
|
#define ISAPNP_WRITE_DATA_PC98 0xA59
|
2010-04-07 20:19:29 +00:00
|
|
|
|
|
|
|
#define ISAPNP_READPORT 0x00
|
|
|
|
#define ISAPNP_SERIALISOLATION 0x01
|
|
|
|
#define ISAPNP_CONFIGCONTROL 0x02
|
|
|
|
#define ISAPNP_WAKE 0x03
|
|
|
|
#define ISAPNP_RESOURCEDATA 0x04
|
|
|
|
#define ISAPNP_STATUS 0x05
|
|
|
|
#define ISAPNP_CARDSELECTNUMBER 0x06
|
|
|
|
#define ISAPNP_LOGICALDEVICENUMBER 0x07
|
|
|
|
|
|
|
|
#define ISAPNP_ACTIVATE 0x30
|
|
|
|
#define ISAPNP_IORANGECHECK 0x31
|
|
|
|
|
2021-03-20 14:51:05 +00:00
|
|
|
#define ISAPNP_MEMBASE(n) (0x40 + ((n) * 8))
|
|
|
|
#define ISAPNP_MEMCONTROL(n) (0x42 + ((n) * 8))
|
|
|
|
#define MEMORY_UPPER_LIMIT 0x01
|
2021-03-20 14:53:54 +00:00
|
|
|
#define MEMORY_USE_8_BIT_DECODER 0x00
|
|
|
|
#define MEMORY_USE_16_BIT_DECODER 0x02
|
|
|
|
#define MEMORY_USE_32_BIT_DECODER 0x06
|
2021-03-20 14:51:05 +00:00
|
|
|
#define ISAPNP_MEMLIMIT(n) (0x43 + ((n) * 8))
|
2010-04-07 20:19:29 +00:00
|
|
|
#define ISAPNP_IOBASE(n) (0x60 + ((n)*2))
|
|
|
|
#define ISAPNP_IRQNO(n) (0x70 + ((n)*2))
|
|
|
|
#define ISAPNP_IRQTYPE(n) (0x71 + ((n) * 2))
|
2021-03-20 14:53:54 +00:00
|
|
|
#define IRQTYPE_LOW_LEVEL 0x01
|
|
|
|
#define IRQTYPE_HIGH_EDGE 0x02
|
2020-03-22 22:23:04 +00:00
|
|
|
#define ISAPNP_DMACHANNEL(n) (0x74 + (n))
|
2024-05-03 14:42:21 +00:00
|
|
|
#define DMACHANNEL_NONE 4
|
2021-03-20 14:51:05 +00:00
|
|
|
#define ISAPNP_MEMBASE32(n) ((n) == 0 ? 0x76 : (0x70 + (n) * 16))
|
|
|
|
#define ISAPNP_MEMCONTROL32(n) ((n) == 0 ? 0x7A : (0x74 + (n) * 16))
|
|
|
|
#define ISAPNP_MEMLIMIT32(n) ((n) == 0 ? 0x7B : (0x75 + (n) * 16))
|
2010-04-07 20:19:29 +00:00
|
|
|
|
|
|
|
#define ISAPNP_CONFIG_RESET (1 << 0)
|
|
|
|
#define ISAPNP_CONFIG_WAIT_FOR_KEY (1 << 1)
|
|
|
|
#define ISAPNP_CONFIG_RESET_CSN (1 << 2)
|
|
|
|
|
|
|
|
#define ISAPNP_LFSR_SEED 0x6A
|
|
|
|
|
|
|
|
#define ISAPNP_IS_SMALL_TAG(t) (!((t) & 0x80))
|
|
|
|
#define ISAPNP_SMALL_TAG_NAME(t) (((t) >> 3) & 0xF)
|
|
|
|
#define ISAPNP_SMALL_TAG_LEN(t) (((t) & 0x7))
|
|
|
|
#define ISAPNP_TAG_PNPVERNO 0x01
|
|
|
|
#define ISAPNP_TAG_LOGDEVID 0x02
|
|
|
|
#define ISAPNP_TAG_COMPATDEVID 0x03
|
|
|
|
#define ISAPNP_TAG_IRQ 0x04
|
|
|
|
#define ISAPNP_TAG_DMA 0x05
|
|
|
|
#define ISAPNP_TAG_STARTDEP 0x06
|
|
|
|
#define ISAPNP_TAG_ENDDEP 0x07
|
|
|
|
#define ISAPNP_TAG_IOPORT 0x08
|
|
|
|
#define ISAPNP_TAG_FIXEDIO 0x09
|
|
|
|
#define ISAPNP_TAG_END 0x0F
|
|
|
|
|
|
|
|
#define ISAPNP_IS_LARGE_TAG(t) (((t) & 0x80))
|
|
|
|
#define ISAPNP_LARGE_TAG_NAME(t) (t)
|
|
|
|
#define ISAPNP_TAG_MEMRANGE 0x81
|
2021-03-20 14:53:54 +00:00
|
|
|
#define MEMRANGE_16_BIT_MEMORY_MASK (0x10 | 0x08)
|
|
|
|
#define MEMRANGE_32_BIT_MEMORY_ONLY 0x18
|
2010-04-07 20:19:29 +00:00
|
|
|
#define ISAPNP_TAG_ANSISTR 0x82
|
|
|
|
#define ISAPNP_TAG_UNICODESTR 0x83
|
|
|
|
#define ISAPNP_TAG_MEM32RANGE 0x85
|
|
|
|
#define ISAPNP_TAG_FIXEDMEM32RANGE 0x86
|
2021-03-20 14:50:34 +00:00
|
|
|
|
2021-03-20 14:51:05 +00:00
|
|
|
#define RANGE_LENGTH_TO_LENGTH(RangeLength) ((~(RangeLength) + 1) & 0xFFFFFF)
|
|
|
|
#define LENGTH_TO_RANGE_LENGTH(Length) (~(Length) + 1)
|
|
|
|
|
2021-03-20 14:50:34 +00:00
|
|
|
#include <pshpack1.h>
|
2010-04-07 20:19:29 +00:00
|
|
|
|
2021-03-04 12:42:42 +00:00
|
|
|
typedef struct _ISAPNP_IDENTIFIER
|
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
USHORT VendorId;
|
|
|
|
USHORT ProdId;
|
|
|
|
ULONG Serial;
|
|
|
|
UCHAR Checksum;
|
2010-04-07 20:19:29 +00:00
|
|
|
} ISAPNP_IDENTIFIER, *PISAPNP_IDENTIFIER;
|
|
|
|
|
2021-03-04 12:42:42 +00:00
|
|
|
typedef struct _ISAPNP_LOGDEVID
|
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
USHORT VendorId;
|
|
|
|
USHORT ProdId;
|
|
|
|
USHORT Flags;
|
2010-04-07 20:19:29 +00:00
|
|
|
} ISAPNP_LOGDEVID, *PISAPNP_LOGDEVID;
|
|
|
|
|
2021-03-20 14:50:34 +00:00
|
|
|
typedef struct _ISAPNP_COMPATID
|
2021-03-04 12:42:42 +00:00
|
|
|
{
|
2020-03-20 18:19:30 +00:00
|
|
|
USHORT VendorId;
|
|
|
|
USHORT ProdId;
|
2021-03-20 14:50:34 +00:00
|
|
|
} ISAPNP_COMPATID, *PISAPNP_COMPATID;
|
2020-03-21 22:08:00 +00:00
|
|
|
|
2021-03-04 12:42:42 +00:00
|
|
|
typedef struct _ISAPNP_IO_DESCRIPTION
|
|
|
|
{
|
2020-03-21 22:08:00 +00:00
|
|
|
UCHAR Information;
|
|
|
|
USHORT Minimum;
|
|
|
|
USHORT Maximum;
|
|
|
|
UCHAR Alignment;
|
|
|
|
UCHAR Length;
|
2021-03-04 12:42:42 +00:00
|
|
|
} ISAPNP_IO_DESCRIPTION, *PISAPNP_IO_DESCRIPTION;
|
2020-03-21 22:08:00 +00:00
|
|
|
|
2021-03-20 14:50:34 +00:00
|
|
|
typedef struct _ISAPNP_FIXED_IO_DESCRIPTION
|
|
|
|
{
|
|
|
|
USHORT IoBase;
|
|
|
|
UCHAR Length;
|
|
|
|
} ISAPNP_FIXED_IO_DESCRIPTION, *PISAPNP_FIXED_IO_DESCRIPTION;
|
|
|
|
|
2021-03-04 12:42:42 +00:00
|
|
|
typedef struct _ISAPNP_IRQ_DESCRIPTION
|
|
|
|
{
|
2020-03-21 22:08:00 +00:00
|
|
|
USHORT Mask;
|
|
|
|
UCHAR Information;
|
2021-03-04 12:42:42 +00:00
|
|
|
} ISAPNP_IRQ_DESCRIPTION, *PISAPNP_IRQ_DESCRIPTION;
|
2020-03-21 22:08:00 +00:00
|
|
|
|
2021-03-04 12:42:42 +00:00
|
|
|
typedef struct _ISAPNP_DMA_DESCRIPTION
|
|
|
|
{
|
2020-03-22 22:23:04 +00:00
|
|
|
UCHAR Mask;
|
|
|
|
UCHAR Information;
|
2021-03-04 12:42:42 +00:00
|
|
|
} ISAPNP_DMA_DESCRIPTION, *PISAPNP_DMA_DESCRIPTION;
|
2020-03-22 22:23:04 +00:00
|
|
|
|
2021-03-20 14:50:34 +00:00
|
|
|
typedef struct _ISAPNP_MEMRANGE_DESCRIPTION
|
|
|
|
{
|
|
|
|
UCHAR Information;
|
|
|
|
USHORT Minimum;
|
|
|
|
USHORT Maximum;
|
|
|
|
USHORT Alignment;
|
|
|
|
USHORT Length;
|
|
|
|
} ISAPNP_MEMRANGE_DESCRIPTION, *PISAPNP_MEMRANGE_DESCRIPTION;
|
|
|
|
|
|
|
|
typedef struct _ISAPNP_MEMRANGE32_DESCRIPTION
|
|
|
|
{
|
|
|
|
UCHAR Information;
|
|
|
|
ULONG Minimum;
|
|
|
|
ULONG Maximum;
|
|
|
|
ULONG Alignment;
|
|
|
|
ULONG Length;
|
|
|
|
} ISAPNP_MEMRANGE32_DESCRIPTION, *PISAPNP_MEMRANGE32_DESCRIPTION;
|
|
|
|
|
|
|
|
typedef struct _ISAPNP_FIXEDMEMRANGE_DESCRIPTION
|
|
|
|
{
|
|
|
|
UCHAR Information;
|
|
|
|
ULONG MemoryBase;
|
|
|
|
ULONG Length;
|
|
|
|
} ISAPNP_FIXEDMEMRANGE_DESCRIPTION, *PISAPNP_FIXEDMEMRANGE_DESCRIPTION;
|
|
|
|
|
2020-03-21 22:08:00 +00:00
|
|
|
#include <poppack.h>
|
|
|
|
|
2010-04-07 20:19:29 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|