Changeset eaa0c3f in mainline for uspace/lib/nic/src/nic_driver.c


Ignore:
Timestamp:
2012-01-21T23:55:03Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c38e417
Parents:
86c71de (diff), e98fe28c (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 with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/nic/src/nic_driver.c

    r86c71de reaa0c3f  
    4949#include <devman.h>
    5050#include <ddf/interrupt.h>
    51 #include <net_interface.h>
    5251#include <ops/nic.h>
    5352#include <errno.h>
     
    8988    nic_iface_t *iface)
    9089{
    91         if (driver_ops) {
    92                 if (!driver_ops->device_added)
    93                         driver_ops->device_added = nic_device_added_impl;
    94         }
    95 
    9690        if (dev_ops) {
    9791                if (!dev_ops->open)
     
    429423
    430424/**
    431  * Connect to the NET and IRQ services. This function should be called only from
     425 * Connect to IRC service. This function should be called only from
    432426 * the add_device handler, thus no locking is required.
    433427 *
     
    436430 * @return EOK          If connection was successful.
    437431 * @return EINVAL       If the IRC service cannot be determined.
    438  * @return EREFUSED     If NET or IRC service cannot be connected.
     432 * @return EREFUSED     If IRC service cannot be connected.
    439433 */
    440434int nic_connect_to_services(nic_t *nic_data)
    441435{
    442         /* NET service */
    443         nic_data->net_session = service_connect_blocking(EXCHANGE_SERIALIZE,
    444                 SERVICE_NETWORKING, 0, 0);
    445         if (nic_data->net_session == NULL)
    446                 return errno;
    447        
    448436        /* IRC service */
    449437        sysarg_t apic;
     
    462450       
    463451        return EOK;
    464 }
    465 
    466 /** Notify the NET service that the device is ready
    467  *
    468  * @param nic NICF structure
    469  *
    470  * @return EOK on success
    471  *
    472  */
    473 int nic_ready(nic_t *nic)
    474 {
    475         fibril_rwlock_read_lock(&nic->main_lock);
    476        
    477         async_sess_t *session = nic->net_session;
    478         devman_handle_t handle = nic->dev->handle;
    479        
    480         fibril_rwlock_read_unlock(&nic->main_lock);
    481        
    482         if (session == NULL)
    483                 return EINVAL;
    484        
    485         return net_driver_ready(session, handle);
    486452}
    487453
     
    726692        nic_data->device_id = NIC_DEVICE_INVALID_ID;
    727693        nic_data->state = NIC_STATE_STOPPED;
    728         nic_data->net_session = NULL;
    729694        nic_data->nil_session = NULL;
    730695        nic_data->irc_session = NULL;
     
    781746 */
    782747static void nic_destroy(nic_t *nic_data) {
    783         if (nic_data->net_session != NULL) {
    784                 async_hangup(nic_data->net_session);
    785         }
    786 
    787748        if (nic_data->nil_session != NULL) {
    788749                async_hangup(nic_data->nil_session);
Note: See TracChangeset for help on using the changeset viewer.