diff options
Diffstat (limited to 'drivers/staging/meilhaus')
-rw-r--r-- | drivers/staging/meilhaus/me0600_ext_irq.c | 5 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me0900_di.c | 1 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me1400_device.c | 1 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me1400_ext_irq.c | 5 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me4600_ai.c | 4 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me4600_ai.h | 1 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me4600_ao.c | 6 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me4600_ext_irq.c | 5 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me6000_ao.c | 4 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me6000_ao.h | 1 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me8100_di.c | 5 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me8200_di.c | 9 | ||||
-rw-r--r-- | drivers/staging/meilhaus/me8200_do.c | 5 | ||||
-rw-r--r-- | drivers/staging/meilhaus/memain.c | 184 | ||||
-rw-r--r-- | drivers/staging/meilhaus/memain.h | 194 |
15 files changed, 126 insertions, 304 deletions
diff --git a/drivers/staging/meilhaus/me0600_ext_irq.c b/drivers/staging/meilhaus/me0600_ext_irq.c index 2f6fedca322..1d098420a54 100644 --- a/drivers/staging/meilhaus/me0600_ext_irq.c +++ b/drivers/staging/meilhaus/me0600_ext_irq.c @@ -32,7 +32,6 @@ /* * Includes */ -#include <linux/version.h> #include <linux/module.h> #include <linux/slab.h> @@ -434,11 +433,7 @@ me0600_ext_irq_subdevice_t *me0600_ext_irq_constructor(uint32_t plx_reg_base, subdevice->irq = irq; err = request_irq(subdevice->irq, me0600_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME0600_NAME, (void *)subdevice); if (err) { diff --git a/drivers/staging/meilhaus/me0900_di.c b/drivers/staging/meilhaus/me0900_di.c index 4665b2acbea..b8c448f58e3 100644 --- a/drivers/staging/meilhaus/me0900_di.c +++ b/drivers/staging/meilhaus/me0900_di.c @@ -38,7 +38,6 @@ #include <linux/io.h> #include <linux/types.h> #include <linux/interrupt.h> -#include <linux/version.h> #include "medefines.h" #include "meinternal.h" diff --git a/drivers/staging/meilhaus/me1400_device.c b/drivers/staging/meilhaus/me1400_device.c index ca7498b9056..a018b5f7a19 100644 --- a/drivers/staging/meilhaus/me1400_device.c +++ b/drivers/staging/meilhaus/me1400_device.c @@ -47,7 +47,6 @@ #include <linux/slab.h> #include <linux/sched.h> #include <linux/interrupt.h> -#include <linux/version.h> #include "meids.h" #include "meerror.h" diff --git a/drivers/staging/meilhaus/me1400_ext_irq.c b/drivers/staging/meilhaus/me1400_ext_irq.c index 0dc6b4519b5..6841f41860a 100644 --- a/drivers/staging/meilhaus/me1400_ext_irq.c +++ b/drivers/staging/meilhaus/me1400_ext_irq.c @@ -32,7 +32,6 @@ /* * Includes */ -#include <linux/version.h> #include <linux/module.h> #include <linux/slab.h> @@ -458,11 +457,7 @@ me1400_ext_irq_subdevice_t *me1400_ext_irq_constructor(uint32_t device_id, subdevice->irq = irq; err = request_irq(irq, me1400_ext_irq_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME1400_NAME, (void *)subdevice); if (err) { diff --git a/drivers/staging/meilhaus/me4600_ai.c b/drivers/staging/meilhaus/me4600_ai.c index a3cfef09a4d..e496d0c8d48 100644 --- a/drivers/staging/meilhaus/me4600_ai.c +++ b/drivers/staging/meilhaus/me4600_ai.c @@ -299,11 +299,7 @@ me4600_ai_subdevice_t *me4600_ai_constructor(uint32_t reg_base, // Register interrupt service routine. subdevice->irq = irq; if (request_irq(subdevice->irq, me4600_ai_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME4600_NAME, subdevice)) { PERROR("Cannot register interrupt service routine.\n"); me_subdevice_deinit((me_subdevice_t *) subdevice); diff --git a/drivers/staging/meilhaus/me4600_ai.h b/drivers/staging/meilhaus/me4600_ai.h index 106e1959f9f..7055e44f32e 100644 --- a/drivers/staging/meilhaus/me4600_ai.h +++ b/drivers/staging/meilhaus/me4600_ai.h @@ -28,7 +28,6 @@ #ifndef _ME4600_AI_H_ #define _ME4600_AI_H_ -#include <linux/version.h> #include "mesubdevice.h" #include "meioctl.h" #include "mecirc_buf.h" diff --git a/drivers/staging/meilhaus/me4600_ao.c b/drivers/staging/meilhaus/me4600_ao.c index eb472692a7c..4000dac057e 100644 --- a/drivers/staging/meilhaus/me4600_ao.c +++ b/drivers/staging/meilhaus/me4600_ao.c @@ -2567,11 +2567,7 @@ me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base, if (subdevice->fifo) { subdevice->irq = irq; if (request_irq(subdevice->irq, me4600_ao_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME4600_NAME, subdevice)) { PERROR("Cannot get interrupt line.\n"); PDEBUG("free circ_buf = %p size=%d", @@ -5737,7 +5733,7 @@ me4600_ao_subdevice_t *me4600_ao_constructor(uint32_t reg_base, subdevice->irq = irq; if (request_irq - (subdevice->irq, me4600_ao_isr, SA_INTERRUPT | SA_SHIRQ, + (subdevice->irq, me4600_ao_isr, IRQF_DISABLED | IRQF_SHARED, ME4600_NAME, subdevice)) { PERROR("Cannot get interrupt line.\n"); me_subdevice_deinit((me_subdevice_t *) subdevice); diff --git a/drivers/staging/meilhaus/me4600_ext_irq.c b/drivers/staging/meilhaus/me4600_ext_irq.c index 6b33cba3da8..cfb4adbd41a 100644 --- a/drivers/staging/meilhaus/me4600_ext_irq.c +++ b/drivers/staging/meilhaus/me4600_ext_irq.c @@ -39,7 +39,6 @@ #include <linux/interrupt.h> #include <linux/io.h> #include <linux/types.h> -#include <linux/version.h> #include "medefines.h" #include "meinternal.h" @@ -420,11 +419,7 @@ me4600_ext_irq_subdevice_t *me4600_ext_irq_constructor(uint32_t reg_base, subdevice->irq = irq; if (request_irq(subdevice->irq, me4600_ext_irq_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME4600_NAME, subdevice)) { PERROR("Cannot register interrupt.\n"); kfree(subdevice); diff --git a/drivers/staging/meilhaus/me6000_ao.c b/drivers/staging/meilhaus/me6000_ao.c index f7abdbd485e..66652dc5b96 100644 --- a/drivers/staging/meilhaus/me6000_ao.c +++ b/drivers/staging/meilhaus/me6000_ao.c @@ -2627,11 +2627,7 @@ me6000_ao_subdevice_t *me6000_ao_constructor(uint32_t reg_base, if (subdevice->fifo & ME6000_AO_HAS_FIFO) { subdevice->irq = irq; if (request_irq(subdevice->irq, me6000_ao_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME6000_NAME, subdevice)) { PERROR("Cannot get interrupt line.\n"); PDEBUG("free circ_buf = %p size=%d", diff --git a/drivers/staging/meilhaus/me6000_ao.h b/drivers/staging/meilhaus/me6000_ao.h index ef4d0189bde..d86fb29265f 100644 --- a/drivers/staging/meilhaus/me6000_ao.h +++ b/drivers/staging/meilhaus/me6000_ao.h @@ -27,7 +27,6 @@ #ifndef _ME6000_AO_H_ #define _ME6000_AO_H_ -#include <linux/version.h> #include "mesubdevice.h" #include "mecirc_buf.h" #include "meioctl.h" diff --git a/drivers/staging/meilhaus/me8100_di.c b/drivers/staging/meilhaus/me8100_di.c index 301dbd8f96a..1a3f2692d7a 100644 --- a/drivers/staging/meilhaus/me8100_di.c +++ b/drivers/staging/meilhaus/me8100_di.c @@ -39,7 +39,6 @@ #include <linux/io.h> #include <linux/types.h> #include <linux/interrupt.h> -#include <linux/version.h> #include "medefines.h" #include "meerror.h" @@ -633,11 +632,7 @@ me8100_di_subdevice_t *me8100_di_constructor(uint32_t me8100_reg_base, /* Register interrupt service routine. */ subdevice->irq = irq; err = request_irq(subdevice->irq, me8100_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME8100_NAME, (void *)subdevice); if (err) { diff --git a/drivers/staging/meilhaus/me8200_di.c b/drivers/staging/meilhaus/me8200_di.c index a931fb817c7..fd1af0f0565 100644 --- a/drivers/staging/meilhaus/me8200_di.c +++ b/drivers/staging/meilhaus/me8200_di.c @@ -37,7 +37,6 @@ #include <linux/io.h> #include <linux/types.h> #include <linux/interrupt.h> -#include <linux/version.h> #include "medefines.h" #include "meerror.h" @@ -801,19 +800,11 @@ me8200_di_subdevice_t *me8200_di_constructor(uint32_t me8200_regbase, subdevice->irq = irq; if (subdevice->version > 0) { // NEW err = request_irq(subdevice->irq, me8200_isr_EX, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME8200_NAME, (void *)subdevice); } else { //OLD err = request_irq(subdevice->irq, me8200_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME8200_NAME, (void *)subdevice); } diff --git a/drivers/staging/meilhaus/me8200_do.c b/drivers/staging/meilhaus/me8200_do.c index 40d536c71d5..e42a137617a 100644 --- a/drivers/staging/meilhaus/me8200_do.c +++ b/drivers/staging/meilhaus/me8200_do.c @@ -39,7 +39,6 @@ #include <linux/interrupt.h> #include <linux/io.h> #include <linux/types.h> -#include <linux/version.h> #include "medefines.h" #include "meinternal.h" @@ -556,11 +555,7 @@ me8200_do_subdevice_t *me8200_do_constructor(uint32_t reg_base, /* Request the interrupt line */ err = request_irq(irq, me8200_do_isr, -#ifdef IRQF_DISABLED IRQF_DISABLED | IRQF_SHARED, -#else - SA_INTERRUPT | SA_SHIRQ, -#endif ME8200_NAME, (void *)subdevice); if (err) { diff --git a/drivers/staging/meilhaus/memain.c b/drivers/staging/meilhaus/memain.c index fd9f079b0ed..c4908549192 100644 --- a/drivers/staging/meilhaus/memain.c +++ b/drivers/staging/meilhaus/memain.c @@ -38,7 +38,7 @@ //#include <linux/usb.h> #include <linux/errno.h> #include <linux/uaccess.h> -#include <linux/cdev.h> +#include <linux/miscdevice.h> #include <linux/rwsem.h> #include "medefines.h" @@ -68,13 +68,6 @@ MODULE_PARM_DESC(me_bosch_fw, "Flags which signals the ME-4600 driver to load the bosch firmware (default = 0)."); #endif //BOSCH -static unsigned int major = 0; -#ifdef module_param -module_param(major, int, S_IRUGO); -#else -MODULE_PARM(major, "i"); -#endif - /* Global Driver Lock */ @@ -100,29 +93,131 @@ static int me_ioctl(struct inode *, struct file *, unsigned int, unsigned long); //static int me_probe_usb(struct usb_interface *interface, const struct usb_device_id *id); //static void me_disconnect_usb(struct usb_interface *interface); -/* Character device structure -*/ - -static struct cdev *cdevp; - /* File operations provided by the module */ -static struct file_operations me_file_operations = { +static const struct file_operations me_file_operations = { .owner = THIS_MODULE, .ioctl = me_ioctl, .open = me_open, .release = me_release, }; -struct pci_driver me_pci_driver = { +static const struct pci_device_id me_pci_table[] = { + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000_A) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000_B) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1400) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140A) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140B) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14E0) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14EA) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14EB) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140C) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140D) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_4U) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_8U) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_12U) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_16U) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_16U_8I) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4610) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4650) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4660) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4660I) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670I) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670S) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670IS) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680I) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680S) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680IS) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6004) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6008) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME600F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6014) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6018) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME601F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6034) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6038) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME603F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6104) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6108) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME610F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6114) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6118) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME611F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6134) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6138) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME613F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6044) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6048) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME604F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6054) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6058) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME605F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6074) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6078) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME607F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6144) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6148) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME614F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6154) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6158) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME615F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6174) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6178) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME617F) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6259) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6359) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0630) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8100_A) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8100_B) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8200_A) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8200_B) }, + + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0940) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0950) }, + { PCI_VDEVICE(MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0960) }, + + { } +}; +MODULE_DEVICE_TABLE(pci, me_pci_table); + +static struct pci_driver me_pci_driver = { .name = MEMAIN_NAME, .id_table = me_pci_table, .probe = me_probe_pci, - .remove = me_remove_pci + .remove = __devexit_p(me_remove_pci), }; -/* //me_usb_driver +/* +static struct usb_device_id me_usb_table[] = { + { USB_DEVICE(USB_VENDOR_ID_MEPHISTO_S1, USB_DEVICE_ID_MEPHISTO_S1) }, + { 0 } +}; +MODULE_DEVICE_TABLE (usb, me_usb_table); + static struct usb_driver me_usb_driver = { .name = MEMAIN_NAME, @@ -396,7 +491,8 @@ static me_device_t *get_dummy_instance(unsigned short vendor_id, return instance; } -static int me_probe_pci(struct pci_dev *dev, const struct pci_device_id *id) +static int __devinit me_probe_pci(struct pci_dev *dev, + const struct pci_device_id *id) { int err; me_pci_constructor_t constructor = NULL; @@ -424,7 +520,7 @@ static int me_probe_pci(struct pci_dev *dev, const struct pci_device_id *id) if ((constructor = (me_pci_constructor_t) symbol_get(constructor_name)) == NULL) { - if (request_module(module_name)) { + if (request_module("%s", module_name)) { PERROR("Error while request for module %s.\n", module_name); return -ENODEV; @@ -594,7 +690,7 @@ static int insert_to_device_list(me_device_t *n_device) return 0; } -static void me_remove_pci(struct pci_dev *dev) +static void __devexit me_remove_pci(struct pci_dev *dev) { int vendor_id = dev->vendor; int device_id = dev->device; @@ -1910,11 +2006,16 @@ static int me_ioctl(struct inode *inodep, return -ENOTTY; } +static struct miscdevice me_miscdev = { + .minor = MISC_DYNAMIC_MINOR, + .name = MEMAIN_NAME, + .fops = &me_file_operations, +}; + // Init and exit of module. static int memain_init(void) { int result = 0; - dev_t dev = MKDEV(major, 0); PDEBUG("executed.\n"); @@ -1943,46 +2044,14 @@ static int memain_init(void) } } */ - // Register the character device. - if (major) { - result = register_chrdev_region(dev, 1, MEMAIN_NAME); - } else { - result = alloc_chrdev_region(&dev, 0, 1, MEMAIN_NAME); - major = MAJOR(dev); - } - + result = misc_register(&me_miscdev); if (result < 0) { - PERROR("Can't get major driver no.\n"); + printk(KERN_ERR MEMAIN_NAME ": can't register misc device\n"); goto INIT_ERROR_3; } - cdevp = cdev_alloc(); - - if (!cdevp) { - PERROR("Can't get character device structure.\n"); - result = -ENOMEM; - goto INIT_ERROR_4; - } - - cdevp->ops = &me_file_operations; - - cdevp->owner = THIS_MODULE; - - result = cdev_add(cdevp, dev, 1); - - if (result < 0) { - PERROR("Cannot add character device structure.\n"); - goto INIT_ERROR_5; - } - return 0; - INIT_ERROR_5: - cdev_del(cdevp); - - INIT_ERROR_4: - unregister_chrdev_region(dev, 1); - INIT_ERROR_3: // usb_deregister(&me_usb_driver); @@ -1996,12 +2065,9 @@ static int memain_init(void) static void __exit memain_exit(void) { - dev_t dev = MKDEV(major, 0); - PDEBUG("executed.\n"); - cdev_del(cdevp); - unregister_chrdev_region(dev, 1); + misc_deregister(&me_miscdev); pci_unregister_driver(&me_pci_driver); // usb_deregister(&me_usb_driver); clear_device_list(); diff --git a/drivers/staging/meilhaus/memain.h b/drivers/staging/meilhaus/memain.h index 7616ff7f65c..48f83679379 100644 --- a/drivers/staging/meilhaus/memain.h +++ b/drivers/staging/meilhaus/memain.h @@ -28,200 +28,6 @@ #ifdef __KERNEL__ /*============================================================================= - PCI device table. - This is used by modprobe to translate PCI IDs to drivers. - ===========================================================================*/ - -static struct pci_device_id me_pci_table[] __devinitdata = { - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000_A, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1000_B, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1400, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140A, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140B, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14E0, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14EA, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME14EB, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140C, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME140D, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_4U, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_8U, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_12U, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_16U, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME1600_16U_8I, - PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4610, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4650, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4660, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4660I, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670I, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670S, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4670IS, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680I, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680S, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME4680IS, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6004, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6008, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME600F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6014, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6018, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME601F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6034, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6038, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME603F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6104, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6108, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME610F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6114, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6118, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME611F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6134, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6138, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME613F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6044, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6048, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME604F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6054, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6058, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME605F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6074, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6078, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME607F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6144, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6148, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME614F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6154, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6158, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME615F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6174, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6178, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME617F, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6259, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME6359, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0630, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8100_A, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8100_B, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8200_A, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME8200_B, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0940, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0950, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - {PCI_VENDOR_ID_MEILHAUS, PCI_DEVICE_ID_MEILHAUS_ME0960, PCI_ANY_ID, - PCI_ANY_ID, 0, 0, 0}, - - {0} -}; - -MODULE_DEVICE_TABLE(pci, me_pci_table); - -/*============================================================================= - USB device table. - This is used by modprobe to translate USB IDs to drivers. - ===========================================================================*/ -/* -static struct usb_device_id me_usb_table[] __devinitdata = { - { USB_DEVICE(USB_VENDOR_ID_MEPHISTO_S1, USB_DEVICE_ID_MEPHISTO_S1) }, - { 0 } -}; - -MODULE_DEVICE_TABLE (usb, me_usb_table); -*/ - -/*============================================================================= Templates ===========================================================================*/ |