summaryrefslogtreecommitdiff
path: root/usr/src/uts/common/os/modsysfile.c
diff options
context:
space:
mode:
authorjw149990 <none@none>2008-06-02 20:05:52 -0700
committerjw149990 <none@none>2008-06-02 20:05:52 -0700
commit5c44817c0d1a2b9b02dbbf343823da0b064f0ee7 (patch)
tree399642d887fb92b192aa26bcbe02a11d3f6862fa /usr/src/uts/common/os/modsysfile.c
parent50953a6d365217c310232e7d3d326f02ff97ff8b (diff)
downloadillumos-joyent-5c44817c0d1a2b9b02dbbf343823da0b064f0ee7.tar.gz
PSARC 2008/337 scsi-self-identifying
6637648 new class scsi-self-identifying needed 6682564 solaris shall not chain together 'specs' whose class names are different during parsing hwconf file
Diffstat (limited to 'usr/src/uts/common/os/modsysfile.c')
-rw-r--r--usr/src/uts/common/os/modsysfile.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr/src/uts/common/os/modsysfile.c b/usr/src/uts/common/os/modsysfile.c
index 5ba026e22e..2294f1793b 100644
--- a/usr/src/uts/common/os/modsysfile.c
+++ b/usr/src/uts/common/os/modsysfile.c
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2007 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -3160,8 +3160,9 @@ add_spec(struct hwc_spec *spec, struct par_list **par)
major_t maj;
struct par_list *pl, *par_last = NULL;
char *parent = spec->hwc_parent_name;
+ char *class = spec->hwc_class_name;
- ASSERT(parent || spec->hwc_class_name);
+ ASSERT(parent || class);
/*
* If given a parent=/full-pathname, see if the platform
@@ -3191,10 +3192,14 @@ add_spec(struct hwc_spec *spec, struct par_list **par)
maj = (major_t)-1;
/*
- * Scan the list looking for a matching parent.
+ * Scan the list looking for a matching parent. When parent is
+ * not NULL, we match the parent by major. If parent is NULL but
+ * class is not NULL, we mache the pl by class name.
*/
for (pl = *par; pl; pl = pl->par_next) {
- if (maj == pl->par_major) {
+ if ((parent && (maj == pl->par_major)) || ((parent == NULL) &&
+ class && pl->par_specs->hwc_class_name && (strncmp(class,
+ pl->par_specs->hwc_class_name, strlen(class)) == 0))) {
append(spec, pl);
return;
}