request_end = self.handshake in ('ACK', 'STALL', 'timeout')
ep = self.transaction_ep
addr = self.transaction_addr
+
+ # Handle protocol STALLs, condition lasts until next SETUP transfer (8.5.3.4)
+ if self.transaction_type == 'SETUP' and (addr, ep) in self.request:
+ request = self.request[(addr,ep)]
+ if request['type'] in ('SETUP IN', 'SETUP OUT'):
+ request['es'] = self.ss_transaction
+ self.handle_request(0, 1)
+
if not (addr, ep) in self.request:
self.request[(addr, ep)] = {'setup_data': [], 'data': [],
'type': None, 'ss': self.ss_transaction, 'es': None,
request_started = 1
request = self.request[(addr,ep)]
+ if request_end:
+ request['handshake'] = self.handshake
+
# BULK or INTERRUPT transfer
if request['type'] in (None, 'BULK IN') and self.transaction_type == 'IN':
request['type'] = 'BULK IN'
s += ' ]['
for b in request['data']:
s += ' %02X' % b
- s += ' ] : %s' % self.handshake
+ s += ' ] : %s' % request['handshake']
return s
def handle_request(self, request_start, request_end):