Changeset b7fd2a0 in mainline for uspace/lib/usbdev/src/devdrv.c
- Timestamp:
- 2018-01-13T03:10:29Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a53ed3a
- Parents:
- 36f0738
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usbdev/src/devdrv.c
r36f0738 rb7fd2a0 131 131 * @return Error code. 132 132 */ 133 int usb_device_select_interface(usb_device_t *usb_dev,133 errno_t usb_device_select_interface(usb_device_t *usb_dev, 134 134 uint8_t alternate_setting, const usb_endpoint_description_t **endpoints) 135 135 { … … 141 141 142 142 /* Change the interface itself. */ 143 int rc = usb_request_set_interface(&usb_dev->ctrl_pipe,143 errno_t rc = usb_request_set_interface(&usb_dev->ctrl_pipe, 144 144 usb_dev->interface_no, alternate_setting); 145 145 if (rc != EOK) { … … 165 165 * @return Error code. 166 166 */ 167 static int usb_device_retrieve_descriptors(usb_device_t *usb_dev)167 static errno_t usb_device_retrieve_descriptors(usb_device_t *usb_dev) 168 168 { 169 169 assert(usb_dev); … … 171 171 172 172 /* Get the device descriptor. */ 173 int rc = usb_request_get_device_descriptor(&usb_dev->ctrl_pipe,173 errno_t rc = usb_request_get_device_descriptor(&usb_dev->ctrl_pipe, 174 174 &usb_dev->descriptors.device); 175 175 if (rc != EOK) { … … 217 217 * @return Error code. 218 218 */ 219 int usb_device_create_pipes(usb_device_t *usb_dev,219 errno_t usb_device_create_pipes(usb_device_t *usb_dev, 220 220 const usb_endpoint_description_t **endpoints) 221 221 { … … 245 245 246 246 /* Find the mapping from configuration descriptor. */ 247 int rc = usb_pipe_initialize_from_configuration(pipes, pipe_count,247 errno_t rc = usb_pipe_initialize_from_configuration(pipes, pipe_count, 248 248 usb_dev->descriptors.full_config, 249 249 usb_dev->descriptors.full_config_size, … … 393 393 * @return Error code. 394 394 */ 395 static int usb_device_init(usb_device_t *usb_dev, ddf_dev_t *ddf_dev,395 static errno_t usb_device_init(usb_device_t *usb_dev, ddf_dev_t *ddf_dev, 396 396 const usb_endpoint_description_t **endpoints, const char **errstr_ptr, 397 397 devman_handle_t handle, int interface_no) … … 420 420 /* This pipe was registered by the hub driver, 421 421 * during device initialization. */ 422 int rc = usb_pipe_initialize_default_control(422 errno_t rc = usb_pipe_initialize_default_control( 423 423 &usb_dev->ctrl_pipe, usb_dev->bus_session); 424 424 if (rc != EOK) { … … 457 457 } 458 458 459 static int usb_device_get_info(async_sess_t *sess, devman_handle_t *handle,459 static errno_t usb_device_get_info(async_sess_t *sess, devman_handle_t *handle, 460 460 int *iface_no) 461 461 { … … 467 467 return EPARTY; 468 468 469 int ret = usb_get_my_device_handle(exch, handle);469 errno_t ret = usb_get_my_device_handle(exch, handle); 470 470 if (ret == EOK) { 471 471 ret = usb_get_my_interface(exch, iface_no); … … 480 480 } 481 481 482 int usb_device_create_ddf(ddf_dev_t *ddf_dev,482 errno_t usb_device_create_ddf(ddf_dev_t *ddf_dev, 483 483 const usb_endpoint_description_t **desc, const char **err) 484 484 { … … 492 492 if (sess == NULL) 493 493 return ENOMEM; 494 const int ret = usb_device_get_info(sess, &h, &iface_no);494 const errno_t ret = usb_device_get_info(sess, &h, &iface_no); 495 495 if (ret != EOK) 496 496 return ret; … … 521 521 522 522 async_sess_t *sess = devman_device_connect(handle, IPC_FLAG_BLOCKING); 523 int ret = usb_device_get_info(sess, &h, &iface_no);523 errno_t ret = usb_device_get_info(sess, &h, &iface_no); 524 524 if (sess) 525 525 async_hangup(sess);
Note:
See TracChangeset
for help on using the changeset viewer.