Ignore:
Timestamp:
2018-01-17T01:36:46Z (8 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
740dafc
Parents:
3f44312
git-author:
Ondřej Hlavatý <aearsis@…> (2018-01-16 23:24:28)
git-committer:
Ondřej Hlavatý <aearsis@…> (2018-01-17 01:36:46)
Message:

uhci: fix transfer aborting

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r3f44312 r2755a622  
    179179
    180180                        batch->ep->toggle = td_toggle(&uhci_batch->tds[i]);
    181                         if (i > 0)
    182                                 goto substract_ret;
    183                         return true;
     181                        goto substract_ret;
    184182                }
    185183
     
    190188        }
    191189substract_ret:
    192         if (batch->ep->transfer_type == USB_TRANSFER_CONTROL)
     190        if (batch->transfered_size > 0 && batch->ep->transfer_type == USB_TRANSFER_CONTROL) {
     191                assert(batch->transfered_size >= USB_SETUP_PACKET_SIZE);
    193192                batch->transfered_size -= USB_SETUP_PACKET_SIZE;
    194 
    195         fibril_mutex_lock(&batch->ep->guard);
    196         endpoint_deactivate_locked(batch->ep);
    197         fibril_mutex_unlock(&batch->ep->guard);
     193        }
    198194
    199195        if (batch->dir == USB_DIRECTION_IN) {
Note: See TracChangeset for help on using the changeset viewer.