Skip to content
Snippets Groups Projects
Commit ee7d326e authored by dlukes's avatar dlukes
Browse files

os_freebsd.cpp: Added support for CHECK_POWER_MODE and WRITE_LOG commands

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@2686 4ea69e1a-61f1-4043-bf83-b5c94c648137
parent 78776eb5
No related branches found
No related tags found
No related merge requests found
CHANGELOG for smartmontools CHANGELOG for smartmontools
$Id: CHANGELOG,v 1.754 2008/12/10 22:09:34 manfred99 Exp $ $Id: CHANGELOG,v 1.755 2008/12/17 12:30:18 dlukes Exp $
The most recent version of this file is: The most recent version of this file is:
http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup http://smartmontools.cvs.sourceforge.net/smartmontools/sm5/CHANGELOG?view=markup
...@@ -35,11 +35,15 @@ Maintainers / Developers Key: ...@@ -35,11 +35,15 @@ Maintainers / Developers Key:
[RZ] Richard Zybert [RZ] Richard Zybert
[SZ] Sf Zhou [SZ] Sf Zhou
[JPH] Jordan Powell Hargrave [JPH] Jordan Powell Hargrave
[DL] Dan Lukes
NOTES FOR FUTURE RELEASES: see TODO file. NOTES FOR FUTURE RELEASES: see TODO file.
<DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE> <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
[DL] os_freebsd.cpp:
Added support for CHECK_POWER_MODE and WRITE_LOG commands
[MS] knowndrives.cpp update: [MS] knowndrives.cpp update:
There seem to exist WD Raptors with SATA II interface, add them. There seem to exist WD Raptors with SATA II interface, add them.
......
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
#include "extern.h" #include "extern.h"
#include "os_freebsd.h" #include "os_freebsd.h"
static const char *filenameandversion="$Id: os_freebsd.cpp,v 1.69 2008/11/03 17:00:47 dpgilbert Exp $"; static const char *filenameandversion="$Id: os_freebsd.cpp,v 1.70 2008/12/17 12:30:18 dlukes Exp $";
const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp,v 1.69 2008/11/03 17:00:47 dpgilbert Exp $" \ const char *os_XXXX_c_cvsid="$Id: os_freebsd.cpp,v 1.70 2008/12/17 12:30:18 dlukes Exp $" \
ATACMDS_H_CVSID CCISS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_FREEBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID; ATACMDS_H_CVSID CCISS_H_CVSID CONFIG_H_CVSID INT64_H_CVSID OS_FREEBSD_H_CVSID SCSICMDS_H_CVSID UTILITY_H_CVSID;
extern smartmonctrl * con; extern smartmonctrl * con;
...@@ -387,6 +387,20 @@ int ata_command_interface(int fd, smart_command_set command, int select, char *d ...@@ -387,6 +387,20 @@ int ata_command_interface(int fd, smart_command_set command, int select, char *d
request.u.ata.lba=0xc24f<<8; request.u.ata.lba=0xc24f<<8;
request.flags=ATA_CMD_CONTROL; request.flags=ATA_CMD_CONTROL;
break; break;
case CHECK_POWER_MODE:
request.u.ata.command=ATA_CHECK_POWER_MODE;
request.u.ata.feature=0;
request.flags=ATA_CMD_CONTROL;
break;
case WRITE_LOG:
memcpy(buff, data, 512);
request.u.ata.feature=ATA_SMART_WRITE_LOG_SECTOR;
request.u.ata.lba=select|(0xc24f<<8);
request.u.ata.count=1;
request.flags=ATA_CMD_WRITE;
request.data=(char *)buff;
request.count=512;
break;
default: default:
pout("Unrecognized command %d in ata_command_interface()\n" pout("Unrecognized command %d in ata_command_interface()\n"
"Please contact " PACKAGE_BUGREPORT "\n", command); "Please contact " PACKAGE_BUGREPORT "\n", command);
...@@ -444,6 +458,10 @@ int ata_command_interface(int fd, smart_command_set command, int select, char *d ...@@ -444,6 +458,10 @@ int ata_command_interface(int fd, smart_command_set command, int select, char *d
return -1; return -1;
} }
// //
if (command == CHECK_POWER_MODE) {
data[0] = request.u.ata.count & 0xff;
return 0;
}
if (copydata) if (copydata)
memcpy(data, buff, 512); memcpy(data, buff, 512);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment