Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/net/net.c

    rffa2c8ef r61bfc370  
    4545#include <stdio.h>
    4646#include <str.h>
    47 #include <str_error.h>
    48 
     47
     48#include <ipc/ipc.h>
    4949#include <ipc/services.h>
    5050#include <ipc/net.h>
    5151#include <ipc/net_net.h>
    5252#include <ipc/il.h>
    53 #include <ipc/nil.h>
    5453
    5554#include <net/modules.h>
     
    6362
    6463#include <netif_remote.h>
    65 #include <nil_remote.h>
     64#include <nil_interface.h>
    6665#include <net_interface.h>
    6766#include <ip_interface.h>
     
    289288        if (rc != EOK)
    290289                return rc;
    291         rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME,
    292             (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service);
     290        rc = add_module(NULL, &net_globals.modules, (uint8_t *) DP8390_NAME,
     291            (uint8_t *) DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);
    293292        if (rc != EOK)
    294293                return rc;
     
    325324static int net_module_start(async_client_conn_t client_connection)
    326325{
     326        sysarg_t phonehash;
    327327        int rc;
    328328       
     
    332332                return rc;
    333333       
     334       
    334335        rc = net_initialize(client_connection);
    335336        if (rc != EOK)
    336337                goto out;
    337338       
    338         rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL);
     339        rc = ipc_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, &phonehash);
    339340        if (rc != EOK)
    340341                goto out;
     
    473474       
    474475        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0);
    475         uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
    476        
    477         rc = netif_probe_req(netif->driver->phone, netif->id, irq, (void *) io);
     476        int io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
     477       
     478        rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io);
    478479        if (rc != EOK)
    479480                return rc;
     
    510511        }
    511512       
    512         return netif_start_req(netif->driver->phone, netif->id);
     513        return netif_start_req_remote(netif->driver->phone, netif->id);
    513514}
    514515
     
    590591                rc = start_device(netif);
    591592                if (rc != EOK) {
    592                         printf("%s: Error starting interface %s (%s)\n", NAME,
    593                             netif->name, str_error(rc));
    594593                        measured_strings_destroy(&netif->configuration);
    595594                        netifs_exclude_index(&net_globals.netifs, index);
    596                        
    597595                        return rc;
    598596                }
     
    615613/** Process the networking message.
    616614 *
    617  * @param[in]  callid       The message identifier.
    618  * @param[in]  call         The message parameters.
     615 * @param[in] callid        The message identifier.
     616 * @param[in] call          The message parameters.
    619617 * @param[out] answer       The message answer parameters.
    620618 * @param[out] answer_count The last parameter for the actual answer
     
    629627 */
    630628int net_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer,
    631     size_t *answer_count)
     629    int *answer_count)
    632630{
    633631        measured_string_t *strings;
     
    641639        case NET_NET_GET_DEVICE_CONF:
    642640                rc = measured_strings_receive(&strings, &data,
    643                     IPC_GET_COUNT(*call));
     641                    IPC_GET_COUNT(call));
    644642                if (rc != EOK)
    645643                        return rc;
    646                 net_get_device_conf_req(0, IPC_GET_DEVICE(*call), &strings,
    647                     IPC_GET_COUNT(*call), NULL);
     644                net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings,
     645                    IPC_GET_COUNT(call), NULL);
    648646               
    649647                /* Strings should not contain received data anymore */
    650648                free(data);
    651649               
    652                 rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
     650                rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
    653651                free(strings);
    654652                return rc;
    655653        case NET_NET_GET_CONF:
    656654                rc = measured_strings_receive(&strings, &data,
    657                     IPC_GET_COUNT(*call));
     655                    IPC_GET_COUNT(call));
    658656                if (rc != EOK)
    659657                        return rc;
    660                 net_get_conf_req(0, &strings, IPC_GET_COUNT(*call), NULL);
     658                net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL);
    661659               
    662660                /* Strings should not contain received data anymore */
    663661                free(data);
    664662               
    665                 rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
     663                rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
    666664                free(strings);
    667665                return rc;
     
    685683         *  - Answer the first IPC_M_CONNECT_ME_TO call.
    686684         */
    687         async_answer_0(iid, EOK);
     685        ipc_answer_0(iid, EOK);
    688686       
    689687        while (true) {
    690688                /* Clear the answer structure */
    691689                ipc_call_t answer;
    692                 size_t answer_count;
     690                int answer_count;
    693691                refresh_answer(&answer, &answer_count);
    694692               
     
    711709int main(int argc, char *argv[])
    712710{
    713         return net_module_start(net_client_connection);
     711        int rc;
     712       
     713        rc = net_module_start(net_client_connection);
     714        if (rc != EOK) {
     715                fprintf(stderr, "%s: net_module_start error %i\n", NAME, rc);
     716                return rc;
     717        }
     718       
     719        return EOK;
    714720}
    715721
Note: See TracChangeset for help on using the changeset viewer.