Changeset 1916d1f in mainline for uspace/srv/hw/netif/ne2000/ne2000.c


Ignore:
Timestamp:
2011-07-12T13:41:26Z (13 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
50fc490
Parents:
11809eab (diff), 6817eba (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 libposix changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hw/netif/ne2000/ne2000.c

    r11809eab r1916d1f  
    3838#include <assert.h>
    3939#include <async.h>
    40 #include <async_obsolete.h>
    4140#include <ddi.h>
    4241#include <errno.h>
     
    4443#include <malloc.h>
    4544#include <sysinfo.h>
     45#include <ns.h>
    4646#include <ipc/services.h>
    47 #include <ns.h>
    48 #include <ns_obsolete.h>
    4947#include <ipc/irc.h>
    5048#include <net/modules.h>
     
    7876
    7977static bool irc_service = false;
    80 static int irc_phone = -1;
     78static async_sess_t *irc_sess = NULL;
    8179
    8280/** NE2000 kernel interrupt command sequence.
     
    154152        device_id_t device_id = IRQ_GET_DEVICE(*call);
    155153        netif_device_t *device;
    156         int nil_phone;
     154        async_sess_t *nil_sess;
    157155        ne2k_t *ne2k;
    158156       
    159157        fibril_rwlock_read_lock(&netif_globals.lock);
    160158       
    161         if (find_device(device_id, &device) == EOK) {
    162                 nil_phone = device->nil_phone;
     159        nil_sess = netif_globals.nil_sess;
     160       
     161        if (find_device(device_id, &device) == EOK)
    163162                ne2k = (ne2k_t *) device->specific;
    164         } else
     163        else
    165164                ne2k = NULL;
    166165       
     
    177176                               
    178177                                list_remove(&frame->link);
    179                                 nil_received_msg(nil_phone, device_id,
    180                                     frame->packet, SERVICE_NONE);
     178                                nil_received_msg(nil_sess, device_id, frame->packet,
     179                                    SERVICE_NONE);
    181180                                free(frame);
    182181                        }
     
    278277       
    279278        device->device_id = device_id;
    280         device->nil_phone = -1;
    281279        device->specific = (void *) ne2k;
    282280        device->state = NETIF_STOPPED;
     
    331329                change_state(device, NETIF_ACTIVE);
    332330               
    333                 if (irc_service)
    334                         async_obsolete_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, ne2k->irq);
     331                if (irc_service) {
     332                        async_exch_t *exch = async_exchange_begin(irc_sess);
     333                        async_msg_1(exch, IRC_ENABLE_INTERRUPT, ne2k->irq);
     334                        async_exchange_end(exch);
     335                }
    335336        }
    336337       
     
    390391       
    391392        if (irc_service) {
    392                 while (irc_phone < 0)
    393                         irc_phone = service_obsolete_connect_blocking(SERVICE_IRC, 0, 0);
     393                while (!irc_sess)
     394                        irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE,
     395                            SERVICE_IRC, 0, 0);
    394396        }
    395397       
Note: See TracChangeset for help on using the changeset viewer.