Index: uspace/drv/isa/isa.c
===================================================================
--- uspace/drv/isa/isa.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/isa/isa.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -58,24 +58,24 @@
 
 #define NAME "isa"
-#define CHILD_DEV_CONF_PATH "/drv/isa/isa.dev"
+#define CHILD_FUN_CONF_PATH "/drv/isa/isa.dev"
 
 #define ISA_MAX_HW_RES 4
 
-typedef struct isa_child_data {
+typedef struct isa_fun_data {
 	hw_resource_list_t hw_resources;
-} isa_child_data_t;
-
-static hw_resource_list_t *isa_get_child_resources(device_t *dev)
-{
-	isa_child_data_t *dev_data;
-
-	dev_data = (isa_child_data_t *)dev->driver_data;
-	if (dev_data == NULL)
+} isa_fun_data_t;
+
+static hw_resource_list_t *isa_get_fun_resources(function_t *fun)
+{
+	isa_fun_data_t *fun_data;
+
+	fun_data = (isa_fun_data_t *)fun->driver_data;
+	if (fun_data == NULL)
 		return NULL;
 
-	return &dev_data->hw_resources;
-}
-
-static bool isa_enable_child_interrupt(device_t *dev)
+	return &fun_data->hw_resources;
+}
+
+static bool isa_enable_fun_interrupt(function_t *fun)
 {
 	// TODO
@@ -84,10 +84,10 @@
 }
 
-static hw_res_ops_t isa_child_hw_res_ops = {
-	&isa_get_child_resources,
-	&isa_enable_child_interrupt
+static hw_res_ops_t isa_fun_hw_res_ops = {
+	&isa_get_fun_resources,
+	&isa_enable_fun_interrupt
 };
 
-static device_ops_t isa_child_dev_ops;
+static device_ops_t isa_fun_dev_ops;
 
 static int isa_add_device(device_t *dev);
@@ -105,32 +105,32 @@
 
 
-static isa_child_data_t *create_isa_child_data() 
-{
-	isa_child_data_t *data;
-
-	data = (isa_child_data_t *) malloc(sizeof(isa_child_data_t));
+static isa_fun_data_t *create_isa_fun_data() 
+{
+	isa_fun_data_t *data;
+
+	data = (isa_fun_data_t *) malloc(sizeof(isa_fun_data_t));
 	if (data != NULL)
-		memset(data, 0, sizeof(isa_child_data_t));
+		memset(data, 0, sizeof(isa_fun_data_t));
 
 	return data;
 }
 
-static device_t *create_isa_child_dev()
-{
-	device_t *dev = create_device();
-	if (dev == NULL)
+static function_t *create_isa_fun()
+{
+	function_t *fun = create_function();
+	if (fun == NULL)
 		return NULL;
 
-	isa_child_data_t *data = create_isa_child_data();
+	isa_fun_data_t *data = create_isa_fun_data();
 	if (data == NULL) {
-		delete_device(dev);
+		delete_function(fun);
 		return NULL;
 	}
 
-	dev->driver_data = data;
-	return dev;
-}
-
-static char *read_dev_conf(const char *conf_path)
+	fun->driver_data = data;
+	return fun;
+}
+
+static char *read_fun_conf(const char *conf_path)
 {
 	bool suc = false;
@@ -151,5 +151,5 @@
 	lseek(fd, 0, SEEK_SET);	
 	if (len == 0) {
-		printf(NAME ": read_dev_conf error: configuration file '%s' "
+		printf(NAME ": read_fun_conf error: configuration file '%s' "
 		    "is empty.\n", conf_path);
 		goto cleanup;
@@ -158,10 +158,10 @@
 	buf = malloc(len + 1);
 	if (buf == NULL) {
-		printf(NAME ": read_dev_conf error: memory allocation failed.\n");
+		printf(NAME ": read_fun_conf error: memory allocation failed.\n");
 		goto cleanup;
 	}
 
 	if (0 >= read(fd, buf, len)) {
-		printf(NAME ": read_dev_conf error: unable to read file '%s'.\n",
+		printf(NAME ": read_fun_conf error: unable to read file '%s'.\n",
 		    conf_path);
 		goto cleanup;
@@ -249,7 +249,7 @@
 }
 
-static void isa_child_set_irq(device_t *dev, int irq)
-{
-	isa_child_data_t *data = (isa_child_data_t *)dev->driver_data;
+static void isa_fun_set_irq(function_t *fun, int irq)
+{
+	isa_fun_data_t *data = (isa_fun_data_t *)fun->driver_data;
 
 	size_t count = data->hw_resources.count;
@@ -262,11 +262,11 @@
 		data->hw_resources.count++;
 
-		printf(NAME ": added irq 0x%x to device %s\n", irq, dev->name);
-	}
-}
-
-static void isa_child_set_io_range(device_t *dev, size_t addr, size_t len)
-{
-	isa_child_data_t *data = (isa_child_data_t *)dev->driver_data;
+		printf(NAME ": added irq 0x%x to function %s\n", irq, fun->name);
+	}
+}
+
+static void isa_fun_set_io_range(function_t *fun, size_t addr, size_t len)
+{
+	isa_fun_data_t *data = (isa_fun_data_t *)fun->driver_data;
 
 	size_t count = data->hw_resources.count;
@@ -282,27 +282,27 @@
 
 		printf(NAME ": added io range (addr=0x%x, size=0x%x) to "
-		    "device %s\n", (unsigned int) addr, (unsigned int) len,
-		    dev->name);
-	}
-}
-
-static void get_dev_irq(device_t *dev, char *val)
+		    "function %s\n", (unsigned int) addr, (unsigned int) len,
+		    fun->name);
+	}
+}
+
+static void get_dev_irq(function_t *fun, char *val)
 {
 	int irq = 0;
 	char *end = NULL;
 
-	val = skip_spaces(val);	
+	val = skip_spaces(val);
 	irq = (int)strtol(val, &end, 0x10);
 
 	if (val != end)
-		isa_child_set_irq(dev, irq);
-}
-
-static void get_dev_io_range(device_t *dev, char *val)
+		isa_fun_set_irq(fun, irq);
+}
+
+static void get_dev_io_range(function_t *fun, char *val)
 {
 	size_t addr, len;
 	char *end = NULL;
 
-	val = skip_spaces(val);	
+	val = skip_spaces(val);
 	addr = strtol(val, &end, 0x10);
 
@@ -310,5 +310,5 @@
 		return;
 
-	val = skip_spaces(end);	
+	val = skip_spaces(end);
 	len = strtol(val, &end, 0x10);
 
@@ -316,5 +316,5 @@
 		return;
 
-	isa_child_set_io_range(dev, addr, len);
+	isa_fun_set_io_range(fun, addr, len);
 }
 
