Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/tester/hw/serial/serial1.c

    rffa2c8ef rce79069b  
    3939#include <stdlib.h>
    4040#include <stdio.h>
     41#include <ipc/ipc.h>
    4142#include <sys/types.h>
    4243#include <async.h>
     
    8788        char *buf = (char *) malloc(cnt + 1);
    8889        if (buf == NULL) {
    89                 async_hangup(phone);
     90                ipc_hangup(phone);
    9091                devman_hangup_phone(DEVMAN_CLIENT);
    9192                return "Failed to allocate input buffer";
     
    9798        sysarg_t old_word_size;
    9899       
    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,
    100101            &old_par, &old_word_size, &old_stop);
    101102        if (res != EOK) {
    102103                free(buf);
    103                 async_hangup(phone);
     104                ipc_hangup(phone);
    104105                devman_hangup_phone(DEVMAN_CLIENT);
    105106                return "Failed to get old serial communication parameters";
    106107        }
    107108       
    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,
    109110            SERIAL_NO_PARITY, 8, 1);
    110111        if (EOK != res) {
    111112                free(buf);
    112                 async_hangup(phone);
     113                ipc_hangup(phone);
    113114                devman_hangup_phone(DEVMAN_CLIENT);
    114115                return "Failed to set serial communication parameters";
     
    123124               
    124125                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,
    126127                            old_par, old_word_size, old_stop);
    127128                        free(buf);
    128                         async_hangup(phone);
     129                        ipc_hangup(phone);
    129130                        devman_hangup_phone(DEVMAN_CLIENT);
    130131                        return "Failed read from serial device";
     
    132133               
    133134                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,
    135136                            old_par, old_word_size, old_stop);
    136137                        free(buf);
    137                         async_hangup(phone);
     138                        ipc_hangup(phone);
    138139                        devman_hangup_phone(DEVMAN_CLIENT);
    139140                        return "Read more data than expected";
     
    154155                       
    155156                        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,
    157158                                    old_par, old_word_size, old_stop);
    158159                                free(buf);
    159                                 async_hangup(phone);
     160                                ipc_hangup(phone);
    160161                                devman_hangup_phone(DEVMAN_CLIENT);
    161162                                return "Failed write to serial device";
     
    163164                       
    164165                        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,
    166167                                    old_par, old_word_size, old_stop);
    167168                                free(buf);
    168                                 async_hangup(phone);
     169                                ipc_hangup(phone);
    169170                                devman_hangup_phone(DEVMAN_CLIENT);
    170171                                return "Written less data than read from serial device";
     
    182183        ssize_t written = char_dev_write(phone, (void *) EOT, eot_size);
    183184       
    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,
    185186            old_par, old_word_size, old_stop);
    186187        free(buf);
    187         async_hangup(phone);
     188        ipc_hangup(phone);
    188189        devman_hangup_phone(DEVMAN_CLIENT);
    189190       
Note: See TracChangeset for help on using the changeset viewer.