@@ -150,6 +150,19 @@
# path_checker tur
# }
# device {
+# vendor "HP"
+# product "LOGICAL VOLUME.*"
+# getuid_callout "/sbin/cciss_id /dev/%n"
+# features "0"
+# hardware_handler "0"
+# path_grouping_policy multibus
+# failback immediate
+# rr_weight uniform
+# no_path_retry 12
+# rr_min_io 1000
+# path_checker cciss_tur
+# }
+# device {
# vendor "DDN"
# product "SAN DataDirector"
# getuid_callout "/sbin/scsi_id -g -u -s /block/%n"
@@ -250,8 +250,10 @@
declare_sysfs_get_str(model, "%s/block/%s/device/model", 1);
declare_sysfs_get_str(rev, "%s/block/%s/device/rev", 1);
declare_sysfs_get_str(dev, "%s/block/%s/dev", 1);
-declare_sysfs_get_str(bustype, "%s/block/%s/device/bus", 1);
declare_sysfs_get_str(state, "%s/block/%s/device/state", 0);
+declare_sysfs_get_str(cciss_vendor, "%s/block/%s/vendor", 1);
+declare_sysfs_get_str(cciss_model, "%s/block/%s/model", 1);
+declare_sysfs_get_str(cciss_rev, "%s/block/%s/rev", 1);
int
sysfs_get_timeout (char * sysfs_path, char * dev, unsigned int *timeout)
@@ -475,6 +477,24 @@
}
static int
+sysfs_get_driver (char *sysfs_path, char * dev, char *driver)
+{
+ char path[FILE_NAME_SIZE];
+ char buff[SYSFS_NAME_LEN];
+
+ if (safe_sprintf(path, "%s/block/%s/device/driver", sysfs_path, dev)) {
+ condlog(0, "driver path too small");
+ return 1;
+ }
+ if (sysfs_get_link(path, buff, SYSFS_NAME_LEN) < 0) {
+ condlog(0, "can't get driver link: %s", strerror(errno));
+ return 1;
+ }
+ basename(buff, driver);
+ return 0;
+}
+
+static int
sysfs_get_bus (char * sysfs_path, struct path * pp)
{
struct sysfs_device *sdev;
@@ -517,8 +537,8 @@
while (loop--) {
sdev = sysfs_open_device_path(attr_buff);
if(!strncmp(pp->dev,"cciss",5))
- sysfs_get_bustype(sysfs_path,pp->dev,
- sdev->bus,5);
+ sysfs_get_driver(sysfs_path, pp->dev,
+ sdev->bus);
if (strlen(sdev->bus))
break;
@@ -529,8 +549,8 @@
#else
sdev = sysfs_open_device_path(attr_buff);
if(!strncmp(pp->dev,"cciss",5))
- sysfs_get_bustype(sysfs_path, pp->dev,
- sdev->bus,5);
+ sysfs_get_driver(sysfs_path, pp->dev,
+ sdev->bus);
#endif
if (!strncmp(sdev->bus, "scsi", 4))
@@ -692,20 +712,33 @@
static int
cciss_sysfs_pathinfo (struct path * curpath)
{
+ unsigned int controller, lun;
+ char dev_path[FILE_NAME_SIZE];
+
+ if (sscanf(curpath->dev, "cciss!c%ud%u", &controller, &lun) != 2) {
+ condlog(0, "invalid cciss device name : '%s'", curpath->dev);
+ return 1;
+ }
+
+ if(safe_sprintf(dev_path, "%s/device/cciss%u/c%ud%u", curpath->dev,
+ controller, controller, lun)) {
+ condlog(0, "dev_path too small");
+ return 1;
+ }
- if (sysfs_get_vendor(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_vendor(sysfs_path, dev_path,
curpath->vendor_id, SCSI_VENDOR_SIZE))
return 1;
condlog(3, "vendor = %s", curpath->vendor_id);
- if (sysfs_get_model(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_model(sysfs_path, dev_path,
curpath->product_id, SCSI_PRODUCT_SIZE))
return 1;
condlog(3, "product = %s", curpath->product_id);
- if (sysfs_get_rev(sysfs_path, curpath->dev,
+ if (sysfs_get_cciss_rev(sysfs_path, dev_path,
curpath->rev, SCSI_REV_SIZE))
return 1;
@@ -30,7 +30,6 @@
int sysfs_get_model (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_rev (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_dev (char * sysfs_path, char * dev, char * buff, int len);
-int sysfs_get_bustype (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_state (char * sysfs_path, char * dev, char * buff, int len);
int sysfs_get_size (char * sysfs_path, char * dev, unsigned long long *);
int sysfs_get_timeout (char * sysfs_path, char * dev, unsigned int *timeout);
@@ -185,6 +185,22 @@
.minio = DEFAULT_MINIO,
.checker_name = READSECTOR0,
},
+ {
+ /* HP Smart Array */
+ .vendor = "HP",
+ .product = "LOGICAL VOLUME.*",
+ .getuid = "/sbin/cciss_id /dev/%n",
+ .getprio = NULL,
+ .features = DEFAULT_FEATURES,
+ .hwhandler = DEFAULT_HWHANDLER,
+ .selector = DEFAULT_SELECTOR,
+ .pgpolicy = MULTIBUS,
+ .pgfailback = FAILBACK_UNDEF,
+ .rr_weight = RR_WEIGHT_NONE,
+ .no_path_retry = 12,
+ .minio = DEFAULT_MINIO,
+ .checker_name = CCISS_TUR,
+ },
/*
* DDN controller family
*