Changeset c9c0e41 in mainline


Ignore:
Timestamp:
2017-07-09T20:13:55Z (7 years ago)
Author:
Jaroslav Jindrak <dzejrou@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fd9f4ffe
Parents:
dfd313b
Message:

Moved commands into their own set of files (WIP).

Location:
uspace/drv/bus/usb/xhci
Files:
2 added
2 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/xhci/Makefile

    rdfd313b rc9c0e41  
    4646        trb_ring.c \
    4747        scratchpad.c \
     48        commands.c \
    4849        main.c
    4950
  • uspace/drv/bus/usb/xhci/hc.c

    rdfd313b rc9c0e41  
    4242#include "hw_struct/trb.h"
    4343#include "scratchpad.h"
     44#include "commands.h"
    4445
    4546static const irq_cmd_t irq_commands[] = {
     
    347348}
    348349
    349 static int ring_doorbell(xhci_hc_t *hc, unsigned doorbell, unsigned target)
    350 {
    351         uint32_t v = host2xhci(32, target & BIT_RRANGE(uint32_t, 7));
    352         pio_write_32(&hc->db_arry[doorbell], v);
    353         return EOK;
    354 }
    355 
    356 static int send_no_op_command(xhci_hc_t *hc)
    357 {
    358         xhci_trb_t trb;
    359         memset(&trb, 0, sizeof(trb));
    360 
    361         trb.control = host2xhci(32, XHCI_TRB_TYPE_NO_OP_CMD << 10);
    362 
    363         xhci_trb_ring_enqueue(&hc->command_ring, &trb);
    364         ring_doorbell(hc, 0, 0);
    365 
    366         xhci_dump_trb(&trb);
    367         usb_log_debug2("HC(%p): Sent TRB", hc);
    368         return EOK;
    369 }
    370 
    371350int hc_schedule(xhci_hc_t *hc, usb_transfer_batch_t *batch)
    372351{
    373352        xhci_dump_state(hc);
    374         send_no_op_command(hc);
     353        xhci_send_no_op_command(hc);
    375354        async_usleep(1000);
    376355        xhci_dump_state(hc);
Note: See TracChangeset for help on using the changeset viewer.