diff options
author | Linda Xie <lxiep@us.ibm.com> | 2005-06-27 18:01:48 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.(none)> | 2005-07-02 20:25:09 -0400 |
commit | b4687ca42cb82a7821f682dde0310b16ce284770 (patch) | |
tree | e36a26a2908369535d89863626934e269976d662 | |
parent | fc2b035d38c06a884cb521bb4a1e1183f5eaccf1 (diff) |
[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>
-rw-r--r-- | drivers/scsi/ibmvscsi/ibmvscsi.c | 4 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/rpa_vscsi.c | 51 | ||||
-rw-r--r-- | drivers/scsi/ibmvscsi/srp.h | 2 |
3 files changed, 54 insertions, 3 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index d89b8eb3cdf3..fe09d145542a 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c | |||
@@ -87,7 +87,7 @@ static int max_channel = 3; | |||
87 | static int init_timeout = 5; | 87 | static int init_timeout = 5; |
88 | static int max_requests = 50; | 88 | static int max_requests = 50; |
89 | 89 | ||
90 | #define IBMVSCSI_VERSION "1.5.5" | 90 | #define IBMVSCSI_VERSION "1.5.6" |
91 | 91 | ||
92 | MODULE_DESCRIPTION("IBM Virtual SCSI"); | 92 | MODULE_DESCRIPTION("IBM Virtual SCSI"); |
93 | MODULE_AUTHOR("Dave Boutcher"); | 93 | MODULE_AUTHOR("Dave Boutcher"); |
@@ -675,8 +675,6 @@ static void send_mad_adapter_info(struct ibmvscsi_host_data *hostdata) | |||
675 | struct viosrp_adapter_info *req; | 675 | struct viosrp_adapter_info *req; |
676 | struct srp_event_struct *evt_struct; | 676 | struct srp_event_struct *evt_struct; |
677 | 677 | ||
678 | memset(&hostdata->madapter_info, 0x00, sizeof(hostdata->madapter_info)); | ||
679 | |||
680 | evt_struct = get_event_struct(&hostdata->pool); | 678 | evt_struct = get_event_struct(&hostdata->pool); |
681 | if (!evt_struct) { | 679 | if (!evt_struct) { |
682 | printk(KERN_ERR "ibmvscsi: couldn't allocate an event " | 680 | printk(KERN_ERR "ibmvscsi: couldn't allocate an event " |
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 @@ | |||
33 | #include <linux/dma-mapping.h> | 33 | #include <linux/dma-mapping.h> |
34 | #include <linux/interrupt.h> | 34 | #include <linux/interrupt.h> |
35 | #include "ibmvscsi.h" | 35 | #include "ibmvscsi.h" |
36 | #include "srp.h" | ||
37 | |||
38 | static char partition_name[97] = "UNKNOWN"; | ||
39 | static unsigned int partition_number = -1; | ||
36 | 40 | ||
37 | /* ------------------------------------------------------------ | 41 | /* ------------------------------------------------------------ |
38 | * Routines for managing the command/response queue | 42 | * Routines for managing the command/response queue |
@@ -148,6 +152,48 @@ static void ibmvscsi_task(void *data) | |||
148 | } | 152 | } |
149 | } | 153 | } |
150 | 154 | ||
155 | static void gather_partition_info(void) | ||
156 | { | ||
157 | struct device_node *rootdn; | ||
158 | |||
159 | char *ppartition_name; | ||
160 | unsigned int *p_number_ptr; | ||
161 | |||
162 | /* Retrieve information about this partition */ | ||
163 | rootdn = find_path_device("/"); | ||
164 | if (!rootdn) { | ||
165 | return; | ||
166 | } | ||
167 | |||
168 | ppartition_name = | ||
169 | get_property(rootdn, "ibm,partition-name", NULL); | ||
170 | if (ppartition_name) | ||
171 | strncpy(partition_name, ppartition_name, | ||
172 | sizeof(partition_name)); | ||
173 | p_number_ptr = | ||
174 | (unsigned int *)get_property(rootdn, "ibm,partition-no", | ||
175 | NULL); | ||
176 | if (p_number_ptr) | ||
177 | partition_number = *p_number_ptr; | ||
178 | } | ||
179 | |||
180 | static void set_adapter_info(struct ibmvscsi_host_data *hostdata) | ||
181 | { | ||
182 | memset(&hostdata->madapter_info, 0x00, | ||
183 | sizeof(hostdata->madapter_info)); | ||
184 | |||
185 | printk(KERN_INFO "rpa_vscsi: SPR_VERSION: %s\n", SRP_VERSION); | ||
186 | strcpy(hostdata->madapter_info.srp_version, SRP_VERSION); | ||
187 | |||
188 | strncpy(hostdata->madapter_info.partition_name, partition_name, | ||
189 | sizeof(hostdata->madapter_info.partition_name)); | ||
190 | |||
191 | hostdata->madapter_info.partition_number = partition_number; | ||
192 | |||
193 | hostdata->madapter_info.mad_version = 1; | ||
194 | hostdata->madapter_info.os_type = 2; | ||
195 | } | ||
196 | |||
151 | /** | 197 | /** |
152 | * initialize_crq_queue: - Initializes and registers CRQ with hypervisor | 198 | * initialize_crq_queue: - Initializes and registers CRQ with hypervisor |
153 | * @queue: crq_queue to initialize and register | 199 | * @queue: crq_queue to initialize and register |
@@ -177,6 +223,9 @@ int ibmvscsi_init_crq_queue(struct crq_queue *queue, | |||
177 | if (dma_mapping_error(queue->msg_token)) | 223 | if (dma_mapping_error(queue->msg_token)) |
178 | goto map_failed; | 224 | goto map_failed; |
179 | 225 | ||
226 | gather_partition_info(); | ||
227 | set_adapter_info(hostdata); | ||
228 | |||
180 | rc = plpar_hcall_norets(H_REG_CRQ, | 229 | rc = plpar_hcall_norets(H_REG_CRQ, |
181 | vdev->unit_address, | 230 | vdev->unit_address, |
182 | queue->msg_token, PAGE_SIZE); | 231 | queue->msg_token, PAGE_SIZE); |
@@ -246,6 +295,8 @@ void ibmvscsi_reset_crq_queue(struct crq_queue *queue, | |||
246 | memset(queue->msgs, 0x00, PAGE_SIZE); | 295 | memset(queue->msgs, 0x00, PAGE_SIZE); |
247 | queue->cur = 0; | 296 | queue->cur = 0; |
248 | 297 | ||
298 | set_adapter_info(hostdata); | ||
299 | |||
249 | /* And re-open it again */ | 300 | /* And re-open it again */ |
250 | rc = plpar_hcall_norets(H_REG_CRQ, | 301 | rc = plpar_hcall_norets(H_REG_CRQ, |
251 | vdev->unit_address, | 302 | vdev->unit_address, |
diff --git a/drivers/scsi/ibmvscsi/srp.h b/drivers/scsi/ibmvscsi/srp.h index e952c1cd9740..2ae5154fd89c 100644 --- a/drivers/scsi/ibmvscsi/srp.h +++ b/drivers/scsi/ibmvscsi/srp.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #ifndef SRP_H | 28 | #ifndef SRP_H |
29 | #define SRP_H | 29 | #define SRP_H |
30 | 30 | ||
31 | #define SRP_VERSION "16.a" | ||
32 | |||
31 | #define PACKED __attribute__((packed)) | 33 | #define PACKED __attribute__((packed)) |
32 | 34 | ||
33 | enum srp_types { | 35 | enum srp_types { |