drivers/unix/unix.c
changeset 391 7802a7d5584f
parent 384 83793fc7ce48
child 401 2c90876b9751
--- a/drivers/unix/unix.c	Tue Feb 12 09:42:56 2008 +0100
+++ b/drivers/unix/unix.c	Tue Feb 12 09:44:55 2008 +0100
@@ -19,9 +19,13 @@
 License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
+#ifndef __KERNEL__
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
+#else
+#include <linux/module.h>
+#endif
 
 #ifndef NOT_USE_DYNAMIC_LOADING
 #define DLL_CALL(funcname) (* funcname##_driver)
@@ -171,7 +175,7 @@
 		LeaveMutex();
 		return (CAN_PORT)&canports[i];
 	}else{
-        	fprintf(stderr,"CanOpen : Cannot open board {busname='%s',baudrate='%s'}\n",board->busname, board->baudrate);
+        	MSG("CanOpen : Cannot open board {busname='%s',baudrate='%s'}\n",board->busname, board->baudrate);
 		return NULL;
 	}
 }
@@ -202,3 +206,10 @@
 	}               
 	return 1; // NOT OK
 }
+
+
+#ifdef __KERNEL__
+EXPORT_SYMBOL (canOpen);
+EXPORT_SYMBOL (canClose);
+EXPORT_SYMBOL (canSend);
+#endif