Changeset 14f1db0 in mainline for uspace/srv/net/nil/eth/eth.c
- Timestamp:
- 2010-04-09T12:54:57Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- a1caa3c2
- Parents:
- 24ab58b3
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
r24ab58b3 r14f1db0 60 60 #include <adt/measured_strings.h> 61 61 #include <packet/packet_client.h> 62 #include <nil_module.h> 62 #include <packet_remote.h> 63 #include <nil_local.h> 63 64 64 65 #include "eth.h" … … 271 272 INT_MAP_IMPLEMENT(eth_protos, eth_proto_t) 272 273 273 int nil_device_state_msg (int nil_phone, device_id_t device_id, int state){274 int nil_device_state_msg_local(int nil_phone, device_id_t device_id, int state){ 274 275 int index; 275 276 eth_proto_ref proto; … … 475 476 } 476 477 477 int nil_received_msg (int nil_phone, device_id_t device_id, packet_t packet, services_t target){478 int nil_received_msg_local(int nil_phone, device_id_t device_id, packet_t packet, services_t target){ 478 479 eth_proto_ref proto; 479 480 packet_t next; … … 497 498 }else{ 498 499 // drop invalid/unknown 499 pq_release (eth_globals.net_phone, packet_get_id(packet));500 pq_release_remote(eth_globals.net_phone, packet_get_id(packet)); 500 501 } 501 502 packet = next; … … 681 682 ethertype = htons(protocol_map(SERVICE_ETHERNET, sender)); 682 683 if(! ethertype){ 683 pq_release (eth_globals.net_phone, packet_get_id(packet));684 pq_release_remote(eth_globals.net_phone, packet_get_id(packet)); 684 685 return EINVAL; 685 686 } … … 699 700 packet = tmp; 700 701 } 701 pq_release (eth_globals.net_phone, packet_get_id(next));702 pq_release_remote(eth_globals.net_phone, packet_get_id(next)); 702 703 next = tmp; 703 704 }else{ … … 713 714 } 714 715 715 int nil_message (const char *name, ipc_callid_t callid, ipc_call_t *call,716 int nil_message_standalone(const char *name, ipc_callid_t callid, ipc_call_t *call, 716 717 ipc_call_t *answer, int *answer_count) 717 718 { … … 733 734 IPC_GET_SERVICE(call), IPC_GET_MTU(call)); 734 735 case NET_NIL_SEND: 735 ERROR_PROPAGATE(packet_translate (eth_globals.net_phone, &packet,736 ERROR_PROPAGATE(packet_translate_remote(eth_globals.net_phone, &packet, 736 737 IPC_GET_PACKET(call))); 737 738 return eth_send_message(IPC_GET_DEVICE(call), packet, … … 771 772 switch(IPC_GET_METHOD(*icall)){ 772 773 case NET_NIL_DEVICE_STATE: 773 nil_device_state_msg (0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall));774 nil_device_state_msg_local(0, IPC_GET_DEVICE(icall), IPC_GET_STATE(icall)); 774 775 ipc_answer_0(iid, EOK); 775 776 break; 776 777 case NET_NIL_RECEIVED: 777 if(! ERROR_OCCURRED(packet_translate (eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){778 ERROR_CODE = nil_received_msg (0, IPC_GET_DEVICE(icall), packet, 0);778 if(! ERROR_OCCURRED(packet_translate_remote(eth_globals.net_phone, &packet, IPC_GET_PACKET(icall)))){ 779 ERROR_CODE = nil_received_msg_local(0, IPC_GET_DEVICE(icall), packet, 0); 779 780 } 780 781 ipc_answer_0(iid, (ipcarg_t) ERROR_CODE); … … 787 788 } 788 789 789 #ifdef CONFIG_NETWORKING_modular 790 791 #include <nil_standalone.h> 790 #ifndef CONFIG_NETIF_NIL_BUNDLE 792 791 793 792 /** Default thread for new connections. 794 793 * 795 * 796 * 794 * @param[in] iid The initial message identifier. 795 * @param[in] icall The initial message call structure. 797 796 * 798 797 */ 799 static void nil_client_connection(ipc_callid_t iid, ipc_call_t * 798 static void nil_client_connection(ipc_callid_t iid, ipc_call_t *icall) 800 799 { 801 800 /* … … 817 816 818 817 /* Process the message */ 819 int res = nil_module_message (NAME, callid, &call, &answer,818 int res = nil_module_message_standalone(NAME, callid, &call, &answer, 820 819 &answer_count); 821 820 … … 829 828 } 830 829 831 /** Starts the module.832 *833 * @param argc The count of the command line arguments. Ignored parameter.834 * @param argv The command line parameters. Ignored parameter.835 *836 * @returns EOK on success.837 * @returns Other error codes as defined for each specific module start function.838 *839 */840 830 int main(int argc, char *argv[]) 841 831 { … … 843 833 844 834 /* Start the module */ 845 if (ERROR_OCCURRED(nil_module_start (nil_client_connection)))835 if (ERROR_OCCURRED(nil_module_start_standalone(nil_client_connection))) 846 836 return ERROR_CODE; 847 837 … … 849 839 } 850 840 851 #endif /* CONFIG_NET WORKING_modular*/841 #endif /* CONFIG_NETIF_NIL_BUNDLE */ 852 842 853 843 /** @}
Note:
See TracChangeset
for help on using the changeset viewer.