public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] IBM VSCSI Client: sending client info to  server
@ 2005-06-27 22:01 Linda Xie
  2005-06-29 14:41 ` Dave C Boutcher
  2005-07-01 23:47 ` Anton Blanchard
  0 siblings, 2 replies; 4+ messages in thread
From: Linda Xie @ 2005-06-27 22:01 UTC (permalink / raw)
  To: James.Bottomley; +Cc: linux-scsi, linux-kernel, Dave C Boutcher, Santiago Leon

[-- Attachment #1: Type: text/plain, Size: 329 bytes --]

Hi James,

The attached patch fixes the problem in IBM VSCSI Client  where the 
client doesn't send
the information which is expected by the server.

Comments are welcome.

If there are no objections, I would like to get this upstream.

Thanks,

Linda Xie
IBM Linux Technology Center

Signed-off-by: Linda Xie <lxie@us.ibm.com>


[-- Attachment #2: mainline-IBMVSCSI-CLIENT-madinfo.patch --]
[-- Type: text/plain, Size: 3837 bytes --]

diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/ibmvscsi.c madinfo/drivers/scsi/ibmvscsi/ibmvscsi.c
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/ibmvscsi.c	2005-06-20 19:00:43.000000000 -0500
+++ madinfo/drivers/scsi/ibmvscsi/ibmvscsi.c	2005-06-24 16:36:16.000000000 -0500
@@ -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
 	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 "
diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/rpa_vscsi.c madinfo/drivers/scsi/ibmvscsi/rpa_vscsi.c
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-03-02 01:38:13.000000000 -0600
+++ madinfo/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-06-24 16:36:16.000000000 -0500
@@ -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_q
 	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
 	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,
diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/srp.h madinfo/drivers/scsi/ibmvscsi/srp.h
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/srp.h	2005-03-02 01:38:33.000000000 -0600
+++ madinfo/drivers/scsi/ibmvscsi/srp.h	2005-06-24 16:36:16.000000000 -0500
@@ -28,6 +28,8 @@
 #ifndef SRP_H
 #define SRP_H
 
+#define SRP_VERSION "16.a"
+
 #define PACKED __attribute__((packed))
 
 enum srp_types {

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

* Re: [PATCH] IBM VSCSI Client: sending client info to  server
  2005-06-27 22:01 [PATCH] IBM VSCSI Client: sending client info to server Linda Xie
@ 2005-06-29 14:41 ` Dave C Boutcher
  2005-07-01 23:47 ` Anton Blanchard
  1 sibling, 0 replies; 4+ messages in thread
From: Dave C Boutcher @ 2005-06-29 14:41 UTC (permalink / raw)
  To: Linda Xie; +Cc: James.Bottomley, linux-scsi, linux-kernel, Santiago Leon

On Mon, Jun 27, 2005 at 05:01:48PM -0500, Linda Xie wrote:
> Hi James,
> 
> The attached patch fixes the problem in IBM VSCSI Client  where the 
> client doesn't send
> the information which is expected by the server.
> 
> Comments are welcome.
> 
> If there are no objections, I would like to get this upstream.
> 
> Thanks,
> 
> Linda Xie
> IBM Linux Technology Center
> 
> Signed-off-by: Linda Xie <lxie@us.ibm.com>

Ack

Dave Boutcher


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

* Re: [PATCH] IBM VSCSI Client: sending client info to  server
  2005-06-27 22:01 [PATCH] IBM VSCSI Client: sending client info to server Linda Xie
  2005-06-29 14:41 ` Dave C Boutcher
@ 2005-07-01 23:47 ` Anton Blanchard
  2005-07-06 16:07   ` Linda Xie
  1 sibling, 1 reply; 4+ messages in thread
From: Anton Blanchard @ 2005-07-01 23:47 UTC (permalink / raw)
  To: Linda Xie
  Cc: James.Bottomley, linux-scsi, linux-kernel, Dave C Boutcher,
	Santiago Leon


Hi,
 
> The attached patch fixes the problem in IBM VSCSI Client where the 
> client doesn't send the information which is expected by the server.

...

> +	printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION);

Just a small thing, should the printk say SRP_VERSION?

Anton

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

* Re: [PATCH] IBM VSCSI Client: sending client info to  server
  2005-07-01 23:47 ` Anton Blanchard
@ 2005-07-06 16:07   ` Linda Xie
  0 siblings, 0 replies; 4+ messages in thread
From: Linda Xie @ 2005-07-06 16:07 UTC (permalink / raw)
  To: Anton Blanchard
  Cc: James.Bottomley, linux-scsi, linux-kernel, Dave C Boutcher,
	Santiago Leon

[-- Attachment #1: Type: text/plain, Size: 437 bytes --]

Anton Blanchard wrote:

>Hi,
> 
>  
>
>>The attached patch fixes the problem in IBM VSCSI Client where the 
>>client doesn't send the information which is expected by the server.
>>    
>>
>
>...
>
>  
>
>>+	printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION);
>>    
>>
>
>Just a small thing, should the printk say SRP_VERSION?
>
>Anton
>
>  
>
Anton, thank you for catching my typo.  Attached is an updated version.

Linda



[-- Attachment #2: mainline-IBMVSCSI-CLIENT-madinfo.patch --]
[-- Type: text/plain, Size: 3837 bytes --]

diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/ibmvscsi.c madinfo/drivers/scsi/ibmvscsi/ibmvscsi.c
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/ibmvscsi.c	2005-06-20 19:00:43.000000000 -0500
+++ madinfo/drivers/scsi/ibmvscsi/ibmvscsi.c	2005-06-24 16:36:16.000000000 -0500
@@ -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
 	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 "
diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/rpa_vscsi.c madinfo/drivers/scsi/ibmvscsi/rpa_vscsi.c
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-03-02 01:38:13.000000000 -0600
+++ madinfo/drivers/scsi/ibmvscsi/rpa_vscsi.c	2005-07-06 11:31:31.000000000 -0500
@@ -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: SRP_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_q
 	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
 	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,
diff -X ../dontdiff -purN linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/srp.h madinfo/drivers/scsi/ibmvscsi/srp.h
--- linux-2.6.12-rc5-git10-orig/drivers/scsi/ibmvscsi/srp.h	2005-03-02 01:38:33.000000000 -0600
+++ madinfo/drivers/scsi/ibmvscsi/srp.h	2005-06-24 16:36:16.000000000 -0500
@@ -28,6 +28,8 @@
 #ifndef SRP_H
 #define SRP_H
 
+#define SRP_VERSION "16.a"
+
 #define PACKED __attribute__((packed))
 
 enum srp_types {

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

end of thread, other threads:[~2005-07-07  0:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-27 22:01 [PATCH] IBM VSCSI Client: sending client info to server Linda Xie
2005-06-29 14:41 ` Dave C Boutcher
2005-07-01 23:47 ` Anton Blanchard
2005-07-06 16:07   ` Linda Xie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox