Changeset 76ef94e in mainline for uspace/lib


Ignore:
Timestamp:
2011-05-07T15:51:20Z (15 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
3ae5ca8
Parents:
d2bff2f (diff), b23e9cc (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:

Development branch changes

Location:
uspace/lib
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/devman.c

    rd2bff2f r76ef94e  
    374374}
    375375
     376int devman_get_device_path(devman_handle_t handle, char *path, size_t path_size)
     377{
     378        int phone = devman_get_phone(DEVMAN_CLIENT, 0);
     379
     380        if (phone < 0)
     381                return phone;
     382
     383        async_serialize_start();
     384
     385        ipc_call_t answer;
     386        aid_t req = async_send_1(phone, DEVMAN_DEVICE_GET_DEVICE_PATH,
     387            handle, &answer);
     388
     389        ipc_call_t data_request_call;
     390        aid_t data_request = async_data_read(phone, path, path_size,
     391            &data_request_call);
     392        if (data_request == 0) {
     393                async_wait_for(req, NULL);
     394                async_serialize_end();
     395                return ENOMEM;
     396        }
     397
     398        sysarg_t data_request_rc;
     399        sysarg_t opening_request_rc;
     400        async_wait_for(data_request, &data_request_rc);
     401        async_wait_for(req, &opening_request_rc);
     402
     403        async_serialize_end();
     404
     405        if (data_request_rc != EOK) {
     406                /* Prefer the return code of the opening request. */
     407                if (opening_request_rc != EOK) {
     408                        return (int) opening_request_rc;
     409                } else {
     410                        return (int) data_request_rc;
     411                }
     412        }
     413        if (opening_request_rc != EOK) {
     414                return (int) opening_request_rc;
     415        }
     416
     417        path[path_size - 1] = 0;
     418
     419        if (IPC_GET_ARG2(data_request_call) >= path_size) {
     420                return ELIMIT;
     421        }
     422
     423        return EOK;
     424}
     425
    376426
    377427/** @}
  • uspace/lib/c/include/devman.h

    rd2bff2f r76ef94e  
    5555extern int devman_device_get_handle_by_class(const char *, const char *,
    5656    devman_handle_t *, unsigned int);
     57extern int devman_get_device_path(devman_handle_t, char *, size_t);
    5758
    5859extern int devman_add_device_to_class(devman_handle_t, const char *);
  • uspace/lib/c/include/ipc/devman.h

    rd2bff2f r76ef94e  
    149149typedef enum {
    150150        DEVMAN_DEVICE_GET_HANDLE = IPC_FIRST_USER_METHOD,
    151         DEVMAN_DEVICE_GET_HANDLE_BY_CLASS
     151        DEVMAN_DEVICE_GET_HANDLE_BY_CLASS,
     152        DEVMAN_DEVICE_GET_DEVICE_PATH
    152153} client_to_devman_t;
    153154
  • uspace/lib/drv/generic/remote_usbhc.c

    rd2bff2f r76ef94e  
    302302        async_transaction_t *trans = async_transaction_create(callid);
    303303        if (trans == NULL) {
     304                async_answer_0(data_callid, ENOMEM);
    304305                async_answer_0(callid, ENOMEM);
    305306                return;
     
    314315
    315316        if (rc != EOK) {
     317                async_answer_0(data_callid, rc);
    316318                async_answer_0(callid, rc);
    317319                async_transaction_destroy(trans);
     
    460462        async_transaction_t *trans = async_transaction_create(callid);
    461463        if (trans == NULL) {
     464                async_answer_0(data_callid, ENOMEM);
    462465                async_answer_0(callid, ENOMEM);
    463466                free(setup_packet);
     
    469472        trans->buffer = malloc(data_len);
    470473        if (trans->buffer == NULL) {
     474                async_answer_0(data_callid, ENOMEM);
    471475                async_answer_0(callid, ENOMEM);
    472476                async_transaction_destroy(trans);
     
    480484
    481485        if (rc != EOK) {
     486                async_answer_0(data_callid, rc);
    482487                async_answer_0(callid, rc);
    483488                async_transaction_destroy(trans);
  • uspace/lib/usb/Makefile

    rd2bff2f r76ef94e  
    4646        src/hidparser.c \
    4747        src/hiddescriptor.c \
     48        src/host.c \
    4849        src/hub.c \
    4950        src/pipepriv.c \
  • uspace/lib/usb/include/usb/usb.h

    rd2bff2f r76ef94e  
    172172} usb_packet_id;
    173173
     174/** Class name for USB host controllers. */
     175#define USB_HC_DDF_CLASS_NAME "usbhc"
     176
    174177#endif
    175178/**
Note: See TracChangeset for help on using the changeset viewer.