]> rtime.felk.cvut.cz Git - CanFestival-3.git/blobdiff - drivers/unix/unix.c
Accepted Vladimir Chren linux kernelspace port patch.
[CanFestival-3.git] / drivers / unix / unix.c
index f009b6e45126727f064df63e36040e5d08babb77..074272f33c61d04b365af1ee003f294d02819a57 100644 (file)
@@ -19,9 +19,13 @@ You should have received a copy of the GNU Lesser General Public
 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 @@ CAN_PORT canOpen(s_BOARD *board, CO_Data * d)
                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 @@ UNS8 canChangeBaudRate(CAN_PORT port, char* baud)
        }               
        return 1; // NOT OK
 }
+
+
+#ifdef __KERNEL__
+EXPORT_SYMBOL (canOpen);
+EXPORT_SYMBOL (canClose);
+EXPORT_SYMBOL (canSend);
+#endif