Changeset 3954a63b in mainline
- Timestamp:
- 2011-03-21T14:10:41Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 68b5ed6e
- Parents:
- a372663
- Location:
- uspace
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/usbinfo/dev.c
ra372663 r3954a63b 59 59 } 60 60 61 rc = usb_ endpoint_pipe_initialize_default_control(&dev->ctrl_pipe,61 rc = usb_pipe_initialize_default_control(&dev->ctrl_pipe, 62 62 &dev->wire); 63 63 if (rc != EOK) { … … 68 68 } 69 69 70 rc = usb_ endpoint_pipe_probe_default_control(&dev->ctrl_pipe);70 rc = usb_pipe_probe_default_control(&dev->ctrl_pipe); 71 71 if (rc != EOK) { 72 72 fprintf(stderr, … … 76 76 } 77 77 78 rc = usb_ endpoint_pipe_start_session(&dev->ctrl_pipe);78 rc = usb_pipe_start_session(&dev->ctrl_pipe); 79 79 if (rc != EOK) { 80 80 fprintf(stderr, … … 107 107 108 108 leave: 109 if (usb_ endpoint_pipe_is_session_started(&dev->ctrl_pipe)) {110 usb_ endpoint_pipe_end_session(&dev->ctrl_pipe);109 if (usb_pipe_is_session_started(&dev->ctrl_pipe)) { 110 usb_pipe_end_session(&dev->ctrl_pipe); 111 111 } 112 112 … … 118 118 void destroy_device(usbinfo_device_t *dev) 119 119 { 120 usb_ endpoint_pipe_end_session(&dev->ctrl_pipe);120 usb_pipe_end_session(&dev->ctrl_pipe); 121 121 free(dev); 122 122 } -
uspace/drv/usbhid/hiddev.c
ra372663 r3954a63b 184 184 * successfuly initialize the structure. 185 185 * 186 * @sa usb_ endpoint_pipe_initialize_from_configuration(),186 * @sa usb_pipe_initialize_from_configuration(), 187 187 * usbhid_dev_get_report_descriptor() 188 188 */ … … 218 218 }; 219 219 220 rc = usb_ endpoint_pipe_initialize_from_configuration(220 rc = usb_pipe_initialize_from_configuration( 221 221 endpoint_mapping, 1, descriptors, descriptors_size, 222 222 &hid_dev->wire); … … 359 359 * @return Other value inherited from one of functions 360 360 * usb_device_connection_initialize_from_device(), 361 * usb_ endpoint_pipe_initialize_default_control(),362 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),361 * usb_pipe_initialize_default_control(), 362 * usb_pipe_start_session(), usb_pipe_end_session(), 363 363 * usbhid_dev_process_descriptors(). 364 364 * … … 404 404 * Initialize device pipes. 405 405 */ 406 rc = usb_ endpoint_pipe_initialize_default_control(&hid_dev->ctrl_pipe,406 rc = usb_pipe_initialize_default_control(&hid_dev->ctrl_pipe, 407 407 &hid_dev->wire); 408 408 if (rc != EOK) { … … 411 411 return rc; 412 412 } 413 rc = usb_ endpoint_pipe_probe_default_control(&hid_dev->ctrl_pipe);413 rc = usb_pipe_probe_default_control(&hid_dev->ctrl_pipe); 414 414 if (rc != EOK) { 415 415 usb_log_error("Probing default control pipe failed: %s.\n", … … 430 430 * Get descriptors, parse descriptors and save endpoints. 431 431 */ 432 rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);432 rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 433 433 if (rc != EOK) { 434 434 usb_log_error("Failed to start session on the control pipe: %s" … … 440 440 if (rc != EOK) { 441 441 /* TODO: end session?? */ 442 usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);442 usb_pipe_end_session(&hid_dev->ctrl_pipe); 443 443 usb_log_error("Failed to process descriptors: %s.\n", 444 444 str_error(rc)); … … 446 446 } 447 447 448 rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);448 rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 449 449 if (rc != EOK) { 450 450 usb_log_warning("Failed to start session on the control pipe: " -
uspace/drv/usbhid/hidreq.c
ra372663 r3954a63b 57 57 * @retval EINVAL if no HID device is given. 58 58 * @return Other value inherited from one of functions 59 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),59 * usb_pipe_start_session(), usb_pipe_end_session(), 60 60 * usb_control_request_set(). 61 61 */ … … 76 76 int rc, sess_rc; 77 77 78 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);78 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 79 79 if (sess_rc != EOK) { 80 80 usb_log_warning("Failed to start a session: %s.\n", … … 92 92 USB_HIDREQ_SET_REPORT, value, hid_dev->iface, buffer, buf_size); 93 93 94 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);94 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 95 95 96 96 if (rc != EOK) { … … 119 119 * @retval EINVAL if no HID device is given. 120 120 * @return Other value inherited from one of functions 121 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),121 * usb_pipe_start_session(), usb_pipe_end_session(), 122 122 * usb_control_request_set(). 123 123 */ … … 137 137 int rc, sess_rc; 138 138 139 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);139 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 140 140 if (sess_rc != EOK) { 141 141 usb_log_warning("Failed to start a session: %s.\n", … … 151 151 USB_HIDREQ_SET_PROTOCOL, protocol, hid_dev->iface, NULL, 0); 152 152 153 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);153 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 154 154 155 155 if (rc != EOK) { … … 179 179 * @retval EINVAL if no HID device is given. 180 180 * @return Other value inherited from one of functions 181 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),181 * usb_pipe_start_session(), usb_pipe_end_session(), 182 182 * usb_control_request_set(). 183 183 */ … … 197 197 int rc, sess_rc; 198 198 199 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);199 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 200 200 if (sess_rc != EOK) { 201 201 usb_log_warning("Failed to start a session: %s.\n", … … 213 213 USB_HIDREQ_SET_IDLE, value, hid_dev->iface, NULL, 0); 214 214 215 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);215 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 216 216 217 217 if (rc != EOK) { … … 244 244 * @retval EINVAL if no HID device is given. 245 245 * @return Other value inherited from one of functions 246 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),246 * usb_pipe_start_session(), usb_pipe_end_session(), 247 247 * usb_control_request_set(). 248 248 */ … … 263 263 int rc, sess_rc; 264 264 265 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);265 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 266 266 if (sess_rc != EOK) { 267 267 usb_log_warning("Failed to start a session: %s.\n", … … 280 280 actual_size); 281 281 282 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);282 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 283 283 284 284 if (rc != EOK) { … … 307 307 * @retval EINVAL if no HID device is given. 308 308 * @return Other value inherited from one of functions 309 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),309 * usb_pipe_start_session(), usb_pipe_end_session(), 310 310 * usb_control_request_set(). 311 311 */ … … 325 325 int rc, sess_rc; 326 326 327 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);327 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 328 328 if (sess_rc != EOK) { 329 329 usb_log_warning("Failed to start a session: %s.\n", … … 342 342 USB_HIDREQ_GET_PROTOCOL, 0, hid_dev->iface, buffer, 1, &actual_size); 343 343 344 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);344 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 345 345 346 346 if (rc != EOK) { … … 378 378 * @retval EINVAL if no HID device is given. 379 379 * @return Other value inherited from one of functions 380 * usb_ endpoint_pipe_start_session(), usb_endpoint_pipe_end_session(),380 * usb_pipe_start_session(), usb_pipe_end_session(), 381 381 * usb_control_request_set(). 382 382 */ … … 396 396 int rc, sess_rc; 397 397 398 sess_rc = usb_ endpoint_pipe_start_session(&hid_dev->ctrl_pipe);398 sess_rc = usb_pipe_start_session(&hid_dev->ctrl_pipe); 399 399 if (sess_rc != EOK) { 400 400 usb_log_warning("Failed to start a session: %s.\n", … … 415 415 &actual_size); 416 416 417 sess_rc = usb_ endpoint_pipe_end_session(&hid_dev->ctrl_pipe);417 sess_rc = usb_pipe_end_session(&hid_dev->ctrl_pipe); 418 418 419 419 if (rc != EOK) { -
uspace/drv/usbhid/kbddev.c
ra372663 r3954a63b 780 780 781 781 while (true) { 782 sess_rc = usb_ endpoint_pipe_start_session(782 sess_rc = usb_pipe_start_session( 783 783 &kbd_dev->hid_dev->poll_pipe); 784 784 if (sess_rc != EOK) { … … 788 788 } 789 789 790 rc = usb_ endpoint_pipe_read(&kbd_dev->hid_dev->poll_pipe,790 rc = usb_pipe_read(&kbd_dev->hid_dev->poll_pipe, 791 791 buffer, BOOTP_BUFFER_SIZE, &actual_size); 792 792 793 sess_rc = usb_ endpoint_pipe_end_session(793 sess_rc = usb_pipe_end_session( 794 794 &kbd_dev->hid_dev->poll_pipe); 795 795 -
uspace/drv/usbhub/usbhub.c
ra372663 r3954a63b 224 224 } 225 225 226 usb_ endpoint_pipe_start_session(hub_info->control_pipe);226 usb_pipe_start_session(hub_info->control_pipe); 227 227 //set hub configuration 228 228 opResult = usb_hub_set_configuration(hub_info); … … 239 239 return opResult; 240 240 } 241 usb_ endpoint_pipe_end_session(hub_info->control_pipe);241 usb_pipe_end_session(hub_info->control_pipe); 242 242 243 243 … … 321 321 //reset port 322 322 usb_hub_set_reset_port_request(&request, port); 323 opResult = usb_ endpoint_pipe_control_write(323 opResult = usb_pipe_control_write( 324 324 hub->control_pipe, 325 325 &request,sizeof(usb_device_request_setup_packet_t), … … 360 360 &hub->connection 361 361 ); 362 usb_ endpoint_pipe_initialize_default_control(362 usb_pipe_initialize_default_control( 363 363 &new_device_pipe, 364 364 &new_device_connection); 365 usb_ endpoint_pipe_probe_default_control(&new_device_pipe);365 usb_pipe_probe_default_control(&new_device_pipe); 366 366 367 367 /* Request address from host controller. */ … … 379 379 //opResult = usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT, 380 380 // new_device_address); 381 usb_ endpoint_pipe_start_session(&new_device_pipe);381 usb_pipe_start_session(&new_device_pipe); 382 382 opResult = usb_request_set_address(&new_device_pipe,new_device_address); 383 usb_ endpoint_pipe_end_session(&new_device_pipe);383 usb_pipe_end_session(&new_device_pipe); 384 384 if (opResult != EOK) { 385 385 usb_log_error("could not set address for new device %d\n",opResult); … … 499 499 //endpoint 0 500 500 501 opResult = usb_ endpoint_pipe_control_read(501 opResult = usb_pipe_control_read( 502 502 pipe, 503 503 &request, sizeof(usb_device_request_setup_packet_t), … … 560 560 int usb_hub_check_hub_changes(usb_hub_info_t * hub_info){ 561 561 int opResult; 562 opResult = usb_ endpoint_pipe_start_session(562 opResult = usb_pipe_start_session( 563 563 hub_info->status_change_pipe); 564 564 if(opResult != EOK){ … … 578 578 * Send the request. 579 579 */ 580 opResult = usb_ endpoint_pipe_read(580 opResult = usb_pipe_read( 581 581 hub_info->status_change_pipe, 582 582 change_bitmap, byte_length, &actual_size … … 586 586 free(change_bitmap); 587 587 usb_log_warning("something went wrong while getting status of hub\n"); 588 usb_ endpoint_pipe_end_session(hub_info->status_change_pipe);588 usb_pipe_end_session(hub_info->status_change_pipe); 589 589 return opResult; 590 590 } 591 591 unsigned int port; 592 opResult = usb_ endpoint_pipe_start_session(hub_info->control_pipe);592 opResult = usb_pipe_start_session(hub_info->control_pipe); 593 593 if(opResult!=EOK){ 594 594 usb_log_error("could not start control pipe session %d\n", opResult); 595 usb_ endpoint_pipe_end_session(hub_info->status_change_pipe);595 usb_pipe_end_session(hub_info->status_change_pipe); 596 596 return opResult; 597 597 } … … 600 600 usb_log_error("could not start host controller session %d\n", 601 601 opResult); 602 usb_ endpoint_pipe_end_session(hub_info->control_pipe);603 usb_ endpoint_pipe_end_session(hub_info->status_change_pipe);602 usb_pipe_end_session(hub_info->control_pipe); 603 usb_pipe_end_session(hub_info->status_change_pipe); 604 604 return opResult; 605 605 } … … 615 615 } 616 616 usb_hc_connection_close(&hub_info->connection); 617 usb_ endpoint_pipe_end_session(hub_info->control_pipe);618 usb_ endpoint_pipe_end_session(hub_info->status_change_pipe);617 usb_pipe_end_session(hub_info->control_pipe); 618 usb_pipe_end_session(hub_info->status_change_pipe); 619 619 free(change_bitmap); 620 620 return EOK; -
uspace/drv/usbhub/usbhub_private.h
ra372663 r3954a63b 106 106 }; 107 107 clear_request.value = feature; 108 return usb_ endpoint_pipe_control_write(pipe, &clear_request,108 return usb_pipe_control_write(pipe, &clear_request, 109 109 sizeof(clear_request), NULL, 0); 110 110 } -
uspace/drv/usbmid/main.c
ra372663 r3954a63b 61 61 int rc; 62 62 63 rc = usb_ endpoint_pipe_start_session(&dev->ctrl_pipe);63 rc = usb_pipe_start_session(&dev->ctrl_pipe); 64 64 if (rc != EOK) { 65 65 usb_log_error("Failed to start session on control pipe: %s.\n", … … 70 70 bool accept = usbmid_explore_device(dev); 71 71 72 rc = usb_ endpoint_pipe_end_session(&dev->ctrl_pipe);72 rc = usb_pipe_end_session(&dev->ctrl_pipe); 73 73 if (rc != EOK) { 74 74 usb_log_warning("Failed to end session on control pipe: %s.\n", -
uspace/drv/usbmid/usbmid.c
ra372663 r3954a63b 108 108 } 109 109 110 rc = usb_ endpoint_pipe_initialize_default_control(&mid->ctrl_pipe,110 rc = usb_pipe_initialize_default_control(&mid->ctrl_pipe, 111 111 &mid->wire); 112 112 if (rc != EOK) { … … 116 116 return NULL; 117 117 } 118 rc = usb_ endpoint_pipe_probe_default_control(&mid->ctrl_pipe);118 rc = usb_pipe_probe_default_control(&mid->ctrl_pipe); 119 119 if (rc != EOK) { 120 120 usb_log_error("Probing default control pipe failed: %s.\n", -
uspace/drv/usbmouse/init.c
ra372663 r3954a63b 126 126 127 127 /* Open the control pipe. */ 128 rc = usb_ endpoint_pipe_start_session(&dev->ctrl_pipe);128 rc = usb_pipe_start_session(&dev->ctrl_pipe); 129 129 if (rc != EOK) { 130 130 goto leave; … … 141 141 142 142 /* Close the control pipe (ignore errors). */ 143 usb_ endpoint_pipe_end_session(&dev->ctrl_pipe);143 usb_pipe_end_session(&dev->ctrl_pipe); 144 144 145 145 -
uspace/lib/usb/include/usb/pipes.h
ra372663 r3954a63b 125 125 usb_address_t usb_device_get_assigned_address(devman_handle_t); 126 126 127 int usb_endpoint_pipe_initialize(usb_pipe_t *, 128 usb_device_connection_t *, 127 int usb_pipe_initialize(usb_pipe_t *, usb_device_connection_t *, 129 128 usb_endpoint_t, usb_transfer_type_t, size_t, usb_direction_t); 130 int usb_ endpoint_pipe_initialize_default_control(usb_pipe_t *,129 int usb_pipe_initialize_default_control(usb_pipe_t *, 131 130 usb_device_connection_t *); 132 int usb_ endpoint_pipe_probe_default_control(usb_pipe_t *);133 int usb_ endpoint_pipe_initialize_from_configuration(usb_endpoint_mapping_t *,131 int usb_pipe_probe_default_control(usb_pipe_t *); 132 int usb_pipe_initialize_from_configuration(usb_endpoint_mapping_t *, 134 133 size_t, uint8_t *, size_t, usb_device_connection_t *); 135 int usb_endpoint_pipe_register(usb_pipe_t *, unsigned int, 136 usb_hc_connection_t *); 137 int usb_endpoint_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *); 134 int usb_pipe_register(usb_pipe_t *, unsigned int, usb_hc_connection_t *); 135 int usb_pipe_unregister(usb_pipe_t *, usb_hc_connection_t *); 138 136 139 int usb_ endpoint_pipe_start_session(usb_pipe_t *);140 int usb_ endpoint_pipe_end_session(usb_pipe_t *);141 bool usb_ endpoint_pipe_is_session_started(usb_pipe_t *);137 int usb_pipe_start_session(usb_pipe_t *); 138 int usb_pipe_end_session(usb_pipe_t *); 139 bool usb_pipe_is_session_started(usb_pipe_t *); 142 140 143 int usb_ endpoint_pipe_read(usb_pipe_t *, void *, size_t, size_t *);144 int usb_ endpoint_pipe_write(usb_pipe_t *, void *, size_t);141 int usb_pipe_read(usb_pipe_t *, void *, size_t, size_t *); 142 int usb_pipe_write(usb_pipe_t *, void *, size_t); 145 143 146 int usb_ endpoint_pipe_control_read(usb_pipe_t *, void *, size_t,144 int usb_pipe_control_read(usb_pipe_t *, void *, size_t, 147 145 void *, size_t, size_t *); 148 int usb_ endpoint_pipe_control_write(usb_pipe_t *, void *, size_t,146 int usb_pipe_control_write(usb_pipe_t *, void *, size_t, 149 147 void *, size_t); 150 148 -
uspace/lib/usb/src/devdrv.c
ra372663 r3954a63b 147 147 } 148 148 149 rc = usb_ endpoint_pipe_initialize_from_configuration(dev->pipes,149 rc = usb_pipe_initialize_from_configuration(dev->pipes, 150 150 pipe_count, config_descriptor, config_descriptor_size, &dev->wire); 151 151 if (rc != EOK) { … … 172 172 for (i = 0; i < pipe_count; i++) { 173 173 if (dev->pipes[i].present) { 174 rc = usb_ endpoint_pipe_register(dev->pipes[i].pipe,174 rc = usb_pipe_register(dev->pipes[i].pipe, 175 175 dev->pipes[i].descriptor->poll_interval, 176 176 &hc_conn); … … 219 219 } 220 220 221 rc = usb_ endpoint_pipe_initialize_default_control(&dev->ctrl_pipe,221 rc = usb_pipe_initialize_default_control(&dev->ctrl_pipe, 222 222 &dev->wire); 223 223 if (rc != EOK) { … … 228 228 } 229 229 230 rc = usb_ endpoint_pipe_probe_default_control(&dev->ctrl_pipe);230 rc = usb_pipe_probe_default_control(&dev->ctrl_pipe); 231 231 if (rc != EOK) { 232 232 usb_log_error( … … 240 240 * default control pipe. 241 241 */ 242 rc = usb_ endpoint_pipe_start_session(&dev->ctrl_pipe);242 rc = usb_pipe_start_session(&dev->ctrl_pipe); 243 243 if (rc != EOK) { 244 244 usb_log_error("Failed to start an IPC session: %s.\n", … … 252 252 253 253 /* No checking here. */ 254 usb_ endpoint_pipe_end_session(&dev->ctrl_pipe);254 usb_pipe_end_session(&dev->ctrl_pipe); 255 255 256 256 return rc; -
uspace/lib/usb/src/devpoll.c
ra372663 r3954a63b 71 71 int rc; 72 72 73 rc = usb_ endpoint_pipe_start_session(pipe);73 rc = usb_pipe_start_session(pipe); 74 74 if (rc != EOK) { 75 75 failed_attempts++; … … 78 78 79 79 size_t actual_size; 80 rc = usb_ endpoint_pipe_read(pipe, polling_data->buffer,80 rc = usb_pipe_read(pipe, polling_data->buffer, 81 81 polling_data->request_size, &actual_size); 82 82 83 83 /* Quit the session regardless of errors. */ 84 usb_ endpoint_pipe_end_session(pipe);84 usb_pipe_end_session(pipe); 85 85 86 86 if (rc != EOK) { -
uspace/lib/usb/src/hub.c
ra372663 r3954a63b 229 229 230 230 usb_pipe_t ctrl_pipe; 231 rc = usb_ endpoint_pipe_initialize_default_control(&ctrl_pipe,231 rc = usb_pipe_initialize_default_control(&ctrl_pipe, 232 232 &dev_conn); 233 233 if (rc != EOK) { … … 235 235 goto leave_release_default_address; 236 236 } 237 rc = usb_ endpoint_pipe_probe_default_control(&ctrl_pipe);237 rc = usb_pipe_probe_default_control(&ctrl_pipe); 238 238 if (rc != EOK) { 239 239 rc = ENOTCONN; … … 241 241 } 242 242 243 rc = usb_ endpoint_pipe_start_session(&ctrl_pipe);243 rc = usb_pipe_start_session(&ctrl_pipe); 244 244 if (rc != EOK) { 245 245 rc = ENOTCONN; … … 253 253 } 254 254 255 usb_ endpoint_pipe_end_session(&ctrl_pipe);255 usb_pipe_end_session(&ctrl_pipe); 256 256 257 257 /* … … 306 306 307 307 leave_stop_session: 308 usb_ endpoint_pipe_end_session(&ctrl_pipe);308 usb_pipe_end_session(&ctrl_pipe); 309 309 310 310 leave_release_default_address: -
uspace/lib/usb/src/pipes.c
ra372663 r3954a63b 233 233 * A session is something inside what any communication occurs. 234 234 * It is expected that sessions would be started right before the transfer 235 * and ended - see usb_ endpoint_pipe_end_session() - after the last235 * and ended - see usb_pipe_end_session() - after the last 236 236 * transfer. 237 237 * The reason for this is that session actually opens some communication … … 244 244 * @return Error code. 245 245 */ 246 int usb_ endpoint_pipe_start_session(usb_pipe_t *pipe)246 int usb_pipe_start_session(usb_pipe_t *pipe) 247 247 { 248 248 assert(pipe); 249 249 250 if (usb_ endpoint_pipe_is_session_started(pipe)) {250 if (usb_pipe_is_session_started(pipe)) { 251 251 return EBUSY; 252 252 } … … 265 265 /** Ends a session on the endpoint pipe. 266 266 * 267 * @see usb_ endpoint_pipe_start_session267 * @see usb_pipe_start_session 268 268 * 269 269 * @param pipe Endpoint pipe to end the session on. 270 270 * @return Error code. 271 271 */ 272 int usb_ endpoint_pipe_end_session(usb_pipe_t *pipe)272 int usb_pipe_end_session(usb_pipe_t *pipe) 273 273 { 274 274 assert(pipe); 275 275 276 if (!usb_ endpoint_pipe_is_session_started(pipe)) {276 if (!usb_pipe_is_session_started(pipe)) { 277 277 return ENOENT; 278 278 } … … 296 296 * @return Whether @p pipe has opened a session. 297 297 */ 298 bool usb_ endpoint_pipe_is_session_started(usb_pipe_t *pipe)298 bool usb_pipe_is_session_started(usb_pipe_t *pipe) 299 299 { 300 300 return (pipe->hc_phone >= 0); -
uspace/lib/usb/src/pipesinit.c
ra372663 r3954a63b 193 193 } 194 194 195 int rc = usb_ endpoint_pipe_initialize(ep_mapping->pipe, wire,195 int rc = usb_pipe_initialize(ep_mapping->pipe, wire, 196 196 ep_no, description.transfer_type, endpoint->max_packet_size, 197 197 description.direction); … … 276 276 * @return Error code. 277 277 */ 278 int usb_ endpoint_pipe_initialize_from_configuration(278 int usb_pipe_initialize_from_configuration( 279 279 usb_endpoint_mapping_t *mapping, size_t mapping_count, 280 280 uint8_t *configuration_descriptor, size_t configuration_descriptor_size, … … 342 342 * @return Error code. 343 343 */ 344 int usb_ endpoint_pipe_initialize(usb_pipe_t *pipe,344 int usb_pipe_initialize(usb_pipe_t *pipe, 345 345 usb_device_connection_t *connection, usb_endpoint_t endpoint_no, 346 346 usb_transfer_type_t transfer_type, size_t max_packet_size, … … 367 367 * @return Error code. 368 368 */ 369 int usb_ endpoint_pipe_initialize_default_control(usb_pipe_t *pipe,369 int usb_pipe_initialize_default_control(usb_pipe_t *pipe, 370 370 usb_device_connection_t *connection) 371 371 { … … 373 373 assert(connection); 374 374 375 int rc = usb_ endpoint_pipe_initialize(pipe, connection,375 int rc = usb_pipe_initialize(pipe, connection, 376 376 0, USB_TRANSFER_CONTROL, CTRL_PIPE_MIN_PACKET_SIZE, 377 377 USB_DIRECTION_BOTH); … … 390 390 * @return Error code. 391 391 */ 392 int usb_ endpoint_pipe_probe_default_control(usb_pipe_t *pipe)392 int usb_pipe_probe_default_control(usb_pipe_t *pipe) 393 393 { 394 394 assert(pipe); … … 408 408 409 409 TRY_LOOP(failed_attempts) { 410 rc = usb_ endpoint_pipe_start_session(pipe);410 rc = usb_pipe_start_session(pipe); 411 411 if (rc == EOK) { 412 412 break; … … 433 433 } 434 434 } 435 usb_ endpoint_pipe_end_session(pipe);435 usb_pipe_end_session(pipe); 436 436 if (rc != EOK) { 437 437 return rc; … … 451 451 * @return Error code. 452 452 */ 453 int usb_ endpoint_pipe_register(usb_pipe_t *pipe,453 int usb_pipe_register(usb_pipe_t *pipe, 454 454 unsigned int interval, 455 455 usb_hc_connection_t *hc_connection) … … 479 479 * @return Error code. 480 480 */ 481 int usb_ endpoint_pipe_unregister(usb_pipe_t *pipe,481 int usb_pipe_unregister(usb_pipe_t *pipe, 482 482 usb_hc_connection_t *hc_connection) 483 483 { -
uspace/lib/usb/src/pipesio.c
ra372663 r3954a63b 58 58 * @return Error code. 59 59 */ 60 static int usb_ endpoint_pipe_read_no_checks(usb_pipe_t *pipe,60 static int usb_pipe_read_no_checks(usb_pipe_t *pipe, 61 61 void *buffer, size_t size, size_t *size_transfered) 62 62 { … … 140 140 * @return Error code. 141 141 */ 142 int usb_ endpoint_pipe_read(usb_pipe_t *pipe,142 int usb_pipe_read(usb_pipe_t *pipe, 143 143 void *buffer, size_t size, size_t *size_transfered) 144 144 { … … 153 153 } 154 154 155 if (!usb_ endpoint_pipe_is_session_started(pipe)) {155 if (!usb_pipe_is_session_started(pipe)) { 156 156 return EBADF; 157 157 } … … 168 168 int rc; 169 169 170 rc = usb_ endpoint_pipe_read_no_checks(pipe, buffer, size, &act_size);170 rc = usb_pipe_read_no_checks(pipe, buffer, size, &act_size); 171 171 if (rc != EOK) { 172 172 return rc; … … 190 190 * @return Error code. 191 191 */ 192 static int usb_ endpoint_pipe_write_no_check(usb_pipe_t *pipe,192 static int usb_pipe_write_no_check(usb_pipe_t *pipe, 193 193 void *buffer, size_t size) 194 194 { … … 247 247 * @return Error code. 248 248 */ 249 int usb_ endpoint_pipe_write(usb_pipe_t *pipe,249 int usb_pipe_write(usb_pipe_t *pipe, 250 250 void *buffer, size_t size) 251 251 { … … 260 260 } 261 261 262 if (!usb_ endpoint_pipe_is_session_started(pipe)) {262 if (!usb_pipe_is_session_started(pipe)) { 263 263 return EBADF; 264 264 } … … 272 272 } 273 273 274 int rc = usb_ endpoint_pipe_write_no_check(pipe, buffer, size);274 int rc = usb_pipe_write_no_check(pipe, buffer, size); 275 275 276 276 return rc; … … 289 289 * @return Error code. 290 290 */ 291 static int usb_ endpoint_pipe_control_read_no_check(usb_pipe_t *pipe,291 static int usb_pipe_control_read_no_check(usb_pipe_t *pipe, 292 292 void *setup_buffer, size_t setup_buffer_size, 293 293 void *data_buffer, size_t data_buffer_size, size_t *data_transfered_size) … … 365 365 * @return Error code. 366 366 */ 367 int usb_ endpoint_pipe_control_read(usb_pipe_t *pipe,367 int usb_pipe_control_read(usb_pipe_t *pipe, 368 368 void *setup_buffer, size_t setup_buffer_size, 369 369 void *data_buffer, size_t data_buffer_size, size_t *data_transfered_size) … … 379 379 } 380 380 381 if (!usb_ endpoint_pipe_is_session_started(pipe)) {381 if (!usb_pipe_is_session_started(pipe)) { 382 382 return EBADF; 383 383 } … … 389 389 390 390 size_t act_size = 0; 391 int rc = usb_ endpoint_pipe_control_read_no_check(pipe,391 int rc = usb_pipe_control_read_no_check(pipe, 392 392 setup_buffer, setup_buffer_size, 393 393 data_buffer, data_buffer_size, &act_size); … … 414 414 * @return Error code. 415 415 */ 416 static int usb_ endpoint_pipe_control_write_no_check(usb_pipe_t *pipe,416 static int usb_pipe_control_write_no_check(usb_pipe_t *pipe, 417 417 void *setup_buffer, size_t setup_buffer_size, 418 418 void *data_buffer, size_t data_buffer_size) … … 473 473 * @return Error code. 474 474 */ 475 int usb_ endpoint_pipe_control_write(usb_pipe_t *pipe,475 int usb_pipe_control_write(usb_pipe_t *pipe, 476 476 void *setup_buffer, size_t setup_buffer_size, 477 477 void *data_buffer, size_t data_buffer_size) … … 491 491 } 492 492 493 if (!usb_ endpoint_pipe_is_session_started(pipe)) {493 if (!usb_pipe_is_session_started(pipe)) { 494 494 return EBADF; 495 495 } … … 500 500 } 501 501 502 int rc = usb_ endpoint_pipe_control_write_no_check(pipe,502 int rc = usb_pipe_control_write_no_check(pipe, 503 503 setup_buffer, setup_buffer_size, data_buffer, data_buffer_size); 504 504 -
uspace/lib/usb/src/recognise.c
ra372663 r3954a63b 370 370 } 371 371 372 rc = usb_ endpoint_pipe_initialize_default_control(&ctrl_pipe,372 rc = usb_pipe_initialize_default_control(&ctrl_pipe, 373 373 &dev_connection); 374 374 if (rc != EOK) { 375 375 goto failure; 376 376 } 377 rc = usb_ endpoint_pipe_probe_default_control(&ctrl_pipe);377 rc = usb_pipe_probe_default_control(&ctrl_pipe); 378 378 if (rc != EOK) { 379 379 goto failure; … … 404 404 child->driver_data = dev_data; 405 405 406 rc = usb_ endpoint_pipe_start_session(&ctrl_pipe);406 rc = usb_pipe_start_session(&ctrl_pipe); 407 407 if (rc != EOK) { 408 408 goto failure; … … 414 414 } 415 415 416 rc = usb_ endpoint_pipe_end_session(&ctrl_pipe);416 rc = usb_pipe_end_session(&ctrl_pipe); 417 417 if (rc != EOK) { 418 418 goto failure; -
uspace/lib/usb/src/request.c
ra372663 r3954a63b 42 42 /** Generic wrapper for SET requests using standard control request format. 43 43 * 44 * @see usb_ endpoint_pipe_control_write44 * @see usb_pipe_control_write 45 45 * 46 46 * @param pipe Pipe used for the communication. … … 90 90 setup_packet.length = (uint16_t) data_size; 91 91 92 int rc = usb_ endpoint_pipe_control_write(pipe,92 int rc = usb_pipe_control_write(pipe, 93 93 &setup_packet, sizeof(setup_packet), 94 94 data, data_size); … … 99 99 /** Generic wrapper for GET requests using standard control request format. 100 100 * 101 * @see usb_ endpoint_pipe_control_read101 * @see usb_pipe_control_read 102 102 * 103 103 * @param pipe Pipe used for the communication. … … 150 150 setup_packet.length = (uint16_t) data_size; 151 151 152 int rc = usb_ endpoint_pipe_control_read(pipe,152 int rc = usb_pipe_control_read(pipe, 153 153 &setup_packet, sizeof(setup_packet), 154 154 data, data_size, actual_data_size);
Note:
See TracChangeset
for help on using the changeset viewer.