Changes in / [867e6735:72363a1] in mainline
- Location:
- uspace
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/iface.c
r867e6735 r72363a1 54 54 } 55 55 /*----------------------------------------------------------------------------*/ 56 static int reserve_default_address(device_t *dev , usb_speed_t speed)56 static int reserve_default_address(device_t *dev) 57 57 { 58 58 assert(dev); … … 72 72 } 73 73 /*----------------------------------------------------------------------------*/ 74 static int request_address(device_t *dev, usb_speed_t speed, 75 usb_address_t *address) 74 static int request_address(device_t *dev, usb_address_t *address) 76 75 { 77 76 assert(dev); … … 104 103 /*----------------------------------------------------------------------------*/ 105 104 static int interrupt_out(device_t *dev, usb_target_t target, 106 size_t max_packet_size,107 void *data, size_t size,108 usbhc_iface_transfer_out_callback_t callback, void *arg) 109 { 105 void *data, size_t size, 106 usbhc_iface_transfer_out_callback_t callback, void *arg) 107 { 108 size_t max_packet_size = 8; 110 109 dev_speed_t speed = FULL_SPEED; 111 110 … … 119 118 /*----------------------------------------------------------------------------*/ 120 119 static int interrupt_in(device_t *dev, usb_target_t target, 121 size_t max_packet_size,122 void *data, size_t size,123 usbhc_iface_transfer_in_callback_t callback, void *arg) 124 { 120 void *data, size_t size, 121 usbhc_iface_transfer_in_callback_t callback, void *arg) 122 { 123 size_t max_packet_size = 4; 125 124 dev_speed_t speed = FULL_SPEED; 126 125 … … 134 133 /*----------------------------------------------------------------------------*/ 135 134 static int control_write(device_t *dev, usb_target_t target, 136 size_t max_packet_size,137 135 void *setup_data, size_t setup_size, void *data, size_t size, 138 136 usbhc_iface_transfer_out_callback_t callback, void *arg) 139 137 { 138 size_t max_packet_size = 8; 140 139 dev_speed_t speed = FULL_SPEED; 141 140 … … 150 149 /*----------------------------------------------------------------------------*/ 151 150 static int control_read(device_t *dev, usb_target_t target, 152 size_t max_packet_size,153 151 void *setup_data, size_t setup_size, void *data, size_t size, 154 152 usbhc_iface_transfer_in_callback_t callback, void *arg) 155 153 { 154 size_t max_packet_size = 8; 156 155 dev_speed_t speed = FULL_SPEED; 157 156 … … 166 165 /*----------------------------------------------------------------------------*/ 167 166 static int control_write_setup(device_t *dev, usb_target_t target, 168 size_t max_packet_size,169 void *data, size_t size,170 usbhc_iface_transfer_out_callback_t callback, void *arg) 171 { 167 void *data, size_t size, 168 usbhc_iface_transfer_out_callback_t callback, void *arg) 169 { 170 size_t max_packet_size = 8; 172 171 dev_speed_t speed = FULL_SPEED; 173 172 … … 182 181 /*----------------------------------------------------------------------------*/ 183 182 static int control_write_data(device_t *dev, usb_target_t target, 184 size_t max_packet_size,185 void *data, size_t size,186 usbhc_iface_transfer_out_callback_t callback, void *arg) 187 { 183 void *data, size_t size, 184 usbhc_iface_transfer_out_callback_t callback, void *arg) 185 { 186 size_t max_packet_size = 8; 188 187 dev_speed_t speed = FULL_SPEED; 189 188 … … 213 212 /*----------------------------------------------------------------------------*/ 214 213 static int control_read_setup(device_t *dev, usb_target_t target, 215 size_t max_packet_size,216 void *data, size_t size,217 usbhc_iface_transfer_out_callback_t callback, void *arg) 218 { 214 void *data, size_t size, 215 usbhc_iface_transfer_out_callback_t callback, void *arg) 216 { 217 size_t max_packet_size = 8; 219 218 dev_speed_t speed = FULL_SPEED; 220 219 … … 229 228 /*----------------------------------------------------------------------------*/ 230 229 static int control_read_data(device_t *dev, usb_target_t target, 231 size_t max_packet_size,232 void *data, size_t size,233 usbhc_iface_transfer_in_callback_t callback, void *arg) 234 { 230 void *data, size_t size, 231 usbhc_iface_transfer_in_callback_t callback, void *arg) 232 { 233 size_t max_packet_size = 8; 235 234 dev_speed_t speed = FULL_SPEED; 236 235 -
uspace/drv/uhci-rhd/port.c
r867e6735 r72363a1 131 131 return EOK; 132 132 } 133 134 /** Callback for enabling port during adding a new device. 135 * 136 * @param portno Port number (unused). 137 * @param arg Pointer to uhci_port_t of port with the new device. 138 * @return Error code. 139 */ 140 static int new_device_enable_port(int portno, void *arg) 141 { 142 uhci_port_t *port = (uhci_port_t *) arg; 143 144 usb_log_debug("new_device_enable_port(%d)\n", port->number); 133 /*----------------------------------------------------------------------------*/ 134 static int uhci_port_new_device(uhci_port_t *port) 135 { 136 assert(port); 137 assert(usb_hc_connection_is_opened(&port->hc_connection)); 138 139 usb_log_info("Adding new device on port %d.\n", port->number); 140 141 /* get address of the future device */ 142 const usb_address_t usb_address = usb_hc_request_address(&port->hc_connection); 143 144 if (usb_address <= 0) { 145 usb_log_error("Recieved invalid address(%d).\n", usb_address); 146 return usb_address; 147 } 148 usb_log_debug("Sucessfully obtained address %d for port %d.\n", 149 usb_address, port->number); 150 151 /* get default address */ 152 int ret = usb_hc_reserve_default_address(&port->hc_connection); 153 if (ret != EOK) { 154 usb_log_error("Failed to reserve default address on port %d.\n", 155 port->number); 156 int ret2 = usb_hc_unregister_device(&port->hc_connection, 157 usb_address); 158 if (ret2 != EOK) { 159 usb_log_fatal("Failed to return requested address on port %d.\n", 160 port->number); 161 return ret2; 162 } 163 usb_log_debug("Successfully returned reserved address on port %d.\n", 164 port->number); 165 return ret; 166 } 167 usb_log_debug("Sucessfully obtained default address for port %d.\n", 168 port->number); 145 169 146 170 /* 147 * The host then waits for at least 100 ms to allow completion of171 * the host then waits for at least 100 ms to allow completion of 148 172 * an insertion process and for power at the device to become stable. 149 173 */ 150 174 async_usleep(100000); 151 175 152 /* Enable the port.*/176 /* enable port */ 153 177 uhci_port_set_enabled(port, true); 154 178 … … 172 196 } 173 197 174 return EOK; 175 } 176 177 /*----------------------------------------------------------------------------*/ 178 static int uhci_port_new_device(uhci_port_t *port) 179 { 180 assert(port); 181 assert(usb_hc_connection_is_opened(&port->hc_connection)); 182 183 usb_log_info("Detected new device on port %u.\n", port->number); 184 185 usb_address_t dev_addr; 186 int rc = usb_hc_new_device_wrapper(port->rh, &port->hc_connection, 187 USB_SPEED_FULL, 188 new_device_enable_port, port->number, port, 189 &dev_addr, &port->attached_device); 190 if (rc != EOK) { 191 usb_log_error("Failed adding new device on port %u: %s.\n", 192 port->number, str_error(rc)); 198 /* 199 * Initialize connection to the device. 200 */ 201 /* FIXME: check for errors. */ 202 usb_device_connection_t new_dev_connection; 203 usb_endpoint_pipe_t new_dev_ctrl_pipe; 204 usb_device_connection_initialize_on_default_address( 205 &new_dev_connection, &port->hc_connection); 206 usb_endpoint_pipe_initialize_default_control(&new_dev_ctrl_pipe, 207 &new_dev_connection); 208 209 /* 210 * Assign new address to the device. This function updates 211 * the backing connection to still point to the same device. 212 */ 213 /* FIXME: check for errors. */ 214 usb_endpoint_pipe_start_session(&new_dev_ctrl_pipe); 215 ret = usb_request_set_address(&new_dev_ctrl_pipe, usb_address); 216 usb_endpoint_pipe_end_session(&new_dev_ctrl_pipe); 217 218 if (ret != EOK) { /* address assigning went wrong */ 219 usb_log_error("Failed(%d) to assign address to the device.\n", ret); 193 220 uhci_port_set_enabled(port, false); 194 return rc; 195 } 196 197 usb_log_info("New device on port %u has address %d (handle %zu).\n", 198 port->number, dev_addr, port->attached_device); 199 200 return EOK; 201 } 202 221 int release = usb_hc_release_default_address(&port->hc_connection); 222 if (release != EOK) { 223 usb_log_error("Failed to release default address on port %d.\n", 224 port->number); 225 return release; 226 } 227 usb_log_debug("Sucessfully released default address on port %d.\n", 228 port->number); 229 return ret; 230 } 231 usb_log_debug("Sucessfully assigned address %d for port %d.\n", 232 usb_address, port->number); 233 234 /* release default address */ 235 ret = usb_hc_release_default_address(&port->hc_connection); 236 if (ret != EOK) { 237 usb_log_error("Failed to release default address on port %d.\n", 238 port->number); 239 return ret; 240 } 241 usb_log_debug("Sucessfully released default address on port %d.\n", 242 port->number); 243 244 /* communicate and possibly report to devman */ 245 assert(port->attached_device == 0); 246 247 ret = usb_device_register_child_in_devman(new_dev_connection.address, 248 new_dev_connection.hc_handle, port->rh, &port->attached_device); 249 250 if (ret != EOK) { /* something went wrong */ 251 usb_log_error("Failed(%d) in usb_drv_register_child.\n", ret); 252 uhci_port_set_enabled(port, false); 253 return ENOMEM; 254 } 255 usb_log_info("Sucessfully added device on port(%d) address(%d) handle %d.\n", 256 port->number, usb_address, port->attached_device); 257 258 /* 259 * Register the device in the host controller. 260 */ 261 usb_hc_attached_device_t new_device = { 262 .address = new_dev_connection.address, 263 .handle = port->attached_device 264 }; 265 266 ret = usb_hc_register_device(&port->hc_connection, &new_device); 267 // TODO: proper error check here 268 assert(ret == EOK); 269 270 return EOK; 271 } 203 272 /*----------------------------------------------------------------------------*/ 204 273 static int uhci_port_remove_device(uhci_port_t *port) -
uspace/drv/vhc/connhost.c
r867e6735 r72363a1 276 276 277 277 static int interrupt_out(device_t *dev, usb_target_t target, 278 size_t max_packet_size,279 278 void *data, size_t size, 280 279 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 286 285 287 286 static int interrupt_in(device_t *dev, usb_target_t target, 288 size_t max_packet_size,289 287 void *data, size_t size, 290 288 usbhc_iface_transfer_in_callback_t callback, void *arg) … … 296 294 297 295 static int control_write_setup(device_t *dev, usb_target_t target, 298 size_t max_packet_size,299 296 void *data, size_t size, 300 297 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 306 303 307 304 static int control_write_data(device_t *dev, usb_target_t target, 308 size_t max_packet_size,309 305 void *data, size_t size, 310 306 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 324 320 325 321 static int control_write(device_t *dev, usb_target_t target, 326 size_t max_packet_size,327 322 void *setup_packet, size_t setup_packet_size, 328 323 void *data, size_t data_size, … … 342 337 343 338 static int control_read_setup(device_t *dev, usb_target_t target, 344 size_t max_packet_size,345 339 void *data, size_t size, 346 340 usbhc_iface_transfer_out_callback_t callback, void *arg) … … 352 346 353 347 static int control_read_data(device_t *dev, usb_target_t target, 354 size_t max_packet_size,355 348 void *data, size_t size, 356 349 usbhc_iface_transfer_in_callback_t callback, void *arg) … … 370 363 371 364 static int control_read(device_t *dev, usb_target_t target, 372 size_t max_packet_size,373 365 void *setup_packet, size_t setup_packet_size, 374 366 void *data, size_t data_size, … … 390 382 391 383 392 static int reserve_default_address(device_t *dev , usb_speed_t ignored)384 static int reserve_default_address(device_t *dev) 393 385 { 394 386 usb_address_keeping_reserve_default(&addresses); … … 402 394 } 403 395 404 static int request_address(device_t *dev, usb_speed_t ignored, 405 usb_address_t *address) 396 static int request_address(device_t *dev, usb_address_t *address) 406 397 { 407 398 usb_address_t addr = usb_address_keeping_request(&addresses); -
uspace/lib/c/generic/str_error.c
r867e6735 r72363a1 73 73 case EBADCHECKSUM: 74 74 return "Bad checksum"; 75 case ESTALL:76 return "Operation stalled";77 75 case EAGAIN: 78 76 return "Resource temporarily unavailable"; -
uspace/lib/c/include/errno.h
r867e6735 r72363a1 59 59 #define EBADCHECKSUM (-300) 60 60 61 /** USB: stalled operation. */62 #define ESTALL (-301)63 64 61 /** An API function is called while another blocking function is in progress. */ 65 62 #define EINPROGRESS (-10036) -
uspace/lib/drv/generic/remote_usbhc.c
r867e6735 r72363a1 40 40 41 41 #define USB_MAX_PAYLOAD_SIZE 1020 42 #define HACK_MAX_PACKET_SIZE 843 #define HACK_MAX_PACKET_SIZE_INTERRUPT_IN 444 42 45 43 static void remote_usbhc_get_address(device_t *, void *, ipc_callid_t, ipc_call_t *); … … 165 163 return; 166 164 } 167 168 usb_speed_t speed = DEV_IPC_GET_ARG1(*call); 169 170 int rc = usb_iface->reserve_default_address(device, speed); 165 166 int rc = usb_iface->reserve_default_address(device); 171 167 172 168 async_answer_0(callid, rc); … … 197 193 return; 198 194 } 199 200 usb_speed_t speed = DEV_IPC_GET_ARG1(*call);201 195 202 196 usb_address_t address; 203 int rc = usb_iface->request_address(device, speed,&address);197 int rc = usb_iface->request_address(device, &address); 204 198 if (rc != EOK) { 205 199 async_answer_0(callid, rc); … … 328 322 trans->size = len; 329 323 330 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE, 331 buffer, len, 324 int rc = transfer_func(device, target, buffer, len, 332 325 callback_out, trans); 333 326 … … 375 368 trans->size = len; 376 369 377 int rc = transfer_func(device, target, HACK_MAX_PACKET_SIZE_INTERRUPT_IN, 378 trans->buffer, len, 370 int rc = transfer_func(device, target, trans->buffer, len, 379 371 callback_in, trans); 380 372 … … 584 576 trans->size = data_buffer_len; 585 577 586 rc = usb_iface->control_write(device, target, HACK_MAX_PACKET_SIZE,578 rc = usb_iface->control_write(device, target, 587 579 setup_packet, setup_packet_len, 588 580 data_buffer, data_buffer_len, … … 648 640 } 649 641 650 rc = usb_iface->control_read(device, target, HACK_MAX_PACKET_SIZE,642 rc = usb_iface->control_read(device, target, 651 643 setup_packet, setup_packet_len, 652 644 trans->buffer, trans->size, -
uspace/lib/drv/include/usbhc_iface.h
r867e6735 r72363a1 40 40 #include "driver.h" 41 41 #include <usb/usb.h> 42 #include <bool.h>43 42 44 43 … … 216 215 217 216 /** Out transfer processing function prototype. */ 218 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, size_t,217 typedef int (*usbhc_iface_transfer_out_t)(device_t *, usb_target_t, 219 218 void *, size_t, 220 219 usbhc_iface_transfer_out_callback_t, void *); 221 220 222 /** Setup transfer processing function prototype. @deprecated*/221 /** Setup transfer processing function prototype. */ 223 222 typedef usbhc_iface_transfer_out_t usbhc_iface_transfer_setup_t; 224 223 225 224 /** In transfer processing function prototype. */ 226 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, size_t,225 typedef int (*usbhc_iface_transfer_in_t)(device_t *, usb_target_t, 227 226 void *, size_t, 228 227 usbhc_iface_transfer_in_callback_t, void *); … … 232 231 int (*tell_address)(device_t *, devman_handle_t, usb_address_t *); 233 232 234 int (*reserve_default_address)(device_t * , usb_speed_t);233 int (*reserve_default_address)(device_t *); 235 234 int (*release_default_address)(device_t *); 236 int (*request_address)(device_t *, usb_ speed_t, usb_address_t *);235 int (*request_address)(device_t *, usb_address_t *); 237 236 int (*bind_address)(device_t *, usb_address_t, devman_handle_t); 238 237 int (*release_address)(device_t *, usb_address_t); … … 252 251 253 252 int (*control_write)(device_t *, usb_target_t, 254 size_t,255 253 void *, size_t, void *, size_t, 256 254 usbhc_iface_transfer_out_callback_t, void *); 257 255 258 256 int (*control_read)(device_t *, usb_target_t, 259 size_t,260 257 void *, size_t, void *, size_t, 261 258 usbhc_iface_transfer_in_callback_t, void *); -
uspace/lib/usb/include/usb/hub.h
r867e6735 r72363a1 39 39 #include <usb/usbdevice.h> 40 40 41 int usb_hc_new_device_wrapper(device_t *, usb_hc_connection_t *, usb_speed_t,42 int (*)(int, void *), int, void *, usb_address_t *, devman_handle_t *);43 44 41 /** Info about device attached to host controller. 45 42 * … … 55 52 } usb_hc_attached_device_t; 56 53 57 int usb_hc_reserve_default_address(usb_hc_connection_t * , usb_speed_t);54 int usb_hc_reserve_default_address(usb_hc_connection_t *); 58 55 int usb_hc_release_default_address(usb_hc_connection_t *); 59 56 60 usb_address_t usb_hc_request_address(usb_hc_connection_t * , usb_speed_t);57 usb_address_t usb_hc_request_address(usb_hc_connection_t *); 61 58 int usb_hc_register_device(usb_hc_connection_t *, 62 59 const usb_hc_attached_device_t *); -
uspace/lib/usb/include/usb/usb.h
r867e6735 r72363a1 68 68 USB_DIRECTION_BOTH 69 69 } usb_direction_t; 70 71 /** USB speeds. */72 typedef enum {73 /** USB 1.1 low speed (1.5Mbits/s). */74 USB_SPEED_LOW,75 /** USB 1.1 full speed (12Mbits/s). */76 USB_SPEED_FULL,77 /** USB 2.0 high speed (480Mbits/s). */78 USB_SPEED_HIGH79 } usb_speed_t;80 70 81 71 /** USB request type target. */ -
uspace/lib/usb/src/hub.c
r867e6735 r72363a1 34 34 */ 35 35 #include <usb/hub.h> 36 #include <usb/pipes.h>37 #include <usb/request.h>38 #include <usb/recognise.h>39 36 #include <usbhc_iface.h> 40 37 #include <errno.h> … … 58 55 * @return Error code. 59 56 */ 60 int usb_hc_reserve_default_address(usb_hc_connection_t *connection, 61 usb_speed_t speed) 57 int usb_hc_reserve_default_address(usb_hc_connection_t *connection) 62 58 { 63 59 CHECK_CONNECTION(connection); 64 60 65 return async_req_ 2_0(connection->hc_phone,61 return async_req_1_0(connection->hc_phone, 66 62 DEV_IFACE_ID(USBHC_DEV_IFACE), 67 IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS , speed);63 IPC_M_USBHC_RESERVE_DEFAULT_ADDRESS); 68 64 } 69 65 … … 87 83 * @return Assigned USB address or negative error code. 88 84 */ 89 usb_address_t usb_hc_request_address(usb_hc_connection_t *connection, 90 usb_speed_t speed) 85 usb_address_t usb_hc_request_address(usb_hc_connection_t *connection) 91 86 { 92 87 CHECK_CONNECTION(connection); 93 88 94 89 sysarg_t address; 95 int rc = async_req_ 2_1(connection->hc_phone,90 int rc = async_req_1_1(connection->hc_phone, 96 91 DEV_IFACE_ID(USBHC_DEV_IFACE), 97 IPC_M_USBHC_REQUEST_ADDRESS, speed, 98 &address); 92 IPC_M_USBHC_REQUEST_ADDRESS, &address); 99 93 if (rc != EOK) { 100 94 return (usb_address_t) rc; … … 141 135 142 136 143 /** Wrapper for registering attached device to the hub.144 *145 * The @p enable_port function is expected to enable singalling on given146 * port.147 * The two arguments to it can have arbitrary meaning148 * (the @p port_no is only a suggestion)149 * and are not touched at all by this function150 * (they are passed as is to the @p enable_port function).151 *152 * If the @p enable_port fails (i.e. does not return EOK), the device153 * addition is cancelled.154 * The return value is then returned (it is good idea to use different155 * error codes than those listed as return codes by this function itself).156 *157 * @param parent Parent device (i.e. the hub device).158 * @param connection Opened connection to host controller.159 * @param dev_speed New device speed.160 * @param enable_port Function for enabling signalling through the port the161 * device is attached to.162 * @param port_no Port number (passed through to @p enable_port).163 * @param arg Any data argument to @p enable_port.164 * @param[out] assigned_address USB address of the device.165 * @param[out] assigned_handle Devman handle of the new device.166 * @return Error code.167 * @retval ENOENT Connection to HC not opened.168 * @retval EADDRNOTAVAIL Failed retrieving free address from host controller.169 * @retval EBUSY Failed reserving default USB address.170 * @retval ENOTCONN Problem connecting to the host controller via USB pipe.171 * @retval ESTALL Problem communication with device (either SET_ADDRESS172 * request or requests for descriptors when creating match ids).173 */174 int usb_hc_new_device_wrapper(device_t *parent, usb_hc_connection_t *connection,175 usb_speed_t dev_speed,176 int (*enable_port)(int port_no, void *arg), int port_no, void *arg,177 usb_address_t *assigned_address, devman_handle_t *assigned_handle)178 {179 CHECK_CONNECTION(connection);180 181 /*182 * Request new address.183 */184 usb_address_t dev_addr = usb_hc_request_address(connection, dev_speed);185 if (dev_addr < 0) {186 return EADDRNOTAVAIL;187 }188 189 int rc;190 191 /*192 * Reserve the default address.193 */194 rc = usb_hc_reserve_default_address(connection, dev_speed);195 if (rc != EOK) {196 rc = EBUSY;197 goto leave_release_free_address;198 }199 200 /*201 * Enable the port (i.e. allow signalling through this port).202 */203 rc = enable_port(port_no, arg);204 if (rc != EOK) {205 goto leave_release_default_address;206 }207 208 /*209 * Change the address from default to the free one.210 * We need to create a new control pipe for that.211 */212 usb_device_connection_t dev_conn;213 rc = usb_device_connection_initialize_on_default_address(&dev_conn,214 connection);215 if (rc != EOK) {216 rc = ENOTCONN;217 goto leave_release_default_address;218 }219 220 usb_endpoint_pipe_t ctrl_pipe;221 rc = usb_endpoint_pipe_initialize_default_control(&ctrl_pipe,222 &dev_conn);223 if (rc != EOK) {224 rc = ENOTCONN;225 goto leave_release_default_address;226 }227 228 rc = usb_endpoint_pipe_start_session(&ctrl_pipe);229 if (rc != EOK) {230 rc = ENOTCONN;231 goto leave_release_default_address;232 }233 234 rc = usb_request_set_address(&ctrl_pipe, dev_addr);235 if (rc != EOK) {236 rc = ESTALL;237 goto leave_stop_session;238 }239 240 usb_endpoint_pipe_end_session(&ctrl_pipe);241 242 /*243 * Once the address is changed, we can return the default address.244 */245 usb_hc_release_default_address(connection);246 247 /*248 * It is time to register the device with devman.249 */250 /* FIXME: create device_register that will get opened ctrl pipe. */251 devman_handle_t child_handle;252 rc = usb_device_register_child_in_devman(dev_addr, dev_conn.hc_handle,253 parent, &child_handle);254 if (rc != EOK) {255 rc = ESTALL;256 goto leave_release_free_address;257 }258 259 /*260 * And now inform the host controller about the handle.261 */262 usb_hc_attached_device_t new_device = {263 .address = dev_addr,264 .handle = child_handle265 };266 rc = usb_hc_register_device(connection, &new_device);267 if (rc != EOK) {268 rc = EDESTADDRREQ;269 goto leave_release_free_address;270 }271 272 /*273 * And we are done.274 */275 if (assigned_address != NULL) {276 *assigned_address = dev_addr;277 }278 if (assigned_handle != NULL) {279 *assigned_handle = child_handle;280 }281 282 return EOK;283 284 285 286 /*287 * Error handling (like nested exceptions) starts here.288 * Completely ignoring errors here.289 */290 291 leave_stop_session:292 usb_endpoint_pipe_end_session(&ctrl_pipe);293 294 leave_release_default_address:295 usb_hc_release_default_address(connection);296 297 leave_release_free_address:298 usb_hc_unregister_device(connection, dev_addr);299 300 return rc;301 }302 303 304 137 /** 305 138 * @} -
uspace/lib/usbvirt/Makefile
r867e6735 r72363a1 30 30 LIBRARY = libusbvirt 31 31 32 LIBS = $(LIBUSB_PREFIX)/libusb.a 32 33 EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -Iinclude 33 34
Note:
See TracChangeset
for help on using the changeset viewer.