Skip to content
Snippets Groups Projects
Commit 005b4d6b authored by dpgilbert's avatar dpgilbert
Browse files

remove linux specific libata detect, rely on SAT detection

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2324 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent b11f2c06
Branches
No related tags found
No related merge requests found
......@@ -47,7 +47,7 @@
#include "scsicmds.h"
#include "utility.h"
const char *scsicmds_c_cvsid="$Id: scsicmds.cpp,v 1.91 2006/09/12 00:25:44 dpgilbert Exp $"
const char *scsicmds_c_cvsid="$Id: scsicmds.cpp,v 1.92 2006/11/12 04:45:54 dpgilbert Exp $"
CONFIG_H_CVSID EXTERN_H_CVSID INT64_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
/* for passing global control variables */
......@@ -2074,58 +2074,3 @@ int scsiFetchTransportProtocol(int device, int modese_len)
}
return -EINVAL;
}
/* This is Linux specific code to look for the libata ATA-SCSI
simulator in the vendor device identification page.
Returns 1 if found else 0. */
int isLinuxLibAta(unsigned char * vpd_di_buff, int len)
{
int k, id_len, c_set, assoc, id_type, i_len;
unsigned char * ucp;
unsigned char * ip;
unsigned char buff1[20];
unsigned char buff2[20];
if (len < 4) {
/* Device identification VPD page length too short */
return 0;
}
buff1[0] = '\0';
buff2[0] = '\0';
len -= 4;
ucp = vpd_di_buff + 4;
for (k = 0; k < len; k += id_len, ucp += id_len) {
i_len = ucp[3];
id_len = i_len + 4;
if ((k + id_len) > len) {
/* short descriptor, badly formed */
return 0;
}
ip = ucp + 4;
c_set = (ucp[0] & 0xf);
assoc = ((ucp[1] >> 4) & 0x3);
id_type = (ucp[1] & 0xf);
if ((0 == id_type) && (2 == c_set) && (0 == assoc)) {
/* assoc=lu, c_set=ascii, id_type=vendor */
if (0 == strncmp((const char *)ip,
"Linux ATA-SCSI simulator", i_len)) {
/* until lk 2.6.16 */
return 1;
}
memcpy(buff1, ip, sizeof(buff1));
}
if ((1 == id_type) && (2 == c_set) && (0 == assoc)) {
/* assoc=lu, c_set=ascii, id_type=t10 vendor id */
if (0 == strncmp((const char *)ip, "ATA", 3))
memcpy(buff2, ip + 48, sizeof(buff2));
}
}
if (buff1[0] && buff2[0]) {
if (0 == memcmp(buff1, buff2, sizeof(buff1))) {
/* after lk 2.6.16, look for serial number match */
return 1;
}
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment