~nufcia/helenos/rtl8169

« back to all changes in this revision

Viewing changes to uspace/drv/bus/usb/vhc/hub.c

  • Committer: Agnieszka Tabaka
  • Date: 2014-07-28 21:53:11 UTC
  • mfrom: (2097.1.55 main-clone)
  • Revision ID: nufcia@gmail.com-20140728215311-gkdbocz7wqwq7bjn
Make MAC address change possible on ethip side. Merge mainline changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
93
93
int hub_register_in_devman_fibril(void *arg)
94
94
{
95
95
        ddf_fun_t *hc_dev = (ddf_fun_t *) arg;
96
 
 
97
 
        /*
98
 
         * Wait until parent device is properly initialized.
99
 
         */
100
 
        async_sess_t *sess;
101
 
        do {
102
 
                sess = devman_device_connect(EXCHANGE_SERIALIZE,
103
 
                    ddf_fun_get_handle(hc_dev), 0);
104
 
        } while (!sess);
105
 
        async_hangup(sess);
106
 
 
107
96
        int rc;
108
97
 
109
98
        usb_hc_connection_t hc_conn;
113
102
        assert(rc == EOK);
114
103
 
115
104
        ddf_fun_t *hub_dev;
116
 
        rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), &hc_conn, USB_SPEED_FULL,
117
 
            pretend_port_rest, NULL, NULL, &rh_ops, hc_dev, &hub_dev);
 
105
 
 
106
        hub_dev = ddf_fun_create(ddf_fun_get_dev(hc_dev), fun_inner, NULL);
 
107
        if (hub_dev == NULL) {
 
108
                rc = ENOMEM;
 
109
                usb_log_fatal("Failed to create root hub: %s.\n",
 
110
                    str_error(rc));
 
111
                return rc;
 
112
        }
 
113
 
 
114
        rc = usb_hc_new_device_wrapper(ddf_fun_get_dev(hc_dev), hub_dev,
 
115
            &hc_conn, USB_SPEED_FULL, pretend_port_rest, NULL, NULL, &rh_ops);
118
116
        if (rc != EOK) {
119
117
                usb_log_fatal("Failed to create root hub: %s.\n",
120
118
                    str_error(rc));
 
119
                ddf_fun_destroy(hub_dev);
121
120
        }
122
121
 
123
122
        usb_hc_connection_close(&hc_conn);