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