Fixed the USB Mass Storage CBW in Facedancer. Was one byte short of the proper one...
authortravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 25 Aug 2012 20:16:08 +0000 (20:16 +0000)
committertravisutk <travisutk@12e2690d-a6be-4b82-a7b7-67c4a43b65c8>
Sat, 25 Aug 2012 20:16:08 +0000 (20:16 +0000)
git-svn-id: https://svn.code.sf.net/p/goodfet/code/trunk@1244 12e2690d-a6be-4b82-a7b7-67c4a43b65c8

client/GoodFETMAXUSB.py
client/goodfet.maxusbmass

index d38bfa7..af95558 100644 (file)
@@ -219,10 +219,10 @@ class GoodFETMAXUSB(GoodFET):
             self.wreg(rEPIRQ,bmOUT1DAVIRQ); #Clear the bit *AFTER* servicing.
         if(epirq&bmIN3BAVIRQ): #IN3-IN packet
             self.do_IN3();
-            self.wreg(rEPIRQ,bmIN3BAVIRQ); #Clear the bit
+            #self.wreg(rEPIRQ,bmIN3BAVIRQ); #Clear the bit
         if(epirq&bmIN2BAVIRQ): #IN2 packet
             self.do_IN2();
-            self.wreg(rEPIRQ,bmIN2BAVIRQ); #Clear the bit
+            #self.wreg(rEPIRQ,bmIN2BAVIRQ); #Clear the bit
         #else:
         #    print "No idea how to service this IRQ: %02x" % epirq;
     def do_IN2(self):
index c644827..a40ca1a 100755 (executable)
@@ -168,14 +168,9 @@ class GoodFETMAXUSBMass(GoodFETMAXUSBDevice):
     
     def do_IN3(self):
         """Handle IN3 input event."""
-        #Don't bother clearing interrupt flag, that's done by sending the reply.
-        print "Got an input event, no idea what to do about it.";
-        #This would be for FTDI emulation.  Not for Mass Storage.
-        #self.wreg(rEP3INFIFO,0x01);      #Modem 
-        #self.wreg(rEP3INFIFO,0x00);      #Line 
-        #self.wreg(rEP3INFIFO,0x00);
-        #self.wregAS(rEP3INBC,0);
-        
+        # Do nothing here, as it'll be taken care of elsewhere.  The
+        # interrupt just means that the buffer is empty, not that we
+        # are expected to fill it.
         
     def do_OUT1(self):
         """Handle an OUT1 output event."""
@@ -183,6 +178,7 @@ class GoodFETMAXUSBMass(GoodFETMAXUSBDevice):
         l=self.rreg(rEP1OUTBC);
         frame=self.readbytes(rEP1OUTFIFO,l);
         self.handleCBW(frame);
+        
     lastCBW="";
     def handleCBW(self,cbw):
         """Handles an incoming Command Block Wrapper.  See USB Mass
@@ -282,7 +278,7 @@ class GoodFETMAXUSBMass(GoodFETMAXUSBDevice):
             #CBW key; must be the same as the one we're replying to.
             ord(cbw[4]),ord(cbw[5]),ord(cbw[6]),ord(cbw[7]),
             #CSW Data Residue, probably oughtn't be zeroed.
-            0,0,0,
+            0,0,0,0,
             #Status byte: 00 for good, 01 for bad.
             status];
         self.writebytes(rEP3INFIFO,