Skip to content
Snippets Groups Projects
Commit efea5f07 authored by samm2's avatar samm2
Browse files

FreeBSD: fix device for the detection

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2939 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 95f838ff
Branches
No related tags found
No related merge requests found
......@@ -1425,7 +1425,7 @@ int get_dev_names_cam(char*** names, bool show_all) {
// /* Shall we skip non T_DIRECT devices ? */
// if (dev_result->inq_data.device != T_DIRECT)
// skip_device = 1;
changed = 0;
changed = 1;
} else if (ccb.cdm.matches[i].type == DEV_MATCH_PERIPH && skip_device == 0) {
/* One device may be populated as many peripherals (pass0 & da0 for example).
* We are searching for latest name
......@@ -1765,24 +1765,23 @@ smart_device * freebsd_smart_interface::autodetect_smart_device(const char * nam
// check ATA bus
char * * atanames = 0; int numata = 0;
numata = get_dev_names_ata(&atanames);
if (numata < 0) {
return false;
}
if (numata > 0) {
// check ATA/ATAPI devices
for (i = 0; i < numata; i++) {
if(!strcmp(atanames[i],name)) {
return new freebsd_ata_device(this, name, "");
}
}
}
else {
if (numata < 0)
pout("Unable to get ATA device list\n");
}
// check CAM
char * * scsinames = 0; int numscsi = 0;
numscsi = get_dev_names_cam(&scsinames, 1);
if (numscsi < 0) {
return false;
}
if (numscsi > 0) {
// check all devices on CAM bus
for (i = 0; i < numscsi; i++) {
if(strcmp(scsinames[i],name)==0)
......@@ -1825,6 +1824,10 @@ smart_device * freebsd_smart_interface::autodetect_smart_device(const char * nam
return new freebsd_scsi_device(this, name, "");
}
}
} // numscsi > 0
else {
if(numscsi<0) pout("Unable to get CAM device list\n");
}
// device type unknown
return 0;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment