Changeset 19a1800 in mainline for uspace/drv/vhc/conndev.c
- Timestamp:
- 2011-03-01T22:20:56Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- e24e7b1
- Parents:
- 976f546 (diff), ac8285d (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/conndev.c
r976f546 r19a1800 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 76 76 /** Default handler for IPC methods not handled by DDF. 77 77 * 78 * @param devDevice handling the call.78 * @param fun Device handling the call. 79 79 * @param icallid Call id. 80 80 * @param icall Call data. 81 81 */ 82 void default_connection_handler(d evice_t *dev,82 void default_connection_handler(ddf_fun_t *fun, 83 83 ipc_callid_t icallid, ipc_call_t *icall) 84 84 { … … 88 88 int callback = IPC_GET_ARG5(*icall); 89 89 virtdev_connection_t *dev 90 = virtdev_add_device(callback );90 = virtdev_add_device(callback, (sysarg_t)fibril_get_id()); 91 91 if (!dev) { 92 ipc_answer_0(icallid, EEXISTS);93 ipc_hangup(callback);92 async_answer_0(icallid, EEXISTS); 93 async_hangup(callback); 94 94 return; 95 95 } 96 ipc_answer_0(icallid, EOK);96 async_answer_0(icallid, EOK); 97 97 98 98 char devname[DEVICE_NAME_MAXLENGTH + 1]; 99 99 int rc = get_device_name(callback, devname, DEVICE_NAME_MAXLENGTH); 100 100 101 dprintf(0, "virtual device connected (name: %s)", 102 rc == EOK ? devname : "<unknown>"); 103 104 /* FIXME: destroy the device when the client disconnects. */ 101 usb_log_info("New virtual device `%s' (id = %x).\n", 102 rc == EOK ? devname : "<unknown>", dev->id); 105 103 106 104 return; 107 105 } 108 106 109 ipc_answer_0(icallid, EINVAL); 107 async_answer_0(icallid, EINVAL); 108 } 109 110 /** Callback for DDF when client disconnects. 111 * 112 * @param d Device the client was connected to. 113 */ 114 void on_client_close(ddf_fun_t *fun) 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 usb_log_info("Virtual device disconnected (id = %x).\n", dev->id); 125 virtdev_destroy_device(dev); 110 126 } 111 127
Note:
See TracChangeset
for help on using the changeset viewer.