Changeset 47a7174f in mainline for uspace/srv/devmap/devmap.c


Ignore:
Timestamp:
2010-12-17T22:03:15Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7551706b
Parents:
0bff73a
Message:

Devmap drivers can customize forwarded connections

It is possible to set an extra parameter for forwarded connections through
devmap. The change shall ensure backward compatibility and allows to connect
to devman-style drivers through their devmap path.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/devmap/devmap.c

    r0bff73a r47a7174f  
    9999        /** Device driver handling this device */
    100100        devmap_driver_t *driver;
     101        /** Use this interface when forwarding to driver. */
     102        sysarg_t forward_interface;
    101103} devmap_device_t;
    102104
     
    517519        }
    518520       
     521        /* Set the interface, if any. */
     522        device->forward_interface = IPC_GET_ARG1(*icall);
     523
    519524        /* Get fqdn */
    520525        char *fqdn;
     
    566571        /* Get unique device handle */
    567572        device->handle = devmap_create_handle();
    568        
     573
    569574        devmap_namespace_addref(namespace, device);
    570575        device->driver = driver;
     
    617622        }
    618623       
    619         ipc_forward_fast(callid, dev->driver->phone, dev->handle,
    620             IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
     624        if (dev->forward_interface == 0) {
     625                /* The IPC_GET_ARG3(*icall) would be always zero,
     626                 * wouldn't it? So why to pass it at all?
     627                 */
     628                ipc_forward_fast(callid, dev->driver->phone,
     629                    dev->handle, 0, 0,
     630                    IPC_FF_NONE);
     631        } else {
     632                ipc_forward_fast(callid, dev->driver->phone,
     633                    dev->forward_interface, dev->handle, 0,
     634                    IPC_FF_NONE);
     635        }
    621636       
    622637        fibril_mutex_unlock(&devices_list_mutex);
Note: See TracChangeset for help on using the changeset viewer.