Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
janz-ican3.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrupt.h>
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/netdevice.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include <linux/can/error.h>
#include <linux/mfd/janz.h>
#include <asm/io.h>

Go to the source code of this file.

Data Structures

struct  ican3_dpm_control
 
struct  ican3_dev
 
struct  ican3_msg
 
struct  ican3_new_desc
 
struct  ican3_fast_desc
 

Macros

#define DPM_NUM_PAGES   256
 
#define DPM_PAGE_SIZE   256
 
#define DPM_PAGE_ADDR(p)   ((p) * DPM_PAGE_SIZE)
 
#define QUEUE_OLD_CONTROL   0
 
#define QUEUE_OLD_RB0   1
 
#define QUEUE_OLD_RB1   2
 
#define QUEUE_OLD_WB0   3
 
#define QUEUE_OLD_WB1   4
 
#define MSYNC_PEER   0x00 /* ICAN only */
 
#define MSYNC_LOCL   0x01 /* host only */
 
#define TARGET_RUNNING   0x02
 
#define MSYNC_RB0   0x01
 
#define MSYNC_RB1   0x02
 
#define MSYNC_RBLW   0x04
 
#define MSYNC_RB_MASK   (MSYNC_RB0 | MSYNC_RB1)
 
#define MSYNC_WB0   0x10
 
#define MSYNC_WB1   0x20
 
#define MSYNC_WBLW   0x40
 
#define MSYNC_WB_MASK   (MSYNC_WB0 | MSYNC_WB1)
 
#define QUEUE_TOHOST   5
 
#define QUEUE_FROMHOST_MID   6
 
#define QUEUE_FROMHOST_HIGH   7
 
#define QUEUE_FROMHOST_LOW   8
 
#define DPM_FREE_START   9
 
#define DESC_VALID   0x80
 
#define DESC_WRAP   0x40
 
#define DESC_INTERRUPT   0x20
 
#define DESC_IVALID   0x10
 
#define DESC_LEN(len)   (len)
 
#define MSG_CONNECTI   0x02
 
#define MSG_DISCONNECT   0x03
 
#define MSG_IDVERS   0x04
 
#define MSG_MSGLOST   0x05
 
#define MSG_NEWHOSTIF   0x08
 
#define MSG_INQUIRY   0x0a
 
#define MSG_SETAFILMASK   0x10
 
#define MSG_INITFDPMQUEUE   0x11
 
#define MSG_HWCONF   0x12
 
#define MSG_FMSGLOST   0x15
 
#define MSG_CEVTIND   0x37
 
#define MSG_CBTRREQ   0x41
 
#define MSG_COFFREQ   0x42
 
#define MSG_CONREQ   0x43
 
#define MSG_CCONFREQ   0x47
 
#define INQUIRY_STATUS   0x00
 
#define INQUIRY_TERMINATION   0x01
 
#define INQUIRY_EXTENDED   0x04
 
#define SETAFILMASK_REJECT   0x00
 
#define SETAFILMASK_FASTIF   0x02
 
#define HWCONF_TERMINATE_ON   0x01
 
#define HWCONF_TERMINATE_OFF   0x00
 
#define CEVTIND_EI   0x01
 
#define CEVTIND_DOI   0x02
 
#define CEVTIND_LOST   0x04
 
#define CEVTIND_FULL   0x08
 
#define CEVTIND_BEI   0x10
 
#define CEVTIND_CHIP_SJA1000   0x02
 
#define ICAN3_BUSERR_QUOTA_MAX   255
 
#define ICAN3_SNGL   0x02
 
#define ICAN3_ECHO   0x10
 
#define ICAN3_EFF_RTR   0x40
 
#define ICAN3_SFF_RTR   0x10
 
#define ICAN3_EFF   0x80
 
#define ICAN3_CAN_TYPE_MASK   0x0f
 
#define ICAN3_CAN_TYPE_SFF   0x00
 
#define ICAN3_CAN_TYPE_EFF   0x01
 
#define ICAN3_CAN_DLC_MASK   0x0f
 
#define SR_BS   0x80
 
#define SR_ES   0x40
 
#define SR_TS   0x20
 
#define SR_RS   0x10
 
#define SR_TCS   0x08
 
#define SR_TBS   0x04
 
#define SR_DOS   0x02
 
#define SR_RBS   0x01
 
#define SR_CRIT   (SR_BS|SR_ES)
 
#define ECC_SEG   0x1F
 
#define ECC_DIR   0x20
 
#define ECC_ERR   6
 
#define ECC_BIT   0x00
 
#define ECC_FORM   0x40
 
#define ECC_STUFF   0x80
 
#define ECC_MASK   0xc0
 
#define ICAN3_NEW_BUFFERS   16
 
#define ICAN3_TX_BUFFERS   512
 
