Index: trunk/kernel/drivers/soclib/soclib_bdv.c
===================================================================
--- trunk/kernel/drivers/soclib/soclib_bdv.c	(revision 1)
+++ trunk/kernel/drivers/soclib/soclib_bdv.c	(revision 4)
@@ -22,5 +22,5 @@
  */
 
-#include <device.h>
+#include <chdev.h>
 #include <dev_ioc.h>
 #include <soclib_bdv.h>
@@ -29,13 +29,9 @@
 
 
-/////////////////////////////////////
-void soclib_bdv_init( xptr_t dev_xp )
+///////////////////////////////////////
+void soclib_bdv_init( chdev_t * chdev )
 {
-    // get IOC device descriptor cluster and local pointer
-    cxy_t      dev_cxy  = GET_CXY( dev_xp );
-    device_t * dev_ptr  = (device_t *)GET_PTR( dev_xp );
-  
     // get extended pointer on SOCLIB_BDV peripheral base address
-	xptr_t  bdv_xp = hal_remote_lwd( XPTR( dev_cxy , &dev_ptr->base ) );
+	xptr_t  bdv_xp = chdev->base;
 
     // get hardware device cluster and local pointer
@@ -48,12 +44,12 @@
 
     // set IOC device descriptor extension
-    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.size  ) , block_size );
-    hal_remote_sw( XPTR( dev_cxy , &dev_ptr->ext.ioc.count ) , block_count );
+    chdev->ext.ioc.size  = block_size;
+    chdev->ext.ioc.count = block_count;
 
 } // end soclib_bdv_init()
 
 
-//////////////////////////////////////////////////////////////////
-void __attribute__ ((noinline)) soclib_bdv_command( xptr_t th_xp )
+//////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_bdv_cmd( xptr_t th_xp )
 {
     uint32_t   to_mem;       // command argument
@@ -68,13 +64,13 @@
 
     // get command arguments and extended pointer on IOC device
-    to_mem =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.to_mem ) );
-    lba    =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.lba    ) );
-    count  =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->dev.ioc.count  ) );
-    buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.buf_xp ) );
-    dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->dev.ioc.dev_xp ) );
+    to_mem =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.to_mem ) );
+    lba    =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.lba    ) );
+    count  =         hal_remote_lw ( XPTR( th_cxy , &th_ptr->command.ioc.count  ) );
+    buf_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.ioc.buf_xp ) );
+    dev_xp = (xptr_t)hal_remote_lwd( XPTR( th_cxy , &th_ptr->command.ioc.dev_xp ) );
 
     // get IOC device cluster and local pointer
     cxy_t      dev_cxy = GET_CXY( dev_xp );
-    device_t * dev_ptr = (device_t *)GET_PTR( dev_xp );
+    chdev_t  * dev_ptr = (chdev_t *)GET_PTR( dev_xp );
 
     // get extended pointer on SOCLIB-BDV peripheral
@@ -107,13 +103,13 @@
 
 
-////////////////////////////////////////////////////////////////
-void __attribute__ ((noinline)) soclib_bdv_isr( device_t * dev )
+/////////////////////////////////////////////////////////////////
+void __attribute__ ((noinline)) soclib_bdv_isr( chdev_t * chdev )
 {
     // get extended pointer on client thread
-    xptr_t root = XPTR( local_cxy , &dev->wait_root );
+    xptr_t root = XPTR( local_cxy , &chdev->wait_root );
     xptr_t client_xp = XLIST_FIRST_ELEMENT( root , thread_t , wait_list );
 
     // get extended pointer on server thread
-    xptr_t server_xp = XPTR( local_cxy , &dev->server );
+    xptr_t server_xp = XPTR( local_cxy , &chdev->server );
 
     // get client thread cluster and local pointer
@@ -122,6 +118,6 @@
 
     // get SOCLIB_BDV device cluster and local pointer
-    cxy_t      bdv_cxy  = GET_CXY( dev->base );
-    uint32_t * bdv_ptr  = (uint32_t *)GET_PTR( dev->base );
+    cxy_t      bdv_cxy  = GET_CXY( chdev->base );
+    uint32_t * bdv_ptr  = (uint32_t *)GET_PTR( chdev->base );
 
     // get BDV status register and acknowledge IRQ
@@ -131,9 +127,9 @@
 	if((status != BDV_READ_SUCCESS) && (status != BDV_WRITE_SUCCESS)) 
     {
-        hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 1 );
+        hal_remote_sw( XPTR( client_cxy , &client_ptr->command.ioc.error ) , 1 );
     }
 	else
     {
-        hal_remote_sw( XPTR( client_cxy , &client_ptr->dev.ioc.error ) , 0 );
+        hal_remote_sw( XPTR( client_cxy , &client_ptr->command.ioc.error ) , 0 );
     }
 
