Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Oct 2010 09:41:42 +0000 (UTC)
From:      Gleb Smirnoff <glebius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r213717 - head/sys/dev/usb
Message-ID:  <201010120941.o9C9fgd8043816@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010120941.o9C9fgd8043816>