Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 242f0e2 in mainline


Ignore:
Timestamp:
2011-04-15T16:13:50Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master
Children:
8595577b
Parents:
11d2e96 (diff), 3690c75 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

OHCI bulk out fixes, support for OHCI short packets

Location:
uspace/drv/ohci
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/ohci/batch.c

    r11d2e96 r242f0e2  
    147147            data->ed->next);
    148148        size_t i = 0;
     149        instance->transfered_size = instance->buffer_size;
    149150        for (; i < tds; ++i) {
    150151                assert(data->tds[i] != NULL);
     
    156157                }
    157158                instance->error = td_error(data->tds[i]);
    158                 /* FIXME: calculate real transfered size */
    159                 instance->transfered_size = instance->buffer_size;
    160159                if (instance->error != EOK) {
    161160                        usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
     
    174173        assert(hcd_ep);
    175174        hcd_ep->td = data->tds[i];
     175        if (i > 0)
     176                instance->transfered_size -= td_remain_size(data->tds[i - 1]);
     177
    176178        /* Clear possible ED HALT */
    177179        data->ed->td_head &= ~ED_TDHEAD_HALTED_FLAG;
     
    238240{
    239241        assert(instance);
    240         instance->next_step = usb_transfer_batch_call_in_and_dispose;
     242        /* We are data out, we are supposed to provide data */
     243        memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
     244        instance->next_step = usb_transfer_batch_call_out_and_dispose;
    241245        batch_data(instance);
    242         usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
     246        usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance);
    243247}
    244248/*----------------------------------------------------------------------------*/
  • uspace/drv/ohci/hw_struct/transfer_descriptor.c

    r11d2e96 r242f0e2  
    5252                instance->status |= togg[toggle] << TD_STATUS_T_SHIFT;
    5353        }
     54        if (dir == USB_DIRECTION_IN) {
     55                instance->status |= TD_STATUS_ROUND_FLAG;
     56        }
    5457        if (buffer != NULL) {
    5558                assert(size != 0);
  • uspace/drv/ohci/hw_struct/transfer_descriptor.h

    r11d2e96 r242f0e2  
    5959#define TD_STATUS_T_0 (0x2)
    6060#define TD_STATUS_T_1 (0x3)
     61#define TD_STATUS_T_ED (0)
    6162#define TD_STATUS_EC_MASK (0x3) /* error count */
    6263#define TD_STATUS_EC_SHIFT (26)
     
    102103        return cc_to_rc(cc);
    103104}
     105
     106static inline size_t td_remain_size(td_t *instance)
     107{
     108        assert(instance);
     109        if (instance->cbp == 0)
     110                return 0;
     111        return instance->be - instance->cbp + 1;
     112}
    104113#endif
    105114/**
Note: See TracChangeset for help on using the changeset viewer.