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