Deal with event callback getting moved into pcmcia_driver struct in
authorFrank Mori Hess <fmhess@speakeasy.net>
Tue, 20 Sep 2005 23:27:36 +0000 (23:27 +0000)
committerFrank Mori Hess <fmhess@speakeasy.net>
Tue, 20 Sep 2005 23:27:36 +0000 (23:27 +0000)
2.6.13 kernels.

comedi/drivers/das08_cs.c
comedi/drivers/ni_daq_dio24.c
comedi/drivers/ni_labpc_cs.c
comedi/drivers/ni_mio_cs.c
comedi/drivers/quatech_daqp_cs.c

index 948a0fbe6410189238e5f7222253ab5e71aaaf23..f9af08fb28c502871712ceb94344495f887aa4fd 100644 (file)
@@ -43,6 +43,7 @@ Command support does not exist, but could be added for this board.
 
 #include <linux/delay.h>
 #include <linux/pci.h>
+#include <linux/version.h>
 
 #include "das08.h"
 
@@ -284,11 +285,13 @@ static dev_link_t *das08_pcmcia_attach(void)
     dev_list = link;
     client_reg.dev_info = &dev_info;
     client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &das08_pcmcia_event;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)        
+       client_reg.EventMask =
+               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+       client_reg.event_handler = &das08_pcmcia_event;
+#endif
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -655,8 +658,11 @@ the device state and restart IO.
 
 struct pcmcia_driver das08_cs_driver =
 {
-       .attach = das08_pcmcia_attach,
-       .detach = das08_pcmcia_detach,
+       .attach = &das08_pcmcia_attach,
+       .detach = &das08_pcmcia_detach,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+       .event = &das08_pcmcia_event,
+#endif
        .owner = THIS_MODULE,
        .drv = {
                .name = dev_info,
index 0180d42aaa34405297ecf6fe62ee708b53fc19ec..788e99eb6864ba8f436e58b6bd9bd3241106c82e 100644 (file)
@@ -43,6 +43,7 @@ the PCMCIA interface.
 #include <linux/comedidev.h>
 
 #include <linux/ioport.h>
+#include <linux/version.h>
 
 #include "8255.h"
 
@@ -367,11 +368,13 @@ static dev_link_t *dio24_cs_attach(void)
     pcmcia_dev_list = link;
     client_reg.dev_info = &dev_info;
     client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &dio24_event;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)        
+       client_reg.EventMask =
+               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+       client_reg.event_handler = &dio24_event;
+#endif
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -784,8 +787,11 @@ static int dio24_event(event_t event, int priority,
 
 struct pcmcia_driver dio24_cs_driver =
 {
-       .attach = dio24_cs_attach,
-       .detach = dio24_cs_detach,
+       .attach = &dio24_cs_attach,
+       .detach = &dio24_cs_detach,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+       .event = &dio24_event,
+#endif
        .owner = THIS_MODULE,
        .drv = {
                .name = "ni_daq_dio24",
index f34f69fe9cb6049809ab6345c268e3da09b0c568..3c22f3f7cbe45ffbf1439ba5f6c28369491f722f 100644 (file)
@@ -64,6 +64,7 @@ NI manuals:
 #include <linux/comedidev.h>
 
 #include <linux/delay.h>
+#include <linux/version.h>
 
 #include "8253.h"
 #include "8255.h"
@@ -99,13 +100,13 @@ static int labpc_attach(comedi_device *dev,comedi_devconfig *it);
 
 static comedi_driver driver_labpc_cs =
 {
-       driver_name: "ni_labpc_cs",
-       module: THIS_MODULE,
-       attach: labpc_attach,
-       detach: labpc_common_detach,
-       num_names: sizeof(labpc_cs_boards) / sizeof(labpc_board),
-       board_name: (char **)labpc_cs_boards,
-       offset: sizeof(labpc_board),
+       .driver_name = "ni_labpc_cs",
+       .module = THIS_MODULE,
+       .attach = &labpc_attach,
+       .detach = &labpc_common_detach,
+       .num_names = sizeof(labpc_cs_boards) / sizeof(labpc_board),
+       .board_name = (char **)labpc_cs_boards,
+       .offset = sizeof(labpc_board),
 };
 
 static int labpc_attach(comedi_device *dev, comedi_devconfig *it)
@@ -299,12 +300,14 @@ static dev_link_t *labpc_cs_attach(void)
     pcmcia_dev_list = link;
     client_reg.dev_info = &dev_info;
     client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &labpc_event;
-    client_reg.Version = 0x0210;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)        
+       client_reg.EventMask =
+               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+       client_reg.event_handler = &labpc_event;
+#endif    
+       client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
     if (ret != CS_SUCCESS) {
@@ -709,6 +712,9 @@ struct pcmcia_driver labpc_cs_driver =
 {
        .attach = labpc_cs_attach,
        .detach = labpc_cs_detach,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+       .event = &labpc_event,
+#endif 
        .owner = THIS_MODULE,
        .drv = {
                .name = "daqcard-1200",
index ad43d16c828b7b46055193e2e99dca7ae0121d8b..1d309fcd53c739aaacde93032a5d76f00fbfebe8 100644 (file)
@@ -44,6 +44,7 @@ See the notes in the ni_atmio.o driver.
 #include <linux/comedidev.h>
 
 #include <linux/delay.h>
+#include <linux/version.h>
 
 #include "ni_stc.h"
 #include "8255.h"
@@ -289,11 +290,13 @@ static dev_link_t *cs_attach(void)
 
        client_reg.dev_info = &dev_info;
        client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)
        client_reg.EventMask =
                CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
                CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
                CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
        client_reg.event_handler = &mio_cs_event;
+#endif
        client_reg.Version = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -606,8 +609,11 @@ MODULE_LICENSE("GPL");
 
 struct pcmcia_driver ni_mio_cs_driver =
 {
-       .attach = cs_attach,
-       .detach = cs_detach,
+       .attach = &cs_attach,
+       .detach = &cs_detach,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+       .event = &mio_cs_event,
+#endif 
        .owner = THIS_MODULE,
        .drv = {
                .name = "ni_mio_cs",
index 65d45348e9db6b5fbeb854d1e86c9295a24e5394..6b0cebef8ac66fac10cd051c58eef6c351687685 100644 (file)
@@ -49,6 +49,7 @@ Devices: [Quatech] DAQP-208 (daqp), DAQP-308
 
 #include <linux/comedidev.h>
 
+#include <linux/version.h>
 #include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
@@ -1147,11 +1148,13 @@ static dev_link_t *daqp_cs_attach(void)
     /* Register with Card Services */
     client_reg.dev_info = &dev_info;
     client_reg.Attributes = INFO_IO_CLIENT | INFO_CARD_SHARE;
-    client_reg.EventMask =
-       CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-       CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
-       CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
-    client_reg.event_handler = &daqp_cs_event;
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,13)        
+       client_reg.EventMask =
+               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
+               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET |
+               CS_EVENT_PM_SUSPEND | CS_EVENT_PM_RESUME;
+       client_reg.event_handler = &daqp_cs_event;
+#endif
     client_reg.Version = 0x0210;
     client_reg.event_callback_args.client_data = link;
     ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -1517,6 +1520,9 @@ struct pcmcia_driver daqp_cs_driver =
 {
        .attach = daqp_cs_attach,
        .detach = daqp_cs_detach,
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,13)
+       .event = daqp_cs_event,
+#endif
        .owner = THIS_MODULE,
        .drv = {
                .name = "quatech_daqp_cs",