]> pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
[SCSI] IBM VSCSI Client: sending client info to server
authorLinda Xie <lxiep@us.ibm.com>
Mon, 27 Jun 2005 22:01:48 +0000 (17:01 -0500)
committerJames Bottomley <jejb@mulgrave.(none)>
Sun, 3 Jul 2005 00:25:09 +0000 (19:25 -0500)
Fix the problem in IBM VSCSI Client where the client doesn't send the
information which is expected by the server.

Signed-off-by: Linda Xie <lxie@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/ibmvscsi/ibmvscsi.c
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/ibmvscsi/srp.h

index d89b8eb3cdf374c9b3ed552b0c66457843f59882..fe09d145542ae44f2dae5249d933f00f368f19b4 100644 (file)
@@ -87,7 +87,7 @@ static int max_channel = 3;
 static int init_timeout = 5;
 static int max_requests = 50;
 
-#define IBMVSCSI_VERSION "1.5.5"
+#define IBMVSCSI_VERSION "1.5.6"
 
 MODULE_DESCRIPTION("IBM Virtual SCSI");
 MODULE_AUTHOR("Dave Boutcher");
@@ -675,8 +675,6 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata)
        struct viosrp_adapter_info *req;
        struct srp_event_struct *evt_struct;
        
-       memset(&hostdata->madapter_info, 0x00, sizeof(hostdata->madapter_info));
-       
        evt_struct = get_event_struct(&hostdata->pool);
        if (!evt_struct) {
                printk(KERN_ERR "ibmvscsi: couldn't allocate an event "
index 50cb909f314f43ddfbb5436c752601c6adbe1b29..035f615817d74362bbbed9a767b9d92044ac4ebd 100644 (file)
 #include <linux/dma-mapping.h>
 #include <linux/interrupt.h>
 #include "ibmvscsi.h"
+#include "srp.h"
+
+static char partition_name[97] = "UNKNOWN";
+static unsigned int partition_number = -1;
 
 /* ------------------------------------------------------------
  * Routines for managing the command/response queue
@@ -148,6 +152,48 @@ static void ibmvscsi_task(void *data)
        }
 }
 
+static void gather_partition_info(void)
+{
+       struct device_node *rootdn;
+
+       char *ppartition_name;
+       unsigned int *p_number_ptr;
+
+       /* Retrieve information about this partition */
+       rootdn = find_path_device("/");
+       if (!rootdn) {
+               return;
+       }
+
+       ppartition_name =
+               get_property(rootdn, "ibm,partition-name", NULL);
+       if (ppartition_name)
+               strncpy(partition_name, ppartition_name,
+                               sizeof(partition_name));
+       p_number_ptr =
+               (unsigned int *)get_property(rootdn, "ibm,partition-no",
+                                            NULL);
+       if (p_number_ptr)
+               partition_number = *p_number_ptr;
+}
+
+static void set_adapter_info(struct ibmvscsi_host_data *hostdata)
+{
+       memset(&hostdata->madapter_info, 0x00,
+                       sizeof(hostdata->madapter_info));
+
+       printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION);
+       strcpy(hostdata->madapter_info.srp_version, SRP_VERSION);
+
+       strncpy(hostdata->madapter_info.partition_name, partition_name,
+                       sizeof(hostdata->madapter_info.partition_name));
+
+       hostdata->madapter_info.partition_number = partition_number;
+
+       hostdata->madapter_info.mad_version = 1;
+       hostdata->madapter_info.os_type = 2;
+}
+
 /**
  * initialize_crq_queue: - Initializes and registers CRQ with hypervisor
  * @queue:     crq_queue to initialize and register
@@ -177,6 +223,9 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue,
        if (dma_mapping_error(queue->msg_token))
                goto map_failed;
 
+       gather_partition_info();
+       set_adapter_info(hostdata);
+
        rc = plpar_hcall_norets(H_REG_CRQ,
                                vdev->unit_address,
                                queue->msg_token, PAGE_SIZE);
@@ -246,6 +295,8 @@ void ibmvscsi_reset_crq_queue(struct crq_queue *queue,
        memset(queue->msgs, 0x00, PAGE_SIZE);
        queue->cur = 0;
 
+       set_adapter_info(hostdata);
+
        /* And re-open it again */
        rc = plpar_hcall_norets(H_REG_CRQ,
                                vdev->unit_address,
index e952c1cd9740d18ca206846fb9e2a053d4e2a79a..2ae5154fd89cfffc0d94ec9932c539ca821f73a4 100644 (file)
@@ -28,6 +28,8 @@
 #ifndef SRP_H
 #define SRP_H
 
+#define SRP_VERSION "16.a"
+
 #define PACKED __attribute__((packed))
 
 enum srp_types {