Changeset 08d9525a in mainline
- Timestamp:
- 2010-05-12T10:22:22Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f4ef3c2
- Parents:
- f031713
- Location:
- uspace/lib
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/libc/include/ipc/dev_iface.h
rf031713 r08d9525a 46 46 47 47 #define DEV_IFACE_COUNT DEV_IFACE_MAX 48 #define DEV_FIRST_CUSTOM_METHOD DEV_IFACE_MAX 48 49 49 50 -
uspace/lib/libdrv/generic/driver.c
rf031713 r08d9525a 253 253 254 254 if (!is_valid_iface_idx(iface_idx)) { 255 // this is not device's interface 255 remote_handler_t *default_handler; 256 if (NULL != (default_handler = device_get_default_handler(dev))) { 257 (*default_handler)(dev, callid, &call); 258 break; 259 } 260 // this is not device's interface and the default handler is not provided 256 261 printf("%s: driver_connection_gen error - invalid interface id %d.", driver->name, iface_idx); 257 262 ipc_answer_0(callid, ENOTSUP); -
uspace/lib/libdrv/include/driver.h
rf031713 r08d9525a 56 56 typedef void remote_iface_func_t(device_t*, void *, ipc_callid_t, ipc_call_t *); 57 57 typedef remote_iface_func_t *remote_iface_func_ptr_t; 58 typedef void remote_handler_t(device_t*, ipc_callid_t, ipc_call_t *); 58 59 59 60 typedef struct { … … 86 87 /** Optional callback function called when a client is disconnecting from the device. */ 87 88 void (*close)(device_t *dev); 88 /** The table of interfaces implemented by the device. */89 /** The table of standard interfaces implemented by the device. */ 89 90 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; 90 94 } device_class_t; 91 95 … … 270 274 int unregister_interrupt_handler(device_t *dev, int irq); 271 275 276 277 // default handler for client requests 278 279 static 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 272 288 #endif 273 289
Note:
See TracChangeset
for help on using the changeset viewer.