add scsi backend and frontend RING interface
PATCH 3/4 add scsi backend and frontend RING interface
[PATCH 3/4] [LINUX] add scsi backend and frontend RING interface
Best regards,
Tomonari Horikoshi
# HG changeset patch
# User [email protected]
# Date 1184323375 -32400
# Node ID 507b4b60a51bc0d2af719684b6ee4da186cd0bca # Parent ca71e255bf4b97fecdd75a5aef970d08fb9e8fa5 [LINUX] add scsi backend and frontend RING interface
Signed-off-by Tomonari Horikoshi <[email protected]>
Signed-off-by Tsunehisa Doi <[email protected]>
Signed-off-by Jun Kamada <[email protected]>
Signed-off-by Akira Hayakawa <[email protected]>
include/xen/interface/io/scsiif.h new file +89 -0
@@ -0,0 +1,89 @@ +/****************************************************************************** +* scsiif.h +* +* Based on the blkif.h code. +* +* Permission is hereby granted, free of charge, to any person obtaining a copy +* of this software and associated documentation files (the "Software"), to +* deal in the Software without restriction, including without limitation the +* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +* sell copies of the Software, and to permit persons to whom the Software is +* furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice shall be included in +* all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +* DEALINGS IN THE SOFTWARE. +* +* Copyright(c) FUJITSU Limited 2007. +*/ + +#ifndef __XEN__PUBLIC_IO_SCSI_H__ +#define __XEN__PUBLIC_IO_SCSI_H__ + +#include "ring.h" +#include "../grant_table.h" + +#define DEFAULT_CAN_QUEUE 256 +#define SG_TABLESIZE 32 +#define VSCSI_MAX_COMMAND_SIZE 16 + +/* Frontend to Backend request*/ +struct scsiif_ftb_request { + +uint8_t cmnd[VSCSI_MAX_COMMAND_SIZE ]; +uint8_t cmd_len; +uint32_t id, lun, channel; +uint16_t sc_data_direction; +uint16_t use_sg; +uint16_t request_bufflen; +int32_t retries; +int32_t timeout_per_command; +uint64_t rqid; +struct scsiif_request_segment { +grant_ref_t gref; +uint32_t offset; +uint32_t length; + } seg[SG_TABLESIZE ]; + +}; + +/* Frontend to Backend response*/ +struct scsiif_ftb_response { +#if 0 /*FJVMIO*/ +uint64_t rqid; +int32_t result; +uint64_t sense_len; +#define SCSI_SENSE_BUFFERSIZE 96 +uint8_t sense_buffer[SCSI_SENSE_BUFFERSIZE ]; +#endif +}; + + +/* Backend to Front request*/ +struct scsiif_btf_request { +uint64_t rqid; +int32_t result; +uint64_t sense_len; +#define SCSI_SENSE_BUFFERSIZE 96 +uint8_t sense_buffer[SCSI_SENSE_BUFFERSIZE ]; +}; + +/* Backend to Front request*/ +struct scsiif_btf_response { +#if 0 /*FJVMIO*/ +uint8_t buf[BUFFSIZE ]; +#endif +}; + + +DEFINE_RING_TYPES(scsiif_ftb, struct scsiif_ftb_request, struct scsiif_ftb_response); +DEFINE_RING_TYPES(scsiif_btf, struct scsiif_btf_request, struct scsiif_btf_response); + +#endif
_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel