Changes in uspace/srv/hw/netif/ne2000/ne2000.c [79ae36dd:ee2fa30a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/ne2000/ne2000.c
r79ae36dd ree2fa30a 38 38 #include <assert.h> 39 39 #include <async.h> 40 #include <async_obsolete.h>41 40 #include <ddi.h> 42 41 #include <errno.h> … … 44 43 #include <malloc.h> 45 44 #include <sysinfo.h> 45 #include <ns.h> 46 46 #include <ipc/services.h> 47 #include <ns.h>48 #include <ns_obsolete.h>49 47 #include <ipc/irc.h> 50 48 #include <net/modules.h> … … 78 76 79 77 static bool irc_service = false; 80 static int irc_phone = -1;78 static async_sess_t *irc_sess = NULL; 81 79 82 80 /** NE2000 kernel interrupt command sequence. … … 154 152 device_id_t device_id = IRQ_GET_DEVICE(*call); 155 153 netif_device_t *device; 156 int nil_phone;154 async_sess_t *nil_sess; 157 155 ne2k_t *ne2k; 158 156 159 157 fibril_rwlock_read_lock(&netif_globals.lock); 160 158 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) 163 162 ne2k = (ne2k_t *) device->specific; 164 }else163 else 165 164 ne2k = NULL; 166 165 … … 168 167 169 168 if (ne2k != NULL) { 170 li nk_t *frames =169 list_t *frames = 171 170 ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call)); 172 171 173 172 if (frames != NULL) { 174 173 while (!list_empty(frames)) { 175 frame_t *frame = 176 list_ get_instance(frames->next, frame_t, link);174 frame_t *frame = list_get_instance( 175 list_first(frames), frame_t, link); 177 176 178 177 list_remove(&frame->link); 179 nil_received_msg(nil_ phone, device_id, frame->packet,178 nil_received_msg(nil_sess, device_id, frame->packet, 180 179 SERVICE_NONE); 181 180 free(frame); … … 278 277 279 278 device->device_id = device_id; 280 device->nil_phone = -1;281 279 device->specific = (void *) ne2k; 282 280 device->state = NETIF_STOPPED; … … 331 329 change_state(device, NETIF_ACTIVE); 332 330 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 } 335 336 } 336 337 … … 390 391 391 392 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); 394 396 } 395 397
Note:
See TracChangeset
for help on using the changeset viewer.