Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 1f1fa64 in mainline for uspace/drv/bus/usb/usbmid/usbmid.c


Ignore:
Timestamp:
2014-07-28T21:53:11Z (7 years ago)
Author:
Agnieszka Tabaka <nufcia@…>
Branches:
lfn, master
Children:
c3b25985, f2f4c00
Parents:
cbfece7 (diff), 7eb6c96 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Make MAC address change possible on ethip side. Merge mainline changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/bus/usb/usbmid/usbmid.c

    rcbfece7 r1f1fa64  
    3030 * @{
    3131 */
    32 
    33 /* XXX Fix this */
    34 #define _DDF_DATA_IMPLANT
    3532
    3633/**
     
    10299    const usb_standard_interface_descriptor_t *interface_descriptor)
    103100{
    104         ddf_fun_t *child = NULL;
    105101        char *child_name = NULL;
    106102        int rc;
     
    114110            usb_str_class(interface_descriptor->interface_class),
    115111            interface_descriptor->interface_number);
    116         if (rc < 0) {
     112        if (rc < 0)
    117113                return ENOMEM;
    118         }
    119114
    120         /* Create the device. */
    121         child = ddf_fun_create(parent->ddf_dev, fun_inner, child_name);
     115        rc = ddf_fun_set_name(iface->fun, child_name);
    122116        free(child_name);
    123         if (child == NULL) {
     117        if (rc != EOK)
    124118                return ENOMEM;
    125         }
    126119
    127120        match_id_list_t match_ids;
     
    130123        rc = usb_device_create_match_ids_from_interface(device_descriptor,
    131124            interface_descriptor, &match_ids);
    132         if (rc != EOK) {
    133                 ddf_fun_destroy(child);
     125        if (rc != EOK)
    134126                return rc;
    135         }
    136127
    137128        list_foreach(match_ids.ids, link, match_id_t, match_id) {
    138                 rc = ddf_fun_add_match_id(child, match_id->id, match_id->score);
     129                rc = ddf_fun_add_match_id(iface->fun, match_id->id, match_id->score);
    139130                if (rc != EOK) {
    140131                        clean_match_ids(&match_ids);
    141                         ddf_fun_destroy(child);
    142132                        return rc;
    143133                }
     
    145135        clean_match_ids(&match_ids);
    146136
    147         rc = ddf_fun_bind(child);
    148         if (rc != EOK) {
    149                 /* This takes care of match_id deallocation as well. */
    150                 ddf_fun_destroy(child);
     137        ddf_fun_set_ops(iface->fun, &child_device_ops);
     138
     139        rc = ddf_fun_bind(iface->fun);
     140        if (rc != EOK)
    151141                return rc;
    152         }
    153 
    154         iface->fun = child;
    155         ddf_fun_data_implant(child, iface);
    156         ddf_fun_set_ops(child, &child_device_ops);
    157142
    158143        return EOK;
Note: See TracChangeset for help on using the changeset viewer.