1
0
mirror of https://git.FreeBSD.org/src.git synced 2026-06-02 11:24:32 +00:00

Import smart revision 1.0.3

Fixes armv7 and gcc14 build issues.
This commit is contained in:
Chuck Tuffli
2026-05-12 06:35:31 -07:00
parent eb3b130238
commit d2d20bb509
4 changed files with 11 additions and 14 deletions
+4
View File
@@ -1,5 +1,9 @@
This file documents changes for smart releases This file documents changes for smart releases
version 1.0.3
- Fix build errors detected by GCC14
- Fix printf build error on 32-bit systems
version 1.0.2 version 1.0.2
- Bring man page up to snuff - Bring man page up to snuff
- Fix various complier warnings - Fix various complier warnings
+5 -12
View File
@@ -121,7 +121,7 @@ __device_read_ata(smart_h h, uint32_t page, void *buf, size_t bsize, union ccb *
struct fbsd_smart *fsmart = h; struct fbsd_smart *fsmart = h;
const uint8_t *smart_fis; const uint8_t *smart_fis;
uint32_t smart_fis_size = 0; uint32_t smart_fis_size = 0;
uint32_t cam_flags = 0; uint32_t flags = 0;
uint16_t sector_count = 0; uint16_t sector_count = 0;
uint8_t protocol = 0; uint8_t protocol = 0;
@@ -129,7 +129,7 @@ __device_read_ata(smart_h h, uint32_t page, void *buf, size_t bsize, union ccb *
case PAGE_ID_ATA_SMART_READ_DATA: /* Support SMART READ DATA */ case PAGE_ID_ATA_SMART_READ_DATA: /* Support SMART READ DATA */
smart_fis = smart_read_data; smart_fis = smart_read_data;
smart_fis_size = sizeof(smart_read_data); smart_fis_size = sizeof(smart_read_data);
cam_flags = CAM_DIR_IN; flags = CAM_DIR_IN;
sector_count = 1; sector_count = 1;
protocol = AP_PROTO_PIO_IN; protocol = AP_PROTO_PIO_IN;
break; break;
@@ -137,7 +137,7 @@ __device_read_ata(smart_h h, uint32_t page, void *buf, size_t bsize, union ccb *
smart_fis = smart_return_status; smart_fis = smart_return_status;
smart_fis_size = sizeof(smart_return_status); smart_fis_size = sizeof(smart_return_status);
/* Command has no data but uses the return status */ /* Command has no data but uses the return status */
cam_flags = CAM_DIR_NONE; flags = CAM_DIR_NONE;
protocol = AP_PROTO_NON_DATA; protocol = AP_PROTO_NON_DATA;
bsize = 0; bsize = 0;
break; break;
@@ -165,7 +165,7 @@ __device_read_ata(smart_h h, uint32_t page, void *buf, size_t bsize, union ccb *
scsi_ata_pass_16(&ccb->csio, scsi_ata_pass_16(&ccb->csio,
/*retries*/ 1, /*retries*/ 1,
/*cbfcnp*/ NULL, /*cbfcnp*/ NULL,
/*flags*/ cam_flags, /*flags*/ flags,
/*tag_action*/ MSG_SIMPLE_Q_TAG, /*tag_action*/ MSG_SIMPLE_Q_TAG,
/*protocol*/ protocol, /*protocol*/ protocol,
/*ata_flags*/ cdb_flags, /*ata_flags*/ cdb_flags,
@@ -188,7 +188,7 @@ __device_read_ata(smart_h h, uint32_t page, void *buf, size_t bsize, union ccb *
cam_fill_ataio(&ccb->ataio, cam_fill_ataio(&ccb->ataio,
/* retries */1, /* retries */1,
/* cbfcnp */NULL, /* cbfcnp */NULL,
/* flags */cam_flags, /* flags */flags,
/* tag_action */0, /* tag_action */0,
/* data_ptr */buf, /* data_ptr */buf,
/* dxfer_len */bsize, /* dxfer_len */bsize,
@@ -709,8 +709,6 @@ __device_info_tunneled_ata(struct fbsd_smart *fsmart)
{ {
struct ata_params ident_data; struct ata_params ident_data;
union ccb *ccb = NULL; union ccb *ccb = NULL;
struct ata_pass_16 *ata_pass_16;
struct ata_cmd ata_cmd;
int32_t rc = -1; int32_t rc = -1;
ccb = cam_getccb(fsmart->camdev); ccb = cam_getccb(fsmart->camdev);
@@ -742,11 +740,6 @@ __device_info_tunneled_ata(struct fbsd_smart *fsmart)
/*timeout*/ 5000 /*timeout*/ 5000
); );
ata_pass_16 = (struct ata_pass_16 *)ccb->csio.cdb_io.cdb_bytes;
ata_cmd.command = ata_pass_16->command;
ata_cmd.control = ata_pass_16->control;
ata_cmd.features = ata_pass_16->features;
rc = cam_send_ccb(fsmart->camdev, ccb); rc = cam_send_ccb(fsmart->camdev, ccb);
if (rc != 0) { if (rc != 0) {
warnx("%s: scsi_ata_pass_16() failed (programmer error?)", warnx("%s: scsi_ata_pass_16() failed (programmer error?)",
+1 -1
View File
@@ -1347,7 +1347,7 @@ __smart_read_pages(smart_h h, smart_buf_t *sb)
memset(buf, 0, plist->pages[p].bytes); memset(buf, 0, plist->pages[p].bytes);
rc = device_read_log(h, plist->pages[p].id, buf, plist->pages[p].bytes); rc = device_read_log(h, plist->pages[p].id, buf, plist->pages[p].bytes);
if (rc) { if (rc) {
dprintf("bad read (%d) from page %#x (bytes=%lu)\n", rc, dprintf("bad read (%d) from page %#x (bytes=%zu)\n", rc,
plist->pages[p].id, plist->pages[p].bytes); plist->pages[p].id, plist->pages[p].bytes);
break; break;
} }
+1 -1
View File
@@ -26,7 +26,7 @@
#include "libsmart.h" #include "libsmart.h"
#define SMART_NAME "smart" #define SMART_NAME "smart"
#define SMART_VERSION "1.0.2" #define SMART_VERSION "1.0.3"
extern bool do_debug; extern bool do_debug;