diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2021-05-02 01:09:24 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2021-05-02 01:09:24 +0000 |
commit | 0791cf6b3cd25a054d12c42425cbb8ffee7e598a (patch) | |
tree | e50a551f783363a35d07893dd9db836d60080e0b /include/sg_lib.h | |
parent | 28400776770cf5453f196690fcd24e353c5826e0 (diff) | |
download | sg3_utils-0791cf6b3cd25a054d12c42425cbb8ffee7e598a.tar.gz |
major rework of lib/sg_pt_freebsd.c; sg_raw: fix prints of NVMe NVM command names
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@896 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'include/sg_lib.h')
-rw-r--r-- | include/sg_lib.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/include/sg_lib.h b/include/sg_lib.h index 006c566c..ae228bcc 100644 --- a/include/sg_lib.h +++ b/include/sg_lib.h @@ -67,7 +67,7 @@ extern "C" { /* The SCSI status codes as found in SAM-4 at www.t10.org */ #define SAM_STAT_GOOD 0x0 #define SAM_STAT_CHECK_CONDITION 0x2 -#define SAM_STAT_CONDITION_MET 0x4 +#define SAM_STAT_CONDITION_MET 0x4 /* this is not an error */ #define SAM_STAT_BUSY 0x8 #define SAM_STAT_INTERMEDIATE 0x10 /* obsolete in SAM-4 */ #define SAM_STAT_INTERMEDIATE_CONDITION_MET 0x14 /* obsolete in SAM-4 */ @@ -189,6 +189,10 @@ struct sg_scsi_sense_hdr { uint8_t additional_length; /* zero for fixed format sense data */ }; +/* Returns true when status is SAM_STAT_GOOD or SAM_STAT_CONDITION_MET, + * returns false otherwise. Ignores bit 0. */ +bool sg_scsi_status_is_good(int sstatus); + /* Maps the salient data from a sense buffer which is in either fixed or * descriptor format into a structure mimicking a descriptor format * header (i.e. the first 8 bytes of sense descriptor format). |