Changeset 86ffa27f in mainline for uspace/lib/net/netif/netif_skel.c


Ignore:
Timestamp:
2011-08-07T11:21:44Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
cc574511
Parents:
15f3c3f (diff), e8067c0 (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/lib/net/netif/netif_skel.c

    r15f3c3f r86ffa27f  
    228228}
    229229
     230/** Register the device notification receiver,
     231 *
     232 * Register a network interface layer module as the device
     233 * notification receiver.
     234 *
     235 * @param[in] sess      Session to the network interface layer module.
     236 *
     237 * @return EOK on success.
     238 * @return ELIMIT if there is another module registered.
     239 *
     240 */
     241static int register_message(async_sess_t *sess)
     242{
     243        fibril_rwlock_write_lock(&netif_globals.lock);
     244        if (netif_globals.nil_sess != NULL) {
     245                fibril_rwlock_write_unlock(&netif_globals.lock);
     246                return ELIMIT;
     247        }
     248       
     249        netif_globals.nil_sess = sess;
     250       
     251        fibril_rwlock_write_unlock(&netif_globals.lock);
     252        return EOK;
     253}
     254
    230255/** Process the netif module messages.
    231256 *
     
    257282                return EOK;
    258283       
     284        async_sess_t *callback =
     285            async_callback_receive_start(EXCHANGE_SERIALIZE, call);
     286        if (callback)
     287                return register_message(callback);
     288       
    259289        switch (IPC_GET_IMETHOD(*call)) {
    260290        case NET_NETIF_PROBE:
     
    358388 * messages in an infinite loop.
    359389 *
    360  * @param[in] nil_service Network interface layer service.
    361  *
    362390 * @return EOK on success.
    363391 * @return Other error codes as defined for each specific module
     
    365393 *
    366394 */
    367 int netif_module_start(sysarg_t nil_service)
     395int netif_module_start(void)
    368396{
    369397        async_set_client_connection(netif_client_connection);
    370398       
    371399        netif_globals.sess = connect_to_service(SERVICE_NETWORKING);
    372         netif_globals.nil_sess = connect_to_service(nil_service);
     400        netif_globals.nil_sess = NULL;
    373401        netif_device_map_initialize(&netif_globals.device_map);
    374402       
Note: See TracChangeset for help on using the changeset viewer.