Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usb/src/hub.c

    r9f9b31ad r3954a63b  
    142142            DEV_IFACE_ID(USBHC_DEV_IFACE),
    143143            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);
    163144}
    164145
     
    254235                goto leave_release_default_address;
    255236        }
    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         }
    265237        rc = usb_pipe_probe_default_control(&ctrl_pipe);
    266238        if (rc != EOK) {
     
    272244        if (rc != EOK) {
    273245                rc = ENOTCONN;
    274                 goto leave_unregister_endpoint;
     246                goto leave_release_default_address;
    275247        }
    276248
     
    284256
    285257        /*
    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         /*
    300258         * Once the address is changed, we can return the default address.
    301259         */
    302260        usb_hc_release_default_address(connection);
    303 
    304261
    305262        /*
     
    316273        }
    317274
    318 
    319 
    320275        /*
    321276         * And now inform the host controller about the handle.
     
    353308        usb_pipe_end_session(&ctrl_pipe);
    354309
    355 leave_unregister_endpoint:
    356         usb_pipe_unregister(&ctrl_pipe, connection);
    357 
    358310leave_release_default_address:
    359311        usb_hc_release_default_address(connection);
Note: See TracChangeset for help on using the changeset viewer.