diff options
author | Wolfram Sang <w.sang@pengutronix.de> | 2009-11-16 07:57:44 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-17 06:53:59 -0500 |
commit | 622ed7e9cfa931cefc423562d414cb6cd0b08991 (patch) | |
tree | 8734ded09e2951cf7942162789417e023e8cc158 | |
parent | a2bfbc072e279ff81e6b336acff612b9bc2e5281 (diff) |
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>
-rw-r--r-- | drivers/net/can/mscan/mscan.c | 29 | ||||
-rw-r--r-- | drivers/net/can/mscan/mscan.h | 29 |
2 files changed, 29 insertions, 29 deletions
diff --git a/drivers/net/can/mscan/mscan.c b/drivers/net/can/mscan/mscan.c index 49542cab9df4..2539ebe21bc4 100644 --- a/drivers/net/can/mscan/mscan.c +++ b/drivers/net/can/mscan/mscan.c | |||
@@ -35,31 +35,6 @@ | |||
35 | 35 | ||
36 | #include "mscan.h" | 36 | #include "mscan.h" |
37 | 37 | ||
38 | #define MSCAN_NORMAL_MODE 0 | ||
39 | #define MSCAN_SLEEP_MODE MSCAN_SLPRQ | ||
40 | #define MSCAN_INIT_MODE (MSCAN_INITRQ | MSCAN_SLPRQ) | ||
41 | #define MSCAN_POWEROFF_MODE (MSCAN_CSWAI | MSCAN_SLPRQ) | ||
42 | #define MSCAN_SET_MODE_RETRIES 255 | ||
43 | #define MSCAN_ECHO_SKB_MAX 3 | ||
44 | |||
45 | #define BTR0_BRP_MASK 0x3f | ||
46 | #define BTR0_SJW_SHIFT 6 | ||
47 | #define BTR0_SJW_MASK (0x3 << BTR0_SJW_SHIFT) | ||
48 | |||
49 | #define BTR1_TSEG1_MASK 0xf | ||
50 | #define BTR1_TSEG2_SHIFT 4 | ||
51 | #define BTR1_TSEG2_MASK (0x7 << BTR1_TSEG2_SHIFT) | ||
52 | #define BTR1_SAM_SHIFT 7 | ||
53 | |||
54 | #define BTR0_SET_BRP(brp) (((brp) - 1) & BTR0_BRP_MASK) | ||
55 | #define BTR0_SET_SJW(sjw) ((((sjw) - 1) << BTR0_SJW_SHIFT) & \ | ||
56 | BTR0_SJW_MASK) | ||
57 | |||
58 | #define BTR1_SET_TSEG1(tseg1) (((tseg1) - 1) & BTR1_TSEG1_MASK) | ||
59 | #define BTR1_SET_TSEG2(tseg2) ((((tseg2) - 1) << BTR1_TSEG2_SHIFT) & \ | ||
60 | BTR1_TSEG2_MASK) | ||
61 | #define BTR1_SET_SAM(sam) ((sam) ? 1 << BTR1_SAM_SHIFT : 0) | ||
62 | |||
63 | static struct can_bittiming_const mscan_bittiming_const = { | 38 | static struct can_bittiming_const mscan_bittiming_const = { |
64 | .name = "mscan", | 39 | .name = "mscan", |
65 | .tseg1_min = 4, | 40 | .tseg1_min = 4, |
@@ -78,10 +53,6 @@ struct mscan_state { | |||
78 | u8 cantier; | 53 | u8 cantier; |
79 | }; | 54 | }; |
80 | 55 | ||
81 | #define F_RX_PROGRESS 0 | ||
82 | #define F_TX_PROGRESS 1 | ||
83 | #define F_TX_WAIT_ALL 2 | ||
84 | |||
85 | static enum can_state state_map[] = { | 56 | static enum can_state state_map[] = { |
86 | CAN_STATE_ERROR_ACTIVE, | 57 | CAN_STATE_ERROR_ACTIVE, |
87 | CAN_STATE_ERROR_WARNING, | 58 | CAN_STATE_ERROR_WARNING, |
diff --git a/drivers/net/can/mscan/mscan.h b/drivers/net/can/mscan/mscan.h index 57820f5fb817..76a8abf1c347 100644 --- a/drivers/net/can/mscan/mscan.h +++ b/drivers/net/can/mscan/mscan.h | |||
@@ -226,6 +226,35 @@ struct mscan_regs { | |||
226 | #undef _MSCAN_RESERVED_ | 226 | #undef _MSCAN_RESERVED_ |
227 | #define MSCAN_REGION sizeof(struct mscan) | 227 | #define MSCAN_REGION sizeof(struct mscan) |
228 | 228 | ||
229 | #define MSCAN_NORMAL_MODE 0 | ||
230 | #define MSCAN_SLEEP_MODE MSCAN_SLPRQ | ||
231 | #define MSCAN_INIT_MODE (MSCAN_INITRQ | MSCAN_SLPRQ) | ||
232 | #define MSCAN_POWEROFF_MODE (MSCAN_CSWAI | MSCAN_SLPRQ) | ||
233 | #define MSCAN_SET_MODE_RETRIES 255 | ||
234 | #define MSCAN_ECHO_SKB_MAX 3 | ||
235 | |||
236 | #define BTR0_BRP_MASK 0x3f | ||
237 | #define BTR0_SJW_SHIFT 6 | ||
238 | #define BTR0_SJW_MASK (0x3 << BTR0_SJW_SHIFT) | ||
239 | |||
240 | #define BTR1_TSEG1_MASK 0xf | ||
241 | #define BTR1_TSEG2_SHIFT 4 | ||
242 | #define BTR1_TSEG2_MASK (0x7 << BTR1_TSEG2_SHIFT) | ||
243 | #define BTR1_SAM_SHIFT 7 | ||
244 | |||
245 | #define BTR0_SET_BRP(brp) (((brp) - 1) & BTR0_BRP_MASK) | ||
246 | #define BTR0_SET_SJW(sjw) ((((sjw) - 1) << BTR0_SJW_SHIFT) & \ | ||
247 | BTR0_SJW_MASK) | ||
248 | |||
249 | #define BTR1_SET_TSEG1(tseg1) (((tseg1) - 1) & BTR1_TSEG1_MASK) | ||
250 | #define BTR1_SET_TSEG2(tseg2) ((((tseg2) - 1) << BTR1_TSEG2_SHIFT) & \ | ||
251 | BTR1_TSEG2_MASK) | ||
252 | #define BTR1_SET_SAM(sam) ((sam) ? 1 << BTR1_SAM_SHIFT : 0) | ||
253 | |||
254 | #define F_RX_PROGRESS 0 | ||
255 | #define F_TX_PROGRESS 1 | ||
256 | #define F_TX_WAIT_ALL 2 | ||
257 | |||
229 | #define TX_QUEUE_SIZE 3 | 258 | #define TX_QUEUE_SIZE 3 |
230 | 259 | ||
231 | struct tx_queue_entry { | 260 | struct tx_queue_entry { |