26 #include <linux/device.h>
27 #include <linux/module.h>
28 #include <linux/pci.h>
31 #include <linux/slab.h>
34 #define SERCOS_SUB_VENDOR_ID 0x1971
35 #define SERCOS_SUB_SYSID_3530 0x3530
36 #define SERCOS_SUB_SYSID_3535 0x3535
37 #define SERCOS_SUB_SYSID_3780 0x3780
40 #define IER0_OFFSET 0x08
43 #define ISR0_OFFSET 0x18
51 static void sercos3_disable_interrupts(
struct uio_info *
info,
64 static void sercos3_enable_interrupts(
struct uio_info *
info,
84 sercos3_disable_interrupts(info, priv);
90 static int sercos3_irqcontrol(
struct uio_info *info,
s32 irq_on)
96 sercos3_enable_interrupts(info, priv);
98 sercos3_disable_interrupts(info, priv);
108 if (!info->
mem[n].addr)
112 if (!info->
mem[n].internal_addr)
141 if (sercos3_setup_iomem(dev, info, 0, 0))
143 if (sercos3_setup_iomem(dev, info, 1, 2))
145 if (sercos3_setup_iomem(dev, info, 2, 3))
147 if (sercos3_setup_iomem(dev, info, 3, 4))
149 if (sercos3_setup_iomem(dev, info, 4, 5))
154 info->
name =
"Sercos_III_PCI";
158 info->
handler = sercos3_handler;
161 pci_set_drvdata(dev, info);
169 for (i = 0; i < 5; i++) {
170 if (info->
mem[i].internal_addr)
183 static void sercos3_pci_remove(
struct pci_dev *dev)
185 struct uio_info *info = pci_get_drvdata(dev);
191 pci_set_drvdata(dev,
NULL);
192 for (i = 0; i < 5; i++) {
193 if (info->
mem[i].internal_addr)
222 static struct pci_driver sercos3_pci_driver = {
224 .id_table = sercos3_pci_ids,
225 .probe = sercos3_pci_probe,
226 .remove = sercos3_pci_remove,
229 static int __init sercos3_init_module(
void)
231 return pci_register_driver(&sercos3_pci_driver);
234 static void __exit sercos3_exit_module(
void)