ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / include / asm-ia64 / sn / sn2 / geo.h
1 /*
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
4  * for more details.
5  *
6  * Copyright (C) 1992 - 1997, 2000-2003 Silicon Graphics, Inc. All rights reserved.
7  */
8
9 #ifndef _ASM_IA64_SN_SN2_GEO_H
10 #define _ASM_IA64_SN_SN2_GEO_H
11
12 /* Headers required by declarations in this file */
13
14 #include <asm/sn/slotnum.h>
15
16
17 /* The geoid_t implementation below is based loosely on the pcfg_t
18    implementation in sys/SN/promcfg.h. */
19
20 /* Type declaractions */
21
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. */
25
26 #define MAX_SLABS       0xe     /* slabs per module */
27
28 typedef unsigned char   geo_type_t;
29
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 */
35 } geo_any_t;
36
37 /* Additional fields for particular types of hardware */
38 typedef struct geo_node_s {
39     geo_any_t   any;            /* No additional fields needed */
40 } geo_node_t;
41
42 typedef struct geo_rtr_s {
43     geo_any_t   any;            /* No additional fields needed */
44 } geo_rtr_t;
45
46 typedef struct geo_iocntl_s {
47     geo_any_t   any;            /* No additional fields needed */
48 } geo_iocntl_t;
49
50 typedef struct geo_pcicard_s {
51     geo_iocntl_t        any;
52     char                bus;    /* Bus/widget number */
53     slotid_t            slot;   /* PCI slot number */
54 } geo_pcicard_t;
55
56 /* Subcomponents of a node */
57 typedef struct geo_cpu_s {
58     geo_node_t  node;
59     char        slice;          /* Which CPU on the node */
60 } geo_cpu_t;
61
62 typedef struct geo_mem_s {
63     geo_node_t  node;
64     char        membus;         /* The memory bus on the node */
65     char        memslot;        /* The memory slot on the bus */
66 } geo_mem_t;
67
68
69 typedef union geoid_u {
70     geo_any_t   any;
71     geo_node_t  node;
72     geo_iocntl_t        iocntl;
73     geo_pcicard_t       pcicard;
74     geo_rtr_t   rtr;
75     geo_cpu_t   cpu;
76     geo_mem_t   mem;
77     char        padsize[GEOID_SIZE];
78 } geoid_t;
79
80
81 /* Preprocessor macros */
82
83 #define GEO_MAX_LEN     48      /* max. formatted length, plus some pad:
84                                    module/001c07/slab/5/node/memory/2/slot/4 */
85
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)
96
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
105
106 #define GEO_INVALID_STR         "<invalid>"
107
108 #endif /* _ASM_IA64_SN_SN2_GEO_H */