Index: uspace/drv/nic/e1k/e1k.c
===================================================================
--- uspace/drv/nic/e1k/e1k.c	(revision b1213b0d019ee5b8bf4ee139ae99b9a3fdf827a0)
+++ uspace/drv/nic/e1k/e1k.c	(revision beb93360b4fa19e27b1668938b25de12f07de3f6)
@@ -32,4 +32,7 @@
  *
  */
+
+/* XXX Fix this */
+#define _DDF_DATA_IMPLANT
 
 #include <assert.h>
@@ -71,11 +74,19 @@
 	((e1000_t *) nic_get_specific(nic))
 
-/** device_t* -> nic_driver_data_t* cast */
+/** ddf_fun_t * -> nic_driver_data_t* cast */
+#define NIC_DATA_FUN(fun) \
+	((nic_t *) ddf_fun_data_get(fun))
+
+/** ddf_dev_t * -> nic_driver_data_t* cast */
 #define NIC_DATA_DEV(dev) \
-	((nic_t *) ((dev)->driver_data))
-
-/** device_t* -> e1000_t* cast */
+	((nic_t *) ddf_dev_data_get(dev))
+
+/** ddf_dev_t * -> e1000_t* cast */
 #define DRIVER_DATA_DEV(dev) \
 	(DRIVER_DATA_NIC(NIC_DATA_DEV(dev)))
+
+/** ddf_fun_t * -> e1000_t* cast */
+#define DRIVER_DATA_FUN(fun) \
+	(DRIVER_DATA_NIC(NIC_DATA_FUN(fun)))
 
 /** Cast pointer to uint64_t
@@ -305,11 +316,7 @@
  *
  */
-static int e1000_get_cable_state(ddf_fun_t *dev, nic_cable_state_t *state)
-{
-	assert(dev);
-	assert(DRIVER_DATA_DEV(dev));
-	assert(state);
-	
-	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
+static int e1000_get_cable_state(ddf_fun_t *fun, nic_cable_state_t *state)
+{
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	if (E1000_REG_READ(e1000, E1000_STATUS) & (STATUS_LU))
 		*state = NIC_CS_PLUGGED;
@@ -328,8 +335,8 @@
  *
  */
-static int e1000_get_operation_mode(ddf_fun_t *dev, int *speed,
+static int e1000_get_operation_mode(ddf_fun_t *fun, int *speed,
     nic_channel_mode_t *duplex, nic_role_t *role)
 {
-	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	uint32_t status = E1000_REG_READ(e1000, E1000_STATUS);
 	
@@ -376,5 +383,5 @@
  *
  */
-static int e1000_set_operation_mode(ddf_fun_t *dev, int speed,
+static int e1000_set_operation_mode(ddf_fun_t *fun, int speed,
     nic_channel_mode_t duplex, nic_role_t role)
 {
@@ -385,5 +392,5 @@
 		return EINVAL;
 	
-	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	
 	fibril_mutex_lock(&e1000->ctrl_lock);
@@ -424,7 +431,7 @@
  *
  */
-static int e1000_autoneg_enable(ddf_fun_t *dev, uint32_t advertisement)
-{
-	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
+static int e1000_autoneg_enable(ddf_fun_t *fun, uint32_t advertisement)
+{
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	
 	fibril_mutex_lock(&e1000->ctrl_lock);
@@ -452,7 +459,7 @@
  *
  */
-static int e1000_autoneg_disable(ddf_fun_t *dev)
-{
-	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
+static int e1000_autoneg_disable(ddf_fun_t *fun)
+{
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	
 	fibril_mutex_lock(&e1000->ctrl_lock);
@@ -491,7 +498,7 @@
  *
  */
-static int e1000_defective_get_mode(ddf_fun_t *device, uint32_t *mode)
-{
-	e1000_t *e1000 = DRIVER_DATA_DEV(device);
+static int e1000_defective_get_mode(ddf_fun_t *fun, uint32_t *mode)
+{
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	
 	*mode = 0;
@@ -512,7 +519,7 @@
  *
  */
-static int e1000_defective_set_mode(ddf_fun_t *device, uint32_t mode)
-{
-	e1000_t *e1000 = DRIVER_DATA_DEV(device);
+static int e1000_defective_set_mode(ddf_fun_t *fun, uint32_t mode)
+{
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	int rc = EOK;
 	
@@ -1038,5 +1045,5 @@
  *
  */
-static int e1000_vlan_set_tag(ddf_fun_t *device, uint16_t tag, bool add,
+static int e1000_vlan_set_tag(ddf_fun_t *fun, uint16_t tag, bool add,
     bool strip)
 {
@@ -1052,5 +1059,5 @@
 		return ENOTSUP;
 	
-	e1000_t *e1000 = DRIVER_DATA_DEV(device);
+	e1000_t *e1000 = DRIVER_DATA_FUN(fun);
 	
 	e1000->vlan_tag = tag;
@@ -1855,7 +1862,4 @@
 static e1000_t *e1000_create_dev_data(ddf_dev_t *dev)
 {
-	assert(dev);
-	assert(!dev->driver_data);
-	
 	nic_t *nic = nic_create_and_bind(dev);
 	if (!nic)
@@ -1896,5 +1900,5 @@
 	assert(dev);
 	
-	if (dev->driver_data != NULL)
+	if (ddf_dev_data_get(dev) != NULL)
 		nic_unbind_and_destroy(dev);
 }
@@ -1910,9 +1914,4 @@
 	
 	e1000_delete_dev_data(dev);
-	
-	if (dev->parent_sess != NULL) {
-		async_hangup(dev->parent_sess);
-		dev->parent_sess = NULL;
-	}
 }
 
@@ -1931,8 +1930,4 @@
     const hw_res_list_parsed_t *hw_resources)
 {
-	assert(dev != NULL);
-	assert(hw_resources != NULL);
-	assert(dev->driver_data != NULL);
-	
 	e1000_t *e1000 = DRIVER_DATA_DEV(dev);
 	
@@ -2003,5 +1998,5 @@
 	
 	uint16_t device_id;
-	rc = pci_config_space_read_16(dev->parent_sess, PCI_DEVICE_ID,
+	rc = pci_config_space_read_16(ddf_dev_parent_sess_get(dev), PCI_DEVICE_ID,
 	    &device_id);
 	if (rc != EOK) {
@@ -2121,5 +2116,5 @@
 	
 	/* Device initialization */
-	nic_t *nic = dev->driver_data;
+	nic_t *nic = ddf_dev_data_get(dev);
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	
@@ -2147,6 +2142,6 @@
 		goto err_tx_structure;
 	nic_set_ddf_fun(nic, fun);
-	fun->ops = &e1000_dev_ops;
-	fun->driver_data = nic;
+	ddf_fun_set_ops(fun, &e1000_dev_ops);
+	ddf_fun_data_implant(fun, nic);
 	
 	rc = e1000_register_int_handler(nic);
@@ -2278,7 +2273,7 @@
  * @return Negative error code otherwise
  */
-static int e1000_set_addr(ddf_fun_t *dev, const nic_address_t *addr)
-{
-	nic_t *nic = NIC_DATA_DEV(dev);
+static int e1000_set_addr(ddf_fun_t *fun, const nic_address_t *addr)
+{
+	nic_t *nic = NIC_DATA_FUN(fun);
 	e1000_t *e1000 = DRIVER_DATA_NIC(nic);
 	
