Changes in uspace/srv/net/nil/eth/eth.c [7837101:774e6d1a] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/eth/eth.c
r7837101 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> … … 201 201 202 202 eth_globals.broadcast_addr = 203 measured_string_create_bulk( "\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR);203 measured_string_create_bulk((uint8_t *) "\xFF\xFF\xFF\xFF\xFF\xFF", ETH_ADDR); 204 204 if (!eth_globals.broadcast_addr) { 205 205 rc = ENOMEM; … … 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); … … 284 284 measured_string_t names[2] = { 285 285 { 286 ( char*) "ETH_MODE",286 (uint8_t *) "ETH_MODE", 287 287 8 288 288 }, 289 289 { 290 ( char*) "ETH_DUMMY",290 (uint8_t *) "ETH_DUMMY", 291 291 9 292 292 } … … 294 294 measured_string_t *configuration; 295 295 size_t count = sizeof(names) / sizeof(measured_string_t); 296 char*data;296 uint8_t *data; 297 297 eth_proto_t *proto; 298 298 int rc; … … 358 358 359 359 if (configuration) { 360 if (!str_lcmp( configuration[0].value, "DIX",360 if (!str_lcmp((char *) configuration[0].value, "DIX", 361 361 configuration[0].length)) { 362 362 device->flags |= ETH_DIX; 363 } else if(!str_lcmp( configuration[0].value, "8023_2_LSAP",363 } else if(!str_lcmp((char *) configuration[0].value, "8023_2_LSAP", 364 364 configuration[0].length)) { 365 365 device->flags |= ETH_8023_2_LSAP; … … 407 407 408 408 printf("%s: Device registered (id: %d, service: %d: mtu: %zu, " 409 "mac: % x:%x:%x:%x:%x:%x, flags: 0x%x)\n",409 "mac: %02x:%02x:%02x:%02x:%02x:%02x, flags: 0x%x)\n", 410 410 NAME, device->device_id, device->service, device->mtu, 411 411 device->addr_data[0], device->addr_data[1], … … 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.