Changes in uspace/lib/drv/generic/remote_nic.c [9cd8165:609243f4] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/drv/generic/remote_nic.c
r9cd8165 r609243f4 39 39 #include <errno.h> 40 40 #include <ipc/services.h> 41 #include <adt/measured_strings.h> 41 42 #include <sys/time.h> 42 43 #include "ops/nic.h" 43 44 44 static void remote_nic_send_frame(ddf_fun_t *dev, void *iface, 45 ipc_callid_t callid, ipc_call_t *call) 46 { 47 nic_iface_t *nic_iface = (nic_iface_t *) iface; 48 assert(nic_iface->send_frame); 49 50 void *data; 51 size_t size; 52 int rc; 53 54 rc = async_data_write_accept(&data, false, 0, 0, 0, &size); 55 if (rc != EOK) { 56 async_answer_0(callid, EINVAL); 57 return; 58 } 59 60 rc = nic_iface->send_frame(dev, data, size); 61 async_answer_0(callid, rc); 62 free(data); 63 } 64 65 static void remote_nic_callback_create(ddf_fun_t *dev, void *iface, 66 ipc_callid_t callid, ipc_call_t *call) 67 { 68 nic_iface_t *nic_iface = (nic_iface_t *) iface; 69 assert(nic_iface->callback_create); 70 71 int rc = nic_iface->callback_create(dev); 45 static void remote_nic_send_message(ddf_fun_t *dev, void *iface, 46 ipc_callid_t callid, ipc_call_t *call) 47 { 48 nic_iface_t *nic_iface = (nic_iface_t *) iface; 49 assert(nic_iface->send_message); 50 51 packet_id_t packet_id = (packet_id_t) IPC_GET_ARG2(*call); 52 53 int rc = nic_iface->send_message(dev, packet_id); 54 async_answer_0(callid, rc); 55 } 56 57 static void remote_nic_connect_to_nil(ddf_fun_t *dev, void *iface, 58 ipc_callid_t callid, ipc_call_t *call) 59 { 60 nic_iface_t *nic_iface = (nic_iface_t *) iface; 61 assert(nic_iface->connect_to_nil); 62 63 services_t nil_service = (services_t) IPC_GET_ARG2(*call); 64 nic_device_id_t device_id = (nic_device_id_t) IPC_GET_ARG3(*call); 65 66 int rc = nic_iface->connect_to_nil(dev, nil_service, device_id); 72 67 async_answer_0(callid, rc); 73 68 } … … 834 829 835 830 uint16_t tag = (uint16_t) IPC_GET_ARG2(*call); 836 booladd = (int) IPC_GET_ARG3(*call);837 boolstrip = (int) IPC_GET_ARG4(*call);831 int add = (int) IPC_GET_ARG3(*call); 832 int strip = (int) IPC_GET_ARG4(*call); 838 833 839 834 int rc = nic_iface->vlan_set_tag(dev, tag, add, strip); … … 1199 1194 */ 1200 1195 static remote_iface_func_ptr_t remote_nic_iface_ops[] = { 1201 &remote_nic_send_ frame,1202 &remote_nic_c allback_create,1196 &remote_nic_send_message, 1197 &remote_nic_connect_to_nil, 1203 1198 &remote_nic_get_state, 1204 1199 &remote_nic_set_state,
Note:
See TracChangeset
for help on using the changeset viewer.