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