Unfortunately, <scsi/sg.h> 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.
# include <scsi/sg.h>
#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,
--- /dev/null
+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