Changes in uspace/srv/net/nil/nildummy/nildummy.c [9cd8165:8d7ec69d] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/net/nil/nildummy/nildummy.c
r9cd8165 r8d7ec69d 73 73 void *arg); 74 74 75 static int nildummy_device_state(ni ldummy_device_t *device, sysarg_t state)75 static int nildummy_device_state(nic_device_id_t device_id, sysarg_t state) 76 76 { 77 77 fibril_rwlock_read_lock(&nildummy_globals.protos_lock); 78 78 if (nildummy_globals.proto.sess) 79 il_device_state_msg(nildummy_globals.proto.sess, 80 device->device_id,state, nildummy_globals.proto.service);79 il_device_state_msg(nildummy_globals.proto.sess, device_id, 80 state, nildummy_globals.proto.service); 81 81 fibril_rwlock_read_unlock(&nildummy_globals.protos_lock); 82 82 … … 84 84 } 85 85 86 static int nildummy_addr_changed(ni ldummy_device_t *device)86 static int nildummy_addr_changed(nic_device_id_t device_id) 87 87 { 88 88 return ENOTSUP; … … 182 182 } 183 183 184 int rc = nic_callback_create(device->sess, nildummy_nic_cb_conn,185 device);184 int rc = nic_callback_create(device->sess, device_id, 185 nildummy_nic_cb_conn, NULL); 186 186 if (rc != EOK) { 187 187 async_hangup(device->sess); … … 360 360 services_t sender) 361 361 { 362 packet_t *p; 363 362 364 fibril_rwlock_read_lock(&nildummy_globals.devices_lock); 363 365 … … 369 371 } 370 372 371 p acket_t *p= packet;373 p = packet; 372 374 do { 373 375 nic_send_frame(device->sess, packet_get_data(p), … … 383 385 } 384 386 385 static int nildummy_received(ni ldummy_device_t *device)387 static int nildummy_received(nic_device_id_t device_id) 386 388 { 387 389 void *data; … … 401 403 free(pdata); 402 404 403 return nil_received_msg_local(device ->device_id, packet);405 return nil_received_msg_local(device_id, packet); 404 406 } 405 407 … … 465 467 static void nildummy_nic_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg) 466 468 { 467 nildummy_device_t *device = (nildummy_device_t *)arg;468 469 int rc; 469 470 … … 479 480 switch (IPC_GET_IMETHOD(call)) { 480 481 case NIC_EV_DEVICE_STATE: 481 rc = nildummy_device_state(device, IPC_GET_ARG1(call)); 482 rc = nildummy_device_state(IPC_GET_ARG1(call), 483 IPC_GET_ARG2(call)); 482 484 async_answer_0(callid, (sysarg_t) rc); 483 485 break; 484 486 case NIC_EV_RECEIVED: 485 rc = nildummy_received( device);487 rc = nildummy_received(IPC_GET_ARG1(call)); 486 488 async_answer_0(callid, (sysarg_t) rc); 487 489 break; 488 490 case NIC_EV_ADDR_CHANGED: 489 rc = nildummy_addr_changed( device);491 rc = nildummy_addr_changed(IPC_GET_ARG1(call)); 490 492 async_answer_0(callid, (sysarg_t) rc); 491 493 break;
Note:
See TracChangeset
for help on using the changeset viewer.