Changeset e0ba26b in mainline for uspace/drv/vhc/conndev.c


Ignore:
Timestamp:
2011-01-25T19:20:26Z (13 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
192a0063
Parents:
a088d15 (diff), 68a68705 (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:

Merged vojtechhorky/ - various fixes

The merge includes following changes

  • USB transaction outcome is propagated to clients
  • virtual host controller handles device unplugging
  • Doxygen documentation fixes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/conndev.c

    ra088d15 re0ba26b  
    8888                int callback = IPC_GET_ARG5(*icall);
    8989                virtdev_connection_t *dev
    90                     = virtdev_add_device(callback);
     90                    = virtdev_add_device(callback, (sysarg_t)fibril_get_id());
    9191                if (!dev) {
    9292                        ipc_answer_0(icallid, EEXISTS);
     
    9999                int rc = get_device_name(callback, devname, DEVICE_NAME_MAXLENGTH);
    100100
    101                 dprintf(0, "virtual device connected (name: %s)",
    102                     rc == EOK ? devname : "<unknown>");
    103 
    104                 /* FIXME: destroy the device when the client disconnects. */
     101                dprintf(0, "virtual device connected (name: %s, id: %x)",
     102                    rc == EOK ? devname : "<unknown>", dev->id);
    105103
    106104                return;
     
    110108}
    111109
     110/** Callback for DDF when client disconnects.
     111 *
     112 * @param d Device the client was connected to.
     113 */
     114void on_client_close(device_t *d)
     115{
     116        /*
     117         * Maybe a virtual device is being unplugged.
     118         */
     119        virtdev_connection_t *dev = virtdev_find((sysarg_t)fibril_get_id());
     120        if (dev == NULL) {
     121                return;
     122        }
     123
     124        dprintf(0, "virtual device disconnected (id: %x)", dev->id);
     125        virtdev_destroy_device(dev);
     126}
     127
    112128
    113129/**
Note: See TracChangeset for help on using the changeset viewer.