Index: uspace/drv/nic/rtl8139/driver.c
===================================================================
--- uspace/drv/nic/rtl8139/driver.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
+++ uspace/drv/nic/rtl8139/driver.c	(revision 56fd7cf53b8ee7af3e78e2237e566926562e0291)
@@ -27,4 +27,7 @@
  */
 
+/* XXX Fix this */
+#define _DDF_DATA_IMPLANT
+
 #include <assert.h>
 #include <errno.h>
@@ -212,13 +215,12 @@
 	rtl8139_regs_lock(rtl8139->io_port);
 
+	async_sess_t *pci_sess =
+		ddf_dev_parent_sess_get(nic_get_ddf_dev(rtl8139->nic_data));
+
 	if (bit_val) {
-		async_sess_t *pci_sess =
-			nic_get_ddf_dev(rtl8139->nic_data)->parent_sess;
 		uint8_t pmen;
 		pci_config_space_read_8(pci_sess, 0x55, &pmen);
 		pci_config_space_write_8(pci_sess, 0x55, pmen | 1 | (1 << 7));
 	} else {
-		async_sess_t *pci_sess =
-			nic_get_ddf_dev(rtl8139->nic_data)->parent_sess;
 		uint8_t pmen;
 		pci_config_space_read_8(pci_sess, 0x55, &pmen);
@@ -1052,11 +1054,6 @@
 	assert(dev);
 
-	if (dev->driver_data)
+	if (ddf_dev_data_get(dev))
 		nic_unbind_and_destroy(dev);
-
-	if (dev->parent_sess != NULL) {
-		async_hangup(dev->parent_sess);
-		dev->parent_sess = NULL;
-	}
 }
 
@@ -1080,22 +1077,22 @@
 
 	if (hw_resources->irqs.count != 1) {
-		ddf_msg(LVL_ERROR, "%s device: unexpected irq count", dev->name);
+		ddf_msg(LVL_ERROR, "%s device: unexpected irq count", ddf_dev_get_name(dev));
 		return EINVAL;
 	};
 	if (hw_resources->io_ranges.count != 1) {
-		ddf_msg(LVL_ERROR, "%s device: unexpected io ranges count", dev->name);
+		ddf_msg(LVL_ERROR, "%s device: unexpected io ranges count", ddf_dev_get_name(dev));
 		return EINVAL;
 	}
 
 	rtl8139->irq = hw_resources->irqs.irqs[0];
-	ddf_msg(LVL_DEBUG, "%s device: irq 0x%x assigned", dev->name, rtl8139->irq);
+	ddf_msg(LVL_DEBUG, "%s device: irq 0x%x assigned", ddf_dev_get_name(dev), rtl8139->irq);
 
 	rtl8139->io_addr = IOADDR_TO_PTR(hw_resources->io_ranges.ranges[0].address);
 	if (hw_resources->io_ranges.ranges[0].size < RTL8139_IO_SIZE) {
 		ddf_msg(LVL_ERROR, "i/o range assigned to the device "
-		    "%s is too small.", dev->name);
+		    "%s is too small.", ddf_dev_get_name(dev));
 		return EINVAL;
 	}
-	ddf_msg(LVL_DEBUG, "%s device: i/o addr %p assigned.", dev->name, rtl8139->io_addr);
+	ddf_msg(LVL_DEBUG, "%s device: i/o addr %p assigned.", ddf_dev_get_name(dev), rtl8139->io_addr);
 
 	return EOK;
@@ -1192,5 +1189,5 @@
 static int rtl8139_device_initialize(ddf_dev_t *dev)
 {
-	ddf_msg(LVL_DEBUG, "rtl8139_dev_initialize %s", dev->name);
+	ddf_msg(LVL_DEBUG, "rtl8139_dev_initialize %s", ddf_dev_get_name(dev));
 
 	int ret = EOK;
@@ -1201,5 +1198,5 @@
 	rtl8139_t *rtl8139 = rtl8139_create_dev_data(dev);
 	if (rtl8139 == NULL) {
-		ddf_msg(LVL_ERROR, "Not enough memory for initializing %s.", dev->name);
+		ddf_msg(LVL_ERROR, "Not enough memory for initializing %s.", ddf_dev_get_name(dev));
 		return ENOMEM;
 	}
@@ -1246,5 +1243,5 @@
 static int rtl8139_pio_enable(ddf_dev_t *dev)
 {
-	ddf_msg(LVL_DEBUG, NAME ": rtl8139_pio_enable %s", dev->name);
+	ddf_msg(LVL_DEBUG, NAME ": rtl8139_pio_enable %s", ddf_dev_get_name(dev));
 
 	rtl8139_t *rtl8139 = nic_get_specific(nic_get_from_ddf_dev(dev));
@@ -1253,5 +1250,5 @@
 	if (pio_enable(rtl8139->io_addr, RTL8139_IO_SIZE, &rtl8139->io_port)) {
 		ddf_msg(LVL_ERROR, "Cannot gain the port %lx for device %s.", rtl8139->io_addr,
-		    dev->name);
+		    ddf_dev_get_name(dev));
 		return EADDRNOTAVAIL;
 	}
@@ -1299,5 +1296,6 @@
 
 	assert(dev);
-	ddf_msg(LVL_NOTE, "RTL8139_dev_add %s (handle = %d)", dev->name, dev->handle);
+	ddf_msg(LVL_NOTE, "RTL8139_dev_add %s (handle = %d)",
+	    ddf_dev_get_name(dev), ddf_dev_get_handle(dev));
 
 	/* Init device structure for rtl8139 */
@@ -1340,6 +1338,6 @@
 	}
 	nic_set_ddf_fun(nic_data, fun);
-	fun->ops = &rtl8139_dev_ops;
-	fun->driver_data = nic_data;
+	ddf_fun_set_ops(fun, &rtl8139_dev_ops);
+	ddf_fun_data_implant(fun, nic_data);
 
 	rc = ddf_fun_bind(fun);
@@ -1355,5 +1353,5 @@
 
 	ddf_msg(LVL_NOTE, "The %s device has been successfully initialized.",
-	    dev->name);
+	    ddf_dev_get_name(dev));
 
 	return EOK;
