summaryrefslogtreecommitdiff
path: root/sys/dev/std/ieee1212reg.h
diff options
context:
space:
mode:
authorThierry Deval <tdeval@cvs.openbsd.org>2002-12-13 02:52:12 +0000
committerThierry Deval <tdeval@cvs.openbsd.org>2002-12-13 02:52:12 +0000
commit5c6a44287062e8deb7c860b5f01eb311ce713a85 (patch)
tree15bcf3807be01c4b92e5b84b10c93af9081bb8db /sys/dev/std/ieee1212reg.h
parentfc45335f431868d7d900fa409fa490791fa437e1 (diff)
Better memory balancing (between alloc/free),
some enhancements, lots of debugging, KNF...
Diffstat (limited to 'sys/dev/std/ieee1212reg.h')
-rw-r--r--sys/dev/std/ieee1212reg.h82
1 files changed, 45 insertions, 37 deletions
diff --git a/sys/dev/std/ieee1212reg.h b/sys/dev/std/ieee1212reg.h
index c60f22134c3..bf7d920021d 100644
--- a/sys/dev/std/ieee1212reg.h
+++ b/sys/dev/std/ieee1212reg.h
@@ -1,7 +1,7 @@
-/* $OpenBSD: ieee1212reg.h,v 1.1 2002/06/25 17:11:49 itojun Exp $ */
+/* $OpenBSD: ieee1212reg.h,v 1.2 2002/12/13 02:52:11 tdeval Exp $ */
/* $NetBSD: ieee1212reg.h,v 1.7 2002/04/02 10:10:54 jmc Exp $ */
-/*-
+/*
* Copyright (c) 2000 The NetBSD Foundation, Inc.
* All rights reserved.
*
@@ -18,8 +18,8 @@
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
- * This product includes software developed by the NetBSD
- * Foundation, Inc. and its contributors.
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
* 4. Neither the name of The NetBSD Foundation nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
@@ -37,12 +37,12 @@
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef _DEV_STD_IEEE1212REG_H_
-#define _DEV_STD_IEEE1212REG_H_
+#ifndef _DEV_STD_IEEE1212REG_H_
+#define _DEV_STD_IEEE1212REG_H_
/* This file contains definitions from ISO/IEC 1312 or ANSI/IEEE Std 1212
* Informaton techonology
- * Microprocessor systes
+ * Microprocessor systems
* Control and Status Registers (CSR)
* Architecture for microcomputer buses
* First edition 1994-10-05
@@ -106,7 +106,7 @@
(oui)[0] = ((quadlet) >> 16) & 0xff; \
(oui)[1] = ((quadlet) >> 8) & 0xff; \
(oui)[2] = ((quadlet) >> 0) & 0xff; \
- } while (0)
+ } while (0)
/* size_t P1212_ROMGET_GET_INFOLEN(uint32_t quadlet);
*/
@@ -120,9 +120,9 @@
*/
#define P1212_ROMFMT_GET_CRC(quadlet) ((uint16_t)(quadlet))
-/* uint8_t P1212_DIRENT_GET_KEY(uint32_t quadlet);
+/* uint8_t P1212_DIRENT_GET_KEY(uint32_t quadlet);
*/
-#define P1212_DIRENT_GET_KEY(quadlet) (((quadlet) >> 24) & 0xff)
+#define P1212_DIRENT_GET_KEY(quadlet) (((quadlet) >> 24) & 0xff)
/* unsigned int P1212_DIRENT_GET_KEYTYPE(uint32_t quadlet);
*/
@@ -140,13 +140,13 @@
*/
#define P1212_DIRENT_GET_VALUE(quadlet) ((quadlet) & 0xffffff)
-/* u_int16_t P1212_DIRENT_GET_LEN(quadlet);
+/* u_int16_t P1212_DIRENT_GET_LEN(quadlet);
*/
-#define P1212_DIRENT_GET_LEN(quadlet) (((quadlet) >> 16) & 0xffff)
+#define P1212_DIRENT_GET_LEN(quadlet) (((quadlet) >> 16) & 0xffff)
-/* u_int16_t P1212_DIRENT_GET_CRC(quadlet);
+/* u_int16_t P1212_DIRENT_GET_CRC(quadlet);
*/
-#define P1212_DIRENT_GET_CRC(quadlet) ((uint16_t)(quadlet))
+#define P1212_DIRENT_GET_CRC(quadlet) ((uint16_t)(quadlet))
/* Key Types are stored in bits 31-30 of a directory entry.
*/
@@ -177,7 +177,7 @@
#define P1212_KEYVALUE_Unit_Directory 0x11 /* directory */
#define P1212_KEYVALUE_Unit_Spec_Id 0x12 /* immediate */
#define P1212_KEYVALUE_Unit_Sw_Version 0x13 /* immediate */
-#define P1212_KEYVALUE_Unit_Dependent_Info 0x14 /* leaf | directory */
+#define P1212_KEYVALUE_Unit_Dependent_Info 0x14 /* imm|off|leaf|dir */
#define P1212_KEYVALUE_Unit_Location 0x15 /* leaf */
#define P1212_KEYVALUE_Unit_Poll_Mask 0x16 /* immediate */
@@ -186,20 +186,20 @@
* already in some roms.
*/
-#define P1212_KEYVALUE_Model 0x17 /* immediate */
-#define P1212_KEYVALUR_Instance_Directory 0x18 /* directory */
-#define P1212_KEYVALUE_Keyword 0x19 /* leaf */
-#define P1212_KEYVALUE_Feature_Directory 0x1A /* directory */
-#define P1212_KEYVALUE_Extended_ROM 0x1B /* leaf */
-#define P1212_KEYVALUE_Extended_Key_Spec_Id 0x1C /* immediate */
-#define P1212_KEYVALUE_Extended_Key 0x1D /* immediate */
-#define P1212_KEYVALUE_Extended_Data 0x1E /* imm|leaf|dir|offset */
-#define P1212_KEYVALUE_Modifiable_Descriptor 0x1F /* leaf */
-#define P1212_KEYVALUE_Directory_Id 0x20 /* immediate */
+#define P1212_KEYVALUE_Model 0x17 /* immediate */
+#define P1212_KEYVALUR_Instance_Directory 0x18 /* directory */
+#define P1212_KEYVALUE_Keyword 0x19 /* leaf */
+#define P1212_KEYVALUE_Feature_Directory 0x1A /* directory */
+#define P1212_KEYVALUE_Extended_ROM 0x1B /* leaf */
+#define P1212_KEYVALUE_Extended_Key_Spec_Id 0x1C /* immediate */
+#define P1212_KEYVALUE_Extended_Key 0x1D /* immediate */
+#define P1212_KEYVALUE_Extended_Data 0x1E /* imm|off|leaf|dir */
+#define P1212_KEYVALUE_Modifiable_Descriptor 0x1F /* leaf */
+#define P1212_KEYVALUE_Directory_Id 0x20 /* immediate */
#define P1212_KEYTYPE_STRINGS { "Immediate", "Offset", "Leaf", "Directory" }
-#define P1212_KEYVALUE_STRINGS { "Root-Directory", \
+#define P1212_KEYVALUE_STRINGS { "Root-Directory", \
"Textual-Descriptor", "Bus-Dependent-Info", "Module-Vendor-Id", \
"Module-Hw-Version", "Module-Spec-Id", "Module-Sw-Version", \
"Module-Dependent-Info", "Node-Vendor-Id", "Node-Hw_Version", \
@@ -208,9 +208,17 @@
"Node-Dependent-Info", "Unit-Directory", "Unit-Spec-Id", \
"Unit-Sw-Version", "Unit-Dependent-Info", "Unit-Location", \
"Unit-Poll-Mask", "Model", "Instance-Directory", "Keyword", \
- "Feature-Directory", "Extended-ROM", "Extended-Key-Spec-Id", \
- "Extended-Key", "Extended-Data", "Modifiable-Descriptor", \
- "Directory-Id" }
+ "Feature-Directory", "Extended-ROM", "Extended-Key-Spec-Id", \
+ "Extended-Key", "Extended-Data", "Modifiable-Descriptor", \
+ "Directory-Id", NULL /* 0x21 */, NULL /* 0x22 */, NULL /* 0x23 */, \
+ NULL /* 0x24 */, NULL /* 0x25 */, NULL /* 0x26 */, NULL /* 0x27 */, \
+ NULL /* 0x28 */, NULL /* 0x29 */, NULL /* 0x2A */, NULL /* 0x2B */, \
+ NULL /* 0x2C */, NULL /* 0x2D */, NULL /* 0x2E */, NULL /* 0x2F */, \
+ NULL /* 0x30 */, NULL /* 0x31 */, NULL /* 0x32 */, NULL /* 0x33 */, \
+ NULL /* 0x34 */, NULL /* 0x35 */, NULL /* 0x36 */, NULL /* 0x37 */, \
+ "Command-Set-Spec-ID", "Commant-Set", "Unit-Characteristics", \
+ "Command-Set-Revision", "Firmware-Revision", "Reconnect-Timeout", \
+}
/* Leaf nodes look like:
*
@@ -223,9 +231,9 @@
* [2] 0xllllllll language id
*/
-#define P1212_TEXT_Min_Leaf_Length 0x3
-#define P1212_TEXT_GET_Spec_Type(quadlet) (((quadlet) & 0xff000000) >> 24)
-#define P1212_TEXT_GET_Spec_Id(quadlet) ((quadlet) & 0xffffff)
+#define P1212_TEXT_Min_Leaf_Length 0x3
+#define P1212_TEXT_GET_Spec_Type(quadlet) (((quadlet) & 0xff000000) >> 24)
+#define P1212_TEXT_GET_Spec_Id(quadlet) ((quadlet) & 0xffffff)
/*
* Directory nodes look like:
@@ -236,8 +244,8 @@
/* Some definitions for the p1212_find routines. */
-#define P1212_FIND_SEARCHALL 0x1
-#define P1212_FIND_RETURNALL 0x2
+#define P1212_FIND_SEARCHALL 0x1
+#define P1212_FIND_RETURNALL 0x2
/* Mask definitions for overriding the p1212 standard checks. */
@@ -248,10 +256,10 @@
/* Normally dependent info can only be leaf or directory. Allow offsets also */
-#define P1212_ALLOW_DEPENDENT_INFO_OFFSET_TYPE 0x1
+#define P1212_ALLOW_DEPENDENT_INFO_OFFSET_TYPE 0x1
/* Same thing applies for immediate types. */
-#define P1212_ALLOW_DEPENDENT_INFO_IMMED_TYPE 0x2
-#define P1212_ALLOW_VENDOR_DIRECTORY_TYPE 0x4
+#define P1212_ALLOW_DEPENDENT_INFO_IMMED_TYPE 0x2
+#define P1212_ALLOW_VENDOR_DIRECTORY_TYPE 0x4
#endif /* _DEV_STD_IEEE1212REG_H_ */