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


Ignore:
Timestamp:
2011-01-09T23:24:53Z (13 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/net/net.c

    r3c106e88 r774e6d1a  
    474474       
    475475        setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0);
    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);
     476        uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0;
     477       
     478        rc = netif_probe_req(netif->driver->phone, netif->id, irq, (void *) io);
    479479        if (rc != EOK)
    480480                return rc;
     
    511511        }
    512512       
    513         return netif_start_req_remote(netif->driver->phone, netif->id);
     513        return netif_start_req(netif->driver->phone, netif->id);
    514514}
    515515
     
    613613/** Process the networking message.
    614614 *
    615  * @param[in] callid        The message identifier.
    616  * @param[in] call          The message parameters.
     615 * @param[in]  callid       The message identifier.
     616 * @param[in]  call         The message parameters.
    617617 * @param[out] answer       The message answer parameters.
    618618 * @param[out] answer_count The last parameter for the actual answer
     
    627627 */
    628628int net_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer,
    629     int *answer_count)
     629    size_t *answer_count)
    630630{
    631631        measured_string_t *strings;
     
    639639        case NET_NET_GET_DEVICE_CONF:
    640640                rc = measured_strings_receive(&strings, &data,
    641                     IPC_GET_COUNT(call));
     641                    IPC_GET_COUNT(*call));
    642642                if (rc != EOK)
    643643                        return rc;
    644                 net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings,
    645                     IPC_GET_COUNT(call), NULL);
     644                net_get_device_conf_req(0, IPC_GET_DEVICE(*call), &strings,
     645                    IPC_GET_COUNT(*call), NULL);
    646646               
    647647                /* Strings should not contain received data anymore */
    648648                free(data);
    649649               
    650                 rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
     650                rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
    651651                free(strings);
    652652                return rc;
    653653        case NET_NET_GET_CONF:
    654654                rc = measured_strings_receive(&strings, &data,
    655                     IPC_GET_COUNT(call));
     655                    IPC_GET_COUNT(*call));
    656656                if (rc != EOK)
    657657                        return rc;
    658                 net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL);
     658                net_get_conf_req(0, &strings, IPC_GET_COUNT(*call), NULL);
    659659               
    660660                /* Strings should not contain received data anymore */
    661661                free(data);
    662662               
    663                 rc = measured_strings_reply(strings, IPC_GET_COUNT(call));
     663                rc = measured_strings_reply(strings, IPC_GET_COUNT(*call));
    664664                free(strings);
    665665                return rc;
     
    688688                /* Clear the answer structure */
    689689                ipc_call_t answer;
    690                 int answer_count;
     690                size_t answer_count;
    691691                refresh_answer(&answer, &answer_count);
    692692               
Note: See TracChangeset for help on using the changeset viewer.