#include <linux/can/core.h>
#include <linux/can/dev.h>
#include <linux/can/platform/mcp251x.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/dma-mapping.h>
#include <linux/freezer.h>
#include <linux/interrupt.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/uaccess.h>
Go to the source code of this file.
#define AFTER_SUSPEND_DOWN 2 |
#define AFTER_SUSPEND_POWER 4 |
#define AFTER_SUSPEND_RESTART 8 |
#define AFTER_SUSPEND_UP 1 |
#define CAN_FRAME_MAX_BITS 128 |
#define CAN_FRAME_MAX_DATA_LEN 8 |
#define CANCTRL_ABAT 0x10 |
#define CANCTRL_REQOP_CONF 0x80 |
#define CANCTRL_REQOP_LISTEN_ONLY 0x60 |
#define CANCTRL_REQOP_LOOPBACK 0x40 |
#define CANCTRL_REQOP_MASK 0xe0 |
#define CANCTRL_REQOP_NORMAL 0x00 |
#define CANCTRL_REQOP_SLEEP 0x20 |
#define CANINTE_ERRIE 0x20 |
#define CANINTE_MERRE 0x80 |
#define CANINTE_RX0IE 0x01 |
#define CANINTE_RX1IE 0x02 |
#define CANINTE_TX0IE 0x04 |
#define CANINTE_TX1IE 0x08 |
#define CANINTE_TX2IE 0x10 |
#define CANINTE_WAKIE 0x40 |
#define CANINTF_ERRIF 0x20 |
#define CANINTF_MERRF 0x80 |
#define CANINTF_RX0IF 0x01 |
#define CANINTF_RX1IF 0x02 |
#define CANINTF_TX0IF 0x04 |
#define CANINTF_TX1IF 0x08 |
#define CANINTF_TX2IF 0x10 |
#define CANINTF_WAKIF 0x40 |
#define CNF2_BTLMODE 0x80 |
#define CNF3_PHSEG2_MASK 0x07 |
#define DEVICE_NAME "mcp251x" |
#define INSTRUCTION_BIT_MODIFY 0x05 |
#define INSTRUCTION_LOAD_TXB |
( |
|
n | ) |
(0x40 + 2 * (n)) |
#define INSTRUCTION_READ 0x03 |
#define INSTRUCTION_READ_RXB |
( |
|
n | ) |
(((n) == 0) ? 0x90 : 0x94) |
#define INSTRUCTION_RESET 0xC0 |
#define INSTRUCTION_RTS |
( |
|
n | ) |
(0x80 | ((n) & 0x07)) |
#define INSTRUCTION_WRITE 0x02 |
#define mcp251x_can_resume NULL |
#define mcp251x_can_suspend NULL |
#define MCP251X_IS |
( |
|
_model | ) |
|
Value:
return priv->model == CAN_MCP251X_MCP##_model; \
}
Definition at line 268 of file mcp251x.c.
#define RXBCTRL |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBCTRL_OFF) |
#define RXBCTRL_BUKT 0x04 |
#define RXBCTRL_RXM0 0x20 |
#define RXBCTRL_RXM1 0x40 |
#define RXBDLC |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBDLC_OFF) |
#define RXBDLC_LEN_MASK 0x0f |
#define RXBEID0 |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBEID0_OFF) |
#define RXBEID8 |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBEID8_OFF) |
#define RXBSIDH |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBSIDH_OFF) |
#define RXBSIDL |
( |
|
n | ) |
(((n) * 0x10) + 0x60 + RXBSIDL_OFF) |
#define RXFEID0 |
( |
|
n | ) |
((n) * 4 + 3) |
#define RXFEID8 |
( |
|
n | ) |
((n) * 4 + 2) |
#define RXFSIDH |
( |
|
n | ) |
((n) * 4) |
#define RXFSIDL |
( |
|
n | ) |
((n) * 4 + 1) |
#define RXMEID0 |
( |
|
n | ) |
((n) * 4 + 0x23) |
#define RXMEID8 |
( |
|
n | ) |
((n) * 4 + 0x22) |
#define RXMSIDH |
( |
|
n | ) |
((n) * 4 + 0x20) |
#define RXMSIDL |
( |
|
n | ) |
((n) * 4 + 0x21) |
#define SET_BYTE |
( |
|
val, |
|
|
|
byte |
|
) |
| (((val) & 0xff) << ((byte) * 8)) |
#define SIDL_EID_SHIFT 16 |
#define SIDL_EXIDE_SHIFT 3 |
#define TX_ECHO_SKB_MAX 1 |
#define TXBCTRL |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBCTRL_OFF) |
#define TXBCTRL_ABTF 0x40 |
#define TXBCTRL_MLOA 0x20 |
#define TXBCTRL_TXERR 0x10 |
#define TXBCTRL_TXREQ 0x08 |
#define TXBDLC |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBDLC_OFF) |
#define TXBEID0 |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBEID0_OFF) |
#define TXBEID8 |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBEID8_OFF) |
#define TXBSIDH |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBSIDH_OFF) |
#define TXBSIDL |
( |
|
n | ) |
(((n) * 0x10) + 0x30 + TXBSIDL_OFF) |
- Enumerator:
CAN_MCP251X_MCP2510 |
|
CAN_MCP251X_MCP2515 |
|
Definition at line 234 of file mcp251x.c.
MODULE_AUTHOR |
( |
"Chris Elston <[email protected]> |
, |
|
|
""Christian Pellegrin< chripell @evolware.org >" |
|
|
) |
| |
MODULE_DESCRIPTION |
( |
"Microchip 251x CAN driver" |
| ) |
|
MODULE_DEVICE_TABLE |
( |
spi |
, |
|
|
mcp251x_id_table |
|
|
) |
| |
module_exit |
( |
mcp251x_can_exit |
| ) |
|
module_init |
( |
mcp251x_can_init |
| ) |
|
MODULE_LICENSE |
( |
"GPL v2" |
| ) |
|
module_param |
( |
mcp251x_enable_dma |
, |
|
|
int |
, |
|
|
S_IRUGO |
|
|
) |
| |
MODULE_PARM_DESC |
( |
mcp251x_enable_dma |
, |
|
|
"Enable SPI DMA. Default: 0 (Off)" |
|
|
) |
| |