Changes in uspace/drv/nic/ne2k/ne2k.c [8820544:7de1988c] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/nic/ne2k/ne2k.c
r8820544 r7de1988c 38 38 */ 39 39 40 /* XXX Fix this */ 41 #define _DDF_DATA_IMPLANT 42 40 43 #include <stdio.h> 41 44 #include <errno.h> 42 #include <irc.h>43 45 #include <stdlib.h> 44 46 #include <str_error.h> … … 122 124 }; 123 125 124 static void ne2k_interrupt_handler(ipc_callid_t, ipc_call_t *, ddf_dev_t *); 126 static void ne2k_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid, 127 ipc_call_t *call); 125 128 126 129 static int ne2k_register_interrupt(nic_t *nic_data) … … 239 242 } 240 243 241 void ne2k_interrupt_handler( ipc_callid_t iid, ipc_call_t *call, ddf_dev_t *dev)244 void ne2k_interrupt_handler(ddf_dev_t *dev, ipc_callid_t iid, ipc_call_t *call) 242 245 { 243 246 nic_t *nic_data = DRIVER_DATA(dev); 244 247 ne2k_interrupt(nic_data, IRQ_GET_ISR(*call), IRQ_GET_TSR(*call)); 245 248 246 249 async_answer_0(iid, EOK); 247 250 } … … 253 256 if (!ne2k->up) { 254 257 int rc = ne2k_up(ne2k); 255 if (rc != EOK)256 return rc;257 258 rc = irc_enable_interrupt(ne2k->irq);259 258 if (rc != EOK) { 260 ne2k_down(ne2k);261 259 return rc; 262 260 } 261 262 nic_enable_interrupt(nic_data, ne2k->irq); 263 263 } 264 264 return EOK; … … 269 269 ne2k_t *ne2k = (ne2k_t *) nic_get_specific(nic_data); 270 270 271 (void) irc_disable_interrupt(ne2k->irq);271 nic_disable_interrupt(nic_data, ne2k->irq); 272 272 ne2k->receive_configuration = RCR_AB | RCR_AM; 273 273 ne2k_down(ne2k); … … 396 396 } 397 397 398 rc = nic_connect_to_services(nic_data); 399 if (rc != EOK) { 400 ne2k_dev_cleanup(dev); 401 return rc; 402 } 403 398 404 fun = ddf_fun_create(nic_get_ddf_dev(nic_data), fun_exposed, "port0"); 399 405 if (fun == NULL) { … … 401 407 return ENOMEM; 402 408 } 403 404 409 nic_set_ddf_fun(nic_data, fun); 405 410 ddf_fun_set_ops(fun, &ne2k_dev_ops); 411 ddf_fun_data_implant(fun, nic_data); 406 412 407 413 rc = ddf_fun_bind(fun); … … 437 443 int main(int argc, char *argv[]) 438 444 { 439 printf("%s: HelenOS NE 2000 network adapter driver\n", NAME);440 441 445 nic_driver_init(NAME); 442 446 nic_driver_implement(&ne2k_driver_ops, &ne2k_dev_ops, &ne2k_nic_iface);
Note:
See TracChangeset
for help on using the changeset viewer.