From 25f0d23bad5c836cbcce626b6a1db51c8eaff78f Mon Sep 17 00:00:00 2001 From: David Reid Date: Thu, 25 Jul 2002 14:18:54 +0000 Subject: [PATCH] Add Be's isapnp header. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@441 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/drivers/isapnp.h | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 headers/os/drivers/isapnp.h diff --git a/headers/os/drivers/isapnp.h b/headers/os/drivers/isapnp.h new file mode 100644 index 0000000000..b74e584495 --- /dev/null +++ b/headers/os/drivers/isapnp.h @@ -0,0 +1,68 @@ +#ifndef _ISA_CONFIG_H +#define _ISA_CONFIG_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +typedef union { + uint32 id; + uchar b[4]; +} EISA_PRODUCT_ID; + +/* uint32 MAKE_EISA_PRODUCT_ID(EISA_PRODUCT_ID* ptr, char ch0, char ch1, char ch2, uint12 prod_num, uint4 rev) */ +/* example: MAKE_EISA_PRODUCT_ID(&foo_id, 'F','O','O', 0xdb1, 3); */ +/* makes correct little-endian format */ +#define MAKE_EISA_PRODUCT_ID(ptr, ch0, ch1, ch2, prod_num, rev) \ + do { \ + (ptr)->b[0] = (uint8)(((((ch0) - 'A' + 1) & 0x1f) << 2) | ((((ch1) - 'A' + 1) & 0x18) >> 3)); \ + (ptr)->b[1] = (uint8)(((((ch1) - 'A' + 1) & 0x07) << 5) | ((((ch2) - 'A' + 1) & 0x1f) )); \ + (ptr)->b[2] = (uint8)((((prod_num) & 0xff0) >> 4)); \ + (ptr)->b[3] = (uint8)((((prod_num) & 0x00f) << 4) | ((rev) & 0xf) ); \ + } while(0) + +/* Compare IDs without revision */ +/* bool EQUAL_EISA_PRODUCT_ID(EISA_PRODUCT_ID id1, EISA_PRODUCT_ID id2); */ +#define EQUAL_EISA_PRODUCT_ID(id1, id2) \ + (((id1).b[0] == (id2).b[0]) && ((id1).b[1] == (id2).b[1]) && ((id1).b[2] == (id2).b[2]) && (((id1).b[3] & 0xf0) == ((id2).b[3] & 0xf0))) + +#define B_MAX_COMPATIBLE_IDS 8 + +/* This structure is deprecated and will be going away in the next release */ +struct isa_device_info { + struct device_info info; + + uchar csn; + uchar ldn; + uint32 vendor_id; + uint32 card_id; /* a.k.a. serial number */ + uint32 logical_device_id; + uint32 num_compatible_ids; + uint32 compatible_ids[B_MAX_COMPATIBLE_IDS]; + char card_name[B_OS_NAME_LENGTH]; + char logical_device_name[B_OS_NAME_LENGTH]; +}; + +/* So use this instead */ +struct isa_info { + uchar csn; + uchar ldn; + uint32 vendor_id; + uint32 card_id; /* a.k.a. serial number */ + uint32 logical_device_id; + uint32 num_compatible_ids; + uint32 compatible_ids[B_MAX_COMPATIBLE_IDS]; + char card_name[B_OS_NAME_LENGTH]; + char logical_device_name[B_OS_NAME_LENGTH]; +}; + +/* for the mem_descriptor cookie */ +#define B_ISA_MEMORY_32_BIT 0x100 + +#ifdef __cplusplus +} +#endif + +#endif