Changes in uspace/app/tester/hw/serial/serial1.c [8b1e15ac:ce79069b] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/app/tester/hw/serial/serial1.c
r8b1e15ac rce79069b 39 39 #include <stdlib.h> 40 40 #include <stdio.h> 41 #include <ipc/ipc.h> 41 42 #include <sys/types.h> 42 43 #include <async.h> … … 74 75 75 76 devman_handle_t handle; 76 res = devman_device_get_handle("/hw/pci0/00:01.0/com1 /a", &handle,77 res = devman_device_get_handle("/hw/pci0/00:01.0/com1", &handle, 77 78 IPC_FLAG_BLOCKING); 78 79 if (res != EOK) … … 87 88 char *buf = (char *) malloc(cnt + 1); 88 89 if (buf == NULL) { 89 async_hangup(phone);90 ipc_hangup(phone); 90 91 devman_hangup_phone(DEVMAN_CLIENT); 91 92 return "Failed to allocate input buffer"; … … 97 98 sysarg_t old_word_size; 98 99 99 res = async_req_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud,100 res = ipc_call_sync_0_4(phone, SERIAL_GET_COM_PROPS, &old_baud, 100 101 &old_par, &old_word_size, &old_stop); 101 102 if (res != EOK) { 102 103 free(buf); 103 async_hangup(phone);104 ipc_hangup(phone); 104 105 devman_hangup_phone(DEVMAN_CLIENT); 105 106 return "Failed to get old serial communication parameters"; 106 107 } 107 108 108 res = async_req_4_0(phone, SERIAL_SET_COM_PROPS, 1200,109 res = ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, 1200, 109 110 SERIAL_NO_PARITY, 8, 1); 110 111 if (EOK != res) { 111 112 free(buf); 112 async_hangup(phone);113 ipc_hangup(phone); 113 114 devman_hangup_phone(DEVMAN_CLIENT); 114 115 return "Failed to set serial communication parameters"; … … 123 124 124 125 if (read < 0) { 125 async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,126 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, 126 127 old_par, old_word_size, old_stop); 127 128 free(buf); 128 async_hangup(phone);129 ipc_hangup(phone); 129 130 devman_hangup_phone(DEVMAN_CLIENT); 130 131 return "Failed read from serial device"; … … 132 133 133 134 if ((size_t) read > cnt - total) { 134 async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,135 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, 135 136 old_par, old_word_size, old_stop); 136 137 free(buf); 137 async_hangup(phone);138 ipc_hangup(phone); 138 139 devman_hangup_phone(DEVMAN_CLIENT); 139 140 return "Read more data than expected"; … … 154 155 155 156 if (written < 0) { 156 async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,157 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, 157 158 old_par, old_word_size, old_stop); 158 159 free(buf); 159 async_hangup(phone);160 ipc_hangup(phone); 160 161 devman_hangup_phone(DEVMAN_CLIENT); 161 162 return "Failed write to serial device"; … … 163 164 164 165 if (written != read) { 165 async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,166 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, 166 167 old_par, old_word_size, old_stop); 167 168 free(buf); 168 async_hangup(phone);169 ipc_hangup(phone); 169 170 devman_hangup_phone(DEVMAN_CLIENT); 170 171 return "Written less data than read from serial device"; … … 182 183 ssize_t written = char_dev_write(phone, (void *) EOT, eot_size); 183 184 184 async_req_4_0(phone, SERIAL_SET_COM_PROPS, old_baud,185 ipc_call_sync_4_0(phone, SERIAL_SET_COM_PROPS, old_baud, 185 186 old_par, old_word_size, old_stop); 186 187 free(buf); 187 async_hangup(phone);188 ipc_hangup(phone); 188 189 devman_hangup_phone(DEVMAN_CLIENT); 189 190
Note:
See TracChangeset
for help on using the changeset viewer.