@@ -331,5 +331,5 @@
 }
 
-static void get_dev_match_id(device_t *dev, char *val)
+static void get_fun_match_id(function_t *fun, char *val)
 {
 	char *id = NULL;
@@ -342,5 +342,5 @@
 	if (val == end) {
 		printf(NAME " : error - could not read match score for "
-		    "device %s.\n", dev->name);
+		    "function %s.\n", fun->name);
 		return;
 	}
@@ -348,6 +348,6 @@
 	match_id_t *match_id = create_match_id();
 	if (match_id == NULL) {
-		printf(NAME " : failed to allocate match id for device %s.\n",
-		    dev->name);
+		printf(NAME " : failed to allocate match id for function %s.\n",
+		    fun->name);
 		return;
 	}
@@ -357,5 +357,5 @@
 	if (id == NULL) {
 		printf(NAME " : error - could not read match id for "
-		    "device %s.\n", dev->name);
+		    "function %s.\n", fun->name);
 		delete_match_id(match_id);
 		return;
@@ -365,11 +365,11 @@
 	match_id->score = score;
 
-	printf(NAME ": adding match id '%s' with score %d to device %s\n", id,
-	    score, dev->name);
-	add_match_id(&dev->match_ids, match_id);
-}
-
-static bool read_dev_prop(device_t *dev, char *line, const char *prop,
-    void (*read_fn)(device_t *, char *))
+	printf(NAME ": adding match id '%s' with score %d to function %s\n", id,
+	    score, fun->name);
+	add_match_id(&fun->match_ids, match_id);
+}
+
+static bool read_fun_prop(function_t *fun, char *line, const char *prop,
+    void (*read_fn)(function_t *, char *))
 {
 	size_t proplen = str_size(prop);
@@ -378,5 +378,5 @@
 		line += proplen;
 		line = skip_spaces(line);
-		(*read_fn)(dev, line);
+		(*read_fn)(fun, line);
 
 		return true;
@@ -386,12 +386,12 @@
 }
 
