Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions
at91_can.c File Reference
#include <linux/clk.h>
#include <linux/errno.h>
#include <linux/if_arp.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/platform_device.h>
#include <linux/rtnetlink.h>
#include <linux/skbuff.h>
#include <linux/spinlock.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <mach/board.h>

Go to the source code of this file.

Data Structures

struct  at91_devtype_data
 
struct  at91_priv
 

Macros

#define AT91_MB_MASK(i)   ((1 << (i)) - 1)
 
#define AT91_MMR(i)   (enum at91_reg)(0x200 + ((i) * 0x20))
 
#define AT91_MAM(i)   (enum at91_reg)(0x204 + ((i) * 0x20))
 
#define AT91_MID(i)   (enum at91_reg)(0x208 + ((i) * 0x20))
 
#define AT91_MFID(i)   (enum at91_reg)(0x20C + ((i) * 0x20))
 
#define AT91_MSR(i)   (enum at91_reg)(0x210 + ((i) * 0x20))
 
#define AT91_MDL(i)   (enum at91_reg)(0x214 + ((i) * 0x20))
 
#define AT91_MDH(i)   (enum at91_reg)(0x218 + ((i) * 0x20))
 
#define AT91_MCR(i)   (enum at91_reg)(0x21C + ((i) * 0x20))
 
#define AT91_MR_CANEN   BIT(0)
 
#define AT91_MR_LPM   BIT(1)
 
#define AT91_MR_ABM   BIT(2)
 
#define AT91_MR_OVL   BIT(3)
 
#define AT91_MR_TEOF   BIT(4)
 
#define AT91_MR_TTM   BIT(5)
 
#define AT91_MR_TIMFRZ   BIT(6)
 
#define AT91_MR_DRPT   BIT(7)
 
#define AT91_SR_RBSY   BIT(29)
 
#define AT91_MMR_PRIO_SHIFT   (16)
 
#define AT91_MID_MIDE   BIT(29)
 
#define AT91_MSR_MRTR   BIT(20)
 
#define AT91_MSR_MABT   BIT(22)
 
#define AT91_MSR_MRDY   BIT(23)
 
#define AT91_MSR_MMI   BIT(24)
 
#define AT91_MCR_MRTR   BIT(20)
 
#define AT91_MCR_MTCR   BIT(23)
 
#define AT91_IRQ_ERRA   (1 << 16)
 
#define AT91_IRQ_WARN   (1 << 17)
 
#define AT91_IRQ_ERRP   (1 << 18)
 
#define AT91_IRQ_BOFF   (1 << 19)
 
#define AT91_IRQ_SLEEP   (1 << 20)
 
#define AT91_IRQ_WAKEUP   (1 << 21)
 
#define AT91_IRQ_TOVF   (1 << 22)
 
#define AT91_IRQ_TSTP   (1 << 23)
 
#define AT91_IRQ_CERR   (1 << 24)
 
#define AT91_IRQ_SERR   (1 << 25)
 
#define AT91_IRQ_AERR   (1 << 26)
 
#define AT91_IRQ_FERR   (1 << 27)
 
#define AT91_IRQ_BERR   (1 << 28)
 
#define AT91_IRQ_ERR_ALL   (0x1fff0000)
 
#define AT91_IRQ_ERR_FRAME
 
#define AT91_IRQ_ERR_LINE
 
#define AT91_IRQ_ALL   (0x1fffffff)
 
#define AT91_IS(_model)
 

Enumerations

enum  at91_reg {
  AT91_MR = 0x000, AT91_IER = 0x004, AT91_IDR = 0x008, AT91_IMR = 0x00C,
  AT91_SR = 0x010, AT91_BR = 0x014, AT91_TIM = 0x018, AT91_TIMESTP = 0x01C,
  AT91_ECR = 0x020, AT91_TCR = 0x024, AT91_ACR = 0x028
}
 
enum  at91_mb_mode {
  AT91_MB_MODE_DISABLED = 0, AT91_MB_MODE_RX = 1, AT91_MB_MODE_RX_OVRWR = 2, AT91_MB_MODE_TX = 3,
  AT91_MB_MODE_CONSUMER = 4, AT91_MB_MODE_PRODUCER = 5
}
 
enum  at91_devtype { AT91_DEVTYPE_SAM9263, AT91_DEVTYPE_SAM9X5 }
 

Functions

 AT91_IS (9263)
 
 AT91_IS (9X5)
 
 module_platform_driver (at91_can_driver)
 
 MODULE_AUTHOR ("Marc Kleine-Budde <[email protected]>")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_DESCRIPTION (KBUILD_MODNAME" CAN netdevice driver")
 

Macro Definition Documentation

#define AT91_IRQ_AERR   (1 << 26)

Definition at line 114 of file at91_can.c.

#define AT91_IRQ_ALL   (0x1fffffff)

Definition at line 124 of file at91_can.c.

#define AT91_IRQ_BERR   (1 << 28)

Definition at line 116 of file at91_can.c.

#define AT91_IRQ_BOFF   (1 << 19)

Definition at line 107 of file at91_can.c.

#define AT91_IRQ_CERR   (1 << 24)

Definition at line 112 of file at91_can.c.

#define AT91_IRQ_ERR_ALL   (0x1fff0000)

Definition at line 118 of file at91_can.c.

#define AT91_IRQ_ERR_FRAME
Value:

Definition at line 119 of file at91_can.c.

#define AT91_IRQ_ERR_LINE
Value:
AT91_IRQ_ERRP | AT91_IRQ_BOFF)

