aboutsummaryrefslogtreecommitdiff
path: root/lib/sg_cmds_basic.c
AgeCommit message (Collapse)Author
2022-11-04add two new exit status values: SG_LIB_CAT_STANDBY and ↵Douglas Gilbert
SG_LIB_CAT_UNAVAILABLE which refine the 'not ready' exit status git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@980 6180dd3e-e324-4e3e-922d-17de1ae2f315
2022-08-12sg_inq+sg_vpd: more JSON work (add SG_C_CPP_ZERO_INIT)Douglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@966 6180dd3e-e324-4e3e-922d-17de1ae2f315
2022-01-28cleanup masks for PDT [0x1f] and group_number [0x3f]Douglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@934 6180dd3e-e324-4e3e-922d-17de1ae2f315
2022-01-19round of coverity identified issue fixes (and non-issues)Douglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@931 6180dd3e-e324-4e3e-922d-17de1ae2f315
2021-11-20sg_z_act_query: new utility for sending either a Zone activate or Zone query ↵Douglas Gilbert
command; sg_rep_zones: add Report zone starting LBA granularity field in REPORT ZONES response [zbc2r12]; sg_decode_sense: add --nodecode option; initialize all sense buffers to 0; rework main README file git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@923 6180dd3e-e324-4e3e-922d-17de1ae2f315
2021-08-30improve transport error handling. To fix report of a BAD_TARGET transport ↵Douglas Gilbert
error but the utility still continued. introduce SG_LIB_TRANSPORT_ERROR [35] exit status git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@910 6180dd3e-e324-4e3e-922d-17de1ae2f315
2021-08-01sg_ses: fix crash when 'm LEN' < 252Douglas Gilbert
Cleanups suggested cppcheck git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@907 6180dd3e-e324-4e3e-922d-17de1ae2f315
2021-06-07sg_vpd: fix do_hex type on some recent pages; sg_dd: don't close negative ↵Douglas Gilbert
file descriptors; pt_linux_nvme: fix fua setting git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@903 6180dd3e-e324-4e3e-922d-17de1ae2f315
2020-11-10tweak transport error handling in Linux; sg_compare_and_write: add examples ↵Douglas Gilbert
section to its manpage; testing git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@866 6180dd3e-e324-4e3e-922d-17de1ae2f315
2020-07-24sg_turs: estimated time-to-ready, add --delay=MS option; sg_requests: ↵Douglas Gilbert
cleanup; sg_pt: add partial_clear_scsi_pt_obj, get_scsi_pt_cdb_len and get_scsi_pt_cdb_buf git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@857 6180dd3e-e324-4e3e-922d-17de1ae2f315
2020-05-03sg_ses: use fan speed factor field for calculation [ses4r04]; sg_lib: ↵Douglas Gilbert
reprint cdb with illegal request sense key git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@850 6180dd3e-e324-4e3e-922d-17de1ae2f315
2019-12-27sg_lib: add sg_get_command_str() and sg_print_command_len(); ↵Douglas Gilbert
sg_verify+sg_write_same: fix and --ff option; sg_dd+sgh_dd: add --verify support git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@837 6180dd3e-e324-4e3e-922d-17de1ae2f315
2019-09-17sync with fixes from Redhat, via github; remove testing/Makefile.cplus and ↵Douglas Gilbert
testing/Makefile.cplus_fb git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@832 6180dd3e-e324-4e3e-922d-17de1ae2f315
2019-01-31linux: add nanosecond durations when SG3_UTILS_LINUX_NANO environment ↵Douglas Gilbert
variable given git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@809 6180dd3e-e324-4e3e-922d-17de1ae2f315
2019-01-14sg_lib: tweak sg_pt interface to better handle bidi; sg_cmds_process_resp(): ↵Douglas Gilbert
two arguments removed git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@805 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-12-07add: SPDX-License-Identifier: BSD-2-Clause (or gpl-2-or-later); ↵Douglas Gilbert
testing/sgs_dd.c work git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@797 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-07-13sg_turs: fix exit status when not ready in single case; sg_lib: add ↵Douglas Gilbert
sg_ll_start_stop_unit_pt(); sg_tst_context: add --verbose optin, other tweaks git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@782 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-06-29sg_opcode: support MLU, Multiple Logical Units (18-045r1); sg_lib: ↵Douglas Gilbert
sg_simple_inquiry_pt(); ./configure: option --enable-debug added for testing git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@779 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-06-03sg_decode sense: add --err=ES; sg_dd, sgp_dd, sgm_dd: add --dry-run and ↵Douglas Gilbert
--verbose options; introduce SG3_UTILS_DSENSE environment variable; sg_lib: add sg_nvme_desc2sense(), sg_build_sense_buffer(), and pr2ws() git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@777 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-05-30define SG_NVME_VPD_NICR sg3_utils (vendor) specific VPD page; work with ↵Douglas Gilbert
SG_LIB_LBA_OUT_OF_RANGE git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@775 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-05-24add SG_LIB_LOGIC_ERROR and SG_LIB_CONTRADICT; implement across many ↵Douglas Gilbert
utilities and increase usage of sg_convert_errno() git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@774 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-05-02sg_lib: add sg_ll_inquiry_pt(), sg_ll_test_unit_ready_progress_pt(), ↵Douglas Gilbert
sg_ll_request_sense_pt(), sg_ll_send_diag_pt(), sg_ll_receive_diag_pt(); sg_timestamp: add --elapsed, --hex and --no-timestamp options; sg_ses: check for NVMe enclosure bits git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@769 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-03-05sg_ses: --data=@FN with --status now decodes dpage(s) in FN; add --quiet ↵Douglas Gilbert
option to suppress messages git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@758 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-02-22sg_lib: add sg_if_can2stdout(); use uint8_t instead of unsigned char; ↵Douglas Gilbert
Windows pass-through work git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@754 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-02-11fix compile error in sg_pt_win32.c when NVME_IGNORE; sg_raw: add ↵Douglas Gilbert
--cmdfile=CF option git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@752 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-02-04add sg_convert_errno() and sg_if_can2stderr(); work on NVMe support for ↵Douglas Gilbert
Win32; add REPORT SUPPORTED OPCODES+TMFs to SNTL git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@749 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-01-28add sg_seek and sg_stream_ctl utilities; properly identify vendor-specific ↵Douglas Gilbert
sense; documentation cleanup git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@747 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-01-19add hex2stdout(), hex2stderr() and hex2str(); add testing/sg_tst_nvme; clean ↵Douglas Gilbert
Makefile.freebsd in examples/ and testing/; NVMe error processing git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@745 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-01-13sg_ses_microcode: add --dry-run and --ealsd; sg_write_buffer: add --dry-runDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@744 6180dd3e-e324-4e3e-922d-17de1ae2f315
2018-01-09FreeBSD port now works with NVMe SNTL and sg3_ses pass-through (NVME-MI); ↵Douglas Gilbert
man page cleanups; improve SNTL translation to VPD page 0x83 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@743 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-12-09Clean C++ and clang errors and warnings; fix FreeBSD problem; sg_write_x: ↵Douglas Gilbert
bit more work git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@735 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-10-31sg_lib: add sg_msense_calc_length(); sg_pt: add dummy pt_device_is_nvme()Douglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@727 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-10-22sg_lib: add sg_ll_log_sense_v2(), sg_ll_mode_sense10_v2() and ↵Douglas Gilbert
sg_ll_receive_diag_v2(); documentation cleanup; sg_ses: filter join output on dpage element presence (AES dpage) git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@722 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-10-09convert lots of two valued 'int's to bool; add sg_ll_inquiry_v2() ↵Douglas Gilbert
sg_ll_write_buffer_v2() sg_get_sfs_name() and sg_decode_transportid_str() git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@719 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-09-22block limits and block limit extension VPD pages: add extra info about ↵Douglas Gilbert
corner cases; add SG_LIB_UNBOUNDED_32BIT (_16BIT and _64BIT) defines to help with decoding corner cases git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@716 6180dd3e-e324-4e3e-922d-17de1ae2f315
2017-09-18https://github.com/hreinecke/sg3_utils branch sles15 synced 20170914; change ↵Douglas Gilbert
sg_ll_*() function's 'int noisy' to bool git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@715 6180dd3e-e324-4e3e-922d-17de1ae2f315
2016-05-28cdb naming clean upDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@709 6180dd3e-e324-4e3e-922d-17de1ae2f315
2016-04-05more clang clean ups; allow clang to check printf() style argumentsDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@690 6180dd3e-e324-4e3e-922d-17de1ae2f315
2016-04-02sg_raw: add '--enumerate' optionDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@688 6180dd3e-e324-4e3e-922d-17de1ae2f315
2016-01-27sg_logs: LPS misalignment lpage; sg_format: add ffmt option; sg_lib: big ↵Douglas Gilbert
sense reporting rework git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@657 6180dd3e-e324-4e3e-922d-17de1ae2f315
2015-12-20rescan-scsi-bus.sh: updates from Suse; sg_lib: add 'sense' categories for ↵Douglas Gilbert
SCSI statuses; pr2serr() rework; drop SUGGEST_* git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@654 6180dd3e-e324-4e3e-922d-17de1ae2f315
2015-12-01sg_timestamp: new, to report or set timestampDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@650 6180dd3e-e324-4e3e-922d-17de1ae2f315
2015-05-12sg_lib: Linux: ENXIO errno --> SG_LIB_CAT_NOT_READY; asc/ascq codes --> T10 ↵Douglas Gilbert
20150423 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@644 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-10-07sg_ll_inquiry(), sg_ll_mode_sense*(), sg_ll_log_sense(): use resid to clear ↵Douglas Gilbert
unfilled data-in buffer; sg_format, sg_sanitize: output unit serial number and LU name prior to git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@613 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-06-12examples/sg_persist_tst.sh: add --exclusive optionDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@588 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-06-06sg_luns: add decoding for conglomerate LUNS; change struct ↵Douglas Gilbert
sg_simple_inquiry_resp::rmb to byte_1 git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@586 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-05-15add 'sense' categories for reservation conflict, data protect and protection ↵Douglas Gilbert
information violations; add sg_get_category_sense_str() to API git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@577 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-03-03sg_inq+sg_vpd: add HAW_ZBC in block char. VPD page (14-018r02); 2nd level ↵Douglas Gilbert
debug outputs resid>0 values (was 1st level) git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@557 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-02-23sg_inq: improve unit serial number display (VPD page 0x80)Douglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@556 6180dd3e-e324-4e3e-922d-17de1ae2f315
2014-02-18sg_inq: allow --page=-1 to force std INQUIRY decodingDouglas Gilbert
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@555 6180dd3e-e324-4e3e-922d-17de1ae2f315