Module: xenomai-2.6
Branch: master
Commit: 83af0c2d9d742cfe0994954f49e3fc06ba9456f7
URL:    
http://git.xenomai.org/?p=xenomai-2.6.git;a=commit;h=83af0c2d9d742cfe0994954f49e3fc06ba9456f7

Author: Wolfgang Grandegger <w...@denx.de>
Date:   Thu Sep 27 17:29:13 2012 +0200

rtcan: add some macro definitions for compatibility with Linux-CAN

Signed-off-by: Wolfgang Grandegger <w...@denx.de>

---

 include/rtdm/rtcan.h              |   12 ++++++++++--
 ksrc/drivers/can/rtcan_internal.h |   10 ++++++++++
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/include/rtdm/rtcan.h b/include/rtdm/rtcan.h
index 4c0749d..b8bd762 100644
--- a/include/rtdm/rtcan.h
+++ b/include/rtdm/rtcan.h
@@ -422,6 +422,11 @@ typedef enum CAN_MODE can_mode_t;
  * test operation. */
 #define CAN_CTRLMODE_LOOPBACK   0x2
 
+/*! Triple sampling mode
+ *
+ * In this mode the CAN controller uses Triple sampling. */
+#define CAN_CTRLMODE_3_SAMPLES  0x4
+
 /** @} */
 
 /** See @ref CAN_CTRLMODE */
@@ -433,13 +438,16 @@ typedef int can_ctrlmode_t;
  * @{ */
 enum CAN_STATE {
        /** CAN controller is error active */
+       CAN_STATE_ERROR_ACTIVE = 0,
        CAN_STATE_ACTIVE = 0,
 
        /** CAN controller is error active, warning level is reached */
-       CAN_STATE_BUS_WARNING,
+       CAN_STATE_ERROR_WARNING = 1,
+       CAN_STATE_BUS_WARNING = 1,
 
        /** CAN controller is error passive */
-       CAN_STATE_BUS_PASSIVE,
+       CAN_STATE_ERROR_PASSIVE = 2,
+       CAN_STATE_BUS_PASSIVE = 2,
 
        /** CAN controller went into Bus Off */
        CAN_STATE_BUS_OFF,
diff --git a/ksrc/drivers/can/rtcan_internal.h 
b/ksrc/drivers/can/rtcan_internal.h
index 626cae7..35b778a 100644
--- a/ksrc/drivers/can/rtcan_internal.h
+++ b/ksrc/drivers/can/rtcan_internal.h
@@ -115,4 +115,14 @@
 # define RTCAN_RTDM_DBG(fmt,args...) do {} while (0)
 #endif
 
+#define rtcan_priv(dev)                        (dev)->priv
+#define rtcandev_dbg(dev, fmt, args...)                                \
+       printk(KERN_DEBUG "%s: " fmt, (dev)->name, ##args)
+#define rtcandev_info(dev, fmt, args...)                       \
+       printk(KERN_INFO "%s: " fmt, (dev)->name, ##args)
+#define rtcandev_warn(dev, fmt, args...)                       \
+       printk(KERN_WARNING "%s: " fmt, (dev)->name, ##args)
+#define rtcandev_err(dev, fmt, args...)                                \
+       printk(KERN_ERR "%s: " fmt, (dev)->name, ##args)
+
 #endif /* __RTCAN_INTERNAL_H_ */


_______________________________________________
Xenomai-git mailing list
Xenomai-git@xenomai.org
http://www.xenomai.org/mailman/listinfo/xenomai-git

Reply via email to