Device mapper.

HelenOS device mapper. More...

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_tdevmap_device_find_handle (devmap_handle_t handle)
 Find device with given handle.
static devmap_device_tdevmap_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_tdevmap_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_tdevmap_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_tdevmap_namespace_find_handle (devmap_handle_t handle)
 Find namespace with given handle.
static devmap_namespace_tdevmap_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_tnull_devices [NULL_DEVICES]

Detailed Description

HelenOS device mapper.


Enumeration Type Documentation

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.

Enumerator:
DEVMAP_DRIVER  Connect as device driver.
DEVMAP_CLIENT  Connect as client.
DEVMAP_CONNECT_TO_DEVICE  Create new connection to instance of device that is specified by second argument of call.

Definition at line 70 of file devmap.h.


Enumerator Documentation

DEVMAP_CLIENT

Connect as client.

DEVMAP_CONNECT_TO_DEVICE

Create new connection to instance of device that is specified by second argument of call.


Function Documentation

static devmap_device_t* devmap_device_find_handle ( devmap_handle_t  handle  )  [static]

Find device with given handle.

Definition at line 279 of file devmap.c.

static void devmap_device_get_handle ( ipc_callid_t  iid,
ipc_call_t icall 
) [static]

Find handle for device instance identified by name.

In answer will be send EOK and device handle in arg1 or a error code from errno.h.

Definition at line 634 of file devmap.c.

static void devmap_forward ( ipc_callid_t  callid,
ipc_call_t call 
) [static]

Connect client to the device.

Find device driver owning requested device and forward the message to it.

Definition at line 599 of file devmap.c.

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.

Definition at line 153 of file devmap.c.

static devmap_namespace_t* devmap_namespace_find_handle ( devmap_handle_t  handle  )  [static]

Find namespace with given handle.

Definition at line 239 of file devmap.c.

static void devmap_namespace_get_handle ( ipc_callid_t  iid,
ipc_call_t icall 
) [static]

Find handle for namespace identified by name.

In answer will be send EOK and device handle in arg1 or a error code from errno.h.

Definition at line 697 of file devmap.c.

int main ( int  argc,
char *  argv[] 
)

Main entry point.

Parameters:
[in] argc Nmber of arguments in argv vector (ignored).
[in] argv Cmdline argument vector (ignored).
Returns:
Error code.
Driver debug level is set here.

Definition at line 1150 of file devmap.c.


Generated on Thu Jun 2 07:45:56 2011 for HelenOS/USB by  doxygen 1.4.7