Changes in uspace/lib/usb/src/hub.c [3954a63b:9f9b31ad] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/usb/src/hub.c
r3954a63b r9f9b31ad 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); 144 163 } 145 164 … … 235 254 goto leave_release_default_address; 236 255 } 256 257 /* Before sending any traffic, we need to register this 258 * 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 } 237 265 rc = usb_pipe_probe_default_control(&ctrl_pipe); 238 266 if (rc != EOK) { … … 244 272 if (rc != EOK) { 245 273 rc = ENOTCONN; 246 goto leave_ release_default_address;274 goto leave_unregister_endpoint; 247 275 } 248 276 … … 256 284 257 285 /* 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 /* 258 300 * Once the address is changed, we can return the default address. 259 301 */ 260 302 usb_hc_release_default_address(connection); 303 261 304 262 305 /* … … 273 316 } 274 317 318 319 275 320 /* 276 321 * And now inform the host controller about the handle. … … 308 353 usb_pipe_end_session(&ctrl_pipe); 309 354 355 leave_unregister_endpoint: 356 usb_pipe_unregister(&ctrl_pipe, connection); 357 310 358 leave_release_default_address: 311 359 usb_hc_release_default_address(connection);
Note:
See TracChangeset
for help on using the changeset viewer.