Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/net/generic/net_remote.c

    r6b82009 re882e3a  
    3838#include <ipc/services.h>
    3939#include <ipc/net_net.h>
    40 
    4140#include <malloc.h>
    42 
     41#include <async.h>
    4342#include <generic.h>
    4443#include <net/modules.h>
     
    9897    size_t count, uint8_t **data)
    9998{
    100         return generic_translate_req(sess, NET_NET_GET_DEVICE_CONF, 0, 0,
     99        return generic_translate_req(sess, NET_NET_GET_CONF, 0, 0,
    101100            *configuration, count, configuration, data);
    102101}
     
    124123 *
    125124 */
    126 int net_get_device_conf_req(async_sess_t *sess, device_id_t device_id,
     125int net_get_device_conf_req(async_sess_t *sess, nic_device_id_t device_id,
    127126    measured_string_t **configuration, size_t count, uint8_t **data)
    128127{
     
    131130}
    132131
     132int net_get_devices_req(async_sess_t *sess, measured_string_t **devices,
     133    size_t *count, uint8_t **data)
     134{
     135        if ((!devices) || (!count))
     136                return EBADMEM;
     137       
     138        async_exch_t *exch = async_exchange_begin(sess);
     139       
     140        int rc = async_req_0_1(exch, NET_NET_GET_DEVICES_COUNT, count);
     141        if (rc != EOK) {
     142                async_exchange_end(exch);
     143                return rc;
     144        }
     145       
     146        if (*count == 0) {
     147                async_exchange_end(exch);
     148                *data = NULL;
     149                return EOK;
     150        }
     151       
     152        aid_t message_id = async_send_0(exch, NET_NET_GET_DEVICES, NULL);
     153        rc = measured_strings_return(exch, devices, data, *count);
     154       
     155        async_exchange_end(exch);
     156       
     157        sysarg_t result;
     158        async_wait_for(message_id, &result);
     159       
     160        if ((rc == EOK) && (result != EOK)) {
     161                free(*devices);
     162                free(*data);
     163        }
     164       
     165        return (int) result;
     166}
     167
    133168/** @}
    134169 */
Note: See TracChangeset for help on using the changeset viewer.