#define ICAN3_RX_BUFFERS   1024
 
#define ICAN3_CAN_CLOCK   8000000
 
#define DRV_NAME   "janz-ican3"
 

Functions

 module_platform_driver (ican3_driver)
 
 MODULE_AUTHOR ("Ira W. Snyder <[email protected]>")
 
 MODULE_DESCRIPTION ("Janz MODULbus VMOD-ICAN3 Driver")
 
 MODULE_LICENSE ("GPL")
 
 MODULE_ALIAS ("platform:janz-ican3")
 

Macro Definition Documentation

#define CEVTIND_BEI   0x10

Definition at line 112 of file janz-ican3.c.

#define CEVTIND_CHIP_SJA1000   0x02

Definition at line 114 of file janz-ican3.c.

#define CEVTIND_DOI   0x02

Definition at line 109 of file janz-ican3.c.

#define CEVTIND_EI   0x01

Definition at line 108 of file janz-ican3.c.

#define CEVTIND_FULL   0x08

Definition at line 111 of file janz-ican3.c.

#define CEVTIND_LOST   0x04

Definition at line 110 of file janz-ican3.c.

#define DESC_INTERRUPT   0x20

Definition at line 66 of file janz-ican3.c.

#define DESC_IVALID   0x10

Definition at line 67 of file janz-ican3.c.

#define DESC_LEN (   len)    (len)

Definition at line 68 of file janz-ican3.c.

#define DESC_VALID   0x80

Definition at line 64 of file janz-ican3.c.

#define DESC_WRAP   0x40

Definition at line 65 of file janz-ican3.c.

#define DPM_FREE_START   9

Definition at line 61 of file janz-ican3.c.

#define DPM_NUM_PAGES   256

Definition at line 28 of file janz-ican3.c.

#define DPM_PAGE_ADDR (   p)    ((p) * DPM_PAGE_SIZE)

Definition at line 30 of file janz-ican3.c.

#define DPM_PAGE_SIZE   256

Definition at line 29 of file janz-ican3.c.

#define DRV_NAME   "janz-ican3"

Definition at line 169 of file janz-ican3.c.

#define ECC_BIT   0x00

Definition at line 153 of file janz-ican3.c.

#define ECC_DIR   0x20

Definition at line 151 of file janz-ican3.c.

#define ECC_ERR   6

Definition at line 152 of file janz-ican3.c.

#define ECC_FORM   0x40

Definition at line 154 of file janz-ican3.c.

#define ECC_MASK   0xc0

Definition at line 156 of file janz-ican3.c.

#define ECC_SEG   0x1F

Definition at line 150 of file janz-ican3.c.

#define ECC_STUFF   0x80

Definition at line 155 of file janz-ican3.c.

#define HWCONF_TERMINATE_OFF   0x00

Definition at line 105 of file janz-ican3.c.

#define HWCONF_TERMINATE_ON   0x01

Definition at line 104 of file janz-ican3.c.

#define ICAN3_BUSERR_QUOTA_MAX   255

Definition at line 116 of file janz-ican3.c.

#define ICAN3_CAN_CLOCK   8000000

Definition at line 166 of file janz-ican3.c.

#define ICAN3_CAN_DLC_MASK   0x0f

Definition at line 129 of file janz-ican3.c.

#define ICAN3_CAN_TYPE_EFF   0x01

Definition at line 127 of file janz-ican3.c.

#define ICAN3_CAN_TYPE_MASK   0x0f

Definition at line 125 of file janz-ican3.c.

#define ICAN3_CAN_TYPE_SFF   0x00

Definition at line 126 of file janz-ican3.c.

#define ICAN3_ECHO   0x10

Definition at line 120 of file janz-ican3.c.

#define ICAN3_EFF   0x80

Definition at line 123 of file janz-ican3.c.

#define ICAN3_EFF_RTR   0x40

Definition at line 121 of file janz-ican3.c.

#define ICAN3_NEW_BUFFERS   16

Definition at line 159 of file janz-ican3.c.

#define ICAN3_RX_BUFFERS   1024

Definition at line 163 of file janz-ican3.c.

#define ICAN3_SFF_RTR   0x10

Definition at line 122 of file janz-ican3.c.

#define ICAN3_SNGL   0x02

Definition at line 119 of file janz-ican3.c.

#define ICAN3_TX_BUFFERS   512

Definition at line 162 of file janz-ican3.c.

#define INQUIRY_EXTENDED   0x04

Definition at line 97 of file janz-ican3.c.

#define INQUIRY_STATUS   0x00

Definition at line 95 of file janz-ican3.c.

#define INQUIRY_TERMINATION   0x01

Definition at line 96 of file janz-ican3.c.

#define MSG_CBTRREQ   0x41

