Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
pch_can.c File Reference
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/io.h>
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/pci.h>
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>

Go to the source code of this file.

Data Structures

struct  pch_can_if_regs
 
struct  pch_can_regs
 
struct  pch_can_priv
 

Macros

#define PCH_CTRL_INIT   BIT(0) /* The INIT bit of CANCONT register. */
 
#define PCH_CTRL_IE   BIT(1) /* The IE bit of CAN control register */
 
#define PCH_CTRL_IE_SIE_EIE   (BIT(3) | BIT(2) | BIT(1))
 
#define PCH_CTRL_CCE   BIT(6)
 
#define PCH_CTRL_OPT   BIT(7) /* The OPT bit of CANCONT register. */
 
#define PCH_OPT_SILENT   BIT(3) /* The Silent bit of CANOPT reg. */
 
#define PCH_OPT_LBACK   BIT(4) /* The LoopBack bit of CANOPT reg. */
 
#define PCH_CMASK_RX_TX_SET   0x00f3
 
#define PCH_CMASK_RX_TX_GET   0x0073
 
#define PCH_CMASK_ALL   0xff
 
#define PCH_CMASK_NEWDAT   BIT(2)
 
#define PCH_CMASK_CLRINTPND   BIT(3)
 
#define PCH_CMASK_CTRL   BIT(4)
 
#define PCH_CMASK_ARB   BIT(5)
 
#define PCH_CMASK_MASK   BIT(6)
 
#define PCH_CMASK_RDWR   BIT(7)
 
#define PCH_IF_MCONT_NEWDAT   BIT(15)
 
#define PCH_IF_MCONT_MSGLOST   BIT(14)
 
#define PCH_IF_MCONT_INTPND   BIT(13)
 
#define PCH_IF_MCONT_UMASK   BIT(12)
 
#define PCH_IF_MCONT_TXIE   BIT(11)
 
#define PCH_IF_MCONT_RXIE   BIT(10)
 
#define PCH_IF_MCONT_RMTEN   BIT(9)
 
#define PCH_IF_MCONT_TXRQXT   BIT(8)
 
#define PCH_IF_MCONT_EOB   BIT(7)
 
#define PCH_IF_MCONT_DLC   (BIT(0) | BIT(1) | BIT(2) | BIT(3))
 
#define PCH_MASK2_MDIR_MXTD   (BIT(14) | BIT(15))
 
#define PCH_ID2_DIR   BIT(13)
 
#define PCH_ID2_XTD   BIT(14)
 
#define PCH_ID_MSGVAL   BIT(15)
 
#define PCH_IF_CREQ_BUSY   BIT(15)
 
#define PCH_STATUS_INT   0x8000
 
#define PCH_RP   0x00008000
 
#define PCH_REC   0x00007f00
 
#define PCH_TEC   0x000000ff
 
#define PCH_TX_OK   BIT(3)
 
#define PCH_RX_OK   BIT(4)
 
#define PCH_EPASSIV   BIT(5)
 
#define PCH_EWARN   BIT(6)
 
#define PCH_BUS_OFF   BIT(7)
 
#define PCH_BIT_BRP_SHIFT   0
 
#define PCH_BIT_SJW_SHIFT   6
 
#define PCH_BIT_TSEG1_SHIFT   8
 
#define PCH_BIT_TSEG2_SHIFT   12
 
#define PCH_BIT_BRPE_BRPE_SHIFT   6
 
#define PCH_MSK_BITT_BRP   0x3f
 
#define PCH_MSK_BRPE_BRPE   0x3c0
 
#define PCH_MSK_CTRL_IE_SIE_EIE   0x07
 
#define PCH_COUNTER_LIMIT   10
 
#define PCH_CAN_CLK   50000000 /* 50MHz */
 
#define PCH_RX_OBJ_NUM   26
 
#define PCH_TX_OBJ_NUM   6
 
#define PCH_RX_OBJ_START   1
 
#define PCH_RX_OBJ_END   PCH_RX_OBJ_NUM
 
#define PCH_TX_OBJ_START   (PCH_RX_OBJ_END + 1)
 
#define PCH_TX_OBJ_END   (PCH_RX_OBJ_NUM + PCH_TX_OBJ_NUM)
 
#define PCH_FIFO_THRESH   16
 
#define PCH_TREQ2_TX_MASK
 
#define pch_can_suspend   NULL
 