-static void get_dev_prop(device_t *dev, char *line)
+static void get_fun_prop(function_t *fun, char *line)
 {
 	/* Skip leading spaces. */
 	line = skip_spaces(line);
 
-	if (!read_dev_prop(dev, line, "io_range", &get_dev_io_range) &&
-	    !read_dev_prop(dev, line, "irq", &get_dev_irq) &&
-	    !read_dev_prop(dev, line, "match", &get_dev_match_id))
+	if (!read_fun_prop(fun, line, "io_range", &get_dev_io_range) &&
+	    !read_fun_prop(fun, line, "irq", &get_dev_irq) &&
+	    !read_fun_prop(fun, line, "match", &get_fun_match_id))
 	{
 	    printf(NAME " error undefined device property at line '%s'\n",
@@ -400,19 +400,19 @@
 }
 
-static void child_alloc_hw_res(device_t *dev)
-{
-	isa_child_data_t *data = (isa_child_data_t *)dev->driver_data;
+static void child_alloc_hw_res(function_t *fun)
+{
+	isa_fun_data_t *data = (isa_fun_data_t *)fun->driver_data;
 	data->hw_resources.resources = 
 	    (hw_resource_t *)malloc(sizeof(hw_resource_t) * ISA_MAX_HW_RES);
 }
 
-static char *read_isa_dev_info(char *dev_conf, device_t *parent)
+static char *read_isa_fun_info(char *fun_conf, device_t *dev)
 {
 	char *line;
-	char *dev_name = NULL;
+	char *fun_name = NULL;
 
 	/* Skip empty lines. */
 	while (true) {
-		line = str_get_line(dev_conf, &dev_conf);
+		line = str_get_line(fun_conf, &fun_conf);
 
 		if (line == NULL) {
@@ -426,22 +426,23 @@
 
 	/* Get device name. */
-	dev_name = get_device_name(line);
-	if (dev_name == NULL)
+	fun_name = get_device_name(line);
+	if (fun_name == NULL)
 		return NULL;
 
-	device_t *dev = create_isa_child_dev();
-	if (dev == NULL) {
-		free(dev_name);
+	function_t *fun = create_isa_fun();
+	if (fun == NULL) {
+		free(fun_name);
 		return NULL;
 	}
 
-	dev->name = dev_name;
+	fun->name = fun_name;
+	fun->ftype = fun_inner;
 
 	/* Allocate buffer for the list of hardware resources of the device. */
-	child_alloc_hw_res(dev);
+	child_alloc_hw_res(fun);
 
 	/* Get properties of the device (match ids, irq and io range). */
 	while (true) {
-		line = str_get_line(dev_conf, &dev_conf);
+		line = str_get_line(fun_conf, &fun_conf);
 
 		if (line_empty(line)) {
@@ -454,35 +455,35 @@
 		 * and store it in the device structure.
 		 */
-		get_dev_prop(dev, line);
-
-		//printf(NAME ": next line ='%s'\n", dev_conf);
+		get_fun_prop(fun, line);
+
+		//printf(NAME ": next line ='%s'\n", fun_conf);
 		//printf(NAME ": current line ='%s'\n", line);
 	}
 
 	/* Set device operations to the device. */
-	dev->ops = &isa_child_dev_ops;
-
-	printf(NAME ": child_device_register(dev, parent); device is %s.\n",
-	    dev->name);
-	child_device_register(dev, parent);
-
-	return dev_conf;
-}
-
-static void parse_dev_conf(char *conf, device_t *parent)
+	fun->ops = &isa_fun_dev_ops;
+
+	printf(NAME ": register_function(fun, dev); function is %s.\n",
+	    fun->name);
+	register_function(fun, dev);
+
+	return fun_conf;
+}
+
+static void parse_fun_conf(char *conf, device_t *dev)
 {
 	while (conf != NULL && *conf != '\0') {
-		conf = read_isa_dev_info(conf, parent);
-	}
-}
-
-static void add_legacy_children(device_t *parent)
-{
-	char *dev_conf;
-
-	dev_conf = read_dev_conf(CHILD_DEV_CONF_PATH);
-	if (dev_conf != NULL) {
-		parse_dev_conf(dev_conf, parent);
-		free(dev_conf);
+		conf = read_isa_fun_info(conf, dev);
+	}
+}
+
+static void add_legacy_children(device_t *dev)
+{
+	char *fun_conf;
+
+	fun_conf = read_fun_conf(CHILD_FUN_CONF_PATH);
+	if (fun_conf != NULL) {
+		parse_fun_conf(fun_conf, dev);
+		free(fun_conf);
 	}
 }
@@ -492,4 +493,12 @@
 	printf(NAME ": isa_add_device, device handle = %d\n",
 	    (int) dev->handle);
+
+	/* Make the bus device more visible. Does not do anything. */
+	printf(NAME ": adding a 'ctl' function\n");
+
+	function_t *ctl = create_function();
+	ctl->ftype = fun_exposed;
+	ctl->name = "ctl";
+	register_function(ctl, dev);
 
 	/* Add child devices. */
@@ -502,5 +511,5 @@
 static void isa_init() 
 {
-	isa_child_dev_ops.interfaces[HW_RES_DEV_IFACE] = &isa_child_hw_res_ops;
+	isa_fun_dev_ops.interfaces[HW_RES_DEV_IFACE] = &isa_fun_hw_res_ops;
 }
 
Index: uspace/drv/ns8250/ns8250.c
===================================================================
--- uspace/drv/ns8250/ns8250.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/ns8250/ns8250.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -1,3 +1,3 @@
-/*
+/*                        
  * Copyright (c) 2010 Lenka Trochtova
  * All rights reserved.
@@ -178,8 +178,8 @@
  *			error number otherwise.
  */
-static int ns8250_read(device_t *dev, char *buf, size_t count)
+static int ns8250_read(function_t *fun, char *buf, size_t count)
 {
 	int ret = EOK;
-	ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;
+	ns8250_dev_data_t *data = (ns8250_dev_data_t *) fun->dev->driver_data;
 	
 	fibril_mutex_lock(&data->mutex);
@@ -212,7 +212,7 @@
  * @return		Zero on success.
  */
-static int ns8250_write(device_t *dev, char *buf, size_t count) 
-{
-	ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;
+static int ns8250_write(function_t *fun, char *buf, size_t count)
+{
+	ns8250_dev_data_t *data = (ns8250_dev_data_t *) fun->dev->driver_data;
 	size_t idx;
 	
@@ -719,4 +719,6 @@
 static int ns8250_add_device(device_t *dev)
 {
+	function_t *fun;
+
 	printf(NAME ": ns8250_add_device %s (handle = %d)\n",
 	    dev->name, (int) dev->handle);
@@ -756,9 +758,14 @@
 		return res;
 	}
+
+	fun = create_function();
+	fun->ftype = fun_exposed;
+	fun->name = "a";
 	
 	/* Set device operations. */
-	dev->ops = &ns8250_dev_ops;
-	
-	add_device_to_class(dev, "serial");
+	fun->ops = &ns8250_dev_ops;
+	register_function(fun, dev);
+	
+	add_function_to_class(fun, "serial");
 	
 	printf(NAME ": the %s device has been successfully initialized.\n",
@@ -775,7 +782,7 @@
  * @param dev		The device.
  */
-static int ns8250_open(device_t *dev)
-{
-	ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;
+static int ns8250_open(function_t *fun)
+{
+	ns8250_dev_data_t *data = (ns8250_dev_data_t *) fun->dev->driver_data;
 	int res;
 	
@@ -799,7 +806,7 @@
  * @param dev		The device.
  */
-static void ns8250_close(device_t *dev)
-{
-	ns8250_dev_data_t *data = (ns8250_dev_data_t *) dev->driver_data;
+static void ns8250_close(function_t *fun)
+{
+	ns8250_dev_data_t *data = (ns8250_dev_data_t *) fun->dev->driver_data;
 	
 	fibril_mutex_lock(&data->mutex);
@@ -877,5 +884,5 @@
  * Configure the parameters of the serial communication.
  */
-static void ns8250_default_handler(device_t *dev, ipc_callid_t callid,
+static void ns8250_default_handler(function_t *fun, ipc_callid_t callid,
     ipc_call_t *call)
 {
@@ -886,5 +893,5 @@
 	switch (method) {
 	case SERIAL_GET_COM_PROPS:
-		ns8250_get_props(dev, &baud_rate, &parity, &word_length,
+		ns8250_get_props(fun->dev, &baud_rate, &parity, &word_length,
 		    &stop_bits);
 		async_answer_4(callid, EOK, baud_rate, parity, word_length,
@@ -897,5 +904,5 @@
 		word_length = IPC_GET_ARG3(*call);
 		stop_bits = IPC_GET_ARG4(*call);
-		ret = ns8250_set_props(dev, baud_rate, parity, word_length,
+		ret = ns8250_set_props(fun->dev, baud_rate, parity, word_length,
 		    stop_bits);
 		async_answer_0(callid, ret);
Index: uspace/drv/pciintel/pci.c
===================================================================
--- uspace/drv/pciintel/pci.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/pciintel/pci.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -61,14 +61,14 @@
 	((1 << 31) | (bus << 16) | (dev << 11) | (fn << 8) | (reg & ~3))
 
-static hw_resource_list_t *pciintel_get_child_resources(device_t *dev)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	
-	if (dev_data == NULL)
+static hw_resource_list_t *pciintel_get_child_resources(function_t *fun)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	
+	if (fun_data == NULL)
 		return NULL;
-	return &dev_data->hw_resources;
-}
-
-static bool pciintel_enable_child_interrupt(device_t *dev)
+	return &fun_data->hw_resources;
+}
+
+static bool pciintel_enable_child_interrupt(function_t *fun)
 {
 	/* TODO */
@@ -122,15 +122,15 @@
 }
 
-static void pci_conf_read(device_t *dev, int reg, uint8_t *buf, size_t len)
-{
-	assert(dev->parent != NULL);
-	
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	pci_bus_data_t *bus_data = (pci_bus_data_t *) dev->parent->driver_data;
+static void pci_conf_read(function_t *fun, int reg, uint8_t *buf, size_t len)
+{
+	assert(fun->dev != NULL);
+	
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	pci_bus_data_t *bus_data = (pci_bus_data_t *) fun->dev->driver_data;
 	
 	fibril_mutex_lock(&bus_data->conf_mutex);
 	
 	uint32_t conf_addr;
-	conf_addr = CONF_ADDR(dev_data->bus, dev_data->dev, dev_data->fn, reg);
+	conf_addr = CONF_ADDR(fun_data->bus, fun_data->dev, fun_data->fn, reg);
 	void *addr = bus_data->conf_data_port + (reg & 3);
 	
@@ -152,15 +152,15 @@
 }
 
-static void pci_conf_write(device_t *dev, int reg, uint8_t *buf, size_t len)
-{
-	assert(dev->parent != NULL);
-	
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	pci_bus_data_t *bus_data = (pci_bus_data_t *) dev->parent->driver_data;
+static void pci_conf_write(function_t *fun, int reg, uint8_t *buf, size_t len)
+{
+	assert(fun->dev != NULL);
+	
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	pci_bus_data_t *bus_data = (pci_bus_data_t *) fun->dev->driver_data;
 	
 	fibril_mutex_lock(&bus_data->conf_mutex);
 	
 	uint32_t conf_addr;
-	conf_addr = CONF_ADDR(dev_data->bus, dev_data->dev, dev_data->fn, reg);
+	conf_addr = CONF_ADDR(fun_data->bus, fun_data->dev, fun_data->fn, reg);
 	void *addr = bus_data->conf_data_port + (reg & 3);
 	
@@ -182,43 +182,43 @@
 }
 
-uint8_t pci_conf_read_8(device_t *dev, int reg)
+uint8_t pci_conf_read_8(function_t *fun, int reg)
 {
 	uint8_t res;
-	pci_conf_read(dev, reg, &res, 1);
+	pci_conf_read(fun, reg, &res, 1);
 	return res;
 }
 
-uint16_t pci_conf_read_16(device_t *dev, int reg)
+uint16_t pci_conf_read_16(function_t *fun, int reg)
 {
 	uint16_t res;
-	pci_conf_read(dev, reg, (uint8_t *) &res, 2);
+	pci_conf_read(fun, reg, (uint8_t *) &res, 2);
 	return res;
 }
 
-uint32_t pci_conf_read_32(device_t *dev, int reg)
+uint32_t pci_conf_read_32(function_t *fun, int reg)
 {
 	uint32_t res;
-	pci_conf_read(dev, reg, (uint8_t *) &res, 4);
+	pci_conf_read(fun, reg, (uint8_t *) &res, 4);
 	return res;
 }
 
-void pci_conf_write_8(device_t *dev, int reg, uint8_t val)
-{
-	pci_conf_write(dev, reg, (uint8_t *) &val, 1);
-}
-
-void pci_conf_write_16(device_t *dev, int reg, uint16_t val)
-{
-	pci_conf_write(dev, reg, (uint8_t *) &val, 2);
-}
-
-void pci_conf_write_32(device_t *dev, int reg, uint32_t val)
-{
-	pci_conf_write(dev, reg, (uint8_t *) &val, 4);
-}
-
-void create_pci_match_ids(device_t *dev)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
+void pci_conf_write_8(function_t *fun, int reg, uint8_t val)
+{
+	pci_conf_write(fun, reg, (uint8_t *) &val, 1);
+}
+
+void pci_conf_write_16(function_t *fun, int reg, uint16_t val)
+{
+	pci_conf_write(fun, reg, (uint8_t *) &val, 2);
+}
+
+void pci_conf_write_32(function_t *fun, int reg, uint32_t val)
+{
+	pci_conf_write(fun, reg, (uint8_t *) &val, 4);
+}
+
+void create_pci_match_ids(function_t *fun)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
 	match_id_t *match_id = NULL;
 	char *match_id_str;
@@ -227,8 +227,8 @@
 	if (match_id != NULL) {
 		asprintf(&match_id_str, "pci/ven=%04x&dev=%04x",
-		    dev_data->vendor_id, dev_data->device_id);
+		    fun_data->vendor_id, fun_data->device_id);
 		match_id->id = match_id_str;
 		match_id->score = 90;
-		add_match_id(&dev->match_ids, match_id);
+		add_match_id(&fun->match_ids, match_id);
 	}
 
@@ -237,8 +237,8 @@
 
 void
-pci_add_range(device_t *dev, uint64_t range_addr, size_t range_size, bool io)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	hw_resource_list_t *hw_res_list = &dev_data->hw_resources;
+pci_add_range(function_t *fun, uint64_t range_addr, size_t range_size, bool io)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	hw_resource_list_t *hw_res_list = &fun_data->hw_resources;
 	hw_resource_t *hw_resources =  hw_res_list->resources;
 	size_t count = hw_res_list->count;
@@ -270,5 +270,5 @@
  * @return	The addr the address of the BAR which should be read next.
  */
-int pci_read_bar(device_t *dev, int addr)
+int pci_read_bar(function_t *fun, int addr)
 {	
 	/* Value of the BAR */
@@ -285,5 +285,5 @@
 	
 	/* Get the value of the BAR. */
-	val = pci_conf_read_32(dev, addr);
+	val = pci_conf_read_32(fun, addr);
 	
 	io = (bool) (val & 1);
@@ -305,15 +305,15 @@
 	
 	/* Get the address mask. */
-	pci_conf_write_32(dev, addr, 0xffffffff);
-	mask = pci_conf_read_32(dev, addr);
+	pci_conf_write_32(fun, addr, 0xffffffff);
+	mask = pci_conf_read_32(fun, addr);
 	
 	/* Restore the original value. */
-	pci_conf_write_32(dev, addr, val);
-	val = pci_conf_read_32(dev, addr);
+	pci_conf_write_32(fun, addr, val);
+	val = pci_conf_read_32(fun, addr);
 	
 	range_size = pci_bar_mask_to_size(mask);
 	
 	if (addrw64) {
-		range_addr = ((uint64_t)pci_conf_read_32(dev, addr + 4) << 32) |
+		range_addr = ((uint64_t)pci_conf_read_32(fun, addr + 4) << 32) |
 		    (val & 0xfffffff0);
 	} else {
@@ -322,10 +322,10 @@
 	
 	if (range_addr != 0) {
-		printf(NAME ": device %s : ", dev->name);
+		printf(NAME ": function %s : ", fun->name);
 		printf("address = %" PRIx64, range_addr);
 		printf(", size = %x\n", (unsigned int) range_size);
 	}
 	
-	pci_add_range(dev, range_addr, range_size, io);
+	pci_add_range(fun, range_addr, range_size, io);
 	
 	if (addrw64)
@@ -335,8 +335,8 @@
 }
 
-void pci_add_interrupt(device_t *dev, int irq)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	hw_resource_list_t *hw_res_list = &dev_data->hw_resources;
+void pci_add_interrupt(function_t *fun, int irq)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	hw_resource_list_t *hw_res_list = &fun_data->hw_resources;
 	hw_resource_t *hw_resources = hw_res_list->resources;
 	size_t count = hw_res_list->count;
@@ -350,40 +350,42 @@
 	hw_res_list->count++;
 	
-	printf(NAME ": device %s uses irq %x.\n", dev->name, irq);
-}
-
-void pci_read_interrupt(device_t *dev)
-{
-	uint8_t irq = pci_conf_read_8(dev, PCI_BRIDGE_INT_LINE);
+	printf(NAME ": function %s uses irq %x.\n", fun->name, irq);
+}
+
+void pci_read_interrupt(function_t *fun)
+{
+	uint8_t irq = pci_conf_read_8(fun, PCI_BRIDGE_INT_LINE);
 	if (irq != 0xff)
-		pci_add_interrupt(dev, irq);
+		pci_add_interrupt(fun, irq);
 }
 
 /** Enumerate (recursively) and register the devices connected to a pci bus.
  *
- * @param parent	The host-to-pci bridge device.
+ * @param dev		The host-to-pci bridge device.
  * @param bus_num	The bus number.
  */
-void pci_bus_scan(device_t *parent, int bus_num) 
-{
-	device_t *dev = create_device();
-	pci_dev_data_t *dev_data = create_pci_dev_data();
-	dev->driver_data = dev_data;
-	dev->parent = parent;
+void pci_bus_scan(device_t *dev, int bus_num) 
+{
+	function_t *fun = create_function();
+	pci_fun_data_t *fun_data = create_pci_fun_data();
+	fun->driver_data = fun_data;
 	
 	int child_bus = 0;
 	int dnum, fnum;
 	bool multi;
-	uint8_t header_type; 
+	uint8_t header_type;
+
+	/* We need this early, before registering. */
+	fun->dev = dev;
 	
 	for (dnum = 0; dnum < 32; dnum++) {
 		multi = true;
 		for (fnum = 0; multi && fnum < 8; fnum++) {
-			init_pci_dev_data(dev_data, bus_num, dnum, fnum);
-			dev_data->vendor_id = pci_conf_read_16(dev,
+			init_pci_fun_data(fun_data, bus_num, dnum, fnum);
+			fun_data->vendor_id = pci_conf_read_16(fun,
 			    PCI_VENDOR_ID);
-			dev_data->device_id = pci_conf_read_16(dev,
+			fun_data->device_id = pci_conf_read_16(fun,
 			    PCI_DEVICE_ID);
-			if (dev_data->vendor_id == 0xffff) {
+			if (fun_data->vendor_id == 0xffff) {
 				/*
 				 * The device is not present, go on scanning the
@@ -396,5 +398,5 @@
 			}
 			
-			header_type = pci_conf_read_8(dev, PCI_HEADER_TYPE);
+			header_type = pci_conf_read_8(fun, PCI_HEADER_TYPE);
 			if (fnum == 0) {
 				/* Is the device multifunction? */
@@ -404,22 +406,23 @@
 			header_type = header_type & 0x7F;
 			
-			create_pci_dev_name(dev);
-			
-			pci_alloc_resource_list(dev);
-			pci_read_bars(dev);
-			pci_read_interrupt(dev);
-			
-			dev->ops = &pci_child_ops;
-			
-			printf(NAME ": adding new child device %s.\n",
-			    dev->name);
-			
-			create_pci_match_ids(dev);
-			
-			if (child_device_register(dev, parent) != EOK) {
-				pci_clean_resource_list(dev);
-				clean_match_ids(&dev->match_ids);
-				free((char *) dev->name);
-				dev->name = NULL;
+			create_pci_fun_name(fun);
+			
+			pci_alloc_resource_list(fun);
+			pci_read_bars(fun);
+			pci_read_interrupt(fun);
+			
+			fun->ftype = fun_inner;
+			fun->ops = &pci_child_ops;
+			
+			printf(NAME ": adding new function %s.\n",
+			    fun->name);
+			
+			create_pci_match_ids(fun);
+			
+			if (register_function(fun, dev) != EOK) {
+				pci_clean_resource_list(fun);
+				clean_match_ids(&fun->match_ids);
+				free((char *) fun->name);
+				fun->name = NULL;
 				continue;
 			}
@@ -427,24 +430,27 @@
 			if (header_type == PCI_HEADER_TYPE_BRIDGE ||
 			    header_type == PCI_HEADER_TYPE_CARDBUS) {
-				child_bus = pci_conf_read_8(dev,
+				child_bus = pci_conf_read_8(fun,
 				    PCI_BRIDGE_SEC_BUS_NUM);
 				printf(NAME ": device is pci-to-pci bridge, "
 				    "secondary bus number = %d.\n", bus_num);
 				if (child_bus > bus_num)
-					pci_bus_scan(parent, child_bus);
+					pci_bus_scan(dev, child_bus);
 			}
 			
-			/* Alloc new aux. dev. structure. */
-			dev = create_device();
-			dev_data = create_pci_dev_data();
-			dev->driver_data = dev_data;
-			dev->parent = parent;
+			/* Alloc new aux. fun. structure. */
+			fun = create_function();
+
+			/* We need this early, before registering. */
+		    	fun->dev = dev;
+
+			fun_data = create_pci_fun_data();
+			fun->driver_data = fun_data;
 		}
 	}
 	
-	if (dev_data->vendor_id == 0xffff) {
-		delete_device(dev);
-		/* Free the auxiliary device structure. */
-		delete_pci_dev_data(dev_data);
+	if (fun_data->vendor_id == 0xffff) {
+		delete_function(fun);
+		/* Free the auxiliary function structure. */
+		delete_pci_fun_data(fun_data);
 	}
 }
@@ -504,4 +510,12 @@
 	dev->driver_data = bus_data;
 	
+	/* Make the bus device more visible. Does not do anything. */
+	printf(NAME ": adding a 'ctl' function\n");
+
+	function_t *ctl = create_function();
+	ctl->ftype = fun_exposed;
+	ctl->name = "ctl";
+	register_function(ctl, dev);
+	
 	/* Enumerate child devices. */
 	printf(NAME ": scanning the bus\n");
@@ -518,54 +532,54 @@
 }
 
-pci_dev_data_t *create_pci_dev_data(void)
-{
-	pci_dev_data_t *res = (pci_dev_data_t *) malloc(sizeof(pci_dev_data_t));
+pci_fun_data_t *create_pci_fun_data(void)
+{
+	pci_fun_data_t *res = (pci_fun_data_t *) malloc(sizeof(pci_fun_data_t));
 	
 	if (res != NULL)
-		memset(res, 0, sizeof(pci_dev_data_t));
+		memset(res, 0, sizeof(pci_fun_data_t));
 	return res;
 }
 
-void init_pci_dev_data(pci_dev_data_t *dev_data, int bus, int dev, int fn)
-{
-	dev_data->bus = bus;
-	dev_data->dev = dev;
-	dev_data->fn = fn;
-}
-
-void delete_pci_dev_data(pci_dev_data_t *dev_data)
-{
-	if (dev_data != NULL) {
-		hw_res_clean_resource_list(&dev_data->hw_resources);
-		free(dev_data);
-	}
-}
-
-void create_pci_dev_name(device_t *dev)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
+void init_pci_fun_data(pci_fun_data_t *fun_data, int bus, int dev, int fn)
+{
+	fun_data->bus = bus;
+	fun_data->dev = dev;
+	fun_data->fn = fn;
+}
+
+void delete_pci_fun_data(pci_fun_data_t *fun_data)
+{
+	if (fun_data != NULL) {
+		hw_res_clean_resource_list(&fun_data->hw_resources);
+		free(fun_data);
+	}
+}
+
+void create_pci_fun_name(function_t *fun)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
 	char *name = NULL;
 	
-	asprintf(&name, "%02x:%02x.%01x", dev_data->bus, dev_data->dev,
-	    dev_data->fn);
-	dev->name = name;
-}
-
-bool pci_alloc_resource_list(device_t *dev)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *)dev->driver_data;
-	
-	dev_data->hw_resources.resources =
+	asprintf(&name, "%02x:%02x.%01x", fun_data->bus, fun_data->dev,
+	    fun_data->fn);
+	fun->name = name;
+}
+
+bool pci_alloc_resource_list(function_t *fun)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *)fun->driver_data;
+	
+	fun_data->hw_resources.resources =
 	    (hw_resource_t *) malloc(PCI_MAX_HW_RES * sizeof(hw_resource_t));
-	return dev_data->hw_resources.resources != NULL;
-}
-
-void pci_clean_resource_list(device_t *dev)
-{
-	pci_dev_data_t *dev_data = (pci_dev_data_t *) dev->driver_data;
-	
-	if (dev_data->hw_resources.resources != NULL) {
-		free(dev_data->hw_resources.resources);
-		dev_data->hw_resources.resources = NULL;
+	return fun_data->hw_resources.resources != NULL;
+}
+
+void pci_clean_resource_list(function_t *fun)
+{
+	pci_fun_data_t *fun_data = (pci_fun_data_t *) fun->driver_data;
+	
+	if (fun_data->hw_resources.resources != NULL) {
+		free(fun_data->hw_resources.resources);
+		fun_data->hw_resources.resources = NULL;
 	}
 }
@@ -576,5 +590,5 @@
  * @param dev the pci device.
  */
-void pci_read_bars(device_t *dev)
+void pci_read_bars(function_t *fun)
 {
 	/*
@@ -585,5 +599,5 @@
 	
 	while (addr <= PCI_BASE_ADDR_5)
-		addr = pci_read_bar(dev, addr);
+		addr = pci_read_bar(fun, addr);
 }
 
Index: uspace/drv/pciintel/pci.h
===================================================================
--- uspace/drv/pciintel/pci.h	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/pciintel/pci.h	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -44,5 +44,5 @@
 #define PCI_MAX_HW_RES 8
 
-typedef struct pci_dev_data {
+typedef struct pci_fun_data {
 	int bus;
 	int dev;
@@ -51,31 +51,31 @@
 	int device_id;
 	hw_resource_list_t hw_resources;
-} pci_dev_data_t;
+} pci_fun_data_t;
 
-extern void create_pci_match_ids(device_t *);
+extern void create_pci_match_ids(function_t *);
 
-extern uint8_t pci_conf_read_8(device_t *, int);
-extern uint16_t pci_conf_read_16(device_t *, int);
-extern uint32_t pci_conf_read_32(device_t *, int);
-extern void pci_conf_write_8(device_t *, int, uint8_t);
-extern void pci_conf_write_16(device_t *, int, uint16_t);
-extern void pci_conf_write_32(device_t *, int, uint32_t);
+extern uint8_t pci_conf_read_8(function_t *, int);
+extern uint16_t pci_conf_read_16(function_t *, int);
+extern uint32_t pci_conf_read_32(function_t *, int);
+extern void pci_conf_write_8(function_t *, int, uint8_t);
+extern void pci_conf_write_16(function_t *, int, uint16_t);
+extern void pci_conf_write_32(function_t *, int, uint32_t);
 
-extern void pci_add_range(device_t *, uint64_t, size_t, bool);
-extern int pci_read_bar(device_t *, int);
-extern void pci_read_interrupt(device_t *);
-extern void pci_add_interrupt(device_t *, int);
+extern void pci_add_range(function_t *, uint64_t, size_t, bool);
+extern int pci_read_bar(function_t *, int);
+extern void pci_read_interrupt(function_t *);
+extern void pci_add_interrupt(function_t *, int);
 
 extern void pci_bus_scan(device_t *, int);
 
-extern pci_dev_data_t *create_pci_dev_data(void);
-extern void init_pci_dev_data(pci_dev_data_t *, int, int, int);
-extern void delete_pci_dev_data(pci_dev_data_t *);
-extern void create_pci_dev_name(device_t *);
+extern pci_fun_data_t *create_pci_fun_data(void);
+extern void init_pci_fun_data(pci_fun_data_t *, int, int, int);
+extern void delete_pci_fun_data(pci_fun_data_t *);
+extern void create_pci_fun_name(function_t *);
 
-extern bool pci_alloc_resource_list(device_t *);
-extern void pci_clean_resource_list(device_t *);
+extern bool pci_alloc_resource_list(function_t *);
+extern void pci_clean_resource_list(function_t *);
 
-extern void pci_read_bars(device_t *);
+extern void pci_read_bars(function_t *);
 extern size_t pci_bar_mask_to_size(uint32_t);
 
Index: uspace/drv/root/root.c
===================================================================
--- uspace/drv/root/root.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/root/root.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -87,5 +87,5 @@
 	    VIRTUAL_DEVICE_MATCH_SCORE, VIRTUAL_DEVICE_MATCH_ID);
 
-	int res = child_device_register_wrapper(parent, VIRTUAL_DEVICE_NAME,
+	int res = register_function_wrapper(parent, VIRTUAL_DEVICE_NAME,
 	    VIRTUAL_DEVICE_MATCH_ID, VIRTUAL_DEVICE_MATCH_SCORE);
 
@@ -135,5 +135,5 @@
 	    PLATFORM_DEVICE_MATCH_SCORE, match_id);
 
-	res = child_device_register_wrapper(parent, PLATFORM_DEVICE_NAME,
+	res = register_function_wrapper(parent, PLATFORM_DEVICE_NAME,
 	    match_id, PLATFORM_DEVICE_MATCH_SCORE);
 
Index: uspace/drv/rootpc/rootpc.c
===================================================================
--- uspace/drv/rootpc/rootpc.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/rootpc/rootpc.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -55,7 +55,7 @@
 #define NAME "rootpc"
 
-typedef struct rootpc_child_dev_data {
+typedef struct rootpc_fun_data {
 	hw_resource_list_t hw_resources;
-} rootpc_child_dev_data_t;
+} rootpc_fun_data_t;
 
 static int rootpc_add_device(device_t *dev);
@@ -82,5 +82,5 @@
 };
 
-static rootpc_child_dev_data_t pci_data = {
+static rootpc_fun_data_t pci_data = {
 	.hw_resources = {
 		1,
@@ -89,9 +89,9 @@
 };
 
-static hw_resource_list_t *rootpc_get_child_resources(device_t *dev)
-{
-	rootpc_child_dev_data_t *data;
-	
-	data = (rootpc_child_dev_data_t *) dev->driver_data;
+static hw_resource_list_t *rootpc_get_fun_resources(function_t *fun)
+{
+	rootpc_fun_data_t *data;
+	
+	data = (rootpc_fun_data_t *) fun->driver_data;
 	if (NULL == data)
 		return NULL;
@@ -100,5 +100,5 @@
 }
 
-static bool rootpc_enable_child_interrupt(device_t *dev)
+static bool rootpc_enable_fun_interrupt(function_t *fun)
 {
 	/* TODO */
@@ -107,28 +107,29 @@
 }
 
-static hw_res_ops_t child_hw_res_ops = {
-	&rootpc_get_child_resources,
-	&rootpc_enable_child_interrupt
+static hw_res_ops_t fun_hw_res_ops = {
+	&rootpc_get_fun_resources,
+	&rootpc_enable_fun_interrupt
 };
 
 /* Initialized in root_pc_init() function. */
-static device_ops_t rootpc_child_ops;
+static device_ops_t rootpc_fun_ops;
 
 static bool
-rootpc_add_child(device_t *parent, const char *name, const char *str_match_id,
-    rootpc_child_dev_data_t *drv_data)
-{
-	printf(NAME ": adding new child device '%s'.\n", name);
-	
-	device_t *child = NULL;
+rootpc_add_fun(device_t *parent, const char *name, const char *str_match_id,
+    rootpc_fun_data_t *drv_data)
+{
+	printf(NAME ": adding new function '%s'.\n", name);
+	
+	function_t *fun = NULL;
 	match_id_t *match_id = NULL;
 	
 	/* Create new device. */
-	child = create_device();
-	if (NULL == child)
+	fun = create_function();
+	if (fun == NULL)
 		goto failure;
 	
-	child->name = name;
-	child->driver_data = drv_data;
+	fun->name = name;
+	fun->driver_data = drv_data;
+	fun->ftype = fun_inner;
 	
 	/* Initialize match id list */
@@ -139,12 +140,13 @@
 	match_id->id = str_match_id;
 	match_id->score = 100;
-	add_match_id(&child->match_ids, match_id);
+	add_match_id(&fun->match_ids, match_id);
 	
 	/* Set provided operations to the device. */
-	child->ops = &rootpc_child_ops;
-	
-	/* Register child device. */
-	if (EOK != child_device_register(child, parent))
+	fun->ops = &rootpc_fun_ops;
+	
+	/* Register function. */
+	if (EOK != register_function(fun, parent))
 		goto failure;
+	printf(NAME ": registered function handle = %u\n", fun->handle);
 	
 	return true;
@@ -154,17 +156,17 @@
 		match_id->id = NULL;
 	
-	if (NULL != child) {
-		child->name = NULL;
-		delete_device(child);
-	}
-	
-	printf(NAME ": failed to add child device '%s'.\n", name);
+	if (NULL != fun) {
+		fun->name = NULL;
+		delete_function(fun);
+	}
+	
+	printf(NAME ": failed to add function '%s'.\n", name);
 	
 	return false;
 }
 
-static bool rootpc_add_children(device_t *dev)
-{
-	return rootpc_add_child(dev, "pci0", "intel_pci", &pci_data);
+static bool rootpc_add_functions(device_t *dev)
+{
+	return rootpc_add_fun(dev, "pci0", "intel_pci", &pci_data);
 }
 
@@ -180,7 +182,7 @@
 	    (int)dev->handle);
 	
-	/* Register child devices. */
-	if (!rootpc_add_children(dev)) {
-		printf(NAME ": failed to add child devices for PC platform.\n");
+	/* Register functions. */
+	if (!rootpc_add_functions(dev)) {
+		printf(NAME ": failed to add functions for PC platform.\n");
 	}
 	
@@ -190,5 +192,5 @@
 static void root_pc_init(void)
 {
-	rootpc_child_ops.interfaces[HW_RES_DEV_IFACE] = &child_hw_res_ops;
+	rootpc_fun_ops.interfaces[HW_RES_DEV_IFACE] = &fun_hw_res_ops;
 }
 
Index: uspace/drv/rootvirt/rootvirt.c
===================================================================
--- uspace/drv/rootvirt/rootvirt.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/rootvirt/rootvirt.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -43,16 +43,16 @@
 #define NAME "rootvirt"
 
-/** Virtual device entry. */
+/** Virtual function entry */
 typedef struct {
-	/** Device name. */
+	/** Function name */
 	const char *name;
-	/** Device match id. */
+	/** Function match ID */
 	const char *match_id;
-} virtual_device_t;
+} virtual_function_t;
 
-/** List of existing virtual devices. */
-virtual_device_t virtual_devices[] = {
+/** List of existing virtual functions */
+virtual_function_t virtual_functions[] = {
 #include "devices.def"
-	/* Terminating item. */
+	/* Terminating item */
 	{
 		.name = NULL,
@@ -72,24 +72,24 @@
 };
 
-/** Add child device.
+/** Add function to the virtual device.
  *
- * @param parent Parent device.
- * @param virt_dev Virtual device to add.
- * @return Error code.
+ * @param vdev		The virtual device
+ * @param vfun		Virtual function description
+ * @return		EOK on success or negative error code.
  */
-static int add_child(device_t *parent, virtual_device_t *virt_dev)
+static int add_child(device_t *vdev, virtual_function_t *vfun)
 {
-	printf(NAME ": registering child device `%s' (match \"%s\")\n",
-	    virt_dev->name, virt_dev->match_id);
+	printf(NAME ": registering function `%s' (match \"%s\")\n",
+	    vfun->name, vfun->match_id);
 
-	int rc = child_device_register_wrapper(parent, virt_dev->name,
-	    virt_dev->match_id, 10);
+	int rc = register_function_wrapper(vdev, vfun->name,
+	    vfun->match_id, 10);
 
 	if (rc == EOK) {
 		printf(NAME ": registered child device `%s'\n",
-		    virt_dev->name);
+		    vfun->name);
 	} else {
 		printf(NAME ": failed to register child device `%s': %s\n",
-		    virt_dev->name, str_error(rc));
+		    vfun->name, str_error(rc));
 	}
 
@@ -109,15 +109,14 @@
 	}
 
-	printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
-	    dev->name, (int)dev->handle);
+	printf(NAME ": add_device(handle=%d)\n", (int)dev->handle);
 	
 	/*
-	 * Go through all virtual devices and try to add them.
+	 * Go through all virtual functions and try to add them.
 	 * We silently ignore failures.
 	 */
-	virtual_device_t *virt_dev = virtual_devices;
-	while (virt_dev->name != NULL) {
-		(void) add_child(dev, virt_dev);
-		virt_dev++;
+	virtual_function_t *vfun = virtual_functions;
+	while (vfun->name != NULL) {
+		(void) add_child(dev, vfun);
+		vfun++;
 	}
 
Index: uspace/drv/test1/char.c
===================================================================
--- uspace/drv/test1/char.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/test1/char.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -37,10 +37,10 @@
 #include "test1.h"
 
-static int impl_char_read(device_t *dev, char *buf, size_t count) {
+static int impl_char_read(function_t *fun, char *buf, size_t count) {
 	memset(buf, 0, count);
 	return count;
 }
 
-static int imp_char_write(device_t *dev, char *buf, size_t count) {
+static int imp_char_write(function_t *fun, char *buf, size_t count) {
 	return count;
 }
Index: uspace/drv/test1/test1.c
===================================================================
--- uspace/drv/test1/test1.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/test1/test1.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -61,11 +61,11 @@
 	   name, message);
 
-	int rc = child_device_register_wrapper(parent, name,
+	int rc = register_function_wrapper(parent, name,
 	    match_id, match_score);
 
 	if (rc == EOK) {
-		printf(NAME ": registered child device `%s'.\n", name);
+		printf(NAME ": registered function `%s'.\n", name);
 	} else {
-		printf(NAME ": failed to register child `%s' (%s).\n",
+		printf(NAME ": failed to register function `%s' (%s).\n",
 		    name, str_error(rc));
 	}
@@ -91,13 +91,21 @@
 static int add_device(device_t *dev)
 {
+	function_t *fun_a;
+
 	printf(NAME ": add_device(name=\"%s\", handle=%d)\n",
 	    dev->name, (int) dev->handle);
 
-	add_device_to_class(dev, "virtual");
+	fun_a = create_function();
+	fun_a->ftype = fun_exposed;
+	fun_a->name = "a";
+
+	register_function(fun_a, dev);
+
+	add_function_to_class(fun_a, "virtual");
 
 	if (str_cmp(dev->name, "null") == 0) {
-		dev->ops = &char_device_ops;
-		add_device_to_class(dev, "virt-null");
-	} else if (dev->parent == NULL) {
+		fun_a->ops = &char_device_ops;
+		add_function_to_class(fun_a, "virt-null");
+	} else if (str_cmp(dev->name, "test1") == 0) {
 		register_child_verbose(dev, "cloning myself ;-)", "clone",
 		    "virtual&test1", 10);
Index: uspace/drv/test2/test2.c
===================================================================
--- uspace/drv/test2/test2.c	(revision 86d7bfa1b97f6267e7a11878af29c50679b9c7a6)
+++ uspace/drv/test2/test2.c	(revision 8b1e15ac9100f7b9da56e372d2f441ba44db6fcc)
@@ -63,5 +63,5 @@
 	   name, message);
 
-	int rc = child_device_register_wrapper(parent, name,
+	int rc = register_function_wrapper(parent, name,
 	    match_id, match_score);
 
@@ -82,4 +82,5 @@
 {
 	device_t *dev = (device_t *) arg;
+	function_t *fun;
 
 	async_usleep(1000);
@@ -90,9 +91,14 @@
 	    "test1", "virtual&test1", 10);
 
-	add_device_to_class(dev, "virtual");
+	fun = create_function();
+	fun->ftype = fun_exposed;
+	fun->name = "a";
+
+	register_function(fun, dev);
+
+	add_function_to_class(fun, "virtual");
 
 	return EOK;
 }
-
 
 static int add_device(device_t *dev)
@@ -101,5 +107,5 @@
 	    dev->name, (int) dev->handle);
 
-	if (dev->parent == NULL) {
+	if (str_cmp(dev->name, "child") != 0) {
 		fid_t postpone = fibril_create(postponed_birth, dev);
 		if (postpone == 0) {
