patch-2.4.0-test5 linux/drivers/usb/storage/scsiglue.c

Next file: linux/drivers/usb/storage/scsiglue.h
Previous file: linux/drivers/usb/storage/scm.h
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0-test4/linux/drivers/usb/storage/scsiglue.c linux/drivers/usb/storage/scsiglue.c
@@ -1,7 +1,7 @@
 /* Driver for USB Mass Storage compliant devices
  * SCSI layer glue code
  *
- * $Id: scsiglue.c,v 1.2 2000/06/27 10:20:39 mdharm Exp $
+ * $Id: scsiglue.c,v 1.5 2000/07/24 18:55:39 mdharm Exp $
  *
  * Current development and maintainance by:
  *   (c) 1999, 2000 Matthew Dharm (mdharm-usb@one-eyed-alien.net)
@@ -135,7 +135,7 @@
 	 */
 	US_DEBUGP("-- sending US_ACT_EXIT command to thread\n");
 	us->action = US_ACT_EXIT;
-	up(&(us->sleeper));
+	wake_up(&(us->wqh));
 	down(&(us->notify));
 	
 	/* free the data structure we were using */
@@ -171,9 +171,11 @@
 	srb->scsi_done = done;
 	us->action = US_ACT_COMMAND;
 
-	/* wake up the process task */
+	/* release the lock on the structure */
 	up(&(us->queue_exclusion));
-	up(&(us->sleeper));
+
+	/* wake up the process task */
+	wake_up(&(us->wqh));
 
 	return 0;
 }
@@ -190,7 +192,7 @@
 static int command_abort( Scsi_Cmnd *srb )
 {
 	struct us_data *us = (struct us_data *)srb->host->hostdata[0];
-	api_wrapper_data *awd = (api_wrapper_data *)us->current_urb->context;
+	wait_queue_head_t *wqh = (wait_queue_head_t *)us->current_urb->context;
 
 	US_DEBUGP("command_abort() called\n");
 
@@ -207,8 +209,8 @@
 		usb_unlink_urb(us->current_urb);
 
 		/* wake the control thread up */
-		if (waitqueue_active(awd->wakeup))
-			wake_up(awd->wakeup);
+		if (waitqueue_active(wqh))
+			wake_up(wqh);
 
 		/* wait for us to be done */
 		down(&(us->notify));
@@ -335,7 +337,7 @@
 	emulated:		TRUE
 };
 
-unsigned char usb_stor_sense_notready[12] = {
+unsigned char usb_stor_sense_notready[18] = {
 	[0]	= 0x70,			    /* current error */
 	[2]	= 0x02,			    /* not ready */
 	[5]	= 0x0a,			    /* additional length */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)