ia64/linux-2.6.18-xen.hg

changeset 757:8761101c3ed5

[PVSCSI] Fix some issues

Signed-off-by: James Harper <james.harper@bendigoit.com.au>
Signed-off-by: Tomonari Horikoshi <t.horikoshi@jp.fujitsu.com>
Signed-off-by: Jun Kamada <kama@jp.fujitsu.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Dec 09 13:03:14 2008 +0000 (2008-12-09)
parents eccc622d03af
children 8e3025f94790
files drivers/xen/scsiback/emulate.c
line diff
     1.1 --- a/drivers/xen/scsiback/emulate.c	Tue Dec 09 13:02:38 2008 +0000
     1.2 +++ b/drivers/xen/scsiback/emulate.c	Tue Dec 09 13:03:14 2008 +0000
     1.3 @@ -73,6 +73,11 @@
     1.4  #define VSCSI_MAX_SCSI_OP_CODE		256
     1.5  static unsigned char bitmap[VSCSI_MAX_SCSI_OP_CODE];
     1.6  
     1.7 +#define NO_EMULATE(cmd) \
     1.8 +	bitmap[cmd] = VSCSIIF_NEED_CMD_EXEC; \
     1.9 +	pre_function[cmd] = NULL; \
    1.10 +	post_function[cmd] = NULL
    1.11 +
    1.12  
    1.13  
    1.14  /*
    1.15 @@ -377,74 +382,89 @@ void scsiback_emulation_init(void)
    1.16  	*/
    1.17  
    1.18  	/*
    1.19 -	  This command is Non emulation.
    1.20 +	  Following commands do not require emulation.
    1.21  	*/
    1.22 -	bitmap[TEST_UNIT_READY] = VSCSIIF_NEED_CMD_EXEC;
    1.23 -	pre_function[TEST_UNIT_READY] = NULL;
    1.24 -	post_function[TEST_UNIT_READY] = NULL;
    1.25 -
    1.26 -	bitmap[REZERO_UNIT] = VSCSIIF_NEED_CMD_EXEC;
    1.27 -	pre_function[REZERO_UNIT] = NULL;
    1.28 -	post_function[REZERO_UNIT] = NULL;
    1.29 -
    1.30 -	bitmap[REQUEST_SENSE] = VSCSIIF_NEED_CMD_EXEC;
    1.31 -	pre_function[REQUEST_SENSE] = NULL;
    1.32 -	post_function[REQUEST_SENSE] = NULL;
    1.33 -
    1.34 -	bitmap[FORMAT_UNIT] = VSCSIIF_NEED_CMD_EXEC;
    1.35 -	pre_function[FORMAT_UNIT] = NULL;
    1.36 -	post_function[FORMAT_UNIT] = NULL;
    1.37 -
    1.38 -	bitmap[READ_BLOCK_LIMITS] = VSCSIIF_NEED_CMD_EXEC;
    1.39 -	pre_function[READ_BLOCK_LIMITS] = NULL;
    1.40 -	post_function[READ_BLOCK_LIMITS] = NULL;
    1.41 -
    1.42 -	bitmap[READ_6] = VSCSIIF_NEED_CMD_EXEC;
    1.43 -	pre_function[READ_6] = NULL;
    1.44 -	post_function[READ_6] = NULL;
    1.45 -
    1.46 -	bitmap[WRITE_6] = VSCSIIF_NEED_CMD_EXEC;
    1.47 -	pre_function[WRITE_6] = NULL;
    1.48 -	post_function[WRITE_6] = NULL;
    1.49 +	NO_EMULATE(TEST_UNIT_READY);       /*0x00*/
    1.50 +	NO_EMULATE(REZERO_UNIT);           /*0x01*/
    1.51 +	NO_EMULATE(REQUEST_SENSE);         /*0x03*/
    1.52 +	NO_EMULATE(FORMAT_UNIT);           /*0x04*/
    1.53 +	NO_EMULATE(READ_BLOCK_LIMITS);     /*0x05*/
    1.54 +	/*NO_EMULATE(REASSIGN_BLOCKS);       *//*0x07*/
    1.55 +	/*NO_EMULATE(INITIALIZE_ELEMENT_STATUS); *//*0x07*/
    1.56 +	NO_EMULATE(READ_6);                /*0x08*/
    1.57 +	NO_EMULATE(WRITE_6);               /*0x0a*/
    1.58 +	/*NO_EMULATE(SEEK_6);                *//*0x0b*/
    1.59 +	/*NO_EMULATE(READ_REVERSE);          *//*0x0f*/
    1.60 +	NO_EMULATE(WRITE_FILEMARKS);       /*0x10*/
    1.61 +	NO_EMULATE(SPACE);                 /*0x11*/
    1.62 +	NO_EMULATE(INQUIRY);               /*0x12*/
    1.63 +	/*NO_EMULATE(RECOVER_BUFFERED_DATA); *//*0x14*/
    1.64 +	/*NO_EMULATE(MODE_SELECT);           *//*0x15*/
    1.65 +	/*NO_EMULATE(RESERVE);               *//*0x16*/
    1.66 +	/*NO_EMULATE(RELEASE);               *//*0x17*/
    1.67 +	/*NO_EMULATE(COPY);                  *//*0x18*/
    1.68 +	NO_EMULATE(ERASE);                 /*0x19*/
    1.69 +	NO_EMULATE(MODE_SENSE);            /*0x1a*/
    1.70 +	/*NO_EMULATE(START_STOP);            *//*0x1b*/
    1.71 +	/*NO_EMULATE(RECEIVE_DIAGNOSTIC);    *//*0x1c*/
    1.72 +	NO_EMULATE(SEND_DIAGNOSTIC);       /*0x1d*/
    1.73 +	/*NO_EMULATE(ALLOW_MEDIUM_REMOVAL);  *//*0x1e*/
    1.74  
    1.75 -	bitmap[WRITE_FILEMARKS] = VSCSIIF_NEED_CMD_EXEC;
    1.76 -	pre_function[WRITE_FILEMARKS] = NULL;
    1.77 -	post_function[WRITE_FILEMARKS] = NULL;
    1.78 -
    1.79 -	bitmap[SPACE] = VSCSIIF_NEED_CMD_EXEC;
    1.80 -	pre_function[SPACE] = NULL;
    1.81 -	post_function[SPACE] = NULL;
    1.82 -
    1.83 -	bitmap[INQUIRY] = VSCSIIF_NEED_CMD_EXEC;
    1.84 -	pre_function[INQUIRY] = NULL;
    1.85 -	post_function[INQUIRY] = NULL;
    1.86 -
    1.87 -	bitmap[ERASE] = VSCSIIF_NEED_CMD_EXEC;
    1.88 -	pre_function[ERASE] = NULL;
    1.89 -	post_function[ERASE] = NULL;
    1.90 -
    1.91 -	bitmap[MODE_SENSE] = VSCSIIF_NEED_CMD_EXEC;
    1.92 -	pre_function[MODE_SENSE] = NULL;
    1.93 -	post_function[MODE_SENSE] = NULL;
    1.94 -
    1.95 -	bitmap[SEND_DIAGNOSTIC] = VSCSIIF_NEED_CMD_EXEC;
    1.96 -	pre_function[SEND_DIAGNOSTIC] = NULL;
    1.97 -	post_function[SEND_DIAGNOSTIC] = NULL;
    1.98 -
    1.99 -	bitmap[READ_CAPACITY] = VSCSIIF_NEED_CMD_EXEC;
   1.100 -	pre_function[READ_CAPACITY] = NULL;
   1.101 -	post_function[READ_CAPACITY] = NULL;
   1.102 -
   1.103 -	bitmap[READ_10] = VSCSIIF_NEED_CMD_EXEC;
   1.104 -	pre_function[READ_10] = NULL;
   1.105 -	post_function[READ_10] = NULL;
   1.106 -
   1.107 -	bitmap[WRITE_10] = VSCSIIF_NEED_CMD_EXEC;
   1.108 -	pre_function[WRITE_10] = NULL;
   1.109 -	post_function[WRITE_10] = NULL;
   1.110 +	/*NO_EMULATE(SET_WINDOW);            *//*0x24*/
   1.111 +	NO_EMULATE(READ_CAPACITY);         /*0x25*/
   1.112 +	NO_EMULATE(READ_10);               /*0x28*/
   1.113 +	NO_EMULATE(WRITE_10);              /*0x2a*/
   1.114 +	/*NO_EMULATE(SEEK_10);               *//*0x2b*/
   1.115 +	/*NO_EMULATE(POSITION_TO_ELEMENT);   *//*0x2b*/
   1.116 +	/*NO_EMULATE(WRITE_VERIFY);          *//*0x2e*/
   1.117 +	/*NO_EMULATE(VERIFY);                *//*0x2f*/
   1.118 +	/*NO_EMULATE(SEARCH_HIGH);           *//*0x30*/
   1.119 +	/*NO_EMULATE(SEARCH_EQUAL);          *//*0x31*/
   1.120 +	/*NO_EMULATE(SEARCH_LOW);            *//*0x32*/
   1.121 +	/*NO_EMULATE(SET_LIMITS);            *//*0x33*/
   1.122 +	/*NO_EMULATE(PRE_FETCH);             *//*0x34*/
   1.123 +	/*NO_EMULATE(READ_POSITION);         *//*0x34*/
   1.124 +	/*NO_EMULATE(SYNCHRONIZE_CACHE);     *//*0x35*/
   1.125 +	/*NO_EMULATE(LOCK_UNLOCK_CACHE);     *//*0x36*/
   1.126 +	/*NO_EMULATE(READ_DEFECT_DATA);      *//*0x37*/
   1.127 +	/*NO_EMULATE(MEDIUM_SCAN);           *//*0x38*/
   1.128 +	/*NO_EMULATE(COMPARE);               *//*0x39*/
   1.129 +	/*NO_EMULATE(COPY_VERIFY);           *//*0x3a*/
   1.130 +	/*NO_EMULATE(WRITE_BUFFER);          *//*0x3b*/
   1.131 +	/*NO_EMULATE(READ_BUFFER);           *//*0x3c*/
   1.132 +	/*NO_EMULATE(UPDATE_BLOCK);          *//*0x3d*/
   1.133 +	/*NO_EMULATE(READ_LONG);             *//*0x3e*/
   1.134 +	/*NO_EMULATE(WRITE_LONG);            *//*0x3f*/
   1.135 +	/*NO_EMULATE(CHANGE_DEFINITION);     *//*0x40*/
   1.136 +	/*NO_EMULATE(WRITE_SAME);            *//*0x41*/
   1.137 +	/*NO_EMULATE(READ_TOC);              *//*0x43*/
   1.138 +	/*NO_EMULATE(LOG_SELECT);            *//*0x4c*/
   1.139 +	/*NO_EMULATE(LOG_SENSE);             *//*0x4d*/
   1.140 +	/*NO_EMULATE(MODE_SELECT_10);        *//*0x55*/
   1.141 +	/*NO_EMULATE(RESERVE_10);            *//*0x56*/
   1.142 +	/*NO_EMULATE(RELEASE_10);            *//*0x57*/
   1.143 +	/*NO_EMULATE(MODE_SENSE_10);         *//*0x5a*/
   1.144 +	/*NO_EMULATE(PERSISTENT_RESERVE_IN); *//*0x5e*/
   1.145 +	/*NO_EMULATE(PERSISTENT_RESERVE_OUT); *//*0x5f*/
   1.146 +	/*           REPORT_LUNS             *//*0xa0*//*Full emulaiton*/
   1.147 +	/*NO_EMULATE(MOVE_MEDIUM);           *//*0xa5*/
   1.148 +	/*NO_EMULATE(EXCHANGE_MEDIUM);       *//*0xa6*/
   1.149 +	/*NO_EMULATE(READ_12);               *//*0xa8*/
   1.150 +	/*NO_EMULATE(WRITE_12);              *//*0xaa*/
   1.151 +	/*NO_EMULATE(WRITE_VERIFY_12);       *//*0xae*/
   1.152 +	/*NO_EMULATE(SEARCH_HIGH_12);        *//*0xb0*/
   1.153 +	/*NO_EMULATE(SEARCH_EQUAL_12);       *//*0xb1*/
   1.154 +	/*NO_EMULATE(SEARCH_LOW_12);         *//*0xb2*/
   1.155 +	/*NO_EMULATE(READ_ELEMENT_STATUS);   *//*0xb8*/
   1.156 +	/*NO_EMULATE(SEND_VOLUME_TAG);       *//*0xb6*/
   1.157 +	/*NO_EMULATE(WRITE_LONG_2);          *//*0xea*/
   1.158 +	/*NO_EMULATE(READ_16);               *//*0x88*/
   1.159 +	/*NO_EMULATE(WRITE_16);              *//*0x8a*/
   1.160 +	/*NO_EMULATE(VERIFY_16);	      *//*0x8f*/
   1.161 +	/*NO_EMULATE(SERVICE_ACTION_IN);     *//*0x9e*/
   1.162  
   1.163  	/*
   1.164 -	  This command is Full emulation.
   1.165 +	  Following commands require emulation.
   1.166  	*/
   1.167  	pre_function[REPORT_LUNS] = __report_luns;
   1.168  	bitmap[REPORT_LUNS] = (VSCSIIF_NEED_EMULATE_REQBUF |