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

Changeset 063dfe8 in mainline


Ignore:
Timestamp:
2017-10-13T13:04:26Z (3 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
master
Children:
dcf0597
Parents:
c10daa8
Message:

Moved initialization and polished some log messages.

Location:
uspace/drv/bus/usb/xhci
Files:
3 edited

Legend:

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

    rc10daa8 r063dfe8  
    110110}
    111111
    112 static int hashed_device_create(xhci_bus_t *bus, hashed_device_t **hashed_dev)
     112static int hashed_device_create(xhci_bus_t *bus, hashed_device_t **hashed_dev, usb_address_t address)
    113113{
    114114        int res;
     
    119119        }
    120120
    121         res = xhci_device_init(dev, bus);
     121        res = xhci_device_init(dev, bus, address);
    122122        if (res != EOK) {
    123123                goto err_xhci_dev_init;
    124124        }
    125 
    126         // TODO: Set device data.
    127125
    128126        hashed_device_t *ret_dev = (hashed_device_t *) malloc(sizeof(hashed_device_t));
     
    166164
    167165        if (res == ENOENT) {
    168                 res = hashed_device_create(bus, &hashed_dev);
     166                res = hashed_device_create(bus, &hashed_dev, ep->target.address);
    169167
    170168                if (res != EOK)
  • uspace/drv/bus/usb/xhci/endpoint.c

    rc10daa8 r063dfe8  
    5252        xhci_ep->device = NULL;
    5353
    54         usb_log_debug("XHCI Endpoint %d:%d initialized.", ep->target.address, ep->target.endpoint);
     54        usb_log_debug("Endpoint %d:%d initialized.", ep->target.address, ep->target.endpoint);
    5555
    5656        return EOK;
     
    6565        endpoint_t *ep = &xhci_ep->base;
    6666
    67         usb_log_debug("XHCI Endpoint %d:%d destroyed.", ep->target.address, ep->target.endpoint);
     67        usb_log_debug("Endpoint %d:%d destroyed.", ep->target.address, ep->target.endpoint);
    6868}
    6969
    70 int xhci_device_init(xhci_device_t *dev, xhci_bus_t *bus)
     70int xhci_device_init(xhci_device_t *dev, xhci_bus_t *bus, usb_address_t address)
    7171{
    7272        memset(&dev->endpoints, 0, sizeof(dev->endpoints));
    7373        dev->active_endpoint_count = 0;
     74        dev->address = address;
     75        dev->slot_id = 0;
     76
     77        usb_log_debug("Device %d initialized.", dev->address);
    7478        return EOK;
    7579}
     
    7882{
    7983        // TODO: Check that all endpoints are dead.
     84        usb_log_debug("Device %d destroyed.", dev->address);
    8085}
    8186
  • uspace/drv/bus/usb/xhci/endpoint.h

    rc10daa8 r063dfe8  
    7979void xhci_endpoint_fini(xhci_endpoint_t *);
    8080
    81 int xhci_device_init(xhci_device_t *, xhci_bus_t *);
     81int xhci_device_init(xhci_device_t *, xhci_bus_t *, usb_address_t);
    8282void xhci_device_fini(xhci_device_t *);
    8383
Note: See TracChangeset for help on using the changeset viewer.