Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
esd_usb2.c File Reference
#include <linux/init.h>
#include <linux/signal.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/netdevice.h>
#include <linux/usb.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  header_msg
 
struct  version_msg
 
struct  version_reply_msg
 
struct  rx_msg
 
struct  tx_msg
 
struct  tx_done_msg
 
struct  id_filter_msg
 
struct  set_baudrate_msg
 
struct  esd_tx_urb_context
 
struct  esd_usb2
 
struct  esd_usb2_net_priv
 

Macros

#define USB_ESDGMBH_VENDOR_ID   0x0ab4
 
#define USB_CANUSB2_PRODUCT_ID   0x0010
 
#define ESD_USB2_CAN_CLOCK   60000000
 
#define ESD_USB2_MAX_NETS   2
 
#define CMD_VERSION   1 /* also used for VERSION_REPLY */
 
#define CMD_CAN_RX   2 /* device to host only */
 
#define CMD_CAN_TX   3 /* also used for TX_DONE */
 
#define CMD_SETBAUD   4 /* also used for SETBAUD_REPLY */
 
#define CMD_TS   5 /* also used for TS_REPLY */
 
#define CMD_IDADD   6 /* also used for IDADD_REPLY */
 
#define ESD_RTR   0x10
 
#define ESD_EXTID   0x20000000
 
#define ESD_EVENT   0x40000000
 
#define ESD_IDMASK   0x1fffffff
 
#define ESD_EV_CAN_ERROR_EXT   2
 
#define ESD_USB2_UBR   0x80000000
 
#define ESD_USB2_LOM   0x40000000
 
#define ESD_USB2_NO_BAUDRATE   0x7fffffff
 
#define ESD_USB2_TSEG1_MIN   1
 
#define ESD_USB2_TSEG1_MAX   16
 
#define ESD_USB2_TSEG1_SHIFT   16
 
#define ESD_USB2_TSEG2_MIN   1
 
#define ESD_USB2_TSEG2_MAX   8
 
#define ESD_USB2_TSEG2_SHIFT   20
 
#define ESD_USB2_SJW_MAX   4
 
#define ESD_USB2_SJW_SHIFT   14
 
#define ESD_USB2_BRP_MIN   1
 
#define ESD_USB2_BRP_MAX   1024
 
#define ESD_USB2_BRP_INC   1
 
#define ESD_USB2_3_SAMPLES   0x00800000
 
#define ESD_ID_ENABLE   0x80
 
#define ESD_MAX_ID_SEGMENT   64
 
#define SJA1000_ECC_SEG   0x1F
 
#define SJA1000_ECC_DIR   0x20
 
#define SJA1000_ECC_ERR   0x06
 
#define SJA1000_ECC_BIT   0x00
 
#define SJA1000_ECC_FORM   0x40
 
#define SJA1000_ECC_STUFF   0x80
 
#define SJA1000_ECC_MASK   0xc0
 
#define ESD_BUSSTATE_MASK   0xc0
 
#define ESD_BUSSTATE_WARN   0x40
 
#define ESD_BUSSTATE_ERRPASSIVE   0x80
 
#define ESD_BUSSTATE_BUSOFF   0xc0
 
#define RX_BUFFER_SIZE   1024
 
#define MAX_RX_URBS   4
 
#define MAX_TX_URBS   16 /* must be power of 2 */
 

Functions

 MODULE_AUTHOR ("Matthias Fuchs <[email protected]>")
 
 MODULE_DESCRIPTION ("CAN driver for esd CAN-USB/2 interfaces")
 
 MODULE_LICENSE ("GPL v2")
 
struct __attribute__ ((packed))
 
 MODULE_DEVICE_TABLE (usb, esd_usb2_table)
 
 module_usb_driver (esd_usb2_driver)
 

Macro Definition Documentation

#define CMD_CAN_RX   2 /* device to host only */

Definition at line 43 of file esd_usb2.c.

#define CMD_CAN_TX   3 /* also used for TX_DONE */

Definition at line 44 of file esd_usb2.c.

#define CMD_IDADD   6 /* also used for IDADD_REPLY */

Definition at line 47 of file esd_usb2.c.

#define CMD_SETBAUD   4 /* also used for SETBAUD_REPLY */

Definition at line 45 of file esd_usb2.c.

#define CMD_TS   5 /* also used for TS_REPLY */

Definition at line 46 of file esd_usb2.c.

#define CMD_VERSION   1 /* also used for VERSION_REPLY */

Definition at line 42 of file esd_usb2.c.

#define ESD_BUSSTATE_BUSOFF   0xc0

Definition at line 94 of file esd_usb2.c.

#define ESD_BUSSTATE_ERRPASSIVE   0x80

