Changes in uspace/srv/net/il/arp/arp.c [6b82009:9934f7d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/il/arp/arp.c
r6b82009 r9934f7d 164 164 } 165 165 166 static int arp_clean_cache_req( void)166 static int arp_clean_cache_req(int arp_phone) 167 167 { 168 168 int count; … … 190 190 } 191 191 192 static int arp_clear_address_req( device_id_t device_id, services_t protocol,193 measured_string_t *address)192 static int arp_clear_address_req(int arp_phone, device_id_t device_id, 193 services_t protocol, measured_string_t *address) 194 194 { 195 195 fibril_mutex_lock(&arp_globals.lock); … … 218 218 } 219 219 220 static int arp_clear_device_req( device_id_t device_id)220 static int arp_clear_device_req(int arp_phone, device_id_t device_id) 221 221 { 222 222 fibril_mutex_lock(&arp_globals.lock); … … 375 375 return rc; 376 376 377 nil_send_msg(device-> sess, device_id, packet,377 nil_send_msg(device->phone, device_id, packet, 378 378 SERVICE_ARP); 379 379 return 1; … … 416 416 * @param[in] iid Message identifier. 417 417 * @param[in,out] icall Message parameters. 418 * @param[in] arg Local argument. 419 * 418 * @param[in] arg Local argument. 420 419 */ 421 420 static void arp_receiver(ipc_callid_t iid, ipc_call_t *icall, void *arg) … … 432 431 433 432 case NET_IL_RECEIVED: 434 rc = packet_translate_remote(arp_globals.net_ sess, &packet,433 rc = packet_translate_remote(arp_globals.net_phone, &packet, 435 434 IPC_GET_PACKET(*icall)); 436 435 if (rc == EOK) { … … 440 439 rc = arp_receive_message(IPC_GET_DEVICE(*icall), packet); 441 440 if (rc != 1) { 442 pq_release_remote(arp_globals.net_ sess,441 pq_release_remote(arp_globals.net_phone, 443 442 packet_get_id(packet)); 444 443 } … … 565 564 566 565 /* Bind */ 567 device-> sess= nil_bind_service(device->service,566 device->phone = nil_bind_service(device->service, 568 567 (sysarg_t) device->device_id, SERVICE_ARP, 569 568 arp_receiver); 570 if (device-> sess == NULL) {569 if (device->phone < 0) { 571 570 fibril_mutex_unlock(&arp_globals.lock); 572 571 arp_protos_destroy(&device->protos, free); … … 576 575 577 576 /* Get packet dimensions */ 578 rc = nil_packet_size_req(device-> sess, device_id,577 rc = nil_packet_size_req(device->phone, device_id, 579 578 &device->packet_dimension); 580 579 if (rc != EOK) { … … 586 585 587 586 /* Get hardware address */ 588 rc = nil_get_addr_req(device-> sess, device_id, &device->addr,587 rc = nil_get_addr_req(device->phone, device_id, &device->addr, 589 588 &device->addr_data); 590 589 if (rc != EOK) { … … 596 595 597 596 /* Get broadcast address */ 598 rc = nil_get_broadcast_addr_req(device-> sess, device_id,597 rc = nil_get_broadcast_addr_req(device->phone, device_id, 599 598 &device->broadcast_addr, &device->broadcast_data); 600 599 if (rc != EOK) { … … 628 627 } 629 628 630 int il_initialize( async_sess_t *net_sess)629 int il_initialize(int net_phone) 631 630 { 632 631 fibril_mutex_initialize(&arp_globals.lock); 633 632 634 633 fibril_mutex_lock(&arp_globals.lock); 635 arp_globals.net_ sess = net_sess;634 arp_globals.net_phone = net_phone; 636 635 int rc = arp_cache_initialize(&arp_globals.cache); 637 636 fibril_mutex_unlock(&arp_globals.lock); … … 648 647 return ELIMIT; 649 648 650 packet_t *packet = packet_get_4_remote(arp_globals.net_ sess,649 packet_t *packet = packet_get_4_remote(arp_globals.net_phone, 651 650 device->packet_dimension.addr_len, device->packet_dimension.prefix, 652 651 length, device->packet_dimension.suffix); … … 656 655 arp_header_t *header = (arp_header_t *) packet_suffix(packet, length); 657 656 if (!header) { 658 pq_release_remote(arp_globals.net_ sess, packet_get_id(packet));657 pq_release_remote(arp_globals.net_phone, packet_get_id(packet)); 659 658 return ENOMEM; 660 659 } … … 681 680 (uint8_t *) device->broadcast_addr->value, device->addr->length); 682 681 if (rc != EOK) { 683 pq_release_remote(arp_globals.net_ sess, packet_get_id(packet));682 pq_release_remote(arp_globals.net_phone, packet_get_id(packet)); 684 683 return rc; 685 684 } 686 685 687 nil_send_msg(device-> sess, device_id, packet, SERVICE_ARP);686 nil_send_msg(device->phone, device_id, packet, SERVICE_ARP); 688 687 return EOK; 689 688 } … … 891 890 892 891 case NET_ARP_CLEAR_DEVICE: 893 return arp_clear_device_req( IPC_GET_DEVICE(*call));892 return arp_clear_device_req(0, IPC_GET_DEVICE(*call)); 894 893 895 894 case NET_ARP_CLEAR_ADDRESS: … … 898 897 return rc; 899 898 900 arp_clear_address_req( IPC_GET_DEVICE(*call),899 arp_clear_address_req(0, IPC_GET_DEVICE(*call), 901 900 IPC_GET_SERVICE(*call), address); 902 901 free(address); … … 905 904 906 905 case NET_ARP_CLEAN_CACHE: 907 return arp_clean_cache_req( );906 return arp_clean_cache_req(0); 908 907 } 909 908
Note:
See TracChangeset
for help on using the changeset viewer.