Going forward it is possible that some of the commands that are not currently
implemented will be implemented on future Windows hosts. Make command filtering
depend on the host version.

Signed-off-by: K. Y. Srinivasan <k...@microsoft.com>
Cc: <sta...@vger.kernel.org>
---
 drivers/scsi/storvsc_drv.c |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
index 2e4131c..759853c 100644
--- a/drivers/scsi/storvsc_drv.c
+++ b/drivers/scsi/storvsc_drv.c
@@ -1556,9 +1556,14 @@ static int storvsc_queuecommand(struct Scsi_Host *host, 
struct scsi_cmnd *scmnd)
        struct vmscsi_request *vm_srb;
        struct stor_mem_pools *memp = scmnd->device->hostdata;
 
-       if (!storvsc_scsi_cmd_ok(scmnd)) {
-               scmnd->scsi_done(scmnd);
-               return 0;
+       if (vmstor_current_major <= VMSTOR_WIN8_MAJOR) {
+               /*
+                * On legacy hosts filter unimplemented commands.
+                */
+               if (!storvsc_scsi_cmd_ok(scmnd)) {
+                       scmnd->scsi_done(scmnd);
+                       return 0;
+               }
        }
 
        request_size = sizeof(struct storvsc_cmd_request);
-- 
1.7.4.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to