qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] spapr-vscsi: Adding VSCSI capabilities
@ 2013-08-23  9:22 Alexey Kardashevskiy
  2013-08-25 16:41 ` Alexander Graf
  0 siblings, 1 reply; 26+ messages in thread
From: Alexey Kardashevskiy @ 2013-08-23  9:22 UTC (permalink / raw)
  To: qemu-devel
  Cc: Nikunj A Dadhania, aik, Alexander Graf, qemu-ppc, Paolo Bonzini

From: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>

This implements capabilities exchange between host and client.
As at the moment no capability is supported, put zero flags everywhere
and return.

Signed-off-by: Nikunj A Dadhania <nikunj@linux.vnet.ibm.com>
Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
 hw/scsi/spapr_vscsi.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/hw/scsi/spapr_vscsi.c b/hw/scsi/spapr_vscsi.c
index c5ff794..cc35b1b 100644
--- a/hw/scsi/spapr_vscsi.c
+++ b/hw/scsi/spapr_vscsi.c
@@ -919,6 +919,34 @@ static int vscsi_send_adapter_info(VSCSIState *s, vscsi_req *req)
     return vscsi_send_iu(s, req, sizeof(*sinfo), VIOSRP_MAD_FORMAT);
 }
 
+static int vscsi_send_capabilities(VSCSIState *s, vscsi_req *req)
+{
+    struct viosrp_capabilities *vcap;
+    struct capabilities cap;
+    int rc;
+
+    vcap = &req->iu.mad.capabilities;
+    rc = spapr_vio_dma_read(&s->vdev, be64_to_cpu(vcap->buffer),
+                            &cap, be16_to_cpu(vcap->common.length));
+    if (rc)  {
+        fprintf(stderr, "vscsi_send_capabilities: DMA write failure !\n");
+    }
+
+    cap.flags = 0;
+    cap.migration.ecl = 0;
+    cap.reserve.type = 0;
+    cap.migration.common.server_support = 0;
+    cap.reserve.common.server_support = 0;
+    rc = spapr_vio_dma_write(&s->vdev, be64_to_cpu(vcap->buffer),
+                             &cap, be16_to_cpu(vcap->common.length));
+    if (rc)  {
+        fprintf(stderr, "vscsi_send_capabilities: DMA write failure !\n");
+    }
+    vcap->common.status = rc ? cpu_to_be32(1) : 0;
+
+    return vscsi_send_iu(s, req, sizeof(*vcap), VIOSRP_MAD_FORMAT);
+}
+
 static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req)
 {
     union mad_iu *mad = &req->iu.mad;
@@ -939,6 +967,9 @@ static int vscsi_handle_mad_req(VSCSIState *s, vscsi_req *req)
         mad->host_config.common.status = cpu_to_be16(1);
         vscsi_send_iu(s, req, sizeof(mad->host_config), VIOSRP_MAD_FORMAT);
         break;
+    case VIOSRP_CAPABILITIES_TYPE:
+        vscsi_send_capabilities(s, req);
+        break;
     default:
         fprintf(stderr, "VSCSI: Unknown MAD type %02x\n",
                 be32_to_cpu(mad->empty_iu.common.type));
-- 
1.8.4.rc4

^ permalink raw reply related	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2013-08-27  9:28 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-23  9:22 [Qemu-devel] [PATCH] spapr-vscsi: Adding VSCSI capabilities Alexey Kardashevskiy
2013-08-25 16:41 ` Alexander Graf
2013-08-25 20:51   ` Benjamin Herrenschmidt
2013-08-26 13:37     ` Paolo Bonzini
2013-08-27  0:45       ` Benjamin Herrenschmidt
2013-08-25 22:10   ` Benjamin Herrenschmidt
2013-08-26  4:32     ` Nikunj A Dadhania
2013-08-26  5:44       ` Alexander Graf
2013-08-26  6:22         ` Benjamin Herrenschmidt
2013-08-26  8:43           ` Alexander Graf
2013-08-26  9:08             ` Nikunj A Dadhania
2013-08-26  9:52               ` Alexander Graf
2013-08-26 10:03             ` Benjamin Herrenschmidt
2013-08-26 10:47         ` Nikunj A Dadhania
2013-08-26 10:58         ` Nikunj A Dadhania
2013-08-26 11:17           ` Alexander Graf
2013-08-26 11:46             ` Nikunj A Dadhania
2013-08-26 11:49               ` Alexander Graf
2013-08-27  5:14                 ` Nikunj A Dadhania
2013-08-27  5:43                 ` Nikunj A Dadhania
2013-08-27  8:45                   ` Alexander Graf
2013-08-27  9:27                     ` Nikunj A Dadhania
2013-08-26  6:19       ` Benjamin Herrenschmidt
2013-08-26  9:06         ` Nikunj A Dadhania
2013-08-26 13:42           ` Paolo Bonzini
2013-08-27  5:11             ` Nikunj A Dadhania

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).