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

Changeset 0f6b50f in mainline


Ignore:
Timestamp:
2017-10-19T20:00:08Z (3 years ago)
Author:
Petr Manek <petr.manek@…>
Branches:
master
Children:
1fd2f81
Parents:
60af4cdb
Message:

Added DDF device to HCD initialization to prepare RH data structures before it is started.

Files:
11 edited

Legend:

Unmodified
Added
Removed
  • tools/toolchain.sh

    r60af4cdb r0f6b50f  
    2929#
    3030
     31export CC=/usr/local/bin/gcc-6
     32export CXX=/usr/local/bin/g++-6
     33
    3134GMP_MAIN=<<EOF
    3235#define GCC_GMP_VERSION_NUM(a, b, c) \
     
    345348        show_dependencies
    346349        check_dependecies
    347         show_countdown 10
     350#       show_countdown 10
    348351       
    349352        BINUTILS_SOURCE="ftp://ftp.gnu.org/gnu/binutils/"
  • uspace/drv/bus/usb/ehci/main.c

    r60af4cdb r0f6b50f  
    5151#define NAME "ehci"
    5252
    53 static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *);
     53static int ehci_driver_init(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
    5454static int ehci_driver_claim(hcd_t *, ddf_dev_t *);
    5555static int ehci_driver_start(hcd_t *, bool);
     
    7272
    7373
    74 static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res)
     74static int ehci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, ddf_dev_t *device)
    7575{
    7676        assert(hcd);
  • uspace/drv/bus/usb/ohci/main.c

    r60af4cdb r0f6b50f  
    4848
    4949#define NAME "ohci"
    50 static int ohci_driver_init(hcd_t *, const hw_res_list_parsed_t *);
     50static int ohci_driver_init(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
    5151static int ohci_driver_start(hcd_t *, bool);
    5252static int ohci_driver_claim(hcd_t *, ddf_dev_t *);
     
    6969
    7070
    71 static int ohci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res)
     71static int ohci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, ddf_dev_t *device)
    7272{
    7373        int err;
  • uspace/drv/bus/usb/uhci/main.c

    r60af4cdb r0f6b50f  
    4949#define NAME "uhci"
    5050
    51 static int uhci_driver_init(hcd_t *, const hw_res_list_parsed_t *);
     51static int uhci_driver_init(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
    5252static int uhci_driver_start(hcd_t *, bool);
    5353static void uhci_driver_fini(hcd_t *);
     
    6969};
    7070
    71 static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res)
     71static int uhci_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *res, ddf_dev_t *device)
    7272{
    7373        int err;
  • uspace/drv/bus/usb/xhci/hc.c

    r60af4cdb r0f6b50f  
    187187}
    188188
    189 int hc_init_memory(xhci_hc_t *hc)
     189int hc_init_memory(xhci_hc_t *hc, ddf_dev_t *device)
    190190{
    191191        int err;
     
    216216                goto err_cmd;
    217217
    218         if ((err = xhci_rh_init(&hc->rh, hc)))
     218        if ((err = xhci_rh_init(&hc->rh, hc, device)))
    219219                goto err_transfers;
    220220
  • uspace/drv/bus/usb/xhci/hc.h

    r60af4cdb r0f6b50f  
    8989
    9090int hc_init_mmio(xhci_hc_t *, const hw_res_list_parsed_t *);
    91 int hc_init_memory(xhci_hc_t *);
     91int hc_init_memory(xhci_hc_t *, ddf_dev_t *);
    9292int hc_claim(xhci_hc_t *, ddf_dev_t *);
    9393int hc_irq_code_gen(irq_code_t *, xhci_hc_t *, const hw_res_list_parsed_t *);
  • uspace/drv/bus/usb/xhci/main.c

    r60af4cdb r0f6b50f  
    4747#define NAME "xhci"
    4848
    49 static int hc_driver_init(hcd_t *, const hw_res_list_parsed_t *);
     49static int hc_driver_init(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
    5050static int hcd_irq_code_gen(irq_code_t *, hcd_t *, const hw_res_list_parsed_t *);
    5151static int hcd_claim(hcd_t *, ddf_dev_t *);
     
    7272};
    7373
    74 static int hc_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *hw_res)
     74static int hc_driver_init(hcd_t *hcd, const hw_res_list_parsed_t *hw_res, ddf_dev_t *device)
    7575{
    7676        int err;
     
    8383                goto err;
    8484
    85         if ((err = hc_init_memory(hc)))
     85        if ((err = hc_init_memory(hc, device)))
    8686                goto err;
    8787
     
    124124        assert(hc);
    125125
    126         hc->rh.hc_device = dev;
    127         return device_init(&hc->rh.device);
     126        return EOK;
    128127}
    129128
  • uspace/drv/bus/usb/xhci/rh.c

    r60af4cdb r0f6b50f  
    6161        XHCI_REG_MASK(XHCI_PORT_CEC);
    6262
    63 int xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc)
     63int xhci_rh_init(xhci_rh_t *rh, xhci_hc_t *hc, ddf_dev_t *device)
    6464{
    6565        assert(rh);
     
    6868        rh->hc = hc;
    6969        rh->max_ports = XHCI_REG_RD(hc->cap_regs, XHCI_CAP_MAX_PORTS);
    70 
    71         return EOK;
     70        hc->rh.hc_device = device;
     71
     72        return device_init(&hc->rh.device);
    7273}
    7374
     
    211212        int err;
    212213        assert(rh);
     214        assert(rh->hc_device);
    213215
    214216        xhci_bus_t *bus = &rh->hc->bus;
  • uspace/drv/bus/usb/xhci/rh.h

    r60af4cdb r0f6b50f  
    7777} xhci_rh_t;
    7878
    79 int xhci_rh_init(xhci_rh_t *, xhci_hc_t *);
     79int xhci_rh_init(xhci_rh_t *, xhci_hc_t *, ddf_dev_t *);
    8080int xhci_rh_fini(xhci_rh_t *);
    8181const xhci_port_speed_t *xhci_rh_get_port_speed(xhci_rh_t *, uint8_t);
  • uspace/lib/usbhost/include/usb/host/ddf_helpers.h

    r60af4cdb r0f6b50f  
    4545#include <device/hw_res_parsed.h>
    4646
    47 typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *);
     47typedef int (*driver_init_t)(hcd_t *, const hw_res_list_parsed_t *, ddf_dev_t *);
    4848typedef int (*irq_code_gen_t)(irq_code_t *, hcd_t *, const hw_res_list_parsed_t *);
    4949typedef int (*claim_t)(hcd_t *, ddf_dev_t *);
  • uspace/lib/usbhost/src/ddf_helpers.c

    r60af4cdb r0f6b50f  
    782782
    783783        if (driver->init)
    784                 ret = driver->init(hcd, &hw_res);
     784                ret = driver->init(hcd, &hw_res, device);
    785785        if (ret != EOK) {
    786786                usb_log_error("Failed to init HCD.\n");
Note: See TracChangeset for help on using the changeset viewer.