Changes in uspace/srv/net/net/net.c [ffa2c8ef:61bfc370] in mainline
- File:
-
- 1 edited
-
uspace/srv/net/net/net.c (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/net/net.c
rffa2c8ef r61bfc370 45 45 #include <stdio.h> 46 46 #include <str.h> 47 #include <str_error.h> 48 47 48 #include <ipc/ipc.h> 49 49 #include <ipc/services.h> 50 50 #include <ipc/net.h> 51 51 #include <ipc/net_net.h> 52 52 #include <ipc/il.h> 53 #include <ipc/nil.h>54 53 55 54 #include <net/modules.h> … … 63 62 64 63 #include <netif_remote.h> 65 #include <nil_ remote.h>64 #include <nil_interface.h> 66 65 #include <net_interface.h> 67 66 #include <ip_interface.h> … … 289 288 if (rc != EOK) 290 289 return rc; 291 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME,292 (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service);290 rc = add_module(NULL, &net_globals.modules, (uint8_t *) DP8390_NAME, 291 (uint8_t *) DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service); 293 292 if (rc != EOK) 294 293 return rc; … … 325 324 static int net_module_start(async_client_conn_t client_connection) 326 325 { 326 sysarg_t phonehash; 327 327 int rc; 328 328 … … 332 332 return rc; 333 333 334 334 335 rc = net_initialize(client_connection); 335 336 if (rc != EOK) 336 337 goto out; 337 338 338 rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL);339 rc = ipc_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, &phonehash); 339 340 if (rc != EOK) 340 341 goto out; … … 473 474 474 475 setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0); 475 uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0;476 477 rc = netif_probe_req (netif->driver->phone, netif->id, irq, (void *)io);476 int io = setting ? strtol((char *) setting->value, NULL, 16) : 0; 477 478 rc = netif_probe_req_remote(netif->driver->phone, netif->id, irq, io); 478 479 if (rc != EOK) 479 480 return rc; … … 510 511 } 511 512 512 return netif_start_req (netif->driver->phone, netif->id);513 return netif_start_req_remote(netif->driver->phone, netif->id); 513 514 } 514 515 … … 590 591 rc = start_device(netif); 591 592 if (rc != EOK) { 592 printf("%s: Error starting interface %s (%s)\n", NAME,593 netif->name, str_error(rc));594 593 measured_strings_destroy(&netif->configuration); 595 594 netifs_exclude_index(&net_globals.netifs, index); 596 597 595 return rc; 598 596 } … … 615 613 /** Process the networking message. 616 614 * 617 * @param[in] callidThe message identifier.618 * @param[in] callThe message parameters.615 * @param[in] callid The message identifier. 616 * @param[in] call The message parameters. 619 617 * @param[out] answer The message answer parameters. 620 618 * @param[out] answer_count The last parameter for the actual answer … … 629 627 */ 630 628 int net_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, 631 size_t *answer_count)629 int *answer_count) 632 630 { 633 631 measured_string_t *strings; … … 641 639 case NET_NET_GET_DEVICE_CONF: 642 640 rc = measured_strings_receive(&strings, &data, 643 IPC_GET_COUNT( *call));641 IPC_GET_COUNT(call)); 644 642 if (rc != EOK) 645 643 return rc; 646 net_get_device_conf_req(0, IPC_GET_DEVICE( *call), &strings,647 IPC_GET_COUNT( *call), NULL);644 net_get_device_conf_req(0, IPC_GET_DEVICE(call), &strings, 645 IPC_GET_COUNT(call), NULL); 648 646 649 647 /* Strings should not contain received data anymore */ 650 648 free(data); 651 649 652 rc = measured_strings_reply(strings, IPC_GET_COUNT( *call));650 rc = measured_strings_reply(strings, IPC_GET_COUNT(call)); 653 651 free(strings); 654 652 return rc; 655 653 case NET_NET_GET_CONF: 656 654 rc = measured_strings_receive(&strings, &data, 657 IPC_GET_COUNT( *call));655 IPC_GET_COUNT(call)); 658 656 if (rc != EOK) 659 657 return rc; 660 net_get_conf_req(0, &strings, IPC_GET_COUNT( *call), NULL);658 net_get_conf_req(0, &strings, IPC_GET_COUNT(call), NULL); 661 659 662 660 /* Strings should not contain received data anymore */ 663 661 free(data); 664 662 665 rc = measured_strings_reply(strings, IPC_GET_COUNT( *call));663 rc = measured_strings_reply(strings, IPC_GET_COUNT(call)); 666 664 free(strings); 667 665 return rc; … … 685 683 * - Answer the first IPC_M_CONNECT_ME_TO call. 686 684 */ 687 async_answer_0(iid, EOK);685 ipc_answer_0(iid, EOK); 688 686 689 687 while (true) { 690 688 /* Clear the answer structure */ 691 689 ipc_call_t answer; 692 size_t answer_count;690 int answer_count; 693 691 refresh_answer(&answer, &answer_count); 694 692 … … 711 709 int main(int argc, char *argv[]) 712 710 { 713 return net_module_start(net_client_connection); 711 int rc; 712 713 rc = net_module_start(net_client_connection); 714 if (rc != EOK) { 715 fprintf(stderr, "%s: net_module_start error %i\n", NAME, rc); 716 return rc; 717 } 718 719 return EOK; 714 720 } 715 721
Note:
See TracChangeset
for help on using the changeset viewer.
