Ignore:
Timestamp:
2012-04-12T14:21:46Z (12 years ago)
Author:
Maurizio Lombardi <m.lombardi85@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb8f69d
Parents:
751cabc (diff), d11a181 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

File:
1 edited

Legend:

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

    r751cabc r85f2064  
    4242#include <async.h>
    4343#include <ipc/services.h>
    44 #include <ipc/devman.h>
    45 #include <devman.h>
     44#include <loc.h>
    4645#include <device/char_dev.h>
    4746#include <str.h>
     
    7170                }
    7271       
    73         devman_handle_t handle;
    74         int res = devman_fun_get_handle("/hw/pci0/00:01.0/com1/a", &handle,
    75             IPC_FLAG_BLOCKING);
     72        service_id_t svc_id;
     73        int res = loc_service_get_id("devices/\\hw\\pci0\\00:01.0\\com1\\a",
     74            &svc_id, IPC_FLAG_BLOCKING);
    7675        if (res != EOK)
    77                 return "Could not get serial device handle";
    78        
    79         async_sess_t *sess = devman_device_connect(EXCHANGE_SERIALIZE, handle,
     76                return "Failed getting serial port service ID";
     77       
     78        async_sess_t *sess = loc_service_connect(EXCHANGE_SERIALIZE, svc_id,
    8079            IPC_FLAG_BLOCKING);
    8180        if (!sess)
    82                 return "Unable to connect to serial device";
     81                return "Failed connecting to serial device";
    8382       
    8483        char *buf = (char *) malloc(cnt + 1);
    8584        if (buf == NULL) {
    8685                async_hangup(sess);
    87                 return "Failed to allocate input buffer";
     86                return "Failed allocating input buffer";
    8887        }
    8988       
     
    112111                free(buf);
    113112                async_hangup(sess);
    114                 return "Failed to set serial communication parameters";
    115         }
    116        
    117         TPRINTF("Trying to read %zu characters from serial device "
    118             "(handle=%" PRIun ")\n", cnt, handle);
     113                return "Failed setting serial communication parameters";
     114        }
     115       
     116        TPRINTF("Trying reading %zu characters from serial device "
     117            "(svc_id=%" PRIun ")\n", cnt, svc_id);
    119118       
    120119        size_t total = 0;
     
    130129                        free(buf);
    131130                        async_hangup(sess);
    132                         return "Failed read from serial device";
     131                        return "Failed reading from serial device";
    133132                }
    134133               
     
    165164                                free(buf);
    166165                                async_hangup(sess);
    167                                 return "Failed write to serial device";
     166                                return "Failed writing to serial device";
    168167                        }
    169168                       
Note: See TracChangeset for help on using the changeset viewer.