svn commit: r213717 - head/sys/dev/usb

Gleb Smirnoff glebius at FreeBSD.org
Tue Oct 12 09:41:42 UTC 2010


Author: glebius
Date: Tue Oct 12 09:41:42 2010
New Revision: 213717
URL: http://svn.freebsd.org/changeset/base/213717

Log:
  We already have dummy receive buffer in sc->buffer.
  
  Suggested by:	hselasky

Modified:
  head/sys/dev/usb/usb_msctest.c

Modified: head/sys/dev/usb/usb_msctest.c
==============================================================================
--- head/sys/dev/usb/usb_msctest.c	Tue Oct 12 09:18:17 2010	(r213716)
+++ head/sys/dev/usb/usb_msctest.c	Tue Oct 12 09:41:42 2010	(r213717)
@@ -98,7 +98,6 @@ static uint8_t scsi_huawei_eject[] =	{ 0
 					  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
 					  0x00, 0x00, 0x00, 0x00 };
 static uint8_t scsi_tct_eject[] =	{ 0x06, 0xf5, 0x04, 0x02, 0x52, 0x70 };
-static uint8_t scsi_tct_dummy[4];
 
 #define	BULK_SIZE		64	/* dummy */
 #define	ERR_CSW_FAILED		-1
@@ -621,8 +620,12 @@ usb_msc_eject(struct usb_device *udev, u
 		    USB_MS_HZ);
 		break;
 	case MSC_EJECT_TCT:
-		err = bbb_command_start(sc, DIR_IN, 0, &scsi_tct_dummy,
-		    sizeof(scsi_tct_dummy), &scsi_tct_eject,
+		/*
+		 * TCTMobile needs DIR_IN flag. To get it, we
+		 * supply a dummy data with the command.
+		 */
+		err = bbb_command_start(sc, DIR_IN, 0, &sc->buffer,
+		    sizeof(sc->buffer), &scsi_tct_eject,
 		    sizeof(scsi_tct_eject), USB_MS_HZ);
 		break;
 	default:


More information about the svn-src-all mailing list