Ignore:
Timestamp:
2012-01-27T19:12:45Z (12 years ago)
Author:
Frantisek Princ <frantisek.princ@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fe56c08a
Parents:
ea75ceb (diff), d81eaf94 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge with mainline

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/net/nil/nildummy/nildummy.c

    rea75ceb r8da2c60  
    7373    void *arg);
    7474
    75 static int nildummy_device_state(nic_device_id_t device_id, sysarg_t state)
     75static int nildummy_device_state(nildummy_device_t *device, sysarg_t state)
    7676{
    7777        fibril_rwlock_read_lock(&nildummy_globals.protos_lock);
    7878        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);
    8181        fibril_rwlock_read_unlock(&nildummy_globals.protos_lock);
    8282       
     
    8484}
    8585
    86 static int nildummy_addr_changed(nic_device_id_t device_id)
     86static int nildummy_addr_changed(nildummy_device_t *device)
    8787{
    8888        return ENOTSUP;
     
    182182        }
    183183       
    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);
    186186        if (rc != EOK) {
    187187                async_hangup(device->sess);
     
    383383}
    384384
    385 static int nildummy_received(nic_device_id_t device_id)
     385static int nildummy_received(nildummy_device_t *device)
    386386{
    387387        void *data;
     
    401401        free(pdata);
    402402
    403         return nil_received_msg_local(device_id, packet);
     403        return nil_received_msg_local(device->device_id, packet);
    404404}
    405405
     
    465465static void nildummy_nic_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    466466{
     467        nildummy_device_t *device = (nildummy_device_t *)arg;
    467468        int rc;
    468469       
     
    478479                switch (IPC_GET_IMETHOD(call)) {
    479480                case NIC_EV_DEVICE_STATE:
    480                         rc = nildummy_device_state(IPC_GET_ARG1(call),
    481                             IPC_GET_ARG2(call));
     481                        rc = nildummy_device_state(device, IPC_GET_ARG1(call));
    482482                        async_answer_0(callid, (sysarg_t) rc);
    483483                        break;
    484484                case NIC_EV_RECEIVED:
    485                         rc = nildummy_received(IPC_GET_ARG1(call));
     485                        rc = nildummy_received(device);
    486486                        async_answer_0(callid, (sysarg_t) rc);
    487487                        break;
    488488                case NIC_EV_ADDR_CHANGED:
    489                         rc = nildummy_addr_changed(IPC_GET_ARG1(call));
     489                        rc = nildummy_addr_changed(device);
    490490                        async_answer_0(callid, (sysarg_t) rc);
    491491                        break;
Note: See TracChangeset for help on using the changeset viewer.