Changes in uspace/drv/vhc/conndev.c [00b6c73:6cb58e6] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/vhc/conndev.c
r00b6c73 r6cb58e6 37 37 #include <errno.h> 38 38 #include <ddf/driver.h> 39 #include <usbvirt/ipc.h>40 39 #include "conn.h" 41 40 42 41 static fibril_local uintptr_t plugged_device_handle = 0; 43 #define PLUGGED_DEVICE_NAME_MAXLEN 25644 static fibril_local char plugged_device_name[PLUGGED_DEVICE_NAME_MAXLEN + 1] = "<unknown>";45 46 /** Receive device name.47 *48 * @warning Errors are silently ignored.49 *50 * @param phone Phone to the virtual device.51 */52 static void receive_device_name(int phone)53 {54 aid_t opening_request = async_send_0(phone, IPC_M_USBVIRT_GET_NAME, NULL);55 if (opening_request == 0) {56 return;57 }58 59 60 ipc_call_t data_request_call;61 aid_t data_request = async_data_read(phone,62 plugged_device_name, PLUGGED_DEVICE_NAME_MAXLEN,63 &data_request_call);64 65 if (data_request == 0) {66 async_wait_for(opening_request, NULL);67 return;68 }69 70 sysarg_t data_request_rc;71 sysarg_t opening_request_rc;72 async_wait_for(data_request, &data_request_rc);73 async_wait_for(opening_request, &opening_request_rc);74 75 if ((data_request_rc != EOK) || (opening_request_rc != EOK)) {76 return;77 }78 79 size_t len = IPC_GET_ARG2(data_request_call);80 plugged_device_name[len] = 0;81 }82 42 83 43 /** Default handler for IPC methods not handled by DDF. … … 105 65 async_answer_0(icallid, EOK); 106 66 107 receive_device_name(callback); 108 109 usb_log_info("New virtual device `%s' (id: %" PRIxn ").\n", 110 plugged_device_name, plugged_device_handle); 67 usb_log_info("New virtual device `%s' (id = %" PRIxn ").\n", 68 rc == EOK ? "XXX" : "<unknown>", plugged_device_handle); 111 69 112 70 return; … … 127 85 128 86 if (plugged_device_handle != 0) { 129 usb_log_info("Virtual device `%s' disconnected (id:%" PRIxn ").\n",130 plugged_device_ name, plugged_device_handle);87 usb_log_info("Virtual device disconnected (id = %" PRIxn ").\n", 88 plugged_device_handle); 131 89 vhc_virtdev_unplug(vhc, plugged_device_handle); 132 90 }
Note:
See TracChangeset
for help on using the changeset viewer.