Changeset daf59d1 in mainline


Ignore:
Timestamp:
2012-12-21T11:37:14Z (11 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0a12879
Parents:
0ef03d7
Message:

libusbhost: Move lsit of usb device to ddf helper structure.

Location:
uspace/lib/usbhost
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbhost/include/usb/host/ddf_helpers.h

    r0ef03d7 rdaf59d1  
    4040#include <usbhc_iface.h>
    4141
    42 int hcd_ddf_add_device(hcd_t *instance, ddf_dev_t *parent,
     42int hcd_ddf_add_usb_device(ddf_dev_t *parent,
    4343    usb_address_t address, usb_speed_t speed, const char *name,
    4444    const match_id_list_t *mids);
  • uspace/lib/usbhost/include/usb/host/hcd.h

    r0ef03d7 rdaf59d1  
    5757        /** Endpoint manager. */
    5858        usb_endpoint_manager_t ep_manager;
    59         /** Added devices */
    60         list_t devices;
    6159
    6260        /** Device specific driver data. */
  • uspace/lib/usbhost/src/ddf_helpers.c

    r0ef03d7 rdaf59d1  
    4545typedef struct hc_dev {
    4646        ddf_fun_t *hc_fun;
     47        list_t devices;
    4748} hc_dev_t;
    4849
     
    118119};
    119120
    120 int hcd_ddf_add_device(hcd_t *instance, ddf_dev_t *parent,
     121int hcd_ddf_add_usb_device(ddf_dev_t *parent,
    121122    usb_address_t address, usb_speed_t speed, const char *name,
    122123    const match_id_list_t *mids)
    123124{
    124         assert(instance);
    125125        assert(parent);
    126         hc_dev_t *hc_dev = ddf_dev_data_get(parent);
     126        hc_dev_t *hc_dev = dev_to_hc_dev(parent);
    127127        devman_handle_t hc_handle = ddf_fun_get_handle(hc_dev->hc_fun);
    128128
     
    154154        }
    155155
    156         ret = usb_device_manager_bind_address(&instance->dev_manager,
     156        ret = usb_device_manager_bind_address(&dev_to_hcd(parent)->dev_manager,
    157157            address, ddf_fun_get_handle(fun));
    158158        if (ret != EOK)
    159                 usb_log_warning("Failed to bind root hub address: %s.\n",
     159                usb_log_warning("Failed to bind address: %s.\n",
    160160                    str_error(ret));
    161161
    162         list_append(&info->link, &instance->devices);
     162        list_append(&info->link, &hc_dev->devices);
    163163        return EOK;
    164164}
     
    210210        add_match_id(&mid_list, &mid);
    211211
    212         ret = hcd_ddf_add_device(
    213             instance, device, *address, speed, "rh", &mid_list);
     212        ret = hcd_ddf_add_usb_device(device, *address, speed, "rh", &mid_list);
    214213        CHECK_RET_UNREG_RETURN(ret,
    215214            "Failed to add hcd device: %s.\n", str_error(ret));
     
    240239                return ENOMEM;
    241240        }
     241        list_initialize(&instance->devices);
    242242
    243243#define CHECK_RET_DEST_FREE_RETURN(ret, message...) \
  • uspace/lib/usbhost/src/hcd.c

    r0ef03d7 rdaf59d1  
    5555        usb_device_manager_init(&hcd->dev_manager, max_speed);
    5656        usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count);
    57         list_initialize(&hcd->devices);
    5857
    5958        hcd->private_data = NULL;
Note: See TracChangeset for help on using the changeset viewer.