Changeset edc4c66 in mainline for uspace/drv/usbhub/ports.c


Ignore:
Timestamp:
2011-04-10T08:16:04Z (13 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
86b4ee0
Parents:
a19a2d7 (diff), d824daf (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:

Development branch changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/usbhub/ports.c

    ra19a2d7 redc4c66  
    181181                 */
    182182        } else {
    183                 usb_log_warning("this is strange, disconnected device had "
    184                         "no address\n");
    185                 //device was disconnected before it`s port was reset -
    186                 //return default address
    187                 usb_hub_release_default_address(hub);
     183                // TODO: is this really reason to print a warning?
     184                usb_log_warning("Device removed before being registered.\n");
     185
     186                /*
     187                 * Device was removed before port reset completed.
     188                 * We will announce a failed port reset to unblock the
     189                 * port reset callback from new device wrapper.
     190                 */
     191                usb_hub_port_t *the_port = hub->ports + port;
     192                fibril_mutex_lock(&the_port->reset_mutex);
     193                the_port->reset_completed = true;
     194                the_port->reset_okay = false;
     195                fibril_condvar_broadcast(&the_port->reset_cv);
     196                fibril_mutex_unlock(&the_port->reset_mutex);
    188197        }
    189198}
     
    207216                fibril_mutex_lock(&the_port->reset_mutex);
    208217                the_port->reset_completed = true;
     218                the_port->reset_okay = true;
    209219                fibril_condvar_broadcast(&the_port->reset_cv);
    210220                fibril_mutex_unlock(&the_port->reset_mutex);
     
    319329        }
    320330
    321         return EOK;
     331        if (my_port->reset_okay) {
     332                return EOK;
     333        } else {
     334                return ESTALL;
     335        }
    322336}
    323337
Note: See TracChangeset for help on using the changeset viewer.