Changeset 306a36d in mainline for uspace/lib/usbhost/src/usb2_bus.c
- Timestamp:
- 2017-11-19T23:43:31Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ff14aede
- Parents:
- e76c0ea
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbhost/src/usb2_bus.c
re76c0ea r306a36d 132 132 } 133 133 134 /* Get max packet size for default pipe */ 135 usb_standard_device_descriptor_t desc = { 0 }; 136 const usb_device_request_setup_packet_t get_device_desc_8 = 137 GET_DEVICE_DESC(CTRL_PIPE_MIN_PACKET_SIZE); 138 139 usb_log_debug("Device(%d): Requesting first 8B of device descriptor.", 140 address); 141 ssize_t got = hcd_send_batch_sync(hcd, dev, usb2_default_target, USB_DIRECTION_IN, 142 (char *) &desc, CTRL_PIPE_MIN_PACKET_SIZE, *(uint64_t *)&get_device_desc_8, 143 "read first 8 bytes of dev descriptor"); 144 145 if (got != CTRL_PIPE_MIN_PACKET_SIZE) { 146 err = got < 0 ? got : EOVERFLOW; 147 usb_log_error("Device(%d): Failed to get 8B of dev descr: %s.", 148 address, str_error(err)); 149 goto err_default_control_ep; 150 } 134 uint16_t max_packet_size; 135 if ((err = hcd_get_ep0_max_packet_size(&max_packet_size, hcd, dev))) 136 goto err_address; 151 137 152 138 /* Set new address */ … … 158 144 if (err != 0) { 159 145 usb_log_error("Device(%d): Failed to set new address: %s.", 160 address, str_error( got));146 address, str_error(err)); 161 147 goto err_default_control_ep; 162 148 } … … 175 161 .transfer_type = USB_TRANSFER_CONTROL, 176 162 .direction = USB_DIRECTION_BOTH, 177 .max_packet_size = ED_MPS_PACKET_SIZE_GET(uint16_usb2host(desc.max_packet_size)),178 .packets = ED_MPS_TRANS_OPPORTUNITIES_GET(uint16_usb2host(desc.max_packet_size)),163 .max_packet_size = max_packet_size, 164 .packets = 1, 179 165 }; 180 166
Note:
See TracChangeset
for help on using the changeset viewer.