From fdbcf046416bcd65c6590248970d0f871db6e58f Mon Sep 17 00:00:00 2001 From: Frank Mori Hess Date: Mon, 10 Mar 2003 22:23:30 +0000 Subject: [PATCH] isapnp.h compat header didn't work out as nicely as I hoped --- comedi/drivers/ni_atmio.c | 15 +++++++++------ include/linux/isapnp.h | 35 +---------------------------------- 2 files changed, 10 insertions(+), 40 deletions(-) diff --git a/comedi/drivers/ni_atmio.c b/comedi/drivers/ni_atmio.c index 66bed9f6..c0540872 100644 --- a/comedi/drivers/ni_atmio.c +++ b/comedi/drivers/ni_atmio.c @@ -52,17 +52,17 @@ are not supported. The real guts of the driver is in ni_mio_common.c, which is included both here and in ni_pcimio.c - + Interrupt support added by Truxton Fulton References for specifications: - + 340747b.pdf Register Level Programmer Manual (obsolete) 340747c.pdf Register Level Programmer Manual (new) DAQ-STC reference manual Other possibly relevant info: - + 320517c.pdf User manual (obsolete) 320517f.pdf User manual (new) 320889a.pdf delete @@ -336,8 +336,10 @@ static int ni_atmio_detach(comedi_device *dev) if(dev->irq){ comedi_free_irq(dev->irq,dev); } +#ifdef __ISAPNP__ if(devpriv->isapnp_dev) devpriv->isapnp_dev->deactivate(devpriv->isapnp_dev); +#endif return 0; } @@ -351,9 +353,11 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it) int irq; iobase=it->options[0]; - + irq=it->options[1]; + isapnp_dev = NULL; if( iobase == 0 ) { +#ifdef __ISAPNP__ isapnp_dev = isapnp_find_dev(NULL, ISAPNP_VENDOR('N','I','C'), ISAPNP_FUNCTION(0x1900), @@ -385,8 +389,7 @@ static int ni_atmio_attach(comedi_device *dev,comedi_devconfig *it) iobase = isapnp_dev->resource[0].start; irq = isapnp_dev->irq_resource[0].start; devpriv->isapnp_dev = isapnp_dev; - }else{ - irq=it->options[1]; +#endif } /* reserve our I/O region */ diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h index e8f7aa69..63adcf1a 100644 --- a/include/linux/isapnp.h +++ b/include/linux/isapnp.h @@ -10,40 +10,7 @@ #if LINUX_VERSION_CODE >= 0x020300 #include_next #else -/* lowlevel configuration */ -static inline int isapnp_present(void) { return 0; } -static inline int isapnp_cfg_begin(int csn, int device) { return -ENODEV; } -static inline int isapnp_cfg_end(void) { return -ENODEV; } -static inline unsigned char isapnp_read_byte(unsigned char idx) { return 0xff; } -static inline unsigned short isapnp_read_word(unsigned char idx) { return 0xffff; } -static inline unsigned int isapnp_read_dword(unsigned char idx) { return 0xffffffff; } -static inline void isapnp_write_byte(unsigned char idx, unsigned char val) { ; } -static inline void isapnp_write_word(unsigned char idx, unsigned short val) { ; } -static inline void isapnp_write_dword(unsigned char idx, unsigned int val) { ; } -static inline void isapnp_wake(unsigned char csn) { ; } -static inline void isapnp_device(unsigned char device) { ; } -static inline void isapnp_activate(unsigned char device) { ; } -static inline void isapnp_deactivate(unsigned char device) { ; } -/* manager */ -static inline struct pci_bus *isapnp_find_card(unsigned short vendor, - unsigned short device, - struct pci_bus *from) { return NULL; } -static inline struct pci_dev *isapnp_find_dev(struct pci_bus *card, - unsigned short vendor, - unsigned short function, - struct pci_dev *from) { return NULL; } -static inline int isapnp_probe_cards(const struct isapnp_card_id *ids, - int (*probe)(struct pci_bus *card, - const struct isapnp_card_id *id)) { return -ENODEV; } -static inline int isapnp_probe_devs(const struct isapnp_device_id *ids, - int (*probe)(struct pci_dev *dev, - const struct isapnp_device_id *id)) { return -ENODEV; } -static inline void isapnp_resource_change(struct resource *resource, - unsigned long start, - unsigned long size) { ; } -static inline int isapnp_activate_dev(struct pci_dev *dev, const char *name) { return -ENODEV; } -static inline int isapnp_register_driver(struct isapnp_driver *drv) { return 0; } -static inline void isapnp_unregister_driver(struct isapnp_driver *drv) { } +#include #endif #endif -- 2.26.2