1 /* SPDX-License-Identifier: GPL-2.0-or-later
3 * This file is subject to the terms and conditions of the GNU General Public
4 * License. See the file "COPYING" in the main directory of this archive
7 * Copyright (C) 2020 Hewlett Packard Enterprise Development LP. All rights reserved.
13 /* Type declarations */
15 /* Size of a geoid_s structure (must be before decl. of geoid_u) */
18 /* Fields common to all substructures */
20 unsigned char type; /* What type of h/w is named by this geoid_s */
22 unsigned char slot; /* slot is IRU */
27 /* Additional fields for particular types of hardware */
29 struct geo_common_s common; /* No additional fields needed */
33 struct geo_common_s common; /* No additional fields needed */
37 struct geo_common_s common; /* No additional fields needed */
40 struct geo_pcicard_s {
41 struct geo_iocntl_s common;
42 char bus; /* Bus/widget number */
43 char slot; /* PCI slot number */
46 /* Subcomponents of a node */
48 struct geo_node_s node;
49 unsigned char socket:4, /* Which CPU on the node */
55 struct geo_node_s node;
56 char membus; /* The memory bus on the node */
57 char memslot; /* The memory slot on the bus */
61 struct geo_common_s common;
62 struct geo_node_s node;
63 struct geo_iocntl_s iocntl;
64 struct geo_pcicard_s pcicard;
68 char padsize[GEOID_SIZE];
71 /* Defined constants */
73 #define GEO_MAX_LEN 48
75 #define GEO_TYPE_INVALID 0
76 #define GEO_TYPE_MODULE 1
77 #define GEO_TYPE_NODE 2
78 #define GEO_TYPE_RTR 3
79 #define GEO_TYPE_IOCNTL 4
80 #define GEO_TYPE_IOCARD 5
81 #define GEO_TYPE_CPU 6
82 #define GEO_TYPE_MEM 7
83 #define GEO_TYPE_MAX (GEO_TYPE_MEM+1)
85 static inline int geo_rack(union geoid_u g)
87 return (g.common.type == GEO_TYPE_INVALID) ?
91 static inline int geo_slot(union geoid_u g)
93 return (g.common.type == GEO_TYPE_INVALID) ?
97 static inline int geo_blade(union geoid_u g)
99 return (g.common.type == GEO_TYPE_INVALID) ?
100 -1 : g.common.blade * 2 + g.common.slot;
103 #endif /* _ASM_UV_GEO_H */