Changes in uspace/drv/vhc/conndev.c [e27595b:bd8c753d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/conndev.c
re27595b rbd8c753d 27 27 */ 28 28 29 /** @addtogroup usb29 /** @addtogroup drvusbvhc 30 30 * @{ 31 31 */ … … 47 47 { 48 48 ipc_call_t answer_data; 49 ipcarg_t answer_rc;49 sysarg_t answer_rc; 50 50 aid_t req; 51 51 int rc; … … 83 83 ipc_callid_t icallid, ipc_call_t *icall) 84 84 { 85 ipcarg_t method = IPC_GET_METHOD(*icall);85 sysarg_t method = IPC_GET_IMETHOD(*icall); 86 86 87 87 if (method == IPC_M_CONNECT_TO_ME) { 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 92 ipc_answer_0(icallid, EEXISTS); … … 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 dprintf(0, "virtual device connected (name: %s, id: %x)", 102 rc == EOK ? devname : "<unknown>", dev->id); 105 103 106 104 return; … … 110 108 } 111 109 110 /** Callback for DDF when client disconnects. 111 * 112 * @param d Device the client was connected to. 113 */ 114 void 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 112 128 113 129 /**
Note:
See TracChangeset
for help on using the changeset viewer.