Changeset 774e6d1a in mainline for uspace/srv/net/netif/lo/lo.c


Ignore:
Timestamp:
2011-01-09T23:24:53Z (14 years ago)
Author:
martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4b86dac
Parents:
3c106e88
Message:

partial networking stack overhaul

  • a lot of coding style changes (comments, indentation, etc.)
  • convert several ints to unsigned ints or size_t values
  • streamline many of the IPC-related macros (they no longer dereference the call structure by themselves)
  • get rid of netif_interface.h (containing only aliases for remote functions and not serving any purpose)
  • rename netif_local.{c|h} to netif_skel.{c|h} (it is really just a skeleton)
  • drop the "_remote" and "_standalone" suffixes from most of the netif_ functions (they do not serve any purpose anymore)
  • implement netif_client_connection() as a common framework function for all netif modules
    • update the lo module accordingly
  • ip module now reports the default gateway to the user whenever it is being set
File:
1 edited

Legend:

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

    r3c106e88 r774e6d1a  
    4949#include <net/device.h>
    5050#include <nil_interface.h>
    51 #include <netif_interface.h>
    52 #include <netif_local.h>
     51#include <netif_skel.h>
    5352
    5453/** Default hardware address. */
     
    6564
    6665int netif_specific_message(ipc_callid_t callid, ipc_call_t *call,
    67     ipc_call_t *answer, int *answer_count)
     66    ipc_call_t *answer, size_t *count)
    6867{
    6968        return ENOTSUP;
     
    172171}
    173172
    174 int netif_probe_message(device_id_t device_id, int irq, uintptr_t io)
     173int netif_probe_message(device_id_t device_id, int irq, void *io)
    175174{
    176175        netif_device_t *device;
     
    233232}
    234233
    235 /** Default thread for new connections.
    236  *
    237  * @param[in] iid       The initial message identifier.
    238  * @param[in] icall     The initial message call structure.
    239  */
    240 static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    241 {
    242         /*
    243          * Accept the connection
    244          *  - Answer the first IPC_M_CONNECT_ME_TO call.
    245          */
    246         ipc_answer_0(iid, EOK);
    247        
    248         while (true) {
    249                 ipc_call_t answer;
    250                 int answer_count;
    251                
    252                 /* Clear the answer structure */
    253                 refresh_answer(&answer, &answer_count);
    254                
    255                 /* Fetch the next message */
    256                 ipc_call_t call;
    257                 ipc_callid_t callid = async_get_call(&call);
    258                
    259                 /* Process the message */
    260                 int res = netif_module_message(NAME, callid, &call, &answer,
    261                     &answer_count);
    262                
    263                 /*
    264                  * End if told to either by the message or the processing
    265                  * result.
    266                  */
    267                 if ((IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) ||
    268                     (res == EHANGUP))
    269                         return;
    270                
    271                 /* Answer the message */
    272                 answer_call(callid, res, &answer, answer_count);
    273         }
    274 }
    275 
    276234int main(int argc, char *argv[])
    277235{
    278         int rc;
    279        
    280236        /* Start the module */
    281         rc = netif_module_start(netif_client_connection);
    282         return rc;
     237        return netif_module_start();
    283238}
    284239
Note: See TracChangeset for help on using the changeset viewer.