Changes in uspace/lib/usbdev/src/pipesinit.c [d93f5afb:9d58539] in mainline
- File:
-
- 1 edited
-
uspace/lib/usbdev/src/pipesinit.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipesinit.c
rd93f5afb r9d58539 148 148 * @param interface Interface descriptor under which belongs the @p endpoint. 149 149 * @param endpoint Endpoint descriptor. 150 * @param wire Connection backing the endpoint pipes. 150 151 * @return Error code. 151 152 */ … … 153 154 usb_endpoint_mapping_t *mapping, size_t mapping_count, 154 155 usb_standard_interface_descriptor_t *interface, 155 usb_standard_endpoint_descriptor_t *endpoint _desc,156 usb_dev _session_t *bus_session)156 usb_standard_endpoint_descriptor_t *endpoint, 157 usb_device_connection_t *wire) 157 158 { 158 159 … … 162 163 163 164 /* Actual endpoint number is in bits 0..3 */ 164 const usb_endpoint_t ep_no = endpoint _desc->endpoint_address & 0x0F;165 const usb_endpoint_t ep_no = endpoint->endpoint_address & 0x0F; 165 166 166 167 const usb_endpoint_description_t description = { 167 168 /* Endpoint direction is set by bit 7 */ 168 .direction = (endpoint _desc->endpoint_address & 128)169 .direction = (endpoint->endpoint_address & 128) 169 170 ? USB_DIRECTION_IN : USB_DIRECTION_OUT, 170 171 /* Transfer type is in bits 0..2 and 171 172 * the enum values corresponds 1:1 */ 172 .transfer_type = endpoint _desc->attributes & 3,173 .transfer_type = endpoint->attributes & 3, 173 174 174 175 /* Get interface characteristics. */ … … 192 193 } 193 194 194 int rc = usb_pipe_initialize(&ep_mapping->pipe, 195 ep_no, description.transfer_type, 196 uint16_usb2host(endpoint_desc->max_packet_size), 197 description.direction, bus_session); 195 int rc = usb_pipe_initialize(&ep_mapping->pipe, wire, 196 ep_no, description.transfer_type, endpoint->max_packet_size, 197 description.direction); 198 198 if (rc != EOK) { 199 199 return rc; … … 201 201 202 202 ep_mapping->present = true; 203 ep_mapping->descriptor = endpoint _desc;203 ep_mapping->descriptor = endpoint; 204 204 ep_mapping->interface = interface; 205 205 … … 219 219 usb_endpoint_mapping_t *mapping, size_t mapping_count, 220 220 const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data, 221 const uint8_t *interface_descriptor , usb_dev_session_t *bus_session)221 const uint8_t *interface_descriptor) 222 222 { 223 223 const uint8_t *descriptor = usb_dp_get_nested_descriptor(parser, … … 235 235 (usb_standard_endpoint_descriptor_t *) 236 236 descriptor, 237 bus_session);237 (usb_device_connection_t *) parser_data->arg); 238 238 } 239 239 … … 279 279 usb_endpoint_mapping_t *mapping, size_t mapping_count, 280 280 const uint8_t *config_descriptor, size_t config_descriptor_size, 281 usb_dev_session_t *bus_session) 282 { 281 usb_device_connection_t *connection) 282 { 283 assert(connection); 283 284 284 285 if (config_descriptor == NULL) { … … 304 305 .data = config_descriptor, 305 306 .size = config_descriptor_size, 307 .arg = connection 306 308 }; 307 309 … … 316 318 do { 317 319 (void) process_interface(mapping, mapping_count, 318 &dp_parser, &dp_data, interface , bus_session);320 &dp_parser, &dp_data, interface); 319 321 interface = usb_dp_get_sibling_descriptor(&dp_parser, &dp_data, 320 322 config_descriptor, interface); … … 344 346 return EINVAL; 345 347 } 348 349 350 usb_pipe_start_long_transfer(pipe); 346 351 347 352 uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE]; … … 361 366 } 362 367 } 368 usb_pipe_end_long_transfer(pipe); 363 369 if (rc != EOK) { 364 370 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.
