[parisc-linux-cvs] struct hardware_path

Matthew Wilcox willy@debian.org
Mon, 22 Oct 2001 22:43:04 +0100


Index: arch/parisc/kernel/drivers.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/drivers.c,v
retrieving revision 1.30
diff -u -p -r1.30 drivers.c
--- drivers.c	2001/10/22 15:45:36	1.30
+++ drivers.c	2001/10/22 21:16:11
@@ -196,7 +196,7 @@ static struct parisc_device *find_device
 }
 
 static void
-get_node_path(struct parisc_device *dev, struct pdc_module_path *path)
+get_node_path(struct parisc_device *dev, struct hardware_path *path)
 {
 	int i = 5;
 	memset(&path->bc, -1, 6);
@@ -209,7 +209,7 @@ get_node_path(struct parisc_device *dev,
 static void print_hwpath(struct parisc_device *dev, char *output)
 {
 	int i;
-	struct pdc_module_path path;
+	struct hardware_path path;
 
 	get_node_path(dev->parent, &path);
 	for (i = 0; i < 6; i++) {
@@ -265,7 +265,7 @@ alloc_tree_node(struct parisc_device *pa
 	return create_tree_node(id, parent, &prev->sibling);
 }
 
-static struct parisc_device *find_parisc_device(struct pdc_module_path *modpath)
+static struct parisc_device *find_parisc_device(struct hardware_path *modpath)
 {
 	int i;
 	struct parisc_device *parent = &root;
@@ -278,7 +278,7 @@ static struct parisc_device *find_parisc
 }
 
 struct parisc_device *
-alloc_pa_dev(unsigned long hpa, struct pdc_module_path *mod_path)
+alloc_pa_dev(unsigned long hpa, struct hardware_path *mod_path)
 {
 	int status;
 	unsigned long bytecnt;
@@ -358,7 +358,7 @@ int register_parisc_device(struct parisc
 void walk_native_bus(unsigned long addr, struct parisc_device *parent)
 {
 	int i;
-	struct pdc_module_path path;
+	struct hardware_path path;
 	get_node_path(parent, &path);
 	for (i = 0; i < MAX_NATIVE_DEVICES; i++) {
 		struct parisc_device *dev;
Index: arch/parisc/kernel/inventory.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/inventory.c,v
retrieving revision 1.43
diff -u -p -r1.43 inventory.c
--- inventory.c	2001/10/22 20:23:41	1.43
+++ inventory.c	2001/10/22 21:16:11
@@ -203,7 +203,6 @@ pat_query_module(ulong pcell_loc, ulong 
 	/* REVISIT: who is the consumer of this? not sure yet... */
 	dev->mod_info = pa_pdc_cell.mod_info;	/* pass to PAT_GET_ENTITY() */
 	dev->pmod_loc = pa_pdc_cell.mod_location;
-	dev->mod_path = pa_pdc_cell.mod_path;
 
 	register_parisc_device(dev);	/* advertise device */
 
@@ -428,7 +427,7 @@ legacy_create_device(struct pdc_memory_m
 	if (status != PDC_OK)
 		return NULL;
 
-	dev = alloc_pa_dev(r_addr->hpa, module_path);
+	dev = alloc_pa_dev(r_addr->hpa, &module_path->path);
 	if (dev == NULL)
 		return NULL;
 
@@ -454,18 +453,18 @@ static void __init snake_inventory(void)
 		struct pdc_memory_map r_addr;
 		unsigned int func;
 
-		memset(module_path.bc, 0xff, sizeof(module_path.bc));
-		module_path.mod = mod;
+		memset(module_path.path.bc, 0xff, 6);
+		module_path.path.mod = mod;
 		dev = legacy_create_device(&r_addr, &module_path);
 		if ((!dev) || (dev->id.hw_type != HPHW_BA))
 			continue;
 
-		memset(module_path.bc, 0xff, 4);
-		module_path.bc[4] = mod;
+		memset(module_path.path.bc, 0xff, 4);
+		module_path.path.bc[4] = mod;
 
 		for (func = 0; func < 16; func++) {
-			module_path.bc[5] = 0;
-			module_path.mod = func;
+			module_path.path.bc[5] = 0;
+			module_path.path.mod = func;
 			legacy_create_device(&r_addr, &module_path);
 		}
 	}
@@ -536,7 +535,7 @@ static void __init system_map_inventory(
 		if (status != PDC_OK)
 			continue;
 		
-		dev = alloc_pa_dev(module_result.mod_addr, &module_path);
+		dev = alloc_pa_dev(module_result.mod_addr, &module_path.path);
 		if (!dev)
 			continue;
 		
Index: arch/parisc/kernel/processor.c
===================================================================
RCS file: /home/cvs/parisc/linux/arch/parisc/kernel/processor.c,v
retrieving revision 1.4
diff -u -p -r1.4 processor.c
--- processor.c	2001/10/17 20:02:27	1.4
+++ processor.c	2001/10/22 21:16:14
@@ -99,7 +99,6 @@ static int __init processor_probe(struct
 		/* verify it's the same as what do_pat_inventory() found */
 		ASSERT(dev->mod_info == pa_pdc_cell.mod_info);
 		ASSERT(dev->pmod_loc == pa_pdc_cell.mod_location);
-		ASSERT(dev->mod_path == pa_pdc_cell.mod_path);
 
 		txn_addr = pa_pdc_cell.mod[0];   /* id_eid for IO sapic */
 
Index: include/asm-parisc/hardware.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/hardware.h,v
retrieving revision 1.25
diff -u -p -r1.25 hardware.h
--- hardware.h	2001/10/22 01:36:02	1.25
+++ hardware.h	2001/10/22 21:16:21
@@ -33,7 +33,7 @@ struct parisc_device {
 	char name[80];			/* The hardware description */
 	int		irq;
 
-	unsigned int    hw_path;        /* The hardware path on the current bus */
+	char		hw_path;        /* The module number on this bus */
 	unsigned int	num_addrs;	/* some devices have additional address ranges. */
 	unsigned long	*addr;          /* which will be stored here */
  
@@ -45,7 +45,6 @@ struct parisc_device {
 	/* generic info returned from pdc_pat_cell_module() */
 	unsigned long	mod_info;	/* PAT specific - Misc Module info */
 	unsigned long	pmod_loc;	/* physical Module location */
-	unsigned long	mod_path;	/* Module HW path */
 #endif
 };
 
@@ -99,7 +98,7 @@ extern enum cpu_type parisc_get_cpu_type
 
 /* drivers.c: */
 extern struct parisc_device *alloc_pa_dev(unsigned long hpa,
-		struct pdc_module_path *path);
+		struct hardware_path *path);
 extern int register_parisc_device(struct parisc_device *dev);
 extern int register_parisc_driver(struct parisc_driver *driver);
 extern int unregister_parisc_driver(struct parisc_driver *driver);
Index: include/asm-parisc/pdc.h
===================================================================
RCS file: /home/cvs/parisc/linux/include/asm-parisc/pdc.h,v
retrieving revision 1.34
diff -u -p -r1.34 pdc.h
--- pdc.h	2001/10/05 17:02:33	1.34
+++ pdc.h	2001/10/22 21:16:22
@@ -512,14 +512,18 @@ struct pdc_system_map_addr_info { /* PDC
 	unsigned long mod_pgs;
 };
 
-/*
- * Device path specifications used by PDC.
- */
-struct pdc_module_path {
+struct hardware_path {
 	char  flags;	/* see bit definitions below */
 	char  bc[6];	/* Bus Converter routing info to a specific */
 			/* I/O adaptor (< 0 means none, > 63 resvd) */
 	char  mod;	/* fixed field of specified module */
+};
+
+/*
+ * Device path specifications used by PDC.
+ */
+struct pdc_module_path {
+	struct hardware_path path;
 	unsigned int layers[6]; /* device-specific info (ctlr #, unit # ...) */
 };
 
@@ -563,7 +567,7 @@ struct pdc_pat_cell_mod_maddr_block {	/*
 	unsigned long cba;              /* function 0 configuration space address */
 	unsigned long mod_info;         /* module information */
 	unsigned long mod_location;     /* physical location of the module */
-	unsigned long mod_path;         /* module path (device path - layers) */
+	struct hardware_path mod_path;	/* hardware path */
 	unsigned long mod[508];		/* PAT cell module components */
 };
 

-- 
Revolutions do not require corporate support.