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

Changeset 58ac3ec in mainline


Ignore:
Timestamp:
2017-10-28T10:39:17Z (3 years ago)
Author:
Ondřej Hlavatý <aearsis@…>
Branches:
master
Children:
40a3bfa
Parents:
8b8c164
Message:

uhci: finished forgotten refactoring to generic batch

Location:
uspace
Files:
5 edited

Legend:

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

    r8b8c164 r58ac3ec  
    165165        printf(NAME ": HelenOS UHCI driver.\n");
    166166        log_init(NAME);
    167         logctl_set_log_level(NAME, LVL_NOTE);
     167        logctl_set_log_level(NAME, LVL_DEBUG2);
    168168        return ddf_driver_main(&uhci_driver);
    169169}
  • uspace/drv/bus/usb/uhci/transfer_list.c

    r8b8c164 r58ac3ec  
    116116        assert(uhci_batch);
    117117        usb_log_debug2("Batch %p adding to queue %s.\n",
    118             uhci_batch->usb_batch, instance->name);
     118            uhci_batch, instance->name);
    119119
    120120        fibril_mutex_lock(&instance->guard);
     
    145145
    146146        usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT
    147             " scheduled in queue %s.\n", uhci_batch->usb_batch,
    148             USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch), instance->name);
     147            " scheduled in queue %s.\n", uhci_batch,
     148            USB_TRANSFER_BATCH_ARGS(uhci_batch->base), instance->name);
    149149        fibril_mutex_unlock(&instance->guard);
    150150}
     
    211211
    212212        usb_log_debug2("Batch %p removing from queue %s.\n",
    213             uhci_batch->usb_batch, instance->name);
     213            uhci_batch, instance->name);
    214214
    215215        /* Assume I'm the first */
     
    233233        list_remove(&uhci_batch->link);
    234234        usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT " removed (%s) "
    235             "from %s, next: %x.\n", uhci_batch->usb_batch,
    236             USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch),
     235            "from %s, next: %x.\n", uhci_batch,
     236            USB_TRANSFER_BATCH_ARGS(uhci_batch->base),
    237237            qpos, instance->name, uhci_batch->qh->next);
    238238}
  • uspace/drv/bus/usb/uhci/uhci_batch.c

    r8b8c164 r58ac3ec  
    159159        usb_log_debug2("Batch %p " USB_TRANSFER_BATCH_FMT
    160160            " checking %zu transfer(s) for completion.\n",
    161             uhci_batch->usb_batch,
    162             USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch),
     161            uhci_batch, USB_TRANSFER_BATCH_ARGS(uhci_batch->base),
    163162            uhci_batch->td_count);
    164163        uhci_batch->base.transfered_size = 0;
     
    174173
    175174                        usb_log_debug("Batch %p found error TD(%zu->%p):%"
    176                             PRIx32 ".\n", uhci_batch->usb_batch, i,
     175                            PRIx32 ".\n", uhci_batch, i,
    177176                            &uhci_batch->tds[i], uhci_batch->tds[i].status);
    178177                        td_print_status(&uhci_batch->tds[i]);
     
    250249        usb_log_debug2(
    251250            "Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \
    252             uhci_batch->usb_batch,
     251            uhci_batch,
    253252            usb_str_transfer_type(uhci_batch->base.ep->transfer_type),
    254253            usb_str_direction(uhci_batch->base.ep->direction),
    255             USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch));
     254            USB_TRANSFER_BATCH_ARGS(uhci_batch->base));
    256255}
    257256
  • uspace/drv/bus/usb/uhci/uhci_batch.h

    r8b8c164 r58ac3ec  
    6363        /** Data buffer, must be accessible by the UHCI hw */
    6464        void *device_buffer;
    65         /** Generic transfer data */
    66         usb_transfer_batch_t *usb_batch;
    6765        /** List element */
    6866        link_t link;
     
    9593{
    9694        assert(uhci_batch);
    97         assert(uhci_batch->usb_batch);
    9895        return uhci_transfer_batch_setup_buffer(uhci_batch) +
    9996            (uhci_batch->base.ep->transfer_type == USB_TRANSFER_CONTROL ? USB_SETUP_PACKET_SIZE : 0);
     
    108105{
    109106        assert(uhci_batch);
    110         assert(uhci_batch->usb_batch);
    111         uhci_batch->usb_batch->error = EINTR;
    112         uhci_batch->usb_batch->transfered_size = 0;
     107        uhci_batch->base.error = EINTR;
     108        uhci_batch->base.transfered_size = 0;
    113109        usb_transfer_batch_finish(&uhci_batch->base);
    114110}
  • uspace/lib/usbhost/src/usb2_bus.c

    r8b8c164 r58ac3ec  
    109109        int err;
    110110
     111        /* The default address is currently reserved for this device */
     112        dev->address = USB_ADDRESS_DEFAULT;
     113
    111114        /** Reserve address early, we want pretty log messages */
    112115        usb_address_t address;
Note: See TracChangeset for help on using the changeset viewer.