diff options
author | Linda Xie <lxiep@us.ibm.com> | 2005-06-28 02:01:48 +0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-07-03 04:25:09 +0400 |
commit | b4687ca42cb82a7821f682dde0310b16ce284770 (patch) | |
tree | e36a26a2908369535d89863626934e269976d662 /drivers/scsi/ibmvscsi/rpa_vscsi.c | |
parent | fc2b035d38c06a884cb521bb4a1e1183f5eaccf1 (diff) | |
download | linux-b4687ca42cb82a7821f682dde0310b16ce284770.tar.xz |
[SCSI] IBM VSCSI Client: sending client info to server
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>
Diffstat (limited to 'drivers/scsi/ibmvscsi/rpa_vscsi.c')
-rw-r--r-- | drivers/scsi/ibmvscsi/rpa_vscsi.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/scsi/ibmvscsi/rpa_vscsi.c b/drivers/scsi/ibmvscsi/rpa_vscsi.c index 50cb909f314f..035f615817d7 100644 --- a/drivers/scsi/ibmvscsi/rpa_vscsi.c +++ b/drivers/scsi/ibmvscsi/rpa_vscsi.c @@ -33,6 +33,10 @@ #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, |