Skip to contentSkip to conversation

some fixes for the pvSCSI driver

PATCH In review Jun Kamada 1 participant 1 message Jun 4, 2008 Xen hypervisor interface

lore
Share & tools
lore

Jun Kamada

author
#0 lore raw

PATCH 3/3 some fixes for the pvSCSI driver

3.) Enable REPORT_LUN command emulation.

-----
Jun Kamada

# HG changeset patch
# User [email protected]
# Date 1212555526 -32400
# Node ID 7ac2afc0189a1e40a852bbf90576014c179a8740 # Parent ec0f837865bb151336775cdaff0873c0989b70e3 [LINUX][scsiback] Add Emulation core and REPORTLUN emulation

drivers/xen/scsiback/common.h +6 -5
diff -r ec0f837865bb -r 7ac2afc0189a drivers/xen/scsiback/common.h
@@ -60,7 +60,6 @@
 #include <xen/interface/io/ring.h>
 #include <xen/interface/grant_table.h>
 #include <xen/interface/io/vscsiif.h>
-
 
 
 #define DPRINTK(_f, _a...)			\
@@ -171,11 +170,13 @@ void scsiback_release_translation_entry(
 
 
 void scsiback_cmd_exec(pending_req_t *pending_req);
+void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
+				pending_req_t *pending_req);
+void scsiback_fast_flush_area(pending_req_t *req);
 
-#if 0 /*SAMPLE CODING(tentative)*//*emulation*/
-void scsiback_dispatch_emulation_cmdexec(vscsiif_request_t *ring_req,
-				pending_req_t *pending_req);
-#endif
+void scsiback_rsp_emulation(pending_req_t *pending_req);
+void scsiback_req_emulation_or_cmdexec(pending_req_t *pending_req);
+void scsiback_emulation_init(void);
 
 
 #endif /* __SCSIIF__BACKEND__COMMON_H__ */
drivers/xen/scsiback/emulate.c +126 -68

294 lines not on this page · raw message

drivers/xen/scsiback/scsiback.c +7 -11
diff -r ec0f837865bb -r 7ac2afc0189a drivers/xen/scsiback/scsiback.c
@@ -78,7 +78,7 @@ static unsigned long vaddr(pending_req_t
 	(pending_grant_handles[vaddr_pagenr(_req, _seg)])
 
 
-static void fast_flush_area(pending_req_t *req)
+void scsiback_fast_flush_area(pending_req_t *req)
 {
 	struct gnttab_unmap_grant_ref unmap[VSCSIIF_SG_TABLESIZE];
 	unsigned int i, invcount = 0;
@@ -141,7 +141,7 @@ static void scsiback_notify_work(struct 
 	wake_up(&info->wq);
 }
 
-static void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
+void scsiback_do_resp_with_sense(char *sense_buffer, int32_t result,
 				pending_req_t *pending_req)
 {
 	vscsiif_response_t *ring_res;
@@ -223,10 +223,8 @@ static void scsiback_cmd_done(void *data
 			__scsi_print_sense("scsiback", sense_buffer, SCSI_SENSE_BUFFERSIZE);
 	}
 
-#if 0 /*SAMPLE CODING(tentative)*//*emulation*/
 	scsiback_rsp_emulation(pending_req);
-#endif
-	fast_flush_area(pending_req);
+	scsiback_fast_flush_area(pending_req);
 	scsiback_do_resp_with_sense(sense_buffer, errors, pending_req);
 
 
@@ -303,7 +301,7 @@ static int scsiback_gnttab_data_map(vscs
 	return 0;
 	
 fail_flush:
-	fast_flush_area(pending_req);
+	scsiback_fast_flush_area(pending_req);
 	return -ENOMEM;
 }
 
@@ -622,11 +620,7 @@ static int scsiback_do_cmd_fn(struct vsc
 		}
 
 		if (pending_req->act == VSCSIIF_ACT_SCSI_CDB) {
-#if 0 /*SAMPLE CODING(tentative)*//*emulation*/
-			scsiback_req_emulation_or_through(pending_req);
-#else
-			scsiback_cmd_exec(pending_req);
-#endif
+			scsiback_req_emulation_or_cmdexec(pending_req);
 		} else if (pending_req->act == VSCSIIF_ACT_SCSI_RESET) {
 			scsiback_device_reset_exec(pending_req);
 		} else {
@@ -707,6 +701,8 @@ static int __init scsiback_init(void)
 	if (scsiback_xenbus_init())
 		goto out_of_memory;
 
+	scsiback_emulation_init();
+
 	return 0;
 
 out_of_memory:

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel