Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Enumerations | Functions | Variables
mscan.h File Reference
#include <linux/types.h>

Go to the source code of this file.

Data Structures

struct  mscan_regs
 
struct  tx_queue_entry
 
struct  mscan_priv
 

Macros

#define MSCAN_RXFRM   0x80
 
#define MSCAN_RXACT   0x40
 
#define MSCAN_CSWAI   0x20
 
#define MSCAN_SYNCH   0x10
 
#define MSCAN_TIME   0x08
 
#define MSCAN_WUPE   0x04
 
#define MSCAN_SLPRQ   0x02
 
#define MSCAN_INITRQ   0x01
 
#define MSCAN_CANE   0x80
 
#define MSCAN_CLKSRC   0x40
 
#define MSCAN_LOOPB   0x20
 
#define MSCAN_LISTEN   0x10
 
#define MSCAN_BORM   0x08
 
#define MSCAN_WUPM   0x04
 
#define MSCAN_SLPAK   0x02
 
#define MSCAN_INITAK   0x01
 
#define MSCAN_CLKSRC_BUS   MSCAN_CLKSRC
 
#define MSCAN_CLKSRC_XTAL   0
 
#define MSCAN_WUPIF   0x80
 
#define MSCAN_CSCIF   0x40
 
#define MSCAN_RSTAT1   0x20
 
#define MSCAN_RSTAT0   0x10
 
#define MSCAN_TSTAT1   0x08
 
#define MSCAN_TSTAT0   0x04
 
#define MSCAN_OVRIF   0x02
 
#define MSCAN_RXF   0x01
 
#define MSCAN_ERR_IF   (MSCAN_OVRIF | MSCAN_CSCIF)
 
#define MSCAN_RSTAT_MSK   (MSCAN_RSTAT1 | MSCAN_RSTAT0)
 
#define MSCAN_TSTAT_MSK   (MSCAN_TSTAT1 | MSCAN_TSTAT0)
 
#define MSCAN_STAT_MSK   (MSCAN_RSTAT_MSK | MSCAN_TSTAT_MSK)
 
#define MSCAN_STATE_BUS_OFF
 
#define MSCAN_STATE_TX(canrflg)   (((canrflg)&MSCAN_TSTAT_MSK)>>2)
 
#define MSCAN_STATE_RX(canrflg)   (((canrflg)&MSCAN_RSTAT_MSK)>>4)
 
#define MSCAN_STATE_ACTIVE   0
 
#define MSCAN_STATE_WARNING   1
 
#define MSCAN_STATE_PASSIVE   2
 
#define MSCAN_STATE_BUSOFF   3
 
#define MSCAN_WUPIE   0x80
 
#define MSCAN_CSCIE   0x40
 
#define MSCAN_RSTATE1   0x20
 
#define MSCAN_RSTATE0   0x10
 
#define MSCAN_TSTATE1   0x08
 
#define MSCAN_TSTATE0   0x04
 
#define MSCAN_OVRIE   0x02
 
#define MSCAN_RXFIE   0x01
 
#define MSCAN_TXE2   0x04
 
#define MSCAN_TXE1   0x02
 
#define MSCAN_TXE0   0x01
 
#define MSCAN_TXE   (MSCAN_TXE2 | MSCAN_TXE1 | MSCAN_TXE0)
 
#define MSCAN_TXIE2   0x04
 
#define MSCAN_TXIE1   0x02
 
#define MSCAN_TXIE0   0x01
 
#define MSCAN_TXIE   (MSCAN_TXIE2 | MSCAN_TXIE1 | MSCAN_TXIE0)
 
#define MSCAN_ABTRQ2   0x04
 
#define MSCAN_ABTRQ1   0x02
 
#define MSCAN_ABTRQ0   0x01
 
#define MSCAN_ABTAK2   0x04
 
#define MSCAN_ABTAK1   0x02
 
#define MSCAN_ABTAK0   0x01
 
#define MSCAN_TX2   0x04
 
#define MSCAN_TX1   0x02
 
#define MSCAN_TX0   0x01
 
#define MSCAN_IDAM1   0x20
 
#define MSCAN_IDAM0   0x10
 
#define MSCAN_IDHIT2   0x04
 
#define MSCAN_IDHIT1   0x02
 
#define MSCAN_IDHIT0   0x01
 
#define MSCAN_AF_32BIT   0x00
 
#define MSCAN_AF_16BIT   MSCAN_IDAM0
 
#define MSCAN_AF_8BIT   MSCAN_IDAM1
 
#define MSCAN_AF_CLOSED   (MSCAN_IDAM0|MSCAN_IDAM1)
 
#define MSCAN_AF_MASK   (~(MSCAN_IDAM0|MSCAN_IDAM1))
 
#define MSCAN_BOHOLD   0x01
 
#define MSCAN_SFF_RTR_SHIFT   4
 
#define MSCAN_EFF_RTR_SHIFT   0
 
#define MSCAN_EFF_FLAGS   0x18 /* IDE + SRR */
 
#define _MSCAN_RESERVED_(n, num)
 
#define _MSCAN_RESERVED_DSR_SIZE   0
 
#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 MSCAN_RX_INTS_ENABLE
 
#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)
 
#define BTR1_SET_TSEG1(tseg1)   (((tseg1) - 1) & BTR1_TSEG1_MASK)
 
#define BTR1_SET_TSEG2(tseg2)
 
#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
 

Enumerations

enum  { MSCAN_TYPE_MPC5200, MSCAN_TYPE_MPC5121 }
 

Functions

struct net_devicealloc_mscandev (void)
 
int register_mscandev (struct net_device *dev, int mscan_clksrc)
 
void unregister_mscandev (struct net_device *dev)
 

Variables

struct mscan_regs __packed
 

Macro Definition Documentation

#define _MSCAN_RESERVED_ (   n,
  num 
)

Definition at line 145 of file mscan.h.

#define _MSCAN_RESERVED_DSR_SIZE   0

Definition at line 146 of file mscan.h.

#define BTR0_BRP_MASK   0x3f

Definition at line 251 of file mscan.h.

#define BTR0_SET_BRP (   brp)    (((brp) - 1) & BTR0_BRP_MASK)

Definition at line 260 of file mscan.h.

#define BTR0_SET_SJW (   sjw)
Value:
((((sjw) - 1) << BTR0_SJW_SHIFT) & \

Definition at line 261 of file mscan.h.

#define BTR0_SJW_MASK   (0x3 << BTR0_SJW_SHIFT)

Definition at line 253 of file mscan.h.

#define BTR0_SJW_SHIFT   6

Definition at line 252 of file mscan.h.

#define BTR1_SAM_SHIFT   7

Definition at line 258 of file mscan.h.

#define BTR1_SET_SAM (   sam)    ((sam) ? 1 << BTR1_SAM_SHIFT : 0)

Definition at line 267 of file mscan.h.

#define BTR1_SET_TSEG1 (   tseg1)    (((tseg1) - 1) & BTR1_TSEG1_MASK)

Definition at line 264 of file mscan.h.

#define BTR1_SET_TSEG2 (   tseg2)
Value:
((((tseg2) - 1) << BTR1_TSEG2_SHIFT) & \

Definition at line 265 of file mscan.h.

#define BTR1_TSEG1_MASK   0xf

Definition at line 255 of file mscan.h.

#define BTR1_TSEG2_MASK   (0x7 << BTR1_TSEG2_SHIFT)

Definition at line 257 of file mscan.h.

#define BTR1_TSEG2_SHIFT   4

Definition at line 256 of file mscan.h.

#define F_RX_PROGRESS   0

Definition at line 269 of file mscan.h.

#define F_TX_PROGRESS   1

Definition at line 270 of file mscan.h.

#define F_TX_WAIT_ALL   2

Definition at line 271 of file mscan.h.

#define MSCAN_ABTAK0   0x01

Definition at line 113 of file mscan.h.

#define MSCAN_ABTAK1   0x02

Definition at line 112 of file mscan.h.

#define MSCAN_ABTAK2   0x04

Definition at line 111 of file mscan.h.

#define MSCAN_ABTRQ0   0x01

Definition at line 108 of file mscan.h.

#define MSCAN_ABTRQ1   0x02

Definition at line 107 of file mscan.h.

#define MSCAN_ABTRQ2   0x04

Definition at line 106 of file mscan.h.

#define MSCAN_AF_16BIT   MSCAN_IDAM0

Definition at line 128 of file mscan.h.

#define MSCAN_AF_32BIT   0x00

Definition at line 127 of file mscan.h.

#define MSCAN_AF_8BIT   MSCAN_IDAM1

Definition at line 129 of file mscan.h.

#define MSCAN_AF_CLOSED   (MSCAN_IDAM0|MSCAN_IDAM1)

Definition at line 130 of file mscan.h.

#define MSCAN_AF_MASK   (~(MSCAN_IDAM0|MSCAN_IDAM1))

Definition at line 131 of file mscan.h.

#define MSCAN_BOHOLD   0x01

Definition at line 134 of file mscan.h.

#define MSCAN_BORM   0x08

Definition at line 41 of file mscan.h.

#define MSCAN_CANE   0x80

Definition at line 37 of file mscan.h.

#define MSCAN_CLKSRC   0x40

Definition at line 38 of file mscan.h.

#define MSCAN_CLKSRC_BUS   MSCAN_CLKSRC

Definition at line 56 of file mscan.h.

#define MSCAN_CLKSRC_XTAL   0

Definition at line 57 of file mscan.h.

#define MSCAN_CSCIE   0x40

Definition at line 85 of file mscan.h.

#define MSCAN_CSCIF   0x40

Definition at line 62 of file mscan.h.

#define MSCAN_CSWAI   0x20

Definition at line 29 of file mscan.h.

#define MSCAN_ECHO_SKB_MAX   3

Definition at line 240 of file mscan.h.

#define MSCAN_EFF_FLAGS   0x18 /* IDE + SRR */

Definition at line 139 of file mscan.h.

#define MSCAN_EFF_RTR_SHIFT   0

Definition at line 138 of file mscan.h.

#define MSCAN_ERR_IF   (MSCAN_OVRIF | MSCAN_CSCIF)

Definition at line 69 of file mscan.h.

#define MSCAN_IDAM0   0x10

Definition at line 122 of file mscan.h.

#define MSCAN_IDAM1   0x20

Definition at line 121 of file mscan.h.

#define MSCAN_IDHIT0   0x01

Definition at line 125 of file mscan.h.

#define MSCAN_IDHIT1   0x02

Definition at line 124 of file mscan.h.

#define MSCAN_IDHIT2   0x04

Definition at line 123 of file mscan.h.

#define MSCAN_INIT_MODE   (MSCAN_INITRQ | MSCAN_SLPRQ)

Definition at line 237 of file mscan.h.

#define MSCAN_INITAK   0x01

Definition at line 44 of file mscan.h.

#define MSCAN_INITRQ   0x01

Definition at line 34 of file mscan.h.

#define MSCAN_LISTEN   0x10

Definition at line 40 of file mscan.h.

#define MSCAN_LOOPB   0x20

Definition at line 39 of file mscan.h.

#define MSCAN_NORMAL_MODE   0

Definition at line 235 of file mscan.h.

#define MSCAN_OVRIE   0x02

Definition at line 90 of file mscan.h.

#define MSCAN_OVRIF   0x02

Definition at line 67 of file mscan.h.

#define MSCAN_POWEROFF_MODE   (MSCAN_CSWAI | MSCAN_SLPRQ)

Definition at line 238 of file mscan.h.

#define MSCAN_REGION   sizeof(struct mscan)

Definition at line 233 of file mscan.h.

#define MSCAN_RSTAT0   0x10

Definition at line 64 of file mscan.h.

#define MSCAN_RSTAT1   0x20

Definition at line 63 of file mscan.h.

#define MSCAN_RSTAT_MSK   (MSCAN_RSTAT1 | MSCAN_RSTAT0)

Definition at line 70 of file mscan.h.

#define MSCAN_RSTATE0   0x10

Definition at line 87 of file mscan.h.

#define MSCAN_RSTATE1   0x20

Definition at line 86 of file mscan.h.

#define MSCAN_RX_INTS_ENABLE
Value:
MSCAN_RSTATE1 | MSCAN_RSTATE0 | \
MSCAN_TSTATE1 | MSCAN_TSTATE0)

Definition at line 241 of file mscan.h.

#define MSCAN_RXACT   0x40

Definition at line 28 of file mscan.h.

#define MSCAN_RXF   0x01

Definition at line 68 of file mscan.h.

#define MSCAN_RXFIE   0x01

Definition at line 91 of file mscan.h.

#define MSCAN_RXFRM   0x80

Definition at line 27 of file mscan.h.

#define MSCAN_SET_MODE_RETRIES   255

Definition at line 239 of file mscan.h.

#define MSCAN_SFF_RTR_SHIFT   4

Definition at line 137 of file mscan.h.

#define MSCAN_SLEEP_MODE   MSCAN_SLPRQ

Definition at line 236 of file mscan.h.

#define MSCAN_SLPAK   0x02

Definition at line 43 of file mscan.h.

#define MSCAN_SLPRQ   0x02

Definition at line 33 of file mscan.h.

#define MSCAN_STAT_MSK   (MSCAN_RSTAT_MSK | MSCAN_TSTAT_MSK)

Definition at line 72 of file mscan.h.

#define MSCAN_STATE_ACTIVE   0

Definition at line 78 of file mscan.h.

#define MSCAN_STATE_BUS_OFF
Value:
MSCAN_TSTAT1 | MSCAN_TSTAT0)

Definition at line 74 of file mscan.h.

#define MSCAN_STATE_BUSOFF   3

Definition at line 81 of file mscan.h.

#define MSCAN_STATE_PASSIVE   2

Definition at line 80 of file mscan.h.

#define MSCAN_STATE_RX (   canrflg)    (((canrflg)&MSCAN_RSTAT_MSK)>>4)

Definition at line 77 of file mscan.h.

#define MSCAN_STATE_TX (   canrflg)    (((canrflg)&MSCAN_TSTAT_MSK)>>2)

Definition at line 76 of file mscan.h.

#define MSCAN_STATE_WARNING   1

Definition at line 79 of file mscan.h.

#define MSCAN_SYNCH   0x10

Definition at line 30 of file mscan.h.

#define MSCAN_TIME   0x08

Definition at line 31 of file mscan.h.

#define MSCAN_TSTAT0   0x04

Definition at line 66 of file mscan.h.

#define MSCAN_TSTAT1   0x08

Definition at line 65 of file mscan.h.

#define MSCAN_TSTAT_MSK   (MSCAN_TSTAT1 | MSCAN_TSTAT0)

Definition at line 71 of file mscan.h.

#define MSCAN_TSTATE0   0x04

Definition at line 89 of file mscan.h.

#define MSCAN_TSTATE1   0x08

Definition at line 88 of file mscan.h.

#define MSCAN_TX0   0x01

Definition at line 118 of file mscan.h.

#define MSCAN_TX1   0x02

Definition at line 117 of file mscan.h.

#define MSCAN_TX2   0x04

Definition at line 116 of file mscan.h.

#define MSCAN_TXE   (MSCAN_TXE2 | MSCAN_TXE1 | MSCAN_TXE0)

Definition at line 97 of file mscan.h.

#define MSCAN_TXE0   0x01

Definition at line 96 of file mscan.h.

#define MSCAN_TXE1   0x02

Definition at line 95 of file mscan.h.

#define MSCAN_TXE2   0x04

Definition at line 94 of file mscan.h.

#define MSCAN_TXIE   (MSCAN_TXIE2 | MSCAN_TXIE1 | MSCAN_TXIE0)

Definition at line 103 of file mscan.h.

#define MSCAN_TXIE0   0x01

Definition at line 102 of file mscan.h.

#define MSCAN_TXIE1   0x02

Definition at line 101 of file mscan.h.

#define MSCAN_TXIE2   0x04

Definition at line 100 of file mscan.h.

#define MSCAN_WUPE   0x04

Definition at line 32 of file mscan.h.

#define MSCAN_WUPIE   0x80

Definition at line 84 of file mscan.h.

#define MSCAN_WUPIF   0x80

Definition at line 61 of file mscan.h.

#define MSCAN_WUPM   0x04

Definition at line 42 of file mscan.h.

#define TX_QUEUE_SIZE   3

Definition at line 273 of file mscan.h.

Enumeration Type Documentation

anonymous enum
Enumerator:
MSCAN_TYPE_MPC5200 
MSCAN_TYPE_MPC5121 

Definition at line 246 of file mscan.h.

Function Documentation

struct net_device* alloc_mscandev ( void  )
read

Definition at line 689 of file mscan.c.

int register_mscandev ( struct net_device dev,
int  mscan_clksrc 
)

Definition at line 641 of file mscan.c.

void unregister_mscandev ( struct net_device dev)

Definition at line 680 of file mscan.c.

Variable Documentation