diff options
author | crees <crees@FreeBSD.org> | 2011-09-28 02:59:51 +0800 |
---|---|---|
committer | crees <crees@FreeBSD.org> | 2011-09-28 02:59:51 +0800 |
commit | 04498ec9e9a40bdab00551f129a96220f838609b (patch) | |
tree | ba00b92b043a0469dd9ccf4ef157ab6ec0117598 /sysutils | |
parent | 8326d7951db065d06fc70a655481b31c2a1bd074 (diff) | |
download | freebsd-ports-gnome-04498ec9e9a40bdab00551f129a96220f838609b.tar.gz freebsd-ports-gnome-04498ec9e9a40bdab00551f129a96220f838609b.tar.zst freebsd-ports-gnome-04498ec9e9a40bdab00551f129a96220f838609b.zip |
Fix with atacam driver.
PR: ports/161018
Submitted by: Alex Samorukov <samm@os2.kiev.ua> (maintainer)
Obtained from: https://sourceforge.net/apps/trac/smartmontools/ticket/198
Diffstat (limited to 'sysutils')
-rw-r--r-- | sysutils/smartmontools/Makefile | 2 | ||||
-rw-r--r-- | sysutils/smartmontools/files/patch-os_freebsd | 74 |
2 files changed, 75 insertions, 1 deletions
diff --git a/sysutils/smartmontools/Makefile b/sysutils/smartmontools/Makefile index 627cfeaf17d4..83557246be65 100644 --- a/sysutils/smartmontools/Makefile +++ b/sysutils/smartmontools/Makefile @@ -7,7 +7,7 @@ PORTNAME= smartmontools PORTVERSION= 5.41 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= sysutils MASTER_SITES= SF diff --git a/sysutils/smartmontools/files/patch-os_freebsd b/sysutils/smartmontools/files/patch-os_freebsd new file mode 100644 index 000000000000..097cec21b4bf --- /dev/null +++ b/sysutils/smartmontools/files/patch-os_freebsd @@ -0,0 +1,74 @@ +$FreeBSD$ + +This patch from upstream address 2 issues: + +1) SMART health status is always "GOOD" with atacam driver. +2) Command "-l scterc" is broken on ata and atacam drivers. + +See https://sourceforge.net/apps/trac/smartmontools/ticket/198 for more +details. + +NOTE: Path stripped from filename to make make patch work, but otherwise +identical to the patch in the ticket. + +Index: trunk/smartmontools/os_freebsd.cpp +=================================================================== +--- os_freebsd.cpp (revision 3407) ++++ os_freebsd.cpp (revision 3421) +@@ -288,10 +288,10 @@ + break; + case ata_cmd_in::data_in: +- request.flags=ATA_CMD_READ; ++ request.flags=ATA_CMD_READ | ATA_CMD_CONTROL; + request.data=(char *)in.buffer; + request.count=in.size; + break; + case ata_cmd_in::data_out: +- request.flags=ATA_CMD_WRITE; ++ request.flags=ATA_CMD_WRITE | ATA_CMD_CONTROL; + request.data=(char *)in.buffer; + request.count=in.size; +@@ -300,6 +300,6 @@ + return set_err(ENOSYS); + } +- +- clear_err(); ++ ++ clear_err(); + errno = 0; + if (do_cmd(&request, in.in_regs.is_48bit_cmd())) +@@ -390,5 +390,5 @@ + if (request->count == 0) + camflags = CAM_DIR_NONE; +- else if (request->flags == ATA_CMD_READ) ++ else if (request->flags & ATA_CMD_READ) + camflags = CAM_DIR_IN; + else +@@ -406,9 +406,6 @@ + request->timeout * 1000); // timeout in seconds + ++ ccb.ataio.cmd.flags = CAM_ATAIO_NEEDRESULT; + // ata_28bit_cmd +- if (request->flags == ATA_CMD_CONTROL) +- ccb.ataio.cmd.flags = CAM_ATAIO_NEEDRESULT; +- else +- ccb.ataio.cmd.flags = 0; + ccb.ataio.cmd.command = request->u.ata.command; + ccb.ataio.cmd.features = request->u.ata.feature; +@@ -436,5 +433,15 @@ + } + +- request->u.ata.count = ccb.ataio.res.sector_count; ++ request->u.ata.lba = ++ ((u_int64_t)(ccb.ataio.res.lba_low)) | ++ ((u_int64_t)(ccb.ataio.res.lba_mid) << 8) | ++ ((u_int64_t)(ccb.ataio.res.lba_high) << 16) | ++ ((u_int64_t)(ccb.ataio.res.lba_low_exp) << 24) | ++ ((u_int64_t)(ccb.ataio.res.lba_mid_exp) << 32) | ++ ((u_int64_t)(ccb.ataio.res.lba_high_exp) << 40); ++ ++ request->u.ata.count = ccb.ataio.res.sector_count | (ccb.ataio.res.sector_count_exp << 8); ++ request->error = ccb.ataio.res.error; ++ + return 0; + } |