summaryrefslogtreecommitdiffstats
path: root/include/asm-ia64/sn/geo.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ia64/sn/geo.h')
-rw-r--r--include/asm-ia64/sn/geo.h45
1 files changed, 27 insertions, 18 deletions
diff --git a/include/asm-ia64/sn/geo.h b/include/asm-ia64/sn/geo.h
index f566343d25f8..84b254603b8d 100644
--- a/include/asm-ia64/sn/geo.h
+++ b/include/asm-ia64/sn/geo.h
@@ -18,32 +18,34 @@
#define GEOID_SIZE 8 /* Would 16 be better? The size can
be different on different platforms. */
-#define MAX_SLABS 0xe /* slabs per module */
+#define MAX_SLOTS 0xf /* slots per module */
+#define MAX_SLABS 0xf /* slabs per slot */
typedef unsigned char geo_type_t;
/* Fields common to all substructures */
-typedef struct geo_any_s {
+typedef struct geo_common_s {
moduleid_t module; /* The module (box) this h/w lives in */
geo_type_t type; /* What type of h/w is named by this geoid_t */
- slabid_t slab; /* The logical assembly within the module */
-} geo_any_t;
+ slabid_t slab:4; /* slab (ASIC), 0 .. 15 within slot */
+ slotid_t slot:4; /* slot (Blade), 0 .. 15 within module */
+} geo_common_t;
/* Additional fields for particular types of hardware */
typedef struct geo_node_s {
- geo_any_t any; /* No additional fields needed */
+ geo_common_t common; /* No additional fields needed */
} geo_node_t;
typedef struct geo_rtr_s {
- geo_any_t any; /* No additional fields needed */
+ geo_common_t common; /* No additional fields needed */
} geo_rtr_t;
typedef struct geo_iocntl_s {
- geo_any_t any; /* No additional fields needed */
+ geo_common_t common; /* No additional fields needed */
} geo_iocntl_t;
typedef struct geo_pcicard_s {
- geo_iocntl_t any;
+ geo_iocntl_t common;
char bus; /* Bus/widget number */
char slot; /* PCI slot number */
} geo_pcicard_t;
@@ -62,14 +64,14 @@ typedef struct geo_mem_s {
typedef union geoid_u {
- geo_any_t any;
- geo_node_t node;
+ geo_common_t common;
+ geo_node_t node;
geo_iocntl_t iocntl;
geo_pcicard_t pcicard;
- geo_rtr_t rtr;
- geo_cpu_t cpu;
- geo_mem_t mem;
- char padsize[GEOID_SIZE];
+ geo_rtr_t rtr;
+ geo_cpu_t cpu;
+ geo_mem_t mem;
+ char padsize[GEOID_SIZE];
} geoid_t;
@@ -104,19 +106,26 @@ typedef union geoid_u {
#define INVALID_CNODEID ((cnodeid_t)-1)
#define INVALID_PNODEID ((pnodeid_t)-1)
#define INVALID_SLAB (slabid_t)-1
+#define INVALID_SLOT (slotid_t)-1
#define INVALID_MODULE ((moduleid_t)-1)
#define INVALID_PARTID ((partid_t)-1)
static inline slabid_t geo_slab(geoid_t g)
{
- return (g.any.type == GEO_TYPE_INVALID) ?
- INVALID_SLAB : g.any.slab;
+ return (g.common.type == GEO_TYPE_INVALID) ?
+ INVALID_SLAB : g.common.slab;
+}
+
+static inline slotid_t geo_slot(geoid_t g)
+{
+ return (g.common.type == GEO_TYPE_INVALID) ?
+ INVALID_SLOT : g.common.slot;
}
static inline moduleid_t geo_module(geoid_t g)
{
- return (g.any.type == GEO_TYPE_INVALID) ?
- INVALID_MODULE : g.any.module;
+ return (g.common.type == GEO_TYPE_INVALID) ?
+ INVALID_MODULE : g.common.module;
}
extern geoid_t cnodeid_get_geoid(cnodeid_t cnode);