Definition at line 93 of file esd_usb2.c.

#define ESD_BUSSTATE_MASK   0xc0

Definition at line 91 of file esd_usb2.c.

#define ESD_BUSSTATE_WARN   0x40

Definition at line 92 of file esd_usb2.c.

#define ESD_EV_CAN_ERROR_EXT   2

Definition at line 58 of file esd_usb2.c.

#define ESD_EVENT   0x40000000

Definition at line 54 of file esd_usb2.c.

#define ESD_EXTID   0x20000000

Definition at line 53 of file esd_usb2.c.

#define ESD_ID_ENABLE   0x80

Definition at line 78 of file esd_usb2.c.

#define ESD_IDMASK   0x1fffffff

Definition at line 55 of file esd_usb2.c.

#define ESD_MAX_ID_SEGMENT   64

Definition at line 79 of file esd_usb2.c.

#define ESD_RTR   0x10

Definition at line 50 of file esd_usb2.c.

#define ESD_USB2_3_SAMPLES   0x00800000

Definition at line 75 of file esd_usb2.c.

#define ESD_USB2_BRP_INC   1

Definition at line 74 of file esd_usb2.c.

#define ESD_USB2_BRP_MAX   1024

Definition at line 73 of file esd_usb2.c.

#define ESD_USB2_BRP_MIN   1

Definition at line 72 of file esd_usb2.c.

#define ESD_USB2_CAN_CLOCK   60000000

Definition at line 38 of file esd_usb2.c.

#define ESD_USB2_LOM   0x40000000

Definition at line 62 of file esd_usb2.c.

#define ESD_USB2_MAX_NETS   2

Definition at line 39 of file esd_usb2.c.

#define ESD_USB2_NO_BAUDRATE   0x7fffffff

Definition at line 63 of file esd_usb2.c.

#define ESD_USB2_SJW_MAX   4

Definition at line 70 of file esd_usb2.c.

#define ESD_USB2_SJW_SHIFT   14

Definition at line 71 of file esd_usb2.c.

#define ESD_USB2_TSEG1_MAX   16

Definition at line 65 of file esd_usb2.c.

#define ESD_USB2_TSEG1_MIN   1

Definition at line 64 of file esd_usb2.c.

#define ESD_USB2_TSEG1_SHIFT   16

Definition at line 66 of file esd_usb2.c.

#define ESD_USB2_TSEG2_MAX   8

Definition at line 68 of file esd_usb2.c.

#define ESD_USB2_TSEG2_MIN   1

Definition at line 67 of file esd_usb2.c.

#define ESD_USB2_TSEG2_SHIFT   20

Definition at line 69 of file esd_usb2.c.

#define ESD_USB2_UBR   0x80000000

Definition at line 61 of file esd_usb2.c.

#define MAX_RX_URBS   4

Definition at line 97 of file esd_usb2.c.

#define MAX_TX_URBS   16 /* must be power of 2 */

Definition at line 98 of file esd_usb2.c.

#define RX_BUFFER_SIZE   1024

Definition at line 96 of file esd_usb2.c.

#define SJA1000_ECC_BIT   0x00

Definition at line 85 of file esd_usb2.c.

#define SJA1000_ECC_DIR   0x20

Definition at line 83 of file esd_usb2.c.

#define SJA1000_ECC_ERR   0x06

Definition at line 84 of file esd_usb2.c.

#define SJA1000_ECC_FORM   0x40

Definition at line 86 of file esd_usb2.c.

#define SJA1000_ECC_MASK   0xc0

Definition at line 88 of file esd_usb2.c.

#define SJA1000_ECC_SEG   0x1F

Definition at line 82 of file esd_usb2.c.

#define SJA1000_ECC_STUFF   0x80

Definition at line 87 of file esd_usb2.c.

#define USB_CANUSB2_PRODUCT_ID   0x0010

Definition at line 36 of file esd_usb2.c.

#define USB_ESDGMBH_VENDOR_ID   0x0ab4

Definition at line 35 of file esd_usb2.c.

Function Documentation

struct __attribute__ ( (packed)  )
read

mcontroller : adapter info structure for old mimd_t apps

: base address : irq number : number of logical drives : pci bus : pci device : pci function : pci id : vendor id : slot number : unique id

Definition at line 171 of file esd_usb2.c.

MODULE_AUTHOR ( "Matthias Fuchs <[email protected]>"  )
MODULE_DESCRIPTION ( "CAN driver for esd CAN-USB/2 interfaces"  )
MODULE_DEVICE_TABLE ( usb  ,
esd_usb2_table   
)
MODULE_LICENSE ( "GPL v2 )
module_usb_driver ( esd_usb2_driver  )