Changeset 08d9525a in mainline for uspace/lib/libdrv/include/driver.h


Ignore:
Timestamp:
2010-05-12T10:22:22Z (14 years ago)
Author:
Lenka Trochtova <trochtova.lenka@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
f4ef3c2
Parents:
f031713
Message:

add default handler for client requests which do not use any of the standard interfaces

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/libdrv/include/driver.h

    rf031713 r08d9525a  
    5656typedef void remote_iface_func_t(device_t*, void *, ipc_callid_t, ipc_call_t *);
    5757typedef remote_iface_func_t *remote_iface_func_ptr_t;
     58typedef void remote_handler_t(device_t*, ipc_callid_t, ipc_call_t *);
    5859
    5960typedef struct {
     
    8687        /** Optional callback function called when a client is disconnecting from the device. */
    8788        void (*close)(device_t *dev);
    88         /** The table of interfaces implemented by the device. */
     89        /** The table of standard interfaces implemented by the device. */
    8990        void *interfaces[DEV_IFACE_COUNT];     
     91        /** The default handler of remote client requests. If the client's remote request cannot be handled
     92         * by any of the standard interfaces, the default handler is used.*/
     93        remote_handler_t *default_handler;
    9094} device_class_t;
    9195
     
    270274int unregister_interrupt_handler(device_t *dev, int irq);
    271275
     276
     277// default handler for client requests
     278
     279static inline remote_handler_t * device_get_default_handler(device_t *dev)
     280{
     281        if (NULL == dev->class) {
     282                return NULL;
     283        }
     284       
     285        return dev->class->default_handler;     
     286}
     287
    272288#endif
    273289
Note: See TracChangeset for help on using the changeset viewer.