Changeset 6a44ee4 in mainline for uspace/srv/net/net/net.c
- Timestamp:
- 2011-07-20T15:26:21Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- efcebe1
- Parents:
- 25bef0ff (diff), a701812 (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
r25bef0ff r6a44ee4 36 36 */ 37 37 38 #include "net.h"39 40 38 #include <async.h> 41 39 #include <ctype.h> … … 46 44 #include <str.h> 47 45 #include <str_error.h> 48 46 #include <ns.h> 49 47 #include <ipc/services.h> 50 48 #include <ipc/net.h> … … 52 50 #include <ipc/il.h> 53 51 #include <ipc/nil.h> 54 55 52 #include <net/modules.h> 56 53 #include <net/packet.h> 57 54 #include <net/device.h> 58 59 55 #include <adt/char_map.h> 60 56 #include <adt/generic_char_map.h> 61 57 #include <adt/measured_strings.h> 62 58 #include <adt/module_map.h> 63 64 59 #include <netif_remote.h> 65 60 #include <nil_remote.h> 66 61 #include <net_interface.h> 67 62 #include <ip_interface.h> 63 #include "net.h" 68 64 69 65 /** Networking module name. */ … … 339 335 goto out; 340 336 341 rc = async_connect_to_me(PHONE_NS, SERVICE_NETWORKING, 0, 0, NULL);337 rc = service_register(SERVICE_NETWORKING); 342 338 if (rc != EOK) 343 339 goto out; … … 393 389 } 394 390 395 int net_get_conf_req(int net_phone,measured_string_t **configuration,391 static int net_get_conf_req_local(measured_string_t **configuration, 396 392 size_t count, uint8_t **data) 397 393 { … … 402 398 } 403 399 404 int net_get_device_conf_req(int net_phone,device_id_t device_id,400 static int net_get_device_conf_req_local(device_id_t device_id, 405 401 measured_string_t **configuration, size_t count, uint8_t **data) 406 402 { … … 478 474 uintptr_t io = setting ? strtol((char *) setting->value, NULL, 16) : 0; 479 475 480 rc = netif_probe_req(netif->driver-> phone, netif->id, irq, (void *) io);476 rc = netif_probe_req(netif->driver->sess, netif->id, irq, (void *) io); 481 477 if (rc != EOK) 482 478 return rc; … … 491 487 492 488 int mtu = setting ? strtol((char *) setting->value, NULL, 10) : 0; 493 494 rc = nil_device_req(netif->nil->phone, netif->id, mtu, 489 rc = nil_device_req(netif->nil->sess, netif->id, mtu, 495 490 netif->driver->service); 496 491 if (rc != EOK) … … 502 497 503 498 /* Inter-network layer startup */ 504 switch (netif->il->service) { 505 case SERVICE_IP: 506 rc = ip_device_req(netif->il->phone, netif->id, 507 internet_service); 508 if (rc != EOK) 509 return rc; 510 break; 511 default: 512 return ENOENT; 513 } 514 515 return netif_start_req(netif->driver->phone, netif->id); 499 rc = ip_device_req(netif->il->sess, netif->id, internet_service); 500 if (rc != EOK) 501 return rc; 502 503 return netif_start_req(netif->driver->sess, netif->id); 516 504 } 517 505 … … 638 626 639 627 *answer_count = 0; 628 629 if (!IPC_GET_IMETHOD(*call)) 630 return EOK; 631 640 632 switch (IPC_GET_IMETHOD(*call)) { 641 case IPC_M_PHONE_HUNGUP:642 return EOK;643 633 case NET_NET_GET_DEVICE_CONF: 644 634 rc = measured_strings_receive(&strings, &data, … … 646 636 if (rc != EOK) 647 637 return rc; 648 net_get_device_conf_req (0,IPC_GET_DEVICE(*call), &strings,638 net_get_device_conf_req_local(IPC_GET_DEVICE(*call), &strings, 649 639 IPC_GET_COUNT(*call), NULL); 650 640 … … 660 650 if (rc != EOK) 661 651 return rc; 662 net_get_conf_req (0,&strings, IPC_GET_COUNT(*call), NULL);652 net_get_conf_req_local(&strings, IPC_GET_COUNT(*call), NULL); 663 653 664 654 /* Strings should not contain received data anymore */ … … 677 667 /** Default thread for new connections. 678 668 * 679 * @param[in] iid The initial message identifier.669 * @param[in] iid The initial message identifier. 680 670 * @param[in] icall The initial message call structure. 681 * 682 */ 683 static void net_client_connection(ipc_callid_t iid, ipc_call_t *icall) 671 * @param[in] arg Local argument. 672 * 673 */ 674 static void net_client_connection(ipc_callid_t iid, ipc_call_t *icall, 675 void *arg) 684 676 { 685 677 /* … … 703 695 704 696 /* End if told to either by the message or the processing result */ 705 if (( IPC_GET_IMETHOD(call) == IPC_M_PHONE_HUNGUP) || (res == EHANGUP))697 if ((!IPC_GET_IMETHOD(call)) || (res == EHANGUP)) 706 698 return; 707 699
Note:
See TracChangeset
for help on using the changeset viewer.