diff options
author | n_hibma <n_hibma@FreeBSD.org> | 2000-04-02 21:59:27 +0000 |
---|---|---|
committer | n_hibma <n_hibma@FreeBSD.org> | 2000-04-02 21:59:27 +0000 |
commit | e11b908ab2aff58b2ed9eb1d85913191ca88e262 (patch) | |
tree | 9d76a4be43f2ed065b01159823eec90fe63a853d /sys | |
parent | 2aee6426537b071f44323b92889904d232d9c723 (diff) | |
download | FreeBSD-src-e11b908ab2aff58b2ed9eb1d85913191ca88e262.zip FreeBSD-src-e11b908ab2aff58b2ed9eb1d85913191ca88e262.tar.gz |
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.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/usb/umass.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index 92b6103..6268e32 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); |