Changes in uspace/srv/hw/netif/ne2000/ne2000.c [ee2fa30a:57d129e] in mainline
- File:
-
- 1 edited
-
uspace/srv/hw/netif/ne2000/ne2000.c (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/netif/ne2000/ne2000.c
ree2fa30a r57d129e 43 43 #include <malloc.h> 44 44 #include <sysinfo.h> 45 #include <ns.h>46 45 #include <ipc/services.h> 46 #include <ipc/ns.h> 47 47 #include <ipc/irc.h> 48 48 #include <net/modules.h> … … 76 76 77 77 static bool irc_service = false; 78 static async_sess_t *irc_sess = NULL;78 static int irc_phone = -1; 79 79 80 80 /** NE2000 kernel interrupt command sequence. … … 152 152 device_id_t device_id = IRQ_GET_DEVICE(*call); 153 153 netif_device_t *device; 154 async_sess_t *nil_sess;154 int nil_phone; 155 155 ne2k_t *ne2k; 156 156 157 157 fibril_rwlock_read_lock(&netif_globals.lock); 158 158 159 nil_sess = netif_globals.nil_sess; 160 161 if (find_device(device_id, &device) == EOK) 159 if (find_device(device_id, &device) == EOK) { 160 nil_phone = device->nil_phone; 162 161 ne2k = (ne2k_t *) device->specific; 163 else162 } else 164 163 ne2k = NULL; 165 164 … … 167 166 168 167 if (ne2k != NULL) { 169 li st_t *frames =168 link_t *frames = 170 169 ne2k_interrupt(ne2k, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call)); 171 170 172 171 if (frames != NULL) { 173 172 while (!list_empty(frames)) { 174 frame_t *frame = list_get_instance(175 list_ first(frames), frame_t, link);173 frame_t *frame = 174 list_get_instance(frames->next, frame_t, link); 176 175 177 176 list_remove(&frame->link); 178 nil_received_msg(nil_ sess, device_id, frame->packet,177 nil_received_msg(nil_phone, device_id, frame->packet, 179 178 SERVICE_NONE); 180 179 free(frame); … … 277 276 278 277 device->device_id = device_id; 278 device->nil_phone = -1; 279 279 device->specific = (void *) ne2k; 280 280 device->state = NETIF_STOPPED; … … 329 329 change_state(device, NETIF_ACTIVE); 330 330 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 } 331 if (irc_service) 332 async_msg_1(irc_phone, IRC_ENABLE_INTERRUPT, ne2k->irq); 336 333 } 337 334 … … 391 388 392 389 if (irc_service) { 393 while (!irc_sess) 394 irc_sess = service_connect_blocking(EXCHANGE_SERIALIZE, 395 SERVICE_IRC, 0, 0); 390 while (irc_phone < 0) 391 irc_phone = service_connect_blocking(SERVICE_IRC, 0, 0); 396 392 } 397 393 398 394 async_set_interrupt_received(irq_handler); 399 395 400 return service_register(SERVICE_NE2000);396 return async_connect_to_me(PHONE_NS, SERVICE_NE2000, 0, 0, NULL); 401 397 } 402 398
Note:
See TracChangeset
for help on using the changeset viewer.
