Commit bd4339c3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: Added cbrick_type_get_nasid() function

From: Pat Gefre <pfg@sgi.com>

Added cbrick_type_get_nasid() function
parent 1a3f507d
......@@ -27,6 +27,7 @@ vertex_hdl_t devfn_to_vertex(unsigned char busnum, unsigned int devfn);
extern void register_pcibr_intr(int irq, pcibr_intr_t intr);
void sn_dma_flush_init(unsigned long start, unsigned long end, int idx, int pin, int slot);
extern int cbrick_type_get_nasid(nasid_t);
#define IS_OPUS(nasid) (cbrick_type_get_nasid(nasid) == MODULE_OPUSBRICK)
#define IS_ALTIX(nasid) (cbrick_type_get_nasid(nasid) == MODULE_CBRICK)
......@@ -344,7 +345,6 @@ sn_pci_fixup(int arg)
struct sn_device_sysdata *device_sysdata;
pcibr_intr_t intr_handle;
pciio_provider_t *pci_provider;
int cpuid;
vertex_hdl_t device_vertex;
pciio_intr_line_t lines;
extern int numnodes;
......
......@@ -645,3 +645,27 @@ parse_module_id(char *buffer)
/* avoid sign extending the moduleid_t */
return (int)(unsigned short)m;
}
int
cbrick_type_get_nasid(nasid_t nasid)
{
lboard_t *brd;
moduleid_t module;
uint type;
int t;
brd = find_lboard((lboard_t *)KL_CONFIG_INFO(nasid), KLTYPE_SNIA);
module = geo_module(brd->brd_geoid);
type = (module & MODULE_BTYPE_MASK) >> MODULE_BTYPE_SHFT;
/* convert brick_type to lower case */
if ((type >= 'A') && (type <= 'Z'))
type = type - 'A' + 'a';
/* convert to a module.h brick type */
for( t = 0; t < MAX_BRICK_TYPES; t++ ) {
if( brick_types[t] == type ) {
return t;
}
}
return -1;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment