2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
6 * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
9 #ifndef _ASM_IA64_SN_SN2_GEO_H
10 #define _ASM_IA64_SN_SN2_GEO_H
12 /* Headers required by declarations in this file */
14 #include <asm/sn/slotnum.h>
17 /* The geoid_t implementation below is based loosely on the pcfg_t
18 implementation in sys/SN/promcfg.h. */
20 /* Type declaractions */
22 /* Size of a geoid_t structure (must be before decl. of geoid_u) */
23 #define GEOID_SIZE 8 /* Would 16 be better? The size can
24 be different on different platforms. */
26 #define MAX_SLABS 0xe /* slabs per module */
28 typedef unsigned char geo_type_t;
30 /* Fields common to all substructures */
31 typedef struct geo_any_s {
32 moduleid_t module; /* The module (box) this h/w lives in */
33 geo_type_t type; /* What type of h/w is named by this geoid_t */
34 slabid_t slab; /* The logical assembly within the module */
37 /* Additional fields for particular types of hardware */
38 typedef struct geo_node_s {
39 geo_any_t any; /* No additional fields needed */
42 typedef struct geo_rtr_s {
43 geo_any_t any; /* No additional fields needed */
46 typedef struct geo_iocntl_s {
47 geo_any_t any; /* No additional fields needed */
50 typedef struct geo_pcicard_s {
52 char bus; /* Bus/widget number */
53 slotid_t slot; /* PCI slot number */
56 /* Subcomponents of a node */
57 typedef struct geo_cpu_s {
59 char slice; /* Which CPU on the node */
62 typedef struct geo_mem_s {
64 char membus; /* The memory bus on the node */
65 char memslot; /* The memory slot on the bus */
69 typedef union geoid_u {
73 geo_pcicard_t pcicard;
77 char padsize[GEOID_SIZE];
81 /* Preprocessor macros */
83 #define GEO_MAX_LEN 48 /* max. formatted length, plus some pad:
84 module/001c07/slab/5/node/memory/2/slot/4 */
86 /* Values for geo_type_t */
87 #define GEO_TYPE_INVALID 0
88 #define GEO_TYPE_MODULE 1
89 #define GEO_TYPE_NODE 2
90 #define GEO_TYPE_RTR 3
91 #define GEO_TYPE_IOCNTL 4
92 #define GEO_TYPE_IOCARD 5
93 #define GEO_TYPE_CPU 6
94 #define GEO_TYPE_MEM 7
95 #define GEO_TYPE_MAX (GEO_TYPE_MEM+1)
97 /* Parameter for hwcfg_format_geoid_compt() */
98 #define GEO_COMPT_MODULE 1
99 #define GEO_COMPT_SLAB 2
100 #define GEO_COMPT_IOBUS 3
101 #define GEO_COMPT_IOSLOT 4
102 #define GEO_COMPT_CPU 5
103 #define GEO_COMPT_MEMBUS 6
104 #define GEO_COMPT_MEMSLOT 7
106 #define GEO_INVALID_STR "<invalid>"
108 #endif /* _ASM_IA64_SN_SN2_GEO_H */