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