summaryrefslogtreecommitdiffstats
path: root/drivers/net/can/mscan/mscan.h
diff options
context:
space:
mode:
authorWolfram Sang <w.sang@pengutronix.de>2009-11-16 12:57:44 +0000
committerDavid S. Miller <davem@davemloft.net>2009-11-17 03:53:59 -0800
commit622ed7e9cfa931cefc423562d414cb6cd0b08991 (patch)
tree8734ded09e2951cf7942162789417e023e8cc158 /drivers/net/can/mscan/mscan.h
parenta2bfbc072e279ff81e6b336acff612b9bc2e5281 (diff)
downloadop-kernel-dev-622ed7e9cfa931cefc423562d414cb6cd0b08991.zip
op-kernel-dev-622ed7e9cfa931cefc423562d414cb6cd0b08991.tar.gz
net/can/mscan: move defines into .h file
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can/mscan/mscan.h')
-rw-r--r--drivers/net/can/mscan/mscan.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/drivers/net/can/mscan/mscan.h b/drivers/net/can/mscan/mscan.h
index 57820f5..76a8abf 100644
--- a/drivers/net/can/mscan/mscan.h
+++ b/drivers/net/can/mscan/mscan.h
@@ -226,6 +226,35 @@ struct mscan_regs {
#undef _MSCAN_RESERVED_
#define MSCAN_REGION sizeof(struct mscan)
+#define MSCAN_NORMAL_MODE 0
+#define MSCAN_SLEEP_MODE MSCAN_SLPRQ
+#define MSCAN_INIT_MODE (MSCAN_INITRQ | MSCAN_SLPRQ)
+#define MSCAN_POWEROFF_MODE (MSCAN_CSWAI | MSCAN_SLPRQ)
+#define MSCAN_SET_MODE_RETRIES 255
+#define MSCAN_ECHO_SKB_MAX 3
+
+#define BTR0_BRP_MASK 0x3f
+#define BTR0_SJW_SHIFT 6
+#define BTR0_SJW_MASK (0x3 << BTR0_SJW_SHIFT)
+
+#define BTR1_TSEG1_MASK 0xf
+#define BTR1_TSEG2_SHIFT 4
+#define BTR1_TSEG2_MASK (0x7 << BTR1_TSEG2_SHIFT)
+#define BTR1_SAM_SHIFT 7
+
+#define BTR0_SET_BRP(brp) (((brp) - 1) & BTR0_BRP_MASK)
+#define BTR0_SET_SJW(sjw) ((((sjw) - 1) << BTR0_SJW_SHIFT) & \
+ BTR0_SJW_MASK)
+
+#define BTR1_SET_TSEG1(tseg1) (((tseg1) - 1) & BTR1_TSEG1_MASK)
+#define BTR1_SET_TSEG2(tseg2) ((((tseg2) - 1) << BTR1_TSEG2_SHIFT) & \
+ BTR1_TSEG2_MASK)
+#define BTR1_SET_SAM(sam) ((sam) ? 1 << BTR1_SAM_SHIFT : 0)
+
+#define F_RX_PROGRESS 0
+#define F_TX_PROGRESS 1
+#define F_TX_WAIT_ALL 2
+
#define TX_QUEUE_SIZE 3
struct tx_queue_entry {
OpenPOWER on IntegriCloud