Changeset daf59d1 in mainline
- Timestamp:
- 2012-12-21T11:37:14Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0a12879
- Parents:
- 0ef03d7
- Location:
- uspace/lib/usbhost
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/include/usb/host/ddf_helpers.h
r0ef03d7 rdaf59d1 40 40 #include <usbhc_iface.h> 41 41 42 int hcd_ddf_add_ device(hcd_t *instance,ddf_dev_t *parent,42 int hcd_ddf_add_usb_device(ddf_dev_t *parent, 43 43 usb_address_t address, usb_speed_t speed, const char *name, 44 44 const match_id_list_t *mids); -
uspace/lib/usbhost/include/usb/host/hcd.h
r0ef03d7 rdaf59d1 57 57 /** Endpoint manager. */ 58 58 usb_endpoint_manager_t ep_manager; 59 /** Added devices */60 list_t devices;61 59 62 60 /** Device specific driver data. */ -
uspace/lib/usbhost/src/ddf_helpers.c
r0ef03d7 rdaf59d1 45 45 typedef struct hc_dev { 46 46 ddf_fun_t *hc_fun; 47 list_t devices; 47 48 } hc_dev_t; 48 49 … … 118 119 }; 119 120 120 int hcd_ddf_add_ device(hcd_t *instance,ddf_dev_t *parent,121 int hcd_ddf_add_usb_device(ddf_dev_t *parent, 121 122 usb_address_t address, usb_speed_t speed, const char *name, 122 123 const match_id_list_t *mids) 123 124 { 124 assert(instance);125 125 assert(parent); 126 hc_dev_t *hc_dev = d df_dev_data_get(parent);126 hc_dev_t *hc_dev = dev_to_hc_dev(parent); 127 127 devman_handle_t hc_handle = ddf_fun_get_handle(hc_dev->hc_fun); 128 128 … … 154 154 } 155 155 156 ret = usb_device_manager_bind_address(& instance->dev_manager,156 ret = usb_device_manager_bind_address(&dev_to_hcd(parent)->dev_manager, 157 157 address, ddf_fun_get_handle(fun)); 158 158 if (ret != EOK) 159 usb_log_warning("Failed to bind root hubaddress: %s.\n",159 usb_log_warning("Failed to bind address: %s.\n", 160 160 str_error(ret)); 161 161 162 list_append(&info->link, & instance->devices);162 list_append(&info->link, &hc_dev->devices); 163 163 return EOK; 164 164 } … … 210 210 add_match_id(&mid_list, &mid); 211 211 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); 214 213 CHECK_RET_UNREG_RETURN(ret, 215 214 "Failed to add hcd device: %s.\n", str_error(ret)); … … 240 239 return ENOMEM; 241 240 } 241 list_initialize(&instance->devices); 242 242 243 243 #define CHECK_RET_DEST_FREE_RETURN(ret, message...) \ -
uspace/lib/usbhost/src/hcd.c
r0ef03d7 rdaf59d1 55 55 usb_device_manager_init(&hcd->dev_manager, max_speed); 56 56 usb_endpoint_manager_init(&hcd->ep_manager, bandwidth, bw_count); 57 list_initialize(&hcd->devices);58 57 59 58 hcd->private_data = NULL;
Note:
See TracChangeset
for help on using the changeset viewer.