Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 57937dd in mainline


Ignore:
Timestamp:
2010-04-01T20:21:34Z (12 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master
Children:
5cd136ab
Parents:
52b7b1bb
Message:

minor changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libdrv/generic/remote_res.c

    r52b7b1bb r57937dd  
    3434
    3535#include <ipc/ipc.h>
     36#include <async.h>
    3637#include <errno.h>
    3738
     
    5859       
    5960        if (NULL == ires->enable_interrupt) {
    60                 ipc_answer_0(callid, ENOENT);
     61                ipc_answer_0(callid, ENOTSUP);
    6162        } else if (ires->enable_interrupt(dev)) {
    6263                ipc_answer_0(callid, EOK);
     
    6869static void remote_res_get_resources(device_t *dev, void *iface, ipc_callid_t callid, ipc_call_t *call)
    6970{
    70         resource_iface_t *ires = (resource_iface_t *)iface;
     71        resource_iface_t *ires = (resource_iface_t *)iface;     
     72        if (NULL == ires->get_resources) {
     73                ipc_answer_0(callid, ENOTSUP);
     74                return;
     75        }
    7176       
    72         // TODO
     77        hw_resource_list_t *hw_resources = ires->get_resources(dev);   
     78        if (NULL == hw_resources){
     79                ipc_answer_0(callid, ENOENT);
     80                return;
     81        }       
    7382       
    74         ipc_answer_0(callid, EOK);
     83        ipc_answer_1(callid, EOK, hw_resources->count);
     84
     85        size_t len;
     86        if (!async_data_read_receive(&callid, &len)) {
     87                // protocol error - the recipient is not accepting data
     88                return;
     89        }
     90        async_data_read_finalize(callid, hw_resources->resources, len);
    7591}
    7692 
Note: See TracChangeset for help on using the changeset viewer.