]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
Pvscsi driver accepts 16 byte CDBs, emulation rejects OUT_OF_BAND_CDB flag
authorVMware, Inc <>
Thu, 15 Oct 2009 21:04:31 +0000 (14:04 -0700)
committerMarcelo Vanzin <mvanzin@vmware.com>
Thu, 15 Oct 2009 21:04:31 +0000 (14:04 -0700)
As pointed out in bug 472258, our linux driver doesn't set
host->max_cmd_len, so the guest kernel uses the default of 12.  That
means 16-byte long commands won't make it through to our emulation at
all.  Since disklib doesn't support 2TB disks yet, its not that bad, but
we would like to support >2TB disks connected as s/g devices for klnext.
That requires READ16 and WRITE16.  One line driver fix.

The other bug here is that we advertise a flag for sending OUT_OF_BAND_CDBs,
a method for sending > 16 bytes of CDB.  We don't implement it and silently
ignore it.  Thats bad -- we'd like to at least reject these commands
so future revs of the driver could use this flag for something interesting
without worrying about silent failures.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/modules/linux/pvscsi/pvscsi.c
open-vm-tools/modules/linux/pvscsi/pvscsi_defs.h
open-vm-tools/modules/linux/pvscsi/pvscsi_version.h

index bbd8097366d2988da68dd7adbf2a5bc3b6331d9c..63e376a5727b840a742416c04e6a777c1aa20af2 100644 (file)
@@ -619,6 +619,8 @@ static void pvscsi_complete_request(struct pvscsi_adapter *adapter,
 
        LOG(3, "cmd=%p %x ctx=%p result=0x%x status=0x%x,%x\n",
                cmd, cmd->cmnd[0], ctx, cmd->result, btstat, sdstat);
+       printk(KERN_ERR "pvscsi: cmd=%p %x ctx=%p result=0x%x status=0x%x,%x\n",
+               cmd, cmd->cmnd[0], ctx, cmd->result, btstat, sdstat);
 
        cmd->scsi_done(cmd);
 }
@@ -722,6 +724,11 @@ static int pvscsi_queue_ring(struct pvscsi_adapter *adapter,
                e->flags = PVSCSI_FLAG_CMD_DIR_NONE;
        else
                e->flags = 0;
+        { static int i = 0;
+           if (++i%2)
+              //e->flags |= PVSCSI_FLAG_CMD_OUT_OF_BAND_CDB;
+              e->flags |= (1 << 5);
+        }
 
        pvscsi_map_buffers(adapter, ctx, cmd, e);
 
@@ -1269,6 +1276,7 @@ static int __devinit pvscsi_probe(struct pci_dev *pdev,
        host->max_channel = 0;
        host->max_id      = 16;
        host->max_lun     = 1;
+       host->max_cmd_len = 16;
 
        pci_read_config_byte(pdev, PCI_CLASS_REVISION, &adapter->rev);
 
index 92cac247898f6fdf5c088064f553270bb97f757b..8eccb04eab4efa3eca53b2aa4a95e44586521832 100644 (file)
@@ -449,6 +449,8 @@ PVSCSIRingsState;
 #define PVSCSI_FLAG_CMD_DIR_TOHOST          (1 << 3)
 #define PVSCSI_FLAG_CMD_DIR_TODEVICE        (1 << 4)
 
+#define PVSCSI_FLAG_RESERVED_MASK           (~MASK(5))
+
 typedef
 #include "vmware_pack_begin.h"
 struct PVSCSIRingReqDesc {
index 7156adb4d0168115d3bb8f1766dfc714755c86cd..6126c06e36c9d047a9b7fff161efc846af2c48d0 100644 (file)
@@ -25,6 +25,6 @@
 #ifndef _PVSCSI_VERSION_H_
 #define _PVSCSI_VERSION_H_
 
-#define PVSCSI_DRIVER_VERSION_STRING   "1.0.0.0"
+#define PVSCSI_DRIVER_VERSION_STRING   "1.0.1.0"
 
 #endif /* _PVSCSI_VERSION_H_ */