#define pch_can_resume   NULL
 

Enumerations

enum  pch_ifreg { PCH_RX_IFREG, PCH_TX_IFREG }
 
enum  pch_can_err {
  PCH_STUF_ERR = 1, PCH_FORM_ERR, PCH_ACK_ERR, PCH_BIT1_ERR,
  PCH_BIT0_ERR, PCH_CRC_ERR, PCH_LEC_ALL
}
 
enum  pch_can_mode {
  PCH_CAN_ENABLE, PCH_CAN_DISABLE, PCH_CAN_ALL, PCH_CAN_NONE,
  PCH_CAN_STOP, PCH_CAN_RUN
}
 

Functions

 MODULE_DEVICE_TABLE (pci, pch_pci_tbl)
 
 module_pci_driver (pch_can_pci_driver)
 
 MODULE_DESCRIPTION ("Intel EG20T PCH CAN(Controller Area Network) Driver")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_VERSION ("0.94")
 

Macro Definition Documentation

#define PCH_BIT_BRP_SHIFT   0

Definition at line 80 of file pch_can.c.

#define PCH_BIT_BRPE_BRPE_SHIFT   6

Definition at line 84 of file pch_can.c.

#define PCH_BIT_SJW_SHIFT   6

Definition at line 81 of file pch_can.c.

#define PCH_BIT_TSEG1_SHIFT   8

Definition at line 82 of file pch_can.c.

#define PCH_BIT_TSEG2_SHIFT   12

Definition at line 83 of file pch_can.c.

#define PCH_BUS_OFF   BIT(7)

Definition at line 77 of file pch_can.c.

#define PCH_CAN_CLK   50000000 /* 50MHz */

Definition at line 91 of file pch_can.c.

#define pch_can_resume   NULL

Definition at line 1166 of file pch_can.c.

#define pch_can_suspend   NULL

Definition at line 1165 of file pch_can.c.

#define PCH_CMASK_ALL   0xff

Definition at line 45 of file pch_can.c.

#define PCH_CMASK_ARB   BIT(5)

Definition at line 49 of file pch_can.c.

#define PCH_CMASK_CLRINTPND   BIT(3)

Definition at line 47 of file pch_can.c.

#define PCH_CMASK_CTRL   BIT(4)

Definition at line 48 of file pch_can.c.

#define PCH_CMASK_MASK   BIT(6)

Definition at line 50 of file pch_can.c.

#define PCH_CMASK_NEWDAT   BIT(2)

Definition at line 46 of file pch_can.c.

#define PCH_CMASK_RDWR   BIT(7)

Definition at line 51 of file pch_can.c.

#define PCH_CMASK_RX_TX_GET   0x0073

Definition at line 44 of file pch_can.c.

#define PCH_CMASK_RX_TX_SET   0x00f3

Definition at line 43 of file pch_can.c.

#define PCH_COUNTER_LIMIT   10

Definition at line 89 of file pch_can.c.

#define PCH_CTRL_CCE   BIT(6)

Definition at line 38 of file pch_can.c.

#define PCH_CTRL_IE   BIT(1) /* The IE bit of CAN control register */

Definition at line 36 of file pch_can.c.

#define PCH_CTRL_IE_SIE_EIE   (BIT(3) | BIT(2) | BIT(1))

Definition at line 37 of file pch_can.c.

#define PCH_CTRL_INIT   BIT(0) /* The INIT bit of CANCONT register. */

Definition at line 35 of file pch_can.c.

#define PCH_CTRL_OPT   BIT(7) /* The OPT bit of CANCONT register. */

Definition at line 39 of file pch_can.c.

#define PCH_EPASSIV   BIT(5)

Definition at line 75 of file pch_can.c.

#define PCH_EWARN   BIT(6)

Definition at line 76 of file pch_can.c.

#define PCH_FIFO_THRESH   16

Definition at line 105 of file pch_can.c.

#define PCH_ID2_DIR   BIT(13)

Definition at line 63 of file pch_can.c.

#define PCH_ID2_XTD   BIT(14)

Definition at line 64 of file pch_can.c.

#define PCH_ID_MSGVAL   BIT(15)

Definition at line 65 of file pch_can.c.

#define PCH_IF_CREQ_BUSY   BIT(15)

Definition at line 66 of file pch_can.c.

#define PCH_IF_MCONT_DLC   (BIT(0) | BIT(1) | BIT(2) | BIT(3))

