Changeset 774e6d1a in mainline for uspace/srv/net/nil/eth/eth.c
- Timestamp:
- 2011-01-09T23:24:53Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4b86dac
- Parents:
- 3c106e88
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
r3c106e88 r774e6d1a 54 54 #include <protocol_map.h> 55 55 #include <net/device.h> 56 #include <netif_ interface.h>56 #include <netif_remote.h> 57 57 #include <net_interface.h> 58 58 #include <nil_interface.h> … … 239 239 switch (IPC_GET_IMETHOD(*icall)) { 240 240 case NET_NIL_DEVICE_STATE: 241 nil_device_state_msg_local(0, IPC_GET_DEVICE( icall),242 IPC_GET_STATE( icall));241 nil_device_state_msg_local(0, IPC_GET_DEVICE(*icall), 242 IPC_GET_STATE(*icall)); 243 243 ipc_answer_0(iid, EOK); 244 244 break; 245 245 case NET_NIL_RECEIVED: 246 246 rc = packet_translate_remote(eth_globals.net_phone, 247 &packet, IPC_GET_PACKET( icall));247 &packet, IPC_GET_PACKET(*icall)); 248 248 if (rc == EOK) { 249 249 rc = nil_received_msg_local(0, 250 IPC_GET_DEVICE( icall), packet, 0);250 IPC_GET_DEVICE(*icall), packet, 0); 251 251 } 252 252 ipc_answer_0(iid, (sysarg_t) rc); … … 837 837 838 838 int nil_message_standalone(const char *name, ipc_callid_t callid, 839 ipc_call_t *call, ipc_call_t *answer, int *answer_count)839 ipc_call_t *call, ipc_call_t *answer, size_t *answer_count) 840 840 { 841 841 measured_string_t *address; … … 853 853 854 854 case NET_NIL_DEVICE: 855 return eth_device_message(IPC_GET_DEVICE( call),856 IPC_GET_SERVICE( call), IPC_GET_MTU(call));855 return eth_device_message(IPC_GET_DEVICE(*call), 856 IPC_GET_SERVICE(*call), IPC_GET_MTU(*call)); 857 857 case NET_NIL_SEND: 858 858 rc = packet_translate_remote(eth_globals.net_phone, &packet, 859 IPC_GET_PACKET( call));859 IPC_GET_PACKET(*call)); 860 860 if (rc != EOK) 861 861 return rc; 862 return eth_send_message(IPC_GET_DEVICE( call), packet,863 IPC_GET_SERVICE( call));862 return eth_send_message(IPC_GET_DEVICE(*call), packet, 863 IPC_GET_SERVICE(*call)); 864 864 case NET_NIL_PACKET_SPACE: 865 rc = eth_packet_space_message(IPC_GET_DEVICE( call), &addrlen,865 rc = eth_packet_space_message(IPC_GET_DEVICE(*call), &addrlen, 866 866 &prefix, &content, &suffix); 867 867 if (rc != EOK) 868 868 return rc; 869 IPC_SET_ADDR( answer, addrlen);870 IPC_SET_PREFIX( answer, prefix);871 IPC_SET_CONTENT( answer, content);872 IPC_SET_SUFFIX( answer, suffix);869 IPC_SET_ADDR(*answer, addrlen); 870 IPC_SET_PREFIX(*answer, prefix); 871 IPC_SET_CONTENT(*answer, content); 872 IPC_SET_SUFFIX(*answer, suffix); 873 873 *answer_count = 4; 874 874 return EOK; 875 875 case NET_NIL_ADDR: 876 rc = eth_addr_message(IPC_GET_DEVICE( call), ETH_LOCAL_ADDR,876 rc = eth_addr_message(IPC_GET_DEVICE(*call), ETH_LOCAL_ADDR, 877 877 &address); 878 878 if (rc != EOK) … … 880 880 return measured_strings_reply(address, 1); 881 881 case NET_NIL_BROADCAST_ADDR: 882 rc = eth_addr_message(IPC_GET_DEVICE( call), ETH_BROADCAST_ADDR,882 rc = eth_addr_message(IPC_GET_DEVICE(*call), ETH_BROADCAST_ADDR, 883 883 &address); 884 884 if (rc != EOK) … … 886 886 return measured_strings_reply(address, 1); 887 887 case IPC_M_CONNECT_TO_ME: 888 return eth_register_message(NIL_GET_PROTO( call),889 IPC_GET_PHONE( call));888 return eth_register_message(NIL_GET_PROTO(*call), 889 IPC_GET_PHONE(*call)); 890 890 } 891 891 … … 908 908 while (true) { 909 909 ipc_call_t answer; 910 int answer_count;910 size_t count; 911 911 912 912 /* Clear the answer structure */ 913 refresh_answer(&answer, & answer_count);913 refresh_answer(&answer, &count); 914 914 915 915 /* Fetch the next message */ … … 919 919 /* Process the message */ 920 920 int res = nil_module_message_standalone(NAME, callid, &call, 921 &answer, & answer_count);921 &answer, &count); 922 922 923 923 /* … … 930 930 931 931 /* Answer the message */ 932 answer_call(callid, res, &answer, answer_count);932 answer_call(callid, res, &answer, count); 933 933 } 934 934 }
Note:
See TracChangeset
for help on using the changeset viewer.