static int use_usb_info;
static int use_num_info;
static int export;
-static int debug;
static void set_str(char *to, const char *from, size_t count)
{
if_class = sysfs_attr_get_value(dev_interface->devpath, "bInterfaceClass");
if (!if_class) {
- info("%s: cannot get bInterfaceClass attribute", dev_interface->kernel_name);
+ info("%s: cannot get bInterfaceClass attribute", dev_interface->kernel);
return 1;
}
if_class_num = strtoul(if_class, NULL, 16);
/* Generic SPC-2 device */
scsi_vendor = sysfs_attr_get_value(dev_scsi->devpath, "vendor");
if (!scsi_vendor) {
- info("%s: cannot get SCSI vendor attribute", dev_scsi->kernel_name);
+ info("%s: cannot get SCSI vendor attribute", dev_scsi->kernel);
goto fallback;
}
set_str(vendor_str, scsi_vendor, sizeof(vendor_str)-1);
scsi_model = sysfs_attr_get_value(dev_scsi->devpath, "model");
if (!scsi_model) {
- info("%s: cannot get SCSI model attribute", dev_scsi->kernel_name);
+ info("%s: cannot get SCSI model attribute", dev_scsi->kernel);
goto fallback;
}
set_str(model_str, scsi_model, sizeof(model_str)-1);
scsi_type = sysfs_attr_get_value(dev_scsi->devpath, "type");
if (!scsi_type) {
- info("%s: cannot get SCSI type attribute", dev_scsi->kernel_name);
+ info("%s: cannot get SCSI type attribute", dev_scsi->kernel);
goto fallback;
}
set_scsi_type(type_str, scsi_type, sizeof(type_str)-1);
scsi_rev = sysfs_attr_get_value(dev_scsi->devpath, "rev");
if (!scsi_rev) {
- info("%s: cannot get SCSI revision attribute", dev_scsi->kernel_name);
+ info("%s: cannot get SCSI revision attribute", dev_scsi->kernel);
goto fallback;
}
set_str(revision_str, scsi_rev, sizeof(revision_str)-1);
dbg("argc is %d", argc);
- /* sysfs path can be overridden for testing */
- env = getenv("SYSFS_PATH");
- if (env) {
- strlcpy(sysfs_path, env, sizeof(sysfs_path));
- remove_trailing_chars(sysfs_path, '/');
- } else
- strcpy(sysfs_path, "/sys");
-
while ((option = getopt(argc, argv, "dnux")) != -1 ) {
if (optarg)
dbg("option '%c' arg '%s'", option, optarg);
dbg("option '%c'", option);
switch (option) {
- case 'd':
- debug = 1;
- break;
case 'n':
use_num_info = 1;
use_usb_info = 1;