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

Linux: Hiding debug messages coming from megaraid code, added autodetection of MegaRaid controller

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2951 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent ad612578
Branches
No related tags found
No related merge requests found
......@@ -43,7 +43,8 @@ NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[AS] Linux: Autodetect DELL PERC controller.
[AS] Linux: Autodetect DELL PERC and MegaRAID controllers.
Hiding debug messages coming from megaraid code.
[AS] Linux: Fixed SATA drives support on megaraid device (see ticket #15).
......
......@@ -951,6 +951,7 @@ bool linux_megaraid_device::open()
char line[128];
int mjr, n1;
FILE *fp;
int report = con->reportscsiioctl;
if (!linux_smart_device::open())
return false;
......@@ -963,7 +964,7 @@ bool linux_megaraid_device::open()
else if (ioctl(get_fd(), SCSI_IOCTL_GET_BUS_NUMBER, &m_hba) != 0) {
int err = errno;
linux_smart_device::close();
return set_err(err, "can't get hba");
return set_err(err, "can't get bus number");
}
/* Perform mknod of device ioctl node */
......@@ -972,12 +973,14 @@ bool linux_megaraid_device::open()
n1=0;
if (sscanf(line, "%d megaraid_sas_ioctl%n", &mjr, &n1) == 1 && n1 == 22) {
n1=mknod("/dev/megaraid_sas_ioctl_node", S_IFCHR, makedev(mjr, 0));
if(report > 0)
printf("Creating /dev/megaraid_sas_ioctl_node = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
break;
}
else if (sscanf(line, "%d megadev%n", &mjr, &n1) == 1 && n1 == 11) {
n1=mknod("/dev/megadev0", S_IFCHR, makedev(mjr, 0));
if(report > 0)
printf("Creating /dev/megadev0 = %d\n", n1 >= 0 ? 0 : errno);
if (n1 >= 0 || errno == EEXIST)
break;
......@@ -1043,6 +1046,7 @@ bool linux_megaraid_device::scsi_pass_through(scsi_cmnd_io *iop)
if (iop->cmnd[0] == 0x00)
return true;
if (iop->cmnd[0] == 0x85 && iop->cmnd[1] == 0x06) {
if(report > 0)
pout("Rejecting SMART/ATA command to controller\n");
// Emulate SMART STATUS CHECK drive reply
// smartctl fail to work without this
......@@ -2677,9 +2681,9 @@ smart_device * linux_scsi_device::autodetect_open()
return this;
}
// DELL?
if (!memcmp(req_buff + 8, "DELL PERC", 12)) {
if (!memcmp(req_buff + 8, "DELL PERC", 12) || !memcmp(req_buff + 8, "MegaRAID", 8)) {
close();
set_err(EINVAL, "DELL controller, please try adding '-d megaraid,N'");
set_err(EINVAL, "DELL or MegaRaid controller, please try adding '-d megaraid,N'");
return this;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment