#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/netdevice.h>
#include <linux/delay.h>
#include <linux/pci.h>
#include <linux/io.h>
#include <linux/i2c.h>
#include <linux/i2c-algo-bit.h>
#include <linux/can.h>
#include <linux/can/dev.h>
#include "sja1000.h"
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;
#define DRV_NAME …
#define PEAK_VER_REG1 …
#define PEAK_VER_REG2 …
struct peak_pciec_card;
struct peak_pci_chan { … };
#define PEAK_PCI_CAN_CLOCK …
#define PEAK_PCI_CDR …
#define PEAK_PCI_OCR …
#define PITA_ICR …
#define PITA_GPIOICR …
#define PITA_MISC …
#define PEAK_PCI_CFG_SIZE …
#define PEAK_PCI_CHAN_SIZE …
#define PEAK_PCI_VENDOR_ID …
#define PEAK_PCI_DEVICE_ID …
#define PEAK_PCIEC_DEVICE_ID …
#define PEAK_PCIE_DEVICE_ID …
#define PEAK_CPCI_DEVICE_ID …
#define PEAK_MPCI_DEVICE_ID …
#define PEAK_PC_104P_DEVICE_ID …
#define PEAK_PCI_104E_DEVICE_ID …
#define PEAK_MPCIE_DEVICE_ID …
#define PEAK_PCIE_OEM_ID …
#define PEAK_PCIEC34_DEVICE_ID …
#define PEAK_PCI_CHAN_MAX …
static const u16 peak_pci_icr_masks[PEAK_PCI_CHAN_MAX] = …;
static const struct pci_device_id peak_pci_tbl[] = …;
MODULE_DEVICE_TABLE(pci, peak_pci_tbl);
#ifdef CONFIG_CAN_PEAK_PCIEC
#define PITA_GPOUT …
#define PITA_GPIN …
#define PITA_GPOEN …
#define PITA_GPIN_SCL …
#define PITA_GPIN_SDA …
#define PCA9553_1_SLAVEADDR …
enum { … };
#define PCA9553_ON …
#define PCA9553_OFF …
#define PCA9553_SLOW …
#define PCA9553_FAST …
#define PCA9553_LED(c) …
#define PCA9553_LED_STATE(s, c) …
#define PCA9553_LED_ON(c) …
#define PCA9553_LED_OFF(c) …
#define PCA9553_LED_SLOW(c) …
#define PCA9553_LED_FAST(c) …
#define PCA9553_LED_MASK(c) …
#define PCA9553_LED_OFF_ALL …
#define PCA9553_LS0_INIT …
struct peak_pciec_chan { … };
struct peak_pciec_card { … };
static void peak_pci_write_reg(const struct sja1000_priv *priv,
int port, u8 val);
static inline void pita_set_scl_highz(struct peak_pciec_card *card)
{ … }
static inline void pita_set_sda_highz(struct peak_pciec_card *card)
{ … }
static void peak_pciec_init_pita_gpio(struct peak_pciec_card *card)
{ … }
static void pita_setsda(void *data, int state)
{ … }
static void pita_setscl(void *data, int state)
{ … }
static int pita_getsda(void *data)
{ … }
static int pita_getscl(void *data)
{ … }
static int peak_pciec_write_pca9553(struct peak_pciec_card *card,
u8 offset, u8 data)
{ … }
static void peak_pciec_led_work(struct work_struct *work)
{ … }
static void peak_pciec_set_leds(struct peak_pciec_card *card, u8 led_mask, u8 s)
{ … }
static void peak_pciec_start_led_work(struct peak_pciec_card *card)
{ … }
static void peak_pciec_stop_led_work(struct peak_pciec_card *card)
{ … }
static int peak_pciec_init_leds(struct peak_pciec_card *card)
{ … }
static void peak_pciec_leds_exit(struct peak_pciec_card *card)
{ … }
static void peak_pciec_write_reg(const struct sja1000_priv *priv,
int port, u8 val)
{ … }
static const struct i2c_algo_bit_data peak_pciec_i2c_bit_ops = …;
static int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev)
{ … }
static void peak_pciec_remove(struct peak_pciec_card *card)
{ … }
#else
static inline int peak_pciec_probe(struct pci_dev *pdev, struct net_device *dev)
{
return -ENODEV;
}
static inline void peak_pciec_remove(struct peak_pciec_card *card)
{
}
#endif
static u8 peak_pci_read_reg(const struct sja1000_priv *priv, int port)
{ … }
static void peak_pci_write_reg(const struct sja1000_priv *priv,
int port, u8 val)
{ … }
static void peak_pci_post_irq(const struct sja1000_priv *priv)
{ … }
static int peak_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ … }
static void peak_pci_remove(struct pci_dev *pdev)
{ … }
static struct pci_driver peak_pci_driver = …;
module_pci_driver(…) …;