Definition at line 121 of file at91_can.c.

#define AT91_IRQ_ERRA   (1 << 16)

Definition at line 104 of file at91_can.c.

#define AT91_IRQ_ERRP   (1 << 18)

Definition at line 106 of file at91_can.c.

#define AT91_IRQ_FERR   (1 << 27)

Definition at line 115 of file at91_can.c.

#define AT91_IRQ_SERR   (1 << 25)

Definition at line 113 of file at91_can.c.

#define AT91_IRQ_SLEEP   (1 << 20)

Definition at line 108 of file at91_can.c.

#define AT91_IRQ_TOVF   (1 << 22)

Definition at line 110 of file at91_can.c.

#define AT91_IRQ_TSTP   (1 << 23)

Definition at line 111 of file at91_can.c.

#define AT91_IRQ_WAKEUP   (1 << 21)

Definition at line 109 of file at91_can.c.

#define AT91_IRQ_WARN   (1 << 17)

Definition at line 105 of file at91_can.c.

#define AT91_IS (   _model)
Value:
static inline int at91_is_sam##_model(const struct at91_priv *priv) \
{ \
return priv->devtype_data.type == AT91_DEVTYPE_SAM##_model; \
}

Definition at line 185 of file at91_can.c.

#define AT91_MAM (   i)    (enum at91_reg)(0x204 + ((i) * 0x20))

Definition at line 61 of file at91_can.c.

#define AT91_MB_MASK (   i)    ((1 << (i)) - 1)

Definition at line 42 of file at91_can.c.

#define AT91_MCR (   i)    (enum at91_reg)(0x21C + ((i) * 0x20))

Definition at line 67 of file at91_can.c.

#define AT91_MCR_MRTR   BIT(20)

Definition at line 90 of file at91_can.c.

#define AT91_MCR_MTCR   BIT(23)

Definition at line 91 of file at91_can.c.

#define AT91_MDH (   i)    (enum at91_reg)(0x218 + ((i) * 0x20))

Definition at line 66 of file at91_can.c.

#define AT91_MDL (   i)    (enum at91_reg)(0x214 + ((i) * 0x20))

Definition at line 65 of file at91_can.c.

#define AT91_MFID (   i)    (enum at91_reg)(0x20C + ((i) * 0x20))

Definition at line 63 of file at91_can.c.

#define AT91_MID (   i)    (enum at91_reg)(0x208 + ((i) * 0x20))

Definition at line 62 of file at91_can.c.

#define AT91_MID_MIDE   BIT(29)

Definition at line 83 of file at91_can.c.

#define AT91_MMR (   i)    (enum at91_reg)(0x200 + ((i) * 0x20))

Definition at line 60 of file at91_can.c.

#define AT91_MMR_PRIO_SHIFT   (16)

Definition at line 81 of file at91_can.c.

#define AT91_MR_ABM   BIT(2)

Definition at line 72 of file at91_can.c.

#define AT91_MR_CANEN   BIT(0)

Definition at line 70 of file at91_can.c.

#define AT91_MR_DRPT   BIT(7)

Definition at line 77 of file at91_can.c.

#define AT91_MR_LPM   BIT(1)

Definition at line 71 of file at91_can.c.

#define AT91_MR_OVL   BIT(3)

Definition at line 73 of file at91_can.c.

#define AT91_MR_TEOF   BIT(4)

Definition at line 74 of file at91_can.c.

#define AT91_MR_TIMFRZ   BIT(6)

Definition at line 76 of file at91_can.c.

#define AT91_MR_TTM   BIT(5)

Definition at line 75 of file at91_can.c.

#define AT91_MSR (   i)    (enum at91_reg)(0x210 + ((i) * 0x20))

Definition at line 64 of file at91_can.c.

#define AT91_MSR_MABT   BIT(22)

Definition at line 86 of file at91_can.c.

#define AT91_MSR_MMI   BIT(24)

Definition at line 88 of file at91_can.c.

#define AT91_MSR_MRDY   BIT(23)

Definition at line 87 of file at91_can.c.

#define AT91_MSR_MRTR   BIT(20)

Definition at line 85 of file at91_can.c.

#define AT91_SR_RBSY   BIT(29)

Definition at line 79 of file at91_can.c.

Enumeration Type Documentation

Enumerator:
AT91_DEVTYPE_SAM9263 
AT91_DEVTYPE_SAM9X5 

Definition at line 126 of file at91_can.c.

Enumerator:
AT91_MB_MODE_DISABLED 
AT91_MB_MODE_RX 
AT91_MB_MODE_RX_OVRWR 
AT91_MB_MODE_TX 
AT91_MB_MODE_CONSUMER 
AT91_MB_MODE_PRODUCER 

Definition at line 94 of file at91_can.c.

enum at91_reg
Enumerator:
AT91_MR 
AT91_IER 
AT91_IDR 
AT91_IMR 
AT91_SR 
AT91_BR 
AT91_TIM 
AT91_TIMESTP 
AT91_ECR 
AT91_TCR 
AT91_ACR 

Definition at line 45 of file at91_can.c.

Function Documentation

AT91_IS ( 9263  )
AT91_IS ( 9X5  )
MODULE_AUTHOR ( "Marc Kleine-Budde <[email protected]>"  )
MODULE_DESCRIPTION ( KBUILD_MODNAME" CAN netdevice driver )
MODULE_LICENSE ( "GPL v2 )
module_platform_driver ( at91_can_driver  )