Changeset a8723748 in mainline for uspace/lib


Ignore:
Timestamp:
2017-12-15T10:55:09Z (8 years ago)
Author:
Petr Mánek <petr.manek@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
64d138b
Parents:
837d53d
Message:

usbdiag: add server, dummy stubs and skeletons

Location:
uspace/lib/usbdiag
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/usbdiag/Makefile

    r837d53d ra8723748  
    2929USPACE_PREFIX = ../..
    3030LIBRARY = libusbdiag
    31 LIBS = usb
     31LIBS = drv usb
    3232
    3333SOURCES = \
  • uspace/lib/usbdiag/include/usb/diag/diag.h

    r837d53d ra8723748  
    3636#define LIBUSBDIAG_DIAG_H_
    3737
     38#include <ipc/common.h>
     39
     40typedef enum {
     41  USB_DIAG_IN_TEST = IPC_FIRST_USER_METHOD,
     42} usb_diag_in_request_t;
     43
    3844/** Just a dummy symbol to make compiler happy. TODO: remove it */
    39 int usb_diag_test(int);
     45int usb_diag_test(int, int*);
    4046
    4147#endif
  • uspace/lib/usbdiag/src/test.c

    r837d53d ra8723748  
    3434 */
    3535
     36#include <async.h>
    3637#include <usb/diag/diag.h>
    3738
    38 int usb_diag_test(int x)
     39int usb_diag_test(int x, int *out)
    3940{
    40         return x + 42;
     41        sysarg_t _out;
     42        async_sess_t *session = NULL;
     43        async_exch_t *exch = async_exchange_begin(session);
     44        const int rc = async_req_1_1(exch, USB_DIAG_IN_TEST, x, &_out);
     45        async_exchange_end(exch);
     46
     47        if (out)
     48                *out = (int) _out;
     49
     50        return rc;
    4151}
    4252
Note: See TracChangeset for help on using the changeset viewer.