Changeset 3bacee1 in mainline for uspace/drv/bus/usb/usbhub/usbhub.c
- Timestamp:
- 2018-04-12T16:27:17Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3cf22f9
- Parents:
- 76d0981d
- git-author:
- Jiri Svoboda <jiri@…> (2018-04-11 19:25:33)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-04-12 16:27:17)
- File:
-
- 1 edited
-
uspace/drv/bus/usb/usbhub/usbhub.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/usbhub/usbhub.c
r76d0981d r3bacee1 83 83 */ 84 84 static const usb_endpoint_description_t 85 status_change_single_tt_only = HUB_STATUS_CHANGE_EP(0),86 status_change_mtt_available = HUB_STATUS_CHANGE_EP(1);85 status_change_single_tt_only = HUB_STATUS_CHANGE_EP(0), 86 status_change_mtt_available = HUB_STATUS_CHANGE_EP(1); 87 87 88 88 const usb_endpoint_description_t *usb_hub_endpoints [] = { … … 107 107 108 108 static bool usb_hub_polling_error_callback(usb_device_t *dev, 109 errno_t err_code, void *arg)109 errno_t err_code, void *arg) 110 110 { 111 111 assert(dev); … … 113 113 114 114 usb_log_error("Device %s polling error: %s", 115 usb_device_get_name(dev), str_error(err_code));115 usb_device_get_name(dev), str_error(err_code)); 116 116 117 117 return true; … … 153 153 } 154 154 155 const usb_endpoint_description_t *status_change = hub_dev->mtt_available 156 ? &status_change_mtt_available157 :&status_change_single_tt_only;158 159 usb_endpoint_mapping_t *status_change_mapping 160 =usb_device_get_mapped_ep_desc(hub_dev->usb_device, status_change);155 const usb_endpoint_description_t *status_change = hub_dev->mtt_available ? 156 &status_change_mtt_available : 157 &status_change_single_tt_only; 158 159 usb_endpoint_mapping_t *status_change_mapping = 160 usb_device_get_mapped_ep_desc(hub_dev->usb_device, status_change); 161 161 if (!status_change_mapping) { 162 162 usb_log_error("Failed to map the Status Change Endpoint of a hub."); … … 212 212 if (ret != EOK) { 213 213 usb_log_error("(%p) Failed to unbind '%s' function: %s.", 214 hub, HUB_FNC_NAME, str_error(ret));214 hub, HUB_FNC_NAME, str_error(ret)); 215 215 return ret; 216 216 } … … 272 272 */ 273 273 static errno_t usb_hub_polling_init(usb_hub_dev_t *hub_dev, 274 usb_endpoint_mapping_t *mapping)274 usb_endpoint_mapping_t *mapping) 275 275 { 276 276 errno_t err; … … 377 377 usb_pipe_t *control_pipe = usb_device_get_default_pipe(hub_dev->usb_device); 378 378 379 usb_descriptor_type_t desc_type = hub_dev->speed >= USB_SPEED_SUPER 380 ?USB_DESCTYPE_SSPEED_HUB : USB_DESCTYPE_HUB;379 usb_descriptor_type_t desc_type = hub_dev->speed >= USB_SPEED_SUPER ? 380 USB_DESCTYPE_SSPEED_HUB : USB_DESCTYPE_HUB; 381 381 382 382 /* Get hub descriptor. */ … … 420 420 descriptor.characteristics & HUB_CHAR_POWER_PER_PORT_FLAG; 421 421 422 const uint8_t protocol = usb_device_descriptors(hub_dev->usb_device) 423 ->device.device_protocol; 422 const uint8_t protocol = usb_device_descriptors(hub_dev->usb_device)->device.device_protocol; 424 423 hub_dev->mtt_available = (protocol == 2); 425 424 … … 456 455 457 456 if (config_size < sizeof(usb_standard_configuration_descriptor_t)) { 458 usb_log_error("Configuration descriptor is not big enough"459 " to fit standard configuration descriptor.\n");460 return EOVERFLOW;457 usb_log_error("Configuration descriptor is not big enough" 458 " to fit standard configuration descriptor.\n"); 459 return EOVERFLOW; 461 460 } 462 461
Note:
See TracChangeset
for help on using the changeset viewer.
