Files | |
| file | devmap.c |
Data Structures | |
| struct | dev_desc_t |
| struct | devmap_device_t |
| Info about registered device. More... | |
| struct | devmap_driver_t |
| Representation of device driver. More... | |
| struct | devmap_namespace_t |
| Info about registered namespaces. More... | |
Defines | |
| #define | DEVMAP_NAME_MAXLEN 255 |
| #define | NAME "devmap" |
| #define | NULL_DEVICES 256 |
Typedefs | |
| typedef sysarg_t | devmap_handle_t |
Enumerations | |
| enum | devmap_handle_type_t |
| enum | devmap_interface_t { DEVMAP_DRIVER = 1, DEVMAP_CLIENT, DEVMAP_CONNECT_TO_DEVICE } |
| Interface provided by devmap. More... | |
| enum | devmap_request_t |
Enumerator | |
| DEVMAP_CLIENT | |
| Connect as client. | |
| DEVMAP_CONNECT_TO_DEVICE | |
| Create new connection to instance of device that is specified by second argument of call. | |
Functions | |
| static void | devmap_connection (ipc_callid_t iid, ipc_call_t *icall) |
| Function for handling connections to devmap. | |
| static void | devmap_connection_client (ipc_callid_t iid, ipc_call_t *icall) |
| Handle connection with device client. | |
| static void | devmap_connection_driver (ipc_callid_t iid, ipc_call_t *icall) |
| Handle connection with device driver. | |
| static devmap_handle_t | devmap_create_handle (void) |
| static devmap_device_t * | devmap_device_find_handle (devmap_handle_t handle) |
| Find device with given handle. | |
| static devmap_device_t * | devmap_device_find_name (const char *ns_name, const char *name) |
| Find device with given name. | |
| static void | devmap_device_get_handle (ipc_callid_t iid, ipc_call_t *icall) |
| Find handle for device instance identified by name. | |
| static void | devmap_device_register (ipc_callid_t iid, ipc_call_t *icall, devmap_driver_t *driver) |
| Register instance of device. | |
| static int | devmap_device_unregister (ipc_callid_t iid, ipc_call_t *icall, devmap_driver_t *driver) |
| static void | devmap_device_unregister_core (devmap_device_t *device) |
| Unregister device and free it. | |
| static devmap_driver_t * | devmap_driver_register (void) |
| Read info about new driver and add it into linked list of registered drivers. | |
| static int | devmap_driver_unregister (devmap_driver_t *driver) |
| Unregister device driver, unregister all its devices and free driver structure. | |
| static void | devmap_forward (ipc_callid_t callid, ipc_call_t *call) |
| Connect client to the device. | |
| static bool | devmap_fqdn_split (const char *fqdn, char **ns_name, char **name) |
| Convert fully qualified device name to namespace and device name. | |
| static void | devmap_get_device_count (ipc_callid_t iid, ipc_call_t *icall) |
| static void | devmap_get_devices (ipc_callid_t iid, ipc_call_t *icall) |
| static void | devmap_get_namespace_count (ipc_callid_t iid, ipc_call_t *icall) |
| static void | devmap_get_namespaces (ipc_callid_t iid, ipc_call_t *icall) |
| static void | devmap_handle_probe (ipc_callid_t iid, ipc_call_t *icall) |
| static bool | devmap_init (void) |
| Initialize device mapper. | |
| static void | devmap_namespace_addref (devmap_namespace_t *namespace, devmap_device_t *device) |
| Increase namespace reference count by including device. | |
| static devmap_namespace_t * | devmap_namespace_create (const char *ns_name) |
| Create a namespace (if not already present). | |
| static void | devmap_namespace_delref (devmap_namespace_t *namespace) |
| Decrease namespace reference count. | |
| static void | devmap_namespace_destroy (devmap_namespace_t *namespace) |
| Destroy a namespace (if it is no longer needed). | |
| static devmap_namespace_t * | devmap_namespace_find_handle (devmap_handle_t handle) |
| Find namespace with given handle. | |
| static devmap_namespace_t * | devmap_namespace_find_name (const char *name) |
| Find namespace with given name. | |
| static void | devmap_namespace_get_handle (ipc_callid_t iid, ipc_call_t *icall) |
| Find handle for namespace identified by name. | |
| static void | devmap_null_create (ipc_callid_t iid, ipc_call_t *icall) |
| static void | devmap_null_destroy (ipc_callid_t iid, ipc_call_t *icall) |
| int | main (int argc, char *argv[]) |
| Main entry point. | |
Variables | |
| static devmap_handle_t | last_handle = 0 |
| char | dev_desc_t::name [DEVMAP_NAME_MAXLEN+1] |
| static devmap_device_t * | null_devices [NULL_DEVICES] |
| enum devmap_interface_t |
Interface provided by devmap.
Every process that connects to devmap must ask one of following interfaces otherwise connection will be refused.
| DEVMAP_CLIENT |
Connect as client.
| DEVMAP_CONNECT_TO_DEVICE |
Create new connection to instance of device that is specified by second argument of call.
| static devmap_device_t* devmap_device_find_handle | ( | devmap_handle_t | handle | ) | [static] |
| static void devmap_device_get_handle | ( | ipc_callid_t | iid, | |
| ipc_call_t * | icall | |||
| ) | [static] |
| static void devmap_forward | ( | ipc_callid_t | callid, | |
| ipc_call_t * | call | |||
| ) | [static] |
| static bool devmap_fqdn_split | ( | const char * | fqdn, | |
| char ** | ns_name, | |||
| char ** | name | |||
| ) | [static] |
Convert fully qualified device name to namespace and device name.
A fully qualified device name can be either a plain device name (then the namespace is considered to be an empty string) or consist of two components separated by a slash. No more than one slash is allowed.
| static devmap_namespace_t* devmap_namespace_find_handle | ( | devmap_handle_t | handle | ) | [static] |
| static void devmap_namespace_get_handle | ( | ipc_callid_t | iid, | |
| ipc_call_t * | icall | |||
| ) | [static] |
| int main | ( | int | argc, | |
| char * | argv[] | |||
| ) |
1.4.7