Changeset 59c163c in mainline for uspace/lib/usbdev/src/hub.c


Ignore:
Timestamp:
2011-10-31T11:49:15Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1e6dc5b
Parents:
90d7033
Message:

libusbdev: Automatically create attached device info for new devices.

File:
1 edited

Legend:

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

    r90d7033 r59c163c  
    179179 * @param[in] dev_ops Child device ops. Will use default if not provided.
    180180 * @param[in] new_dev_data Arbitrary pointer to be stored in the child
    181  *      as @c driver_data.
     181 *      as @c driver_data. Will allocate and assign usb_hub_attached_device_t
     182 *      structure if NULL.
    182183 * @param[out] new_fun Storage where pointer to allocated child function
    183184 *      will be written. Must be non-null.
     
    219220        }
    220221
    221 
    222222        /*
    223223         * Request new address.
     
    328328        }
    329329
    330         /*
    331          * And now inform the host controller about the handle.
    332          */
    333330        const usb_hub_attached_device_t new_device = {
    334331                .address = dev_addr,
    335332                .fun = child_fun,
    336333        };
     334
     335
     336        /*
     337         * And now inform the host controller about the handle.
     338         */
    337339        rc = usb_hc_register_device(&hc_conn, &new_device);
    338340        if (rc != EOK) {
     341                /* We know nothing about that data. */
     342                if (new_dev_data)
     343                        child_fun->driver_data = NULL;
    339344                /* The child function is already created. */
    340                 child_fun->driver_data = NULL;
    341345                ddf_fun_destroy(child_fun);
    342346                rc = EDESTADDRREQ;
Note: See TracChangeset for help on using the changeset viewer.