Definition at line 61 of file pch_can.c.

#define PCH_IF_MCONT_EOB   BIT(7)

Definition at line 60 of file pch_can.c.

#define PCH_IF_MCONT_INTPND   BIT(13)

Definition at line 54 of file pch_can.c.

#define PCH_IF_MCONT_MSGLOST   BIT(14)

Definition at line 53 of file pch_can.c.

#define PCH_IF_MCONT_NEWDAT   BIT(15)

Definition at line 52 of file pch_can.c.

#define PCH_IF_MCONT_RMTEN   BIT(9)

Definition at line 58 of file pch_can.c.

#define PCH_IF_MCONT_RXIE   BIT(10)

Definition at line 57 of file pch_can.c.

#define PCH_IF_MCONT_TXIE   BIT(11)

Definition at line 56 of file pch_can.c.

#define PCH_IF_MCONT_TXRQXT   BIT(8)

Definition at line 59 of file pch_can.c.

#define PCH_IF_MCONT_UMASK   BIT(12)

Definition at line 55 of file pch_can.c.

#define PCH_MASK2_MDIR_MXTD   (BIT(14) | BIT(15))

Definition at line 62 of file pch_can.c.

#define PCH_MSK_BITT_BRP   0x3f

Definition at line 86 of file pch_can.c.

#define PCH_MSK_BRPE_BRPE   0x3c0

Definition at line 87 of file pch_can.c.

#define PCH_MSK_CTRL_IE_SIE_EIE   0x07

Definition at line 88 of file pch_can.c.

#define PCH_OPT_LBACK   BIT(4) /* The LoopBack bit of CANOPT reg. */

Definition at line 41 of file pch_can.c.

#define PCH_OPT_SILENT   BIT(3) /* The Silent bit of CANOPT reg. */

Definition at line 40 of file pch_can.c.

#define PCH_REC   0x00007f00

Definition at line 70 of file pch_can.c.

#define PCH_RP   0x00008000

Definition at line 69 of file pch_can.c.

#define PCH_RX_OBJ_END   PCH_RX_OBJ_NUM

Definition at line 101 of file pch_can.c.

#define PCH_RX_OBJ_NUM   26

Definition at line 98 of file pch_can.c.

#define PCH_RX_OBJ_START   1

Definition at line 100 of file pch_can.c.

#define PCH_RX_OK   BIT(4)

Definition at line 74 of file pch_can.c.

#define PCH_STATUS_INT   0x8000

Definition at line 68 of file pch_can.c.

#define PCH_TEC   0x000000ff

Definition at line 71 of file pch_can.c.

#define PCH_TREQ2_TX_MASK
Value:
(((1 << PCH_TX_OBJ_NUM) - 1) <<\

Definition at line 108 of file pch_can.c.

#define PCH_TX_OBJ_END   (PCH_RX_OBJ_NUM + PCH_TX_OBJ_NUM)

Definition at line 103 of file pch_can.c.

#define PCH_TX_OBJ_NUM   6

Definition at line 99 of file pch_can.c.

#define PCH_TX_OBJ_START   (PCH_RX_OBJ_END + 1)

Definition at line 102 of file pch_can.c.

#define PCH_TX_OK   BIT(3)

Definition at line 73 of file pch_can.c.

Enumeration Type Documentation

Enumerator:
PCH_STUF_ERR 
PCH_FORM_ERR 
PCH_ACK_ERR 
PCH_BIT1_ERR 
PCH_BIT0_ERR 
PCH_CRC_ERR 
PCH_LEC_ALL 

Definition at line 116 of file pch_can.c.

Enumerator:
PCH_CAN_ENABLE 
PCH_CAN_DISABLE 
PCH_CAN_ALL 
PCH_CAN_NONE 
PCH_CAN_STOP 
PCH_CAN_RUN 

Definition at line 126 of file pch_can.c.

enum pch_ifreg
Enumerator:
PCH_RX_IFREG 
PCH_TX_IFREG 

Definition at line 111 of file pch_can.c.

Function Documentation

MODULE_DESCRIPTION ( "Intel EG20T PCH CAN(Controller Area Network) Driver"  )
MODULE_DEVICE_TABLE ( pci  ,
pch_pci_tbl   
)
MODULE_LICENSE ( "GPL v2 )
module_pci_driver ( pch_can_pci_driver  )
MODULE_VERSION ( "0.94"  )