From 91db08ca9640aea2e3e6a713b9208c0330ffb312 Mon Sep 17 00:00:00 2001
From: samm2 <samm2@4ea69e1a-61f1-4043-bf83-b5c94c648137>
Date: Mon, 15 Feb 2010 23:10:49 +0000
Subject: [PATCH] FreeBSD: disable 48bit commans in the ata_pass_through
 because of IOCATAREQUEST ioctl limitations

git-svn-id: https://smartmontools.svn.sourceforge.net/svnroot/smartmontools/trunk@3066 4ea69e1a-61f1-4043-bf83-b5c94c648137
---
 smartmontools/CHANGELOG      | 3 +++
 smartmontools/os_freebsd.cpp | 6 +++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/smartmontools/CHANGELOG b/smartmontools/CHANGELOG
index c56a114b3..8fce24650 100644
--- a/smartmontools/CHANGELOG
+++ b/smartmontools/CHANGELOG
@@ -43,6 +43,9 @@ NOTES FOR FUTURE RELEASES: see TODO file.
 
 <DEVELOPERS: ADDITIONS TO THE CHANGE LOG GO JUST BELOW HERE, PLEASE>
 
+  [AS] FreeBSD: disable 48-bit commands in the ata_pass_through interface, 
+       there is no 48-bit support in the IOCATAREQUEST ioctl.
+
   [CF] smartctl: Add option '-l scterc[,READTIME,WRITETIME]' to get/set
        the SCT Error Recovery Control time limit (ticket #50).
 
diff --git a/smartmontools/os_freebsd.cpp b/smartmontools/os_freebsd.cpp
index 5d114c2fe..cc832543b 100644
--- a/smartmontools/os_freebsd.cpp
+++ b/smartmontools/os_freebsd.cpp
@@ -261,7 +261,11 @@ int freebsd_ata_device::do_cmd( struct ata_ioc_request* request)
 
 bool freebsd_ata_device::ata_pass_through(const ata_cmd_in & in, ata_cmd_out & out)
 {
-  if (!ata_cmd_is_ok(in, true, true, true)) // data_out_support
+  if (!ata_cmd_is_ok(in,
+    true,  // data_out_support
+    true,  // multi_sector_support
+    false) // no ata_48bit_support via IOCATAREQUEST
+    ) 
     return false;
 
   struct ata_ioc_request request;
-- 
GitLab