Definition at line 82 of file janz-ican3.c.

#define MSG_CCONFREQ   0x47

Definition at line 85 of file janz-ican3.c.

#define MSG_CEVTIND   0x37

Definition at line 81 of file janz-ican3.c.

#define MSG_COFFREQ   0x42

Definition at line 83 of file janz-ican3.c.

#define MSG_CONNECTI   0x02

Definition at line 71 of file janz-ican3.c.

#define MSG_CONREQ   0x43

Definition at line 84 of file janz-ican3.c.

#define MSG_DISCONNECT   0x03

Definition at line 72 of file janz-ican3.c.

#define MSG_FMSGLOST   0x15

Definition at line 80 of file janz-ican3.c.

#define MSG_HWCONF   0x12

Definition at line 79 of file janz-ican3.c.

#define MSG_IDVERS   0x04

Definition at line 73 of file janz-ican3.c.

#define MSG_INITFDPMQUEUE   0x11

Definition at line 78 of file janz-ican3.c.

#define MSG_INQUIRY   0x0a

Definition at line 76 of file janz-ican3.c.

#define MSG_MSGLOST   0x05

Definition at line 74 of file janz-ican3.c.

#define MSG_NEWHOSTIF   0x08

Definition at line 75 of file janz-ican3.c.

#define MSG_SETAFILMASK   0x10

Definition at line 77 of file janz-ican3.c.

#define MSYNC_LOCL   0x01 /* host only */

Definition at line 41 of file janz-ican3.c.

#define MSYNC_PEER   0x00 /* ICAN only */

Definition at line 40 of file janz-ican3.c.

#define MSYNC_RB0   0x01

Definition at line 44 of file janz-ican3.c.

#define MSYNC_RB1   0x02

Definition at line 45 of file janz-ican3.c.

#define MSYNC_RB_MASK   (MSYNC_RB0 | MSYNC_RB1)

Definition at line 47 of file janz-ican3.c.

#define MSYNC_RBLW   0x04

Definition at line 46 of file janz-ican3.c.

#define MSYNC_WB0   0x10

Definition at line 49 of file janz-ican3.c.

#define MSYNC_WB1   0x20

Definition at line 50 of file janz-ican3.c.

#define MSYNC_WB_MASK   (MSYNC_WB0 | MSYNC_WB1)

Definition at line 52 of file janz-ican3.c.

#define MSYNC_WBLW   0x40

Definition at line 51 of file janz-ican3.c.

#define QUEUE_FROMHOST_HIGH   7

Definition at line 57 of file janz-ican3.c.

#define QUEUE_FROMHOST_LOW   8

Definition at line 58 of file janz-ican3.c.

#define QUEUE_FROMHOST_MID   6

Definition at line 56 of file janz-ican3.c.

#define QUEUE_OLD_CONTROL   0

Definition at line 33 of file janz-ican3.c.

#define QUEUE_OLD_RB0   1

Definition at line 34 of file janz-ican3.c.

#define QUEUE_OLD_RB1   2

Definition at line 35 of file janz-ican3.c.

#define QUEUE_OLD_WB0   3

Definition at line 36 of file janz-ican3.c.

#define QUEUE_OLD_WB1   4

Definition at line 37 of file janz-ican3.c.

#define QUEUE_TOHOST   5

Definition at line 55 of file janz-ican3.c.

#define SETAFILMASK_FASTIF   0x02

Definition at line 101 of file janz-ican3.c.

#define SETAFILMASK_REJECT   0x00

Definition at line 100 of file janz-ican3.c.

#define SR_BS   0x80

Definition at line 138 of file janz-ican3.c.

#define SR_CRIT   (SR_BS|SR_ES)

Definition at line 147 of file janz-ican3.c.

#define SR_DOS   0x02

Definition at line 144 of file janz-ican3.c.

#define SR_ES   0x40

Definition at line 139 of file janz-ican3.c.

#define SR_RBS   0x01

Definition at line 145 of file janz-ican3.c.

#define SR_RS   0x10

Definition at line 141 of file janz-ican3.c.

#define SR_TBS   0x04

Definition at line 143 of file janz-ican3.c.

#define SR_TCS   0x08

Definition at line 142 of file janz-ican3.c.

#define SR_TS   0x20

Definition at line 140 of file janz-ican3.c.

#define TARGET_RUNNING   0x02

Definition at line 42 of file janz-ican3.c.

Function Documentation

MODULE_ALIAS ( "platform:janz-ican3"  )
MODULE_AUTHOR ( "Ira W. Snyder <[email protected]>"  )
MODULE_DESCRIPTION ( "Janz MODULbus VMOD-ICAN3 Driver"  )
MODULE_LICENSE ( "GPL"  )
module_platform_driver ( ican3_driver  )