From ee7912c0caceb23eb92c4cfa500cc0857fd336ca Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 9 Jan 2017 02:40:08 +0000 Subject: [PATCH] scsi: add fallback definitions for SG_* ioctl command constants Unfortunately, from libc does not provide all constants recognized by the kernel. * xlat/scsi_sg_commands.in: New file. * scsi.c: Include "xlat/scsi_sg_commands.h" instead of providing a fallback definition of SG_IO. --- scsi.c | 4 +--- xlat/scsi_sg_commands.in | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 xlat/scsi_sg_commands.in diff --git a/scsi.c b/scsi.c index 2f93de1e..7da6dece 100644 --- a/scsi.c +++ b/scsi.c @@ -32,9 +32,7 @@ # include #endif -#ifndef SG_IO -# define SG_IO 0x2285 -#endif +#include "xlat/scsi_sg_commands.h" static int decode_sg_io(struct tcb *const tcp, const uint32_t iid, diff --git a/xlat/scsi_sg_commands.in b/xlat/scsi_sg_commands.in new file mode 100644 index 00000000..e95e0d12 --- /dev/null +++ b/xlat/scsi_sg_commands.in @@ -0,0 +1,26 @@ +SG_SET_TIMEOUT 0x2201 +SG_GET_TIMEOUT 0x2202 +SG_EMULATED_HOST 0x2203 +SG_SET_TRANSFORM 0x2204 +SG_GET_TRANSFORM 0x2205 +SG_GET_COMMAND_Q 0x2270 +SG_SET_COMMAND_Q 0x2271 +SG_GET_RESERVED_SIZE 0x2272 +SG_SET_RESERVED_SIZE 0x2275 +SG_GET_SCSI_ID 0x2276 +SG_SET_FORCE_LOW_DMA 0x2279 +SG_GET_LOW_DMA 0x227a +SG_SET_FORCE_PACK_ID 0x227b +SG_GET_PACK_ID 0x227c +SG_GET_NUM_WAITING 0x227d +SG_SET_DEBUG 0x227e +SG_GET_SG_TABLESIZE 0x227F +SG_GET_VERSION_NUM 0x2282 +SG_NEXT_CMD_LEN 0x2283 +SG_SCSI_RESET 0x2284 +SG_IO 0x2285 +SG_GET_REQUEST_TABLE 0x2286 +SG_SET_KEEP_ORPHAN 0x2287 +SG_GET_KEEP_ORPHAN 0x2288 +SG_GET_ACCESS_COUNT 0x2289 +#stop -- 2.40.0