Changeset 42bc933 in mainline for uspace/drv/bus/usb/xhci/transfers.c


Ignore:
Timestamp:
2017-10-09T16:27:02Z (8 years ago)
Author:
Michal Staruch <salmelu@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ac18b08
Parents:
a0be5d0
Message:

Dummy for bulk transfers (need to support streams)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/transfers.c

    ra0be5d0 r42bc933  
    221221}
    222222
     223int xhci_schedule_bulk_transfer(xhci_hc_t* hc, usb_transfer_batch_t* batch) {
     224        if (batch->setup_size) {
     225                usb_log_warning("Setup packet present for a bulk transfer.");
     226        }
     227
     228        uint8_t slot_id = batch->ep->hc_data.slot_id;
     229        xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[batch->ep->endpoint];
     230
     231        xhci_transfer_t *transfer = xhci_transfer_alloc(batch);
     232
     233        xhci_trb_t trb;
     234        memset(&trb, 0, sizeof(xhci_trb_t));
     235        trb.parameter = (uintptr_t) addr_to_phys(batch->buffer);
     236
     237        // data size (sent for OUT, or buffer size)
     238        TRB_CTRL_SET_XFER_LEN(trb, batch->buffer_size);
     239        // FIXME: TD size 4.11.2.4
     240        TRB_CTRL_SET_TD_SIZE(trb, 1);
     241
     242        // we want an interrupt after this td is done
     243        TRB_CTRL_SET_IOC(trb, 1);
     244
     245        TRB_CTRL_SET_TRB_TYPE(trb, XHCI_TRB_TYPE_NORMAL);
     246
     247        xhci_trb_ring_enqueue(ring, &trb, &transfer->interrupt_trb_phys);
     248        list_append(&transfer->link, &hc->transfers);
     249
     250        /* For control transfers, the target is always 1. */
     251        hc_ring_doorbell(hc, slot_id, 1);
     252        return EOK;
     253}
     254
    223255int xhci_handle_transfer_event(xhci_hc_t* hc, xhci_trb_t* trb)
    224256{
Note: See TracChangeset for help on using the changeset viewer.