Subversion Repositories HelenOS

Compare Revisions

Ignore whitespace Rev 2634 → Rev 2635

/trunk/uspace/srv/devmap/devmap.h
41,7 → 41,6
typedef enum {
DEVMAP_DRIVER_REGISTER = IPC_FIRST_USER_METHOD,
DEVMAP_DRIVER_UNREGISTER,
DEVMAP_DEVICE_CONNECT_ME_TO,
DEVMAP_DEVICE_REGISTER,
DEVMAP_DEVICE_UNREGISTER,
DEVMAP_DEVICE_GET_NAME,
82,12 → 81,18
devmap_driver_t *driver;
} devmap_device_t;
 
/** Interface provided by DevMap.
*
/** Interface provided by devmap.
* Every process that connects to devmap must ask one of following
* interfaces otherwise connection will be refused.
*/
typedef enum {
DEVMAP_DRIVER = 1,
DEVMAP_CLIENT
/** Connect as device driver */
DEVMAP_DRIVER = 1,
/** Connect as client */
DEVMAP_CLIENT,
/** Create new connection to instance of device that
* is specified by second argument of call. */
DEVMAP_CONNECT_TO_DEVICE
} devmap_interface_t;
 
#endif
/trunk/uspace/srv/devmap/devmap.c
448,8 → 448,6
/** Connect client to the device.
* Find device driver owning requested device and forward
* the message to it.
*
*
*/
static void devmap_forward(ipc_callid_t callid, ipc_call_t *call)
{
459,7 → 457,7
/*
* Get handle from request
*/
handle = IPC_GET_ARG1(*call);
handle = IPC_GET_ARG2(*call);
dev = devmap_device_find_handle(handle);
 
if (NULL == dev) {
469,9 → 467,8
return;
}
 
/* FIXME: is this correct method how to pass argument on forwarding ?*/
ipc_forward_fast(callid, dev->driver->phone, (ipcarg_t)(dev->handle),
0, IPC_FF_NONE);
IPC_GET_ARG3(*call), 0, IPC_FF_NONE);
return;
}
 
669,13 → 666,6
cont = false;
continue; /* Exit thread */
 
case DEVMAP_DEVICE_CONNECT_ME_TO:
/* Connect client to selected device */
printf("DEVMAP: connect to device %d.\n",
IPC_GET_ARG1(call));
devmap_forward(callid, &call);
break;
 
case DEVMAP_DEVICE_GET_HANDLE:
devmap_get_handle(callid, &call);
 
709,6 → 699,12
case DEVMAP_CLIENT:
devmap_connection_client(iid, icall);
break;
case DEVMAP_CONNECT_TO_DEVICE:
/* Connect client to selected device */
printf("DEVMAP: connect to device %d.\n",
IPC_GET_ARG2(*icall));
devmap_forward(iid, icall);
break;
default:
ipc_answer_0(iid, ENOENT); /* No such interface */
printf("DEVMAP: Unknown interface %u.\n",