1 | interface devmap_driver {
|
---|
2 | /* Establish connection (iface is DEVMAP_DRIVER) */
|
---|
3 | ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface);
|
---|
4 |
|
---|
5 | /* Register as a new driver */
|
---|
6 | ipcarg_t driver_register(in_copy string name);
|
---|
7 |
|
---|
8 | /* Unregister all devices and the driver itself */
|
---|
9 | ipcarg_t driver_unregister(void);
|
---|
10 |
|
---|
11 | /* Register new device and return handle */
|
---|
12 | ipcarg_t device_register(in_copy string name, out ipcarg_t handle);
|
---|
13 |
|
---|
14 | /* Unregister device */
|
---|
15 | ipcarg_t device_unregister(in ipcarg_t handle);
|
---|
16 |
|
---|
17 | /* Resolve device name to handle */
|
---|
18 | ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
|
---|
19 |
|
---|
20 | /* Get device name for a given handle */
|
---|
21 | ipcarg_t device_get_name(in ipcarg_t handle);
|
---|
22 |
|
---|
23 | /* Close connection */
|
---|
24 | ipcarg_t ipc_m_phone_hungup(void);
|
---|
25 | protocol:
|
---|
26 | [devmap_driver.bp]
|
---|
27 | };
|
---|
28 |
|
---|
29 | interface devmap_client {
|
---|
30 | /* Establish connection (iface is DEVMAP_CLIENT) or forward to device (iface is DEVMAP_CONNECT_TO_DEVICE) */
|
---|
31 | ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface, in ipcarg_t handle);
|
---|
32 |
|
---|
33 | /* Resolve device name to handle */
|
---|
34 | ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
|
---|
35 |
|
---|
36 | /* Get device name for a given handle */
|
---|
37 | ipcarg_t device_get_name(in ipcarg_t handle);
|
---|
38 |
|
---|
39 | /* Clone NULL device */
|
---|
40 | ipcarg_t device_null_create(out ipcarg_t index);
|
---|
41 |
|
---|
42 | /* Destroy NULL device */
|
---|
43 | ipcarg_t device_null_destroy(in ipcarg_t index);
|
---|
44 |
|
---|
45 | /* Get number of devices */
|
---|
46 | ipcarg_t device_get_count(out ipcarg_t count);
|
---|
47 |
|
---|
48 | /* Get an array of (device_name, handle) pairs */
|
---|
49 | ipcarg_t device_get_devices(out_copy stream data);
|
---|
50 |
|
---|
51 | /* Close connection */
|
---|
52 | ipcarg_t ipc_m_phone_hungup(void);
|
---|
53 | protocol:
|
---|
54 | [devmap_client.bp]
|
---|
55 |
|
---|
56 | };
|
---|
57 |
|
---|
58 | frame devmap {
|
---|
59 | provides:
|
---|
60 | devmap_driver devmap_driver;
|
---|
61 | devmap_client devmap_client;
|
---|
62 | requires:
|
---|
63 | [/uspace/lib/libc/requires]
|
---|
64 | ns ns;
|
---|
65 | protocol:
|
---|
66 | [/uspace/lib/libc/protocol] |
|
---|
67 | [devmap_server.bp]
|
---|
68 | };
|
---|