Changeset c028b22 in mainline for uspace/srv/net/net/net.c


Ignore:
Timestamp:
2011-07-08T17:01:01Z (13 years ago)
Author:
Martin Sucha <sucha14@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc1a727
Parents:
4e36219 (diff), 026793d (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:

Merge mainline changes

File:
1 edited

Legend:

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

    r4e36219 rc028b22  
    3636 */
    3737
    38 #include "net.h"
    39 
    4038#include <async.h>
    4139#include <ctype.h>
     
    4644#include <str.h>
    4745#include <str_error.h>
    48 
     46#include <ns.h>
    4947#include <ipc/services.h>
    5048#include <ipc/net.h>
     
    5250#include <ipc/il.h>
    5351#include <ipc/nil.h>
    54 
    5552#include <net/modules.h>
    5653#include <net/packet.h>
    5754#include <net/device.h>
    58 
    5955#include <adt/char_map.h>
    6056#include <adt/generic_char_map.h>
    6157#include <adt/measured_strings.h>
    6258#include <adt/module_map.h>
    63 
    6459#include <netif_remote.h>
    6560#include <nil_remote.h>
    6661#include <net_interface.h>
    6762#include <ip_interface.h>
     63#include "net.h"
    6864
    6965/** Networking module name. */
     
    339335                goto out;
    340336       
    341         rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL);
     337        rc = service_register(SERVICE_NETWORKING);
    342338        if (rc != EOK)
    343339                goto out;
     
    393389}
    394390
    395 int net_get_conf_req(int net_phone, measured_string_t **configuration,
     391static int net_get_conf_req_local(measured_string_t **configuration,
    396392    size_t count, uint8_t **data)
    397393{
     
    402398}
    403399
    404 int net_get_device_conf_req(int net_phone, device_id_t device_id,
     400static int net_get_device_conf_req_local(device_id_t device_id,
    405401    measured_string_t **configuration, size_t count, uint8_t **data)
    406402{
     
    478474        uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
    479475       
    480         rc = netif_probe_req(netif->driver->phone, netif->id, irq, (void *) io);
     476        rc = netif_probe_req(netif->driver->sess, netif->id, irq, (void *) io);
    481477        if (rc != EOK)
    482478                return rc;
     
    491487               
    492488                int mtu = setting ? strtol((char *) setting->value, NULL, 10) : 0;
    493                
    494                 rc = nil_device_req(netif->nil->phone, netif->id, mtu,
     489                rc = nil_device_req(netif->nil->sess, netif->id, mtu,
    495490                    netif->driver->service);
    496491                if (rc != EOK)
     
    502497       
    503498        /* Inter-network layer startup */
    504         switch (netif->il->service) {
    505         case SERVICE_IP:
    506                 rc = ip_device_req(netif->il->phone, netif->id,
    507                     internet_service);
    508                 if (rc != EOK)
    509                         return rc;
    510                 break;
    511         default:
    512                 return ENOENT;
    513         }
    514        
    515         return netif_start_req(netif->driver->phone, netif->id);
     499        rc = ip_device_req(netif->il->sess, netif->id, internet_service);
     500        if (rc != EOK)
     501                return rc;
     502       
     503        return netif_start_req(netif->driver->sess, netif->id);
    516504}
    517505
     
    638626       
    639627        *answer_count = 0;
     628       
     629        if (!IPC_GET_IMETHOD(*call))
     630                return EOK;
     631       
    640632        switch (IPC_GET_IMETHOD(*call)) {
    641         case IPC_M_PHONE_HUNGUP:
    642                 return EOK;
    643633        case NET_NET_GET_DEVICE_CONF:
    644634                rc = measured_strings_receive(&strings, &data,
     
    646636                if (rc != EOK)
    647637                        return rc;
    648                 net_get_device_conf_req(0, IPC_GET_DEVICE(*call), &strings,
     638                net_get_device_conf_req_local(IPC_GET_DEVICE(*call), &strings,
    649639                    IPC_GET_COUNT(*call), NULL);
    650640               
     
    660650                if (rc != EOK)
    661651                        return rc;
    662                 net_get_conf_req(0, &strings, IPC_GET_COUNT(*call), NULL);
     652                net_get_conf_req_local(&strings, IPC_GET_COUNT(*call), NULL);
    663653               
    664654                /* Strings should not contain received data anymore */
     
    677667/** Default thread for new connections.
    678668 *
    679  * @param[in] iid The initial message identifier.
     669 * @param[in] iid   The initial message identifier.
    680670 * @param[in] icall The initial message call structure.
    681  *
    682  */
    683 static void net_client_connection(ipc_callid_t iid, ipc_call_t *icall)
     671 * @param[in] arg   Local argument.
     672 *
     673 */
     674static void net_client_connection(ipc_callid_t iid, ipc_call_t *icall,
     675    void *arg)
    684676{
    685677        /*
     
    703695               
    704696                /* End if told to either by the message or the processing result */
    705                 if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))
     697                if ((!IPC_GET_IMETHOD(call)) || (res == EHANGUP))
    706698                        return;
    707699               
Note: See TracChangeset for help on using the changeset viewer.