Changeset 14f1db0 in mainline for uspace/srv/net/netif/lo/lo.c


Ignore:
Timestamp:
2010-04-09T12:54:57Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1caa3c2
Parents:
24ab58b3
Message:

networking overhaul:

  • separation of conserns
  • removal of (almost all) overlaping symbols, libnetif is not needed anymore
  • again, it is possible to build the networking in multiple architecture configurations (however, currently only the bundling netif and nil layers is supported, more to come)
  • code style updates and fixes (still a huge amount of work to do)
File:
1 edited

Legend:

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

    r24ab58b3 r14f1db0  
    5151#include <nil_interface.h>
    5252#include <nil_messages.h>
    53 #include <netif.h>
    54 #include <netif_module.h>
     53#include <netif_interface.h>
     54#include <netif_local.h>
    5555
    5656/** Default hardware address.
     
    7676 *  @returns EOK otherwise.
    7777 */
    78 int change_state_message(device_ref device, device_state_t state);
     78int change_state_message(netif_device_t * device, device_state_t state);
    7979
    8080/** Creates and returns the loopback network interface structure.
     
    8585 *  @returns ENOMEM if there is not enough memory left.
    8686 */
    87 int create(device_id_t device_id, device_ref * device);
     87int create(device_id_t device_id, netif_device_t * * device);
    8888
    8989int netif_specific_message(ipc_callid_t callid, ipc_call_t * call, ipc_call_t * answer, int * answer_count){
     
    103103        ERROR_DECLARE;
    104104
    105         device_ref device;
     105        netif_device_t * device;
    106106
    107107        if(! stats){
     
    113113}
    114114
    115 int change_state_message(device_ref device, device_state_t state)
     115int change_state_message(netif_device_t * device, device_state_t state)
    116116{
    117117        if (device->state != state) {
     
    127127}
    128128
    129 int create(device_id_t device_id, device_ref * device){
     129int create(device_id_t device_id, netif_device_t * * device){
    130130        int index;
    131131
    132         if(device_map_count(&netif_globals.device_map) > 0){
     132        if(netif_device_map_count(&netif_globals.device_map) > 0){
    133133                return EXDEV;
    134134        }else{
    135                 *device = (device_ref) malloc(sizeof(device_t));
     135                *device = (netif_device_t *) malloc(sizeof(netif_device_t));
    136136                if(!(*device)){
    137137                        return ENOMEM;
     
    146146                (** device).nil_phone = -1;
    147147                (** device).state = NETIF_STOPPED;
    148                 index = device_map_add(&netif_globals.device_map, (** device).device_id, * device);
     148                index = netif_device_map_add(&netif_globals.device_map, (** device).device_id, * device);
    149149                if(index < 0){
    150150                        free(*device);
     
    166166        ERROR_DECLARE;
    167167
    168         device_ref device;
     168        netif_device_t * device;
    169169
    170170        // create a new device
     
    178178        ERROR_DECLARE;
    179179
    180         device_ref device;
     180        netif_device_t * device;
    181181        size_t length;
    182182        packet_t next;
     
    204204}
    205205
    206 int netif_start_message(device_ref device){
     206int netif_start_message(netif_device_t * device){
    207207        return change_state_message(device, NETIF_ACTIVE);
    208208}
    209209
    210 int netif_stop_message(device_ref device){
     210int netif_stop_message(netif_device_t * device){
    211211        return change_state_message(device, NETIF_STOPPED);
    212212}
    213213
    214 #ifdef CONFIG_NETWORKING_modular
    215 
    216 #include <netif_standalone.h>
    217 
    218214/** Default thread for new connections.
    219215 *
    220  *  @param[in] iid The initial message identifier.
    221  *  @param[in] icall The initial message call structure.
    222  *
    223  */
    224 static void netif_client_connection(ipc_callid_t iid, ipc_call_t * icall)
     216 * @param[in] iid The initial message identifier.
     217 * @param[in] icall The initial message call structure.
     218 *
     219 */
     220static void netif_client_connection(ipc_callid_t iid, ipc_call_t *icall)
    225221{
    226222        /*
     
    254250}
    255251
    256 /** Starts the module.
    257  *
    258  *  @param argc The count of the command line arguments. Ignored parameter.
    259  *  @param argv The command line parameters. Ignored parameter.
    260  *
    261  *  @returns EOK on success.
    262  *  @returns Other error codes as defined for each specific module start function.
    263  *
    264  */
    265252int main(int argc, char *argv[])
    266253{
     
    274261}
    275262
    276 #endif /* CONFIG_NETWORKING_modular */
    277 
    278263/** @}
    279264 */
Note: See TracChangeset for help on using the changeset viewer.