Ignore:
Timestamp:
2012-02-01T00:09:22Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
ffcc5776
Parents:
cb3dbb63 (diff), 3d4750f (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:

Mainline changes.

File:
1 edited

Legend:

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

    rcb3dbb63 r70922c2  
    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);
     
    360360    services_t sender)
    361361{
    362         packet_t *p;
    363        
    364362        fibril_rwlock_read_lock(&nildummy_globals.devices_lock);
    365363       
     
    371369        }
    372370       
    373         p = packet;
     371        packet_t *p = packet;
    374372        do {
    375373                nic_send_frame(device->sess, packet_get_data(p),
     
    385383}
    386384
    387 static int nildummy_received(nic_device_id_t device_id)
     385static int nildummy_received(nildummy_device_t *device)
    388386{
    389387        void *data;
     
    403401        free(pdata);
    404402
    405         return nil_received_msg_local(device_id, packet);
     403        return nil_received_msg_local(device->device_id, packet);
    406404}
    407405
     
    467465static void nildummy_nic_cb_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    468466{
     467        nildummy_device_t *device = (nildummy_device_t *)arg;
    469468        int rc;
    470469       
     
    480479                switch (IPC_GET_IMETHOD(call)) {
    481480                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));
    484482                        async_answer_0(callid, (sysarg_t) rc);
    485483                        break;
    486484                case NIC_EV_RECEIVED:
    487                         rc = nildummy_received(IPC_GET_ARG1(call));
     485                        rc = nildummy_received(device);
    488486                        async_answer_0(callid, (sysarg_t) rc);
    489487                        break;
    490488                case NIC_EV_ADDR_CHANGED:
    491                         rc = nildummy_addr_changed(IPC_GET_ARG1(call));
     489                        rc = nildummy_addr_changed(device);
    492490                        async_answer_0(callid, (sysarg_t) rc);
    493491                        break;
Note: See TracChangeset for help on using the changeset viewer.