Changeset 609243f4 in mainline for uspace/lib/net/generic/net_remote.c


Ignore:
Timestamp:
2011-10-07T15:46:01Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e2c50e1
Parents:
f51b1d3
Message:

cherrypick general networking improvements from lp:~helenos-nicf/helenos/nicf (after sanitization)
remove obsolete networking drivers
this renders the networking non-functional for the time being

File:
1 edited

Legend:

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

    rf51b1d3 r609243f4  
    3838#include <ipc/services.h>
    3939#include <ipc/net_net.h>
    40 
    4140#include <malloc.h>
    42 
     41#include <async.h>
     42#include <devman.h>
    4343#include <generic.h>
    4444#include <net/modules.h>
     
    9898    size_t count, uint8_t **data)
    9999{
    100         return generic_translate_req(sess, NET_NET_GET_DEVICE_CONF, 0, 0,
     100        return generic_translate_req(sess, NET_NET_GET_CONF, 0, 0,
    101101            *configuration, count, configuration, data);
    102102}
     
    124124 *
    125125 */
    126 int net_get_device_conf_req(async_sess_t *sess, device_id_t device_id,
     126int net_get_device_conf_req(async_sess_t *sess, nic_device_id_t device_id,
    127127    measured_string_t **configuration, size_t count, uint8_t **data)
    128128{
     
    131131}
    132132
     133int net_get_devices_req(async_sess_t *sess, measured_string_t **devices,
     134    size_t *count, uint8_t **data)
     135{
     136        if ((!devices) || (!count))
     137                return EBADMEM;
     138       
     139        async_exch_t *exch = async_exchange_begin(sess);
     140       
     141        int rc = async_req_0_1(exch, NET_NET_GET_DEVICES_COUNT, count);
     142        if (rc != EOK) {
     143                async_exchange_end(exch);
     144                return rc;
     145        }
     146       
     147        if (*count == 0) {
     148                async_exchange_end(exch);
     149                *data = NULL;
     150                return EOK;
     151        }
     152       
     153        aid_t message_id = async_send_0(exch, NET_NET_GET_DEVICES, NULL);
     154        rc = measured_strings_return(exch, devices, data, *count);
     155       
     156        async_exchange_end(exch);
     157       
     158        sysarg_t result;
     159        async_wait_for(message_id, &result);
     160       
     161        if ((rc == EOK) && (result != EOK)) {
     162                free(*devices);
     163                free(*data);
     164        }
     165       
     166        return (int) result;
     167}
     168
     169int net_driver_ready(async_sess_t *sess, devman_handle_t handle)
     170{
     171        async_exch_t *exch = async_exchange_begin(sess);
     172        int rc = async_req_1_0(exch, NET_NET_DRIVER_READY, handle);
     173        async_exchange_end(exch);
     174       
     175        return rc;
     176}
     177
    133178/** @}
    134179 */
Note: See TracChangeset for help on using the changeset viewer.