Changes in uspace/lib/usb/src/hub.c [9f9b31ad:3954a63b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hub.c
r9f9b31ad r3954a63b 142 142 DEV_IFACE_ID(USBHC_DEV_IFACE), 143 143 IPC_M_USBHC_RELEASE_ADDRESS, address); 144 }145 146 static void unregister_control_endpoint_on_default_address(147 usb_hc_connection_t *connection)148 {149 usb_device_connection_t dev_conn;150 int rc = usb_device_connection_initialize_on_default_address(&dev_conn,151 connection);152 if (rc != EOK) {153 return;154 }155 156 usb_pipe_t ctrl_pipe;157 rc = usb_pipe_initialize_default_control(&ctrl_pipe, &dev_conn);158 if (rc != EOK) {159 return;160 }161 162 usb_pipe_unregister(&ctrl_pipe, connection);163 144 } 164 145 … … 254 235 goto leave_release_default_address; 255 236 } 256 257 /* Before sending any traffic, we need to register this258 * endpoint.259 */260 rc = usb_pipe_register(&ctrl_pipe, 0, connection);261 if (rc != EOK) {262 rc = EREFUSED;263 goto leave_release_default_address;264 }265 237 rc = usb_pipe_probe_default_control(&ctrl_pipe); 266 238 if (rc != EOK) { … … 272 244 if (rc != EOK) { 273 245 rc = ENOTCONN; 274 goto leave_ unregister_endpoint;246 goto leave_release_default_address; 275 247 } 276 248 … … 284 256 285 257 /* 286 * Register the control endpoint for the new device.287 */288 rc = usb_pipe_register(&ctrl_pipe, 0, connection);289 if (rc != EOK) {290 rc = EREFUSED;291 goto leave_unregister_endpoint;292 }293 294 /*295 * Release the original endpoint.296 */297 unregister_control_endpoint_on_default_address(connection);298 299 /*300 258 * Once the address is changed, we can return the default address. 301 259 */ 302 260 usb_hc_release_default_address(connection); 303 304 261 305 262 /* … … 316 273 } 317 274 318 319 320 275 /* 321 276 * And now inform the host controller about the handle. … … 353 308 usb_pipe_end_session(&ctrl_pipe); 354 309 355 leave_unregister_endpoint:356 usb_pipe_unregister(&ctrl_pipe, connection);357 358 310 leave_release_default_address: 359 311 usb_hc_release_default_address(connection);
Note:
See TracChangeset
for help on using the changeset viewer.