win-pvdrivers

changeset 463:7f9bedb7dcf9

Updated vscsi header file to 3.3.0 version
author James Harper <james.harper@bendigoit.com.au>
date Sun Nov 23 14:58:25 2008 +1100 (2008-11-23)
parents ae1c232e7d4a
children 4f1c7b79948b
files common/include/public/io/vscsiif.h
line diff
     1.1 --- a/common/include/public/io/vscsiif.h	Sun Nov 23 14:17:34 2008 +1100
     1.2 +++ b/common/include/public/io/vscsiif.h	Sun Nov 23 14:58:25 2008 +1100
     1.3 @@ -1,8 +1,8 @@
     1.4  /******************************************************************************
     1.5 - * scsiif.h
     1.6 - * 
     1.7 + * vscsiif.h
     1.8 + *
     1.9   * Based on the blkif.h code.
    1.10 - * 
    1.11 + *
    1.12   * Permission is hereby granted, free of charge, to any person obtaining a copy
    1.13   * of this software and associated documentation files (the "Software"), to
    1.14   * deal in the Software without restriction, including without limitation the
    1.15 @@ -30,44 +30,76 @@
    1.16  #include "ring.h"
    1.17  #include "../grant_table.h"
    1.18  
    1.19 -#define VSCSIIF_CMND_SCSI			1	/* scsi */
    1.20 -#define VSCSIIF_CMND_SCSI_RESET			2	/* scsi */
    1.21 +/* command between backend and frontend */
    1.22 +#define VSCSIIF_ACT_SCSI_CDB         1    /* SCSI CDB command */
    1.23 +#define VSCSIIF_ACT_SCSI_ABORT       2    /* SCSI Device(Lun) Abort*/
    1.24 +#define VSCSIIF_ACT_SCSI_RESET       3    /* SCSI Device(Lun) Reset*/
    1.25  
    1.26 -/* ----------------------------------------------------------------------
    1.27 -	Definition of Ring Structures
    1.28 -   ---------------------------------------------------------------------- */
    1.29  
    1.30 -#define VSCSIIF_DEFAULT_CAN_QUEUE	256
    1.31 -#define VSCSIIF_MAX_COMMAND_SIZE	16
    1.32 -#define VSCSIIF_SG_TABLESIZE		27
    1.33 +#define VSCSIIF_BACK_MAX_PENDING_REQS    128
    1.34 +
    1.35 +/*
    1.36 + * Maximum scatter/gather segments per request.
    1.37 + *
    1.38 + * Considering balance between allocating al least 16 "vscsiif_request"
    1.39 + * structures on one page (4096bytes) and number of scatter gather
    1.40 + * needed, we decided to use 26 as a magic number.
    1.41 + */
    1.42 +#define VSCSIIF_SG_TABLESIZE             26
    1.43 +
    1.44 +/*
    1.45 + * base on linux kernel 2.6.18
    1.46 + */
    1.47 +#define VSCSIIF_MAX_COMMAND_SIZE         16
    1.48 +#define VSCSIIF_SENSE_BUFFERSIZE         96
    1.49 +
    1.50  
    1.51  struct vscsiif_request {
    1.52 -	uint16_t rqid;
    1.53 -	uint8_t cmd;
    1.54 -	/* SCSI */
    1.55 -	uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE];
    1.56 -	uint8_t cmd_len;
    1.57 -	uint16_t id, lun, channel;
    1.58 -	uint8_t sc_data_direction;
    1.59 -	uint8_t use_sg;
    1.60 -	uint32_t request_bufflen;
    1.61 -	/*int32_t timeout_per_command;*/
    1.62 -	struct scsiif_request_segment {
    1.63 -		grant_ref_t gref;
    1.64 -		uint16_t offset;
    1.65 -		uint16_t length;
    1.66 -	} seg[VSCSIIF_SG_TABLESIZE];
    1.67 +    uint16_t rqid;          /* private guest value, echoed in resp  */
    1.68 +    uint8_t act;            /* command between backend and frontend */
    1.69 +    uint8_t cmd_len;
    1.70 +
    1.71 +    uint8_t cmnd[VSCSIIF_MAX_COMMAND_SIZE];
    1.72 +    uint16_t timeout_per_command;     /* The command is issued by twice
    1.73 +                                         the value in Backend. */
    1.74 +    uint16_t channel, id, lun;
    1.75 +    uint16_t padding;
    1.76 +    uint8_t sc_data_direction;        /* for DMA_TO_DEVICE(1)
    1.77 +                                         DMA_FROM_DEVICE(2)
    1.78 +                                         DMA_NONE(3) requests  */
    1.79 +    uint8_t nr_segments;              /* Number of pieces of scatter-gather */
    1.80 +
    1.81 +    struct scsiif_request_segment {
    1.82 +        grant_ref_t gref;
    1.83 +        uint16_t offset;
    1.84 +        uint16_t length;
    1.85 +    } seg[VSCSIIF_SG_TABLESIZE];
    1.86 +    uint32_t reserved[3];
    1.87  };
    1.88 -
    1.89 -#define VSCSIIF_SENSE_BUFFERSIZE 	96
    1.90 +typedef struct vscsiif_request vscsiif_request_t;
    1.91  
    1.92  struct vscsiif_response {
    1.93 -	uint16_t rqid;
    1.94 -	int32_t  rslt;
    1.95 -	uint8_t sense_len;
    1.96 -	uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
    1.97 +    uint16_t rqid;
    1.98 +    uint8_t padding;
    1.99 +    uint8_t sense_len;
   1.100 +    uint8_t sense_buffer[VSCSIIF_SENSE_BUFFERSIZE];
   1.101 +    int32_t rslt;
   1.102 +    uint32_t residual_len;     /* request bufflen -
   1.103 +                                  return the value from physical device */
   1.104 +    uint32_t reserved[36];
   1.105  };
   1.106 +typedef struct vscsiif_response vscsiif_response_t;
   1.107  
   1.108  DEFINE_RING_TYPES(vscsiif, struct vscsiif_request, struct vscsiif_response);
   1.109  
   1.110 -#endif
   1.111 \ No newline at end of file
   1.112 +
   1.113 +#endif  /*__XEN__PUBLIC_IO_SCSI_H__*/
   1.114 +/*
   1.115 + * Local variables:
   1.116 + * mode: C
   1.117 + * c-set-style: "BSD"
   1.118 + * c-basic-offset: 4
   1.119 + * tab-width: 4
   1.120 + * indent-tabs-mode: nil
   1.121 + * End:
   1.122 + */