Changeset 41924f30 in mainline for uspace/lib/usbhost/src/ddf_helpers.c
- Timestamp:
- 2017-10-12T14:07:27Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a5976973
- Parents:
- 7e74911
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/ddf_helpers.c
r7e74911 r41924f30 469 469 470 470 /* This checks whether the default address is reserved and gets speed */ 471 int ret = usb_bus_get_speed(&hcd->bus, USB_ADDRESS_DEFAULT, &speed);471 int ret = bus_get_speed(hcd->bus, USB_ADDRESS_DEFAULT, &speed); 472 472 if (ret != EOK) { 473 473 usb_log_error("Failed to verify speed: %s.", str_error(ret)); … … 623 623 assert(hcd); 624 624 625 hcd_reserve_default_address(hcd, hcd->bus.max_speed);625 hcd_reserve_default_address(hcd, USB_SPEED_MAX); 626 626 const int ret = hcd_ddf_new_device(device, NULL, 0); 627 627 hcd_release_default_address(hcd); … … 639 639 * This function does all the ddf work for hc driver. 640 640 */ 641 int hcd_ddf_setup_hc(ddf_dev_t *device, usb_speed_t max_speed, 642 size_t bw, bw_count_func_t bw_count) 641 int hcd_ddf_setup_hc(ddf_dev_t *device) 643 642 { 644 643 assert(device); … … 650 649 } 651 650 instance->root_hub = NULL; 652 hcd_init(&instance->hcd , max_speed, bw, bw_count);651 hcd_init(&instance->hcd); 653 652 654 653 int ret = ENOMEM; … … 851 850 { 852 851 assert(driver); 853 static const struct { size_t bw; bw_count_func_t bw_count; }bw[] = {854 [USB_SPEED_FULL] = { .bw = BANDWIDTH_AVAILABLE_USB11,855 .bw_count = bandwidth_count_usb11 },856 [USB_SPEED_HIGH] = { .bw = BANDWIDTH_AVAILABLE_USB11,857 .bw_count = bandwidth_count_usb11 },858 [USB_SPEED_SUPER] = { .bw = BANDWIDTH_AVAILABLE_USB11,859 .bw_count = bandwidth_count_usb11 },860 };861 852 862 853 int ret = EOK; 863 const usb_speed_t speed = driver->hc_speed;864 if (speed >= ARRAY_SIZE(bw) || bw[speed].bw == 0) {865 usb_log_error("Driver `%s' reported unsupported speed: %s",866 driver->name, usb_str_speed(speed));867 return ENOTSUP;868 }869 854 870 855 hw_res_list_parsed_t hw_res; … … 877 862 } 878 863 879 ret = hcd_ddf_setup_hc(device , speed, bw[speed].bw, bw[speed].bw_count);864 ret = hcd_ddf_setup_hc(device); 880 865 if (ret != EOK) { 881 866 usb_log_error("Failed to setup generic HCD.\n");
Note:
See TracChangeset
for help on using the changeset viewer.