Changeset 8b5690f in mainline for uspace/srv/net/net/net.c
- Timestamp:
- 2011-02-03T05:11:01Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- ba38f72c
- Parents:
- 22027b6e (diff), 86d7bfa (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/net/net.c
r22027b6e r8b5690f 45 45 #include <stdio.h> 46 46 #include <str.h> 47 48 #include <ipc/ipc.h> 47 #include <str_error.h> 48 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> 53 54 54 55 #include <net/modules.h> … … 62 63 63 64 #include <netif_remote.h> 64 #include <nil_ interface.h>65 #include <nil_remote.h> 65 66 #include <net_interface.h> 66 67 #include <ip_interface.h> … … 288 289 if (rc != EOK) 289 290 return rc; 290 rc = add_module(NULL, &net_globals.modules, (uint8_t *) DP8390_NAME,291 (uint8_t *) DP8390_FILENAME, SERVICE_DP8390, 0, connect_to_service);291 rc = add_module(NULL, &net_globals.modules, (uint8_t *) NE2000_NAME, 292 (uint8_t *) NE2000_FILENAME, SERVICE_NE2000, 0, connect_to_service); 292 293 if (rc != EOK) 293 294 return rc; … … 324 325 static int net_module_start(async_client_conn_t client_connection) 325 326 { 326 sysarg_t phonehash;327 327 int rc; 328 328 … … 332 332 return rc; 333 333 334 335 334 rc = net_initialize(client_connection); 336 335 if (rc != EOK) 337 336 goto out; 338 337 339 rc = ipc_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, &phonehash);338 rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL); 340 339 if (rc != EOK) 341 340 goto out; … … 474 473 475 474 setting = measured_strings_find(&netif->configuration, (uint8_t *) CONF_IO, 0); 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);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); 479 478 if (rc != EOK) 480 479 return rc; … … 511 510 } 512 511 513 return netif_start_req _remote(netif->driver->phone, netif->id);512 return netif_start_req(netif->driver->phone, netif->id); 514 513 } 515 514 … … 591 590 rc = start_device(netif); 592 591 if (rc != EOK) { 592 printf("%s: Error starting interface %s (%s)\n", NAME, 593 netif->name, str_error(rc)); 593 594 measured_strings_destroy(&netif->configuration); 594 595 netifs_exclude_index(&net_globals.netifs, index); 596 595 597 return rc; 596 598 } … … 613 615 /** Process the networking message. 614 616 * 615 * @param[in] callidThe message identifier.616 * @param[in] callThe message parameters.617 * @param[in] callid The message identifier. 618 * @param[in] call The message parameters. 617 619 * @param[out] answer The message answer parameters. 618 620 * @param[out] answer_count The last parameter for the actual answer … … 627 629 */ 628 630 int net_message(ipc_callid_t callid, ipc_call_t *call, ipc_call_t *answer, 629 int *answer_count)631 size_t *answer_count) 630 632 { 631 633 measured_string_t *strings; … … 639 641 case NET_NET_GET_DEVICE_CONF: 640 642 rc = measured_strings_receive(&strings, &data, 641 IPC_GET_COUNT( call));643 IPC_GET_COUNT(*call)); 642 644 if (rc != EOK) 643 645 return rc; 644 net_get_device_conf_req(0, IPC_GET_DEVICE( call), &strings,645 IPC_GET_COUNT( call), NULL);646 net_get_device_conf_req(0, IPC_GET_DEVICE(*call), &strings, 647 IPC_GET_COUNT(*call), NULL); 646 648 647 649 /* Strings should not contain received data anymore */ 648 650 free(data); 649 651 650 rc = measured_strings_reply(strings, IPC_GET_COUNT( call));652 rc = measured_strings_reply(strings, IPC_GET_COUNT(*call)); 651 653 free(strings); 652 654 return rc; 653 655 case NET_NET_GET_CONF: 654 656 rc = measured_strings_receive(&strings, &data, 655 IPC_GET_COUNT( call));657 IPC_GET_COUNT(*call)); 656 658 if (rc != EOK) 657 659 return rc; 658 net_get_conf_req(0, &strings, IPC_GET_COUNT( call), NULL);660 net_get_conf_req(0, &strings, IPC_GET_COUNT(*call), NULL); 659 661 660 662 /* Strings should not contain received data anymore */ 661 663 free(data); 662 664 663 rc = measured_strings_reply(strings, IPC_GET_COUNT( call));665 rc = measured_strings_reply(strings, IPC_GET_COUNT(*call)); 664 666 free(strings); 665 667 return rc; … … 683 685 * - Answer the first IPC_M_CONNECT_ME_TO call. 684 686 */ 685 ipc_answer_0(iid, EOK);687 async_answer_0(iid, EOK); 686 688 687 689 while (true) { 688 690 /* Clear the answer structure */ 689 691 ipc_call_t answer; 690 int answer_count;692 size_t answer_count; 691 693 refresh_answer(&answer, &answer_count); 692 694 … … 709 711 int main(int argc, char *argv[]) 710 712 { 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; 713 return net_module_start(net_client_connection); 720 714 } 721 715
Note:
See TracChangeset
for help on using the changeset viewer.