67d0a8ecfa288928c2096123a9ddfb0e5392edbf
The Linux kernel supports two different versions of the SG_IO API, namely v3 and v4. This patch adds support for version 4 of this API. At least the sg3_utils package supports version 4 of this API. Version 4 of this API is used if /dev/bsg/H:C:I:L is used as device name. This patch has been tested by inspecting the output of the following commands: modprobe scsi_debug dev_size_mb=16 delay=0 dev=$(lsscsi | sed -n '/ scsi_debug /s,^[^/]*,,p') ./strace -eioctl -s256 sg_inq $dev echo 'Test XDWRITEREAD(10)' bsg=/dev/bsg/$(lsscsi | sed -n '/ scsi_debug /s,^\[\([^]]\+\)\].*,\1,p') dd if=/dev/zero bs=512 count=1 | ./strace -eioctl -s256 sg_raw -s 512 -r 1024 $bsg 53 00 00 00 00 01 00 00 01 00 * configure.ac (AC_CHECK_HEADERS): Add linux/bsg.h. * xlat/bsg_protocol.in: New file. * xlat/bsg_subprotocol.in: Likewise. * scsi.c: Include them and <linux/bsg.h>. (print_sg_io_v3_req, print_sg_io_v3_res, print_sg_io_v4_req, print_sg_io_v4_res): New functions. (print_sg_io_req, print_sg_io_res): Use them. (scsi_ioctl): Update callers. Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com> Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
This is strace, a system call tracer for Linux. strace is released under a Berkeley-style license at the request of Paul Kranenburg; see the file COPYING for details. See the file CREDITS for a list of authors and other contributors. See the file INSTALL for compilation and installation instructions. See the file NEWS for information on what has changed in recent versions. You can get the latest version of strace from its homepage at http://sourceforge.net/projects/strace/ . Please send bug reports and enhancements to the strace mailinglist at strace-devel@lists.sourceforge.net.
Description
Languages
C
92.2%
Shell
3.4%
M4
1.4%
Makefile
0.8%
Roff
0.7%
Other
1.5%