aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/usb/umass.c
diff options
context:
space:
mode:
authorNick Hibma <n_hibma@FreeBSD.org>2000-04-02 21:59:27 +0000
committerNick Hibma <n_hibma@FreeBSD.org>2000-04-02 21:59:27 +0000
commit767fd36c733167e2567366010b6bb054f6833351 (patch)
tree9024fa91bcb6bf66ceab54a8b4e41da72e5f55a0 /sys/dev/usb/umass.c
parent7054370f40c2c8b836af33fd0a83ffb8436f9199 (diff)
downloadsrc-767fd36c733167e2567366010b6bb054f6833351.tar.gz
src-767fd36c733167e2567366010b6bb054f6833351.zip
Remove a static variable, a uniquifier for a SCSI command. It might have
produced inadvertently failed transfers in the case were multiple Bulk-Only devices are connected and a command is prepared at the same time.
Notes
Notes: svn path=/head/; revision=58951
Diffstat (limited to 'sys/dev/usb/umass.c')
-rw-r--r--sys/dev/usb/umass.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c
index 92b61031f5b5..6268e32e1cfc 100644
--- a/sys/dev/usb/umass.c
+++ b/sys/dev/usb/umass.c
@@ -1037,8 +1037,6 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
void *data, int datalen, int dir,
transfer_cb_f cb, void *priv)
{
- static int dCBWtag = 42; /* unique for CBW of transfer */
-
KASSERT(sc->proto & PROTO_BBB,
("sc->proto == 0x%02x wrong for umass_bbb_transfer\n",
sc->proto));
@@ -1104,10 +1102,12 @@ umass_bbb_transfer(struct umass_softc *sc, int lun, void *cmd, int cmdlen,
* 1 = data In from device to host
*/
- /* Fill in the Command Block Wrapper */
+ /* Fill in the Command Block Wrapper
+ * We fill in all the fields, so there is no need to bzero it first.
+ */
USETDW(sc->cbw.dCBWSignature, CBWSIGNATURE);
- USETDW(sc->cbw.dCBWTag, dCBWtag);
- dCBWtag++; /* cannot be done in macro (it will be done 4 times) */
+ /* We don't care what the initial value was, as long as the values are unique */
+ sc->cbw.dCBWTag++; /* Increase the tag number */
USETDW(sc->cbw.dCBWDataTransferLength, datalen);
/* DIR_NONE is treated as DIR_OUT (0x00) */
sc->cbw.bCBWFlags = (dir == DIR_IN? CBWFLAGS_IN:CBWFLAGS_OUT);