Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
ems_pci.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/delay.h>
#include <linux/slab.h>
#include <linux/pci.h>
#include <linux/can/dev.h>
#include <linux/io.h>
#include "sja1000.h"

Go to the source code of this file.

Data Structures

struct  ems_pci_card
 

Macros

#define DRV_NAME   "ems_pci"
 
#define EMS_PCI_V1_MAX_CHAN   2
 
#define EMS_PCI_V2_MAX_CHAN   4
 
#define EMS_PCI_MAX_CHAN   EMS_PCI_V2_MAX_CHAN
 
#define EMS_PCI_CAN_CLOCK   (16000000 / 2)
 
#define PITA2_ICR   0x00 /* Interrupt Control Register */
 
#define PITA2_ICR_INT0   0x00000002 /* [RC] INT0 Active/Clear */
 
#define PITA2_ICR_INT0_EN   0x00020000 /* [RW] Enable INT0 */
 
#define PITA2_MISC   0x1c /* Miscellaneous Register */
 
#define PITA2_MISC_CONFIG   0x04000000 /* Multiplexed parallel interface */
 
#define PLX_ICSR   0x4c /* Interrupt Control/Status register */
 
#define PLX_ICSR_LINTI1_ENA   0x0001 /* LINTi1 Enable */
 
#define PLX_ICSR_PCIINT_ENA   0x0040 /* PCI Interrupt Enable */
 
#define PLX_ICSR_LINTI1_CLR   0x0400 /* Local Edge Triggerable Interrupt Clear */
 
#define PLX_ICSR_ENA_CLR
 
#define EMS_PCI_OCR   (OCR_TX0_PUSHPULL | OCR_TX1_PUSHPULL)
 
#define EMS_PCI_CDR   (CDR_CBP | CDR_CLKOUT_MASK)
 
#define EMS_PCI_V1_BASE_BAR   1
 
#define EMS_PCI_V1_CONF_SIZE   4096 /* size of PITA control area */
 
#define EMS_PCI_V2_BASE_BAR   2
 
#define EMS_PCI_V2_CONF_SIZE   128 /* size of PLX control area */
 
#define EMS_PCI_CAN_BASE_OFFSET   0x400 /* offset where the controllers starts */
 
#define EMS_PCI_CAN_CTRL_SIZE   0x200 /* memory size for each controller */
 
#define EMS_PCI_BASE_SIZE   4096 /* size of controller area */
 

Functions

 MODULE_AUTHOR ("Sebastian Haas <[email protected]>")
 
 MODULE_DESCRIPTION ("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards")
 
 MODULE_SUPPORTED_DEVICE ("EMS CPC-PCI/PCIe/104P CAN card")
 
 MODULE_LICENSE ("GPL v2")
 
 MODULE_DEVICE_TABLE (pci, ems_pci_tbl)
 
 module_pci_driver (ems_pci_driver)
 

Macro Definition Documentation

#define DRV_NAME   "ems_pci"

Definition at line 32 of file ems_pci.c.

#define EMS_PCI_BASE_SIZE   4096 /* size of controller area */

Definition at line 103 of file ems_pci.c.

#define EMS_PCI_CAN_BASE_OFFSET   0x400 /* offset where the controllers starts */

Definition at line 100 of file ems_pci.c.

#define EMS_PCI_CAN_CLOCK   (16000000 / 2)

Definition at line 54 of file ems_pci.c.

#define EMS_PCI_CAN_CTRL_SIZE   0x200 /* memory size for each controller */

Definition at line 101 of file ems_pci.c.

#define EMS_PCI_CDR   (CDR_CBP | CDR_CLKOUT_MASK)

Definition at line 94 of file ems_pci.c.

#define EMS_PCI_MAX_CHAN   EMS_PCI_V2_MAX_CHAN

Definition at line 41 of file ems_pci.c.

#define EMS_PCI_OCR   (OCR_TX0_PUSHPULL | OCR_TX1_PUSHPULL)

Definition at line 86 of file ems_pci.c.

#define EMS_PCI_V1_BASE_BAR   1

Definition at line 96 of file ems_pci.c.

#define EMS_PCI_V1_CONF_SIZE   4096 /* size of PITA control area */

Definition at line 97 of file ems_pci.c.

#define EMS_PCI_V1_MAX_CHAN   2

Definition at line 39 of file ems_pci.c.

#define EMS_PCI_V2_BASE_BAR   2

Definition at line 98 of file ems_pci.c.

#define EMS_PCI_V2_CONF_SIZE   128 /* size of PLX control area */

Definition at line 99 of file ems_pci.c.

#define EMS_PCI_V2_MAX_CHAN   4

Definition at line 40 of file ems_pci.c.

#define PITA2_ICR   0x00 /* Interrupt Control Register */

Definition at line 61 of file ems_pci.c.

#define PITA2_ICR_INT0   0x00000002 /* [RC] INT0 Active/Clear */

Definition at line 62 of file ems_pci.c.

#define PITA2_ICR_INT0_EN   0x00020000 /* [RW] Enable INT0 */

Definition at line 63 of file ems_pci.c.

#define PITA2_MISC   0x1c /* Miscellaneous Register */

Definition at line 65 of file ems_pci.c.

#define PITA2_MISC_CONFIG   0x04000000 /* Multiplexed parallel interface */

Definition at line 66 of file ems_pci.c.

#define PLX_ICSR   0x4c /* Interrupt Control/Status register */

Definition at line 71 of file ems_pci.c.

#define PLX_ICSR_ENA_CLR
Value:
PLX_ICSR_LINTI1_CLR)

Definition at line 75 of file ems_pci.c.

#define PLX_ICSR_LINTI1_CLR   0x0400 /* Local Edge Triggerable Interrupt Clear */

Definition at line 74 of file ems_pci.c.

#define PLX_ICSR_LINTI1_ENA   0x0001 /* LINTi1 Enable */

Definition at line 72 of file ems_pci.c.

#define PLX_ICSR_PCIINT_ENA   0x0040 /* PCI Interrupt Enable */

Definition at line 73 of file ems_pci.c.

Function Documentation

MODULE_AUTHOR ( "Sebastian Haas <[email protected]>"  )
MODULE_DESCRIPTION ( "Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards"  )
MODULE_DEVICE_TABLE ( pci  ,
ems_pci_tbl   
)
MODULE_LICENSE ( "GPL v2 )
module_pci_driver ( ems_pci_driver  )
MODULE_SUPPORTED_DEVICE ( "EMS CPC-PCI/PCIe/104P CAN card"  )