Changes in uspace/lib/usbdev/src/pipesinit.c [4e732f1a:1cf26ab] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/pipesinit.c
r4e732f1a r1cf26ab 34 34 * 35 35 */ 36 #include <usb/usb.h> 36 37 #include <usb/dev/pipes.h> 37 38 #include <usb/dev/dp.h> 38 39 #include <usb/dev/request.h> 39 #include <usb/usb.h> 40 #include <usb/descriptor.h> 41 40 #include <errno.h> 42 41 #include <assert.h> 43 #include <errno.h>44 42 45 43 #define DEV_DESCR_MAX_PACKET_SIZE_OFFSET 7 … … 150 148 * @param interface Interface descriptor under which belongs the @p endpoint. 151 149 * @param endpoint Endpoint descriptor. 150 * @param wire Connection backing the endpoint pipes. 152 151 * @return Error code. 153 152 */ … … 156 155 usb_standard_interface_descriptor_t *interface, 157 156 usb_standard_endpoint_descriptor_t *endpoint_desc, 158 usb_dev _session_t *bus_session)157 usb_device_connection_t *wire) 159 158 { 160 159 … … 191 190 192 191 if (ep_mapping->present) { 193 return EEXIST S;194 } 195 196 int rc = usb_pipe_initialize(&ep_mapping->pipe, 192 return EEXIST; 193 } 194 195 int rc = usb_pipe_initialize(&ep_mapping->pipe, wire, 197 196 ep_no, description.transfer_type, 198 ED_MPS_PACKET_SIZE_GET( 199 uint16_usb2host(endpoint_desc->max_packet_size)), 200 description.direction, 201 ED_MPS_TRANS_OPPORTUNITIES_GET( 202 uint16_usb2host(endpoint_desc->max_packet_size)), bus_session); 197 uint16_usb2host(endpoint_desc->max_packet_size), 198 description.direction); 203 199 if (rc != EOK) { 204 200 return rc; … … 224 220 usb_endpoint_mapping_t *mapping, size_t mapping_count, 225 221 const usb_dp_parser_t *parser, const usb_dp_parser_data_t *parser_data, 226 const uint8_t *interface_descriptor , usb_dev_session_t *bus_session)222 const uint8_t *interface_descriptor) 227 223 { 228 224 const uint8_t *descriptor = usb_dp_get_nested_descriptor(parser, … … 240 236 (usb_standard_endpoint_descriptor_t *) 241 237 descriptor, 242 bus_session);238 (usb_device_connection_t *) parser_data->arg); 243 239 } 244 240 … … 284 280 usb_endpoint_mapping_t *mapping, size_t mapping_count, 285 281 const uint8_t *config_descriptor, size_t config_descriptor_size, 286 usb_dev_session_t *bus_session) 287 { 282 usb_device_connection_t *connection) 283 { 284 assert(connection); 288 285 289 286 if (config_descriptor == NULL) { … … 309 306 .data = config_descriptor, 310 307 .size = config_descriptor_size, 308 .arg = connection 311 309 }; 312 310 … … 321 319 do { 322 320 (void) process_interface(mapping, mapping_count, 323 &dp_parser, &dp_data, interface , bus_session);321 &dp_parser, &dp_data, interface); 324 322 interface = usb_dp_get_sibling_descriptor(&dp_parser, &dp_data, 325 323 config_descriptor, interface); … … 342 340 { 343 341 assert(pipe); 344 assert(DEV_DESCR_MAX_PACKET_SIZE_OFFSET < CTRL_PIPE_MIN_PACKET_SIZE);342 static_assert(DEV_DESCR_MAX_PACKET_SIZE_OFFSET < CTRL_PIPE_MIN_PACKET_SIZE); 345 343 346 344 if ((pipe->direction != USB_DIRECTION_BOTH) || … … 349 347 return EINVAL; 350 348 } 349 350 351 usb_pipe_start_long_transfer(pipe); 351 352 352 353 uint8_t dev_descr_start[CTRL_PIPE_MIN_PACKET_SIZE]; … … 366 367 } 367 368 } 369 usb_pipe_end_long_transfer(pipe); 368 370 if (rc != EOK) { 369 371 return rc;
Note:
See TracChangeset
for help on using the changeset viewer.