|
|
1.1 ! root 1: \ ***************************************************************************** ! 2: \ * Copyright (c) 2004, 2008 IBM Corporation ! 3: \ * All rights reserved. ! 4: \ * This program and the accompanying materials ! 5: \ * are made available under the terms of the BSD License ! 6: \ * which accompanies this distribution, and is available at ! 7: \ * http://www.opensource.org/licenses/bsd-license.php ! 8: \ * ! 9: \ * Contributors: ! 10: \ * IBM Corporation - initial implementation ! 11: \ ****************************************************************************/ ! 12: ! 13: ! 14: s" bulk" device-name ! 15: ! 16: ! 17: \ standard open firmare method ! 18: ! 19: ! 20: : open true ; ! 21: ! 22: \ standard open firmare method ! 23: ! 24: ! 25: : close ; ! 26: ! 27: ! 28: \ ------------------------------------------------- ! 29: \ Locals ! 30: \ ------------------------------------------------ ! 31: ! 32: ! 33: 8 chars alloc-mem VALUE setup-packet ! 34: ! 35: ! 36: \ -------------------------------------------------- ! 37: \ signature --->4bytes offset --->0 ! 38: \ tag --->4bytes offset --->4 ! 39: \ trans-len --->4bytes offset --->8 ! 40: \ dir-flag --->1byte offset --->c ! 41: \ lun --->1byte offset --->d ! 42: \ comm-len --->1byte offset --->e ! 43: \ -------------------------------------------------- ! 44: ! 45: ! 46: 0 VALUE cbw-addr ! 47: : build-cbw ( address tag transfer-len direction lun command-len -- ) ! 48: 5 pick TO cbw-addr ( address tag transfer-len direction lun command-len ) ! 49: cbw-addr 0f erase ( address tag transfer-len direction lun command-len ) ! 50: cbw-addr e + c! ( address tag transfer-len direction lun ) ! 51: cbw-addr d + c! ( address tag transfer-len direction ) ! 52: cbw-addr c + c! ( address tag transfer-len ) ! 53: cbw-addr 8 + l!-le ( address tag ) ! 54: cbw-addr 4 + l!-le ( address ) ! 55: 43425355 cbw-addr l!-le ( address ) ! 56: drop ; ! 57: ! 58: ! 59: \ --------------------------------------------------- ! 60: \ signature --->4bytes offset --->0 ! 61: \ tag --->4bytes offset --->4 ! 62: \ residue --->4bytes offset --->8 ! 63: \ status --->1byte offset --->c ! 64: \ --------------------------------------------------- ! 65: ! 66: ! 67: 0 VALUE csw-addr ! 68: : analyze-csw ( address -- residue tag true|reason false ) ! 69: TO csw-addr ! 70: csw-addr l@-le 53425355 = IF ! 71: csw-addr c + c@ dup 0= IF ( reason ) ! 72: drop ! 73: csw-addr 8 + l@-le ( residue ) ! 74: csw-addr 4 + l@-le ( residue tag ) \ command block tag ! 75: TRUE ( residue tag TRUE ) ! 76: ELSE ! 77: FALSE ( reason FALSE ) ! 78: THEN ! 79: ELSE ! 80: FALSE ( FALSE ) ! 81: THEN ! 82: csw-addr 0c erase ! 83: ; ! 84: ! 85: : bulk-reset-recovery-procedure ( bulk-out-endp bulk-in-endp usb-addr -- ) ! 86: s" bulk-reset-recovery-procedure" $call-parent ! 87: ;
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.