]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
authorLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 19:25:06 +0000 (12:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Fri, 6 Aug 2010 19:25:06 +0000 (12:25 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6:
  pcmcia: avoid buffer overflow in pcmcia_setup_isa_irq
  pcmcia: do not request windows if you don't need to
  pcmcia: insert PCMCIA device resources into resource tree
  pcmcia: export resource information to sysfs
  pcmcia: use struct resource for PCMCIA devices, part 2
  pcmcia: remove memreq_t
  pcmcia: move local definitions out of include/pcmcia/cs.h
  pcmcia: do not use io_req_t when calling pcmcia_request_io()
  pcmcia: do not use io_req_t after call to pcmcia_request_io()
  pcmcia: use struct resource for PCMCIA devices
  pcmcia: clean up cs.h
  pcmcia: use pcmica_{read,write}_config_byte
  pcmcia: remove cs_types.h
  pcmcia: remove unused flag, simplify headers
  pcmcia: remove obsolete CS_EVENT_ definitions
  pcmcia: split up central event handler
  pcmcia: simplify event callback
  pcmcia: remove obsolete ioctl

Conflicts in:
 - drivers/staging/comedi/drivers/*
 - drivers/staging/wlags49_h2/wl_cs.c
due to dev_info_t and whitespace changes

13 files changed:
1  2 
Documentation/feature-removal-schedule.txt
drivers/bluetooth/dtl1_cs.c
drivers/net/wireless/ray_cs.c
drivers/pcmcia/pxa2xx_base.c
drivers/ssb/main.c
drivers/staging/comedi/drivers/cb_das16_cs.c
drivers/staging/comedi/drivers/das08_cs.c
drivers/staging/comedi/drivers/ni_daq_700.c
drivers/staging/comedi/drivers/ni_daq_dio24.c
drivers/staging/comedi/drivers/ni_labpc_cs.c
drivers/staging/comedi/drivers/ni_mio_cs.c
drivers/staging/comedi/drivers/quatech_daqp_cs.c
drivers/staging/wlags49_h2/wl_cs.c

index be7030e4dd73697ed5b979f02b6841dac7bb69c0,27ed68d95adca0d01aa7b53951bda67780c55415..6fdb837d940bac4ec64337c448f7d61f0b24e6a5
@@@ -93,7 -93,7 +93,7 @@@ Why:  Broken design for runtime control 
        inputs.  This framework was never widely used, and most attempts to
        use it were broken.  Drivers should instead be exposing domain-specific
        interfaces either to kernel or to userspace.
 -Who:  Pavel Machek <pavel@suse.cz>
 +Who:  Pavel Machek <pavel@ucw.cz>
  
  ---------------------------
  
@@@ -115,29 -115,6 +115,6 @@@ Why:      V4L1 AP1 was replaced by V4L2 API 
  Who:  Mauro Carvalho Chehab <mchehab@infradead.org>
  
  ---------------------------
- What: PCMCIA control ioctl (needed for pcmcia-cs [cardmgr, cardctl])
- When: 2.6.35/2.6.36
- Files:        drivers/pcmcia/: pcmcia_ioctl.c
- Why:  With the 16-bit PCMCIA subsystem now behaving (almost) like a
-       normal hotpluggable bus, and with it using the default kernel
-       infrastructure (hotplug, driver core, sysfs) keeping the PCMCIA
-       control ioctl needed by cardmgr and cardctl from pcmcia-cs is
-       unnecessary and potentially harmful (it does not provide for
-       proper locking), and makes further cleanups and integration of the
-       PCMCIA subsystem into the Linux kernel device driver model more
-       difficult. The features provided by cardmgr and cardctl are either
-       handled by the kernel itself now or are available in the new
-       pcmciautils package available at
-       http://kernel.org/pub/linux/utils/kernel/pcmcia/
-       For all architectures except ARM, the associated config symbol
-       has been removed from kernel 2.6.34; for ARM, it will be likely
-       be removed from kernel 2.6.35. The actual code will then likely
-       be removed from kernel 2.6.36.
- Who:  Dominik Brodowski <linux@dominikbrodowski.net>
- ---------------------------
  
  What: sys_sysctl
  When: September 2010
@@@ -303,6 -280,15 +280,6 @@@ Who:      Johannes Berg <johannes@sipsolutio
  
  ---------------------------
  
 -What: CONFIG_NF_CT_ACCT
 -When: 2.6.29
 -Why:  Accounting can now be enabled/disabled without kernel recompilation.
 -      Currently used only to set a default value for a feature that is also
 -      controlled by a kernel/module/sysfs/sysctl parameter.
 -Who:  Krzysztof Piotr Oledzki <ole@ans.pl>
 -
 ----------------------------
 -
  What: sysfs ui for changing p4-clockmod parameters
  When: September 2009
  Why:  See commits 129f8ae9b1b5be94517da76009ea956e89104ce8 and
@@@ -368,6 -354,16 +345,6 @@@ Who:      Eric Paris <eparis@redhat.com
  
  ----------------------------
  
 -What: lock_policy_rwsem_* and unlock_policy_rwsem_* will not be
 -      exported interface anymore.
 -When: 2.6.33
 -Why:  cpu_policy_rwsem has a new cleaner definition making it local to
 -      cpufreq core and contained inside cpufreq.c. Other dependent
 -      drivers should not use it in order to safely avoid lockdep issues.
 -Who:  Venkatesh Pallipadi <venkatesh.pallipadi@intel.com>
 -
 -----------------------------
 -
  What: sound-slot/service-* module aliases and related clutters in
        sound/sound_core.c
  When: August 2010
@@@ -440,6 -436,57 +417,6 @@@ Who:      Corentin Chary <corentin.chary@gma
  
  ----------------------------
  
 -What: usbvideo quickcam_messenger driver
 -When: 2.6.35
 -Files:        drivers/media/video/usbvideo/quickcam_messenger.[ch]
 -Why:  obsolete v4l1 driver replaced by gspca_stv06xx
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
 -What: ov511 v4l1 driver
 -When: 2.6.35
 -Files:        drivers/media/video/ov511.[ch]
 -Why:  obsolete v4l1 driver replaced by gspca_ov519
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
 -What: w9968cf v4l1 driver
 -When: 2.6.35
 -Files:        drivers/media/video/w9968cf*.[ch]
 -Why:  obsolete v4l1 driver replaced by gspca_ov519
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
 -What: ovcamchip sensor framework
 -When: 2.6.35
 -Files:        drivers/media/video/ovcamchip/*
 -Why:  Only used by obsoleted v4l1 drivers
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
 -What: stv680 v4l1 driver
 -When: 2.6.35
 -Files:        drivers/media/video/stv680.[ch]
 -Why:  obsolete v4l1 driver replaced by gspca_stv0680
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
 -What: zc0301 v4l driver
 -When: 2.6.35
 -Files:        drivers/media/video/zc0301/*
 -Why:  Duplicate functionality with the gspca_zc3xx driver, zc0301 only
 -      supports 2 USB-ID's (because it only supports a limited set of
 -      sensors) wich are also supported by the gspca_zc3xx driver
 -      (which supports 53 USB-ID's in total)
 -Who:  Hans de Goede <hdegoede@redhat.com>
 -
 -----------------------------
 -
  What: sysfs-class-rfkill state file
  When: Feb 2014
  Files:        net/rfkill/core.c
@@@ -468,6 -515,17 +445,6 @@@ Who:      Jan Kiszka <jan.kiszka@web.de
  
  ----------------------------
  
 -What: KVM memory aliases support
 -When: July 2010
 -Why:  Memory aliasing support is used for speeding up guest vga access
 -      through the vga windows.
 -
 -      Modern userspace no longer uses this feature, so it's just bitrotted
 -      code and can be removed with no impact.
 -Who:  Avi Kivity <avi@redhat.com>
 -
 -----------------------------
 -
  What: xtime, wall_to_monotonic
  When: 2.6.36+
  Files:        kernel/time/timekeeping.c include/linux/time.h
@@@ -478,6 -536,16 +455,6 @@@ Who:      John Stultz <johnstul@us.ibm.com
  
  ----------------------------
  
 -What: KVM kernel-allocated memory slots
 -When: July 2010
 -Why:  Since 2.6.25, kvm supports user-allocated memory slots, which are
 -      much more flexible than kernel-allocated slots.  All current userspace
 -      supports the newer interface and this code can be removed with no
 -      impact.
 -Who:  Avi Kivity <avi@redhat.com>
 -
 -----------------------------
 -
  What: KVM paravirt mmu host support
  When: January 2011
  Why:  The paravirt mmu host support is slower than non-paravirt mmu, both
@@@ -556,10 -624,3 +533,10 @@@ Who:     Stefan Richter <stefanr@s5r6.in-be
  
  ----------------------------
  
 +What: The acpi_sleep=s4_nonvs command line option
 +When: 2.6.37
 +Files:        arch/x86/kernel/acpi/sleep.c
 +Why:  superseded by acpi_sleep=nonvs
 +Who:  Rafael J. Wysocki <rjw@sisk.pl>
 +
 +----------------------------
index cbe9e44a42e96d44bfb4224d284838f90b919060,18ecc5734e9f6276c2d250764e5b25091a8c1ebd..db7c8db695fc643cff089670b721ef801dd14090
@@@ -41,7 -41,6 +41,6 @@@
  #include <asm/system.h>
  #include <asm/io.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/ciscode.h>
@@@ -104,7 -103,7 +103,7 @@@ typedef struct 
        u8 type;
        u8 zero;
        u16 len;
 -} __attribute__ ((packed)) nsh_t;     /* Nokia Specific Header */
 +} __packed nsh_t;     /* Nokia Specific Header */
  
  #define NSHL  4                               /* Nokia Specific Header Length */
  
@@@ -150,7 -149,7 +149,7 @@@ static void dtl1_write_wakeup(dtl1_info
        }
  
        do {
-               register unsigned int iobase = info->p_dev->io.BasePort1;
+               register unsigned int iobase = info->p_dev->resource[0]->start;
                register struct sk_buff *skb;
                register int len;
  
@@@ -215,7 -214,7 +214,7 @@@ static void dtl1_receive(dtl1_info_t *i
                return;
        }
  
-       iobase = info->p_dev->io.BasePort1;
+       iobase = info->p_dev->resource[0]->start;
  
        do {
                info->hdev->stat.byte_rx++;
@@@ -302,7 -301,7 +301,7 @@@ static irqreturn_t dtl1_interrupt(int i
                /* our irq handler is shared */
                return IRQ_NONE;
  
-       iobase = info->p_dev->io.BasePort1;
+       iobase = info->p_dev->resource[0]->start;
  
        spin_lock(&(info->lock));
  
@@@ -462,7 -461,7 +461,7 @@@ static int dtl1_hci_ioctl(struct hci_de
  static int dtl1_open(dtl1_info_t *info)
  {
        unsigned long flags;
-       unsigned int iobase = info->p_dev->io.BasePort1;
+       unsigned int iobase = info->p_dev->resource[0]->start;
        struct hci_dev *hdev;
  
        spin_lock_init(&(info->lock));
        outb(UART_LCR_WLEN8, iobase + UART_LCR);        /* Reset DLAB */
        outb((UART_MCR_DTR | UART_MCR_RTS | UART_MCR_OUT2), iobase + UART_MCR);
  
-       info->ri_latch = inb(info->p_dev->io.BasePort1 + UART_MSR) & UART_MSR_RI;
+       info->ri_latch = inb(info->p_dev->resource[0]->start + UART_MSR)
+                               & UART_MSR_RI;
  
        /* Turn on interrupts */
        outb(UART_IER_RLSI | UART_IER_RDI | UART_IER_THRI, iobase + UART_IER);
  static int dtl1_close(dtl1_info_t *info)
  {
        unsigned long flags;
-       unsigned int iobase = info->p_dev->io.BasePort1;
+       unsigned int iobase = info->p_dev->resource[0]->start;
        struct hci_dev *hdev = info->hdev;
  
        if (!hdev)
@@@ -572,8 -572,8 +572,8 @@@ static int dtl1_probe(struct pcmcia_dev
        info->p_dev = link;
        link->priv = info;
  
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       link->io.NumPorts1 = 8;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
+       link->resource[0]->end = 8;
  
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
@@@ -597,14 -597,13 +597,13 @@@ static int dtl1_confcheck(struct pcmcia
                          unsigned int vcc,
                          void *priv_data)
  {
-       if ((cf->io.nwin == 1) && (cf->io.win[0].len > 8)) {
-               p_dev->io.BasePort1 = cf->io.win[0].base;
-               p_dev->io.NumPorts1 = cf->io.win[0].len;        /*yo */
-               p_dev->io.IOAddrLines = cf->io.flags & CISTPL_IO_LINES_MASK;
-               if (!pcmcia_request_io(p_dev, &p_dev->io))
-                       return 0;
-       }
-       return -ENODEV;
+       if ((cf->io.nwin != 1) || (cf->io.win[0].len <= 8))
+               return -ENODEV;
+       p_dev->resource[0]->start = cf->io.win[0].base;
+       p_dev->resource[0]->end = cf->io.win[0].len;    /*yo */
+       p_dev->io_lines = cf->io.flags & CISTPL_IO_LINES_MASK;
+       return pcmcia_request_io(p_dev);
  }
  
  static int dtl1_config(struct pcmcia_device *link)
        int i;
  
        /* Look for a generic full-sized window */
-       link->io.NumPorts1 = 8;
+       link->resource[0]->end = 8;
        if (pcmcia_loop_config(link, dtl1_confcheck, NULL) < 0)
                goto failed;
  
index 9c38fc331dca7966a6d643d37aaef20079cdd8b6,a860bce6849b0d4517bcf6d8f4ee57559f5e70f1..88560d0ae50a2457d1373103db85b98ebb61211e
@@@ -46,7 -46,6 +46,6 @@@
  #include <linux/ethtool.h>
  #include <linux/ieee80211.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -97,6 -96,7 +96,6 @@@ static iw_stats *ray_get_wireless_stats
  static const struct iw_handler_def ray_handler_def;
  
  /***** Prototypes for raylink functions **************************************/
 -static int asc_to_int(char a);
  static void authenticate(ray_dev_t *local);
  static int build_auth_frame(ray_dev_t *local, UCHAR *dest, int auth_type);
  static void authenticate_timeout(u_long);
@@@ -315,9 -315,8 +314,8 @@@ static int ray_probe(struct pcmcia_devi
        local->finder = p_dev;
  
        /* The io structure describes IO port mapping. None used here */
-       p_dev->io.NumPorts1 = 0;
-       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-       p_dev->io.IOAddrLines = 5;
+       p_dev->resource[0]->end = 0;
+       p_dev->resource[0]->flags |= IO_DATA_PATH_WIDTH_8;
  
        /* General socket configuration */
        p_dev->conf.Attributes = CONF_ENABLE_IRQ;
@@@ -394,7 -393,6 +392,6 @@@ static int ray_config(struct pcmcia_dev
        int ret = 0;
        int i;
        win_req_t req;
-       memreq_t mem;
        struct net_device *dev = (struct net_device *)link->priv;
        ray_dev_t *local = netdev_priv(dev);
  
        ret = pcmcia_request_window(link, &req, &link->win);
        if (ret)
                goto failed;
-       mem.CardOffset = 0x0000;
-       mem.Page = 0;
-       ret = pcmcia_map_mem_page(link, link->win, &mem);
+       ret = pcmcia_map_mem_page(link, link->win, 0);
        if (ret)
                goto failed;
        local->sram = ioremap(req.Base, req.Size);
        ret = pcmcia_request_window(link, &req, &local->rmem_handle);
        if (ret)
                goto failed;
-       mem.CardOffset = 0x8000;
-       mem.Page = 0;
-       ret = pcmcia_map_mem_page(link, local->rmem_handle, &mem);
+       ret = pcmcia_map_mem_page(link, local->rmem_handle, 0x8000);
        if (ret)
                goto failed;
        local->rmem = ioremap(req.Base, req.Size);
        ret = pcmcia_request_window(link, &req, &local->amem_handle);
        if (ret)
                goto failed;
-       mem.CardOffset = 0x0000;
-       mem.Page = 0;
-       ret = pcmcia_map_mem_page(link, local->amem_handle, &mem);
+       ret = pcmcia_map_mem_page(link, local->amem_handle, 0);
        if (ret)
                goto failed;
        local->amem = ioremap(req.Base, req.Size);
@@@ -793,7 -785,6 +784,6 @@@ static void ray_release(struct pcmcia_d
  {
        struct net_device *dev = link->priv;
        ray_dev_t *local = netdev_priv(dev);
-       int i;
  
        dev_dbg(&link->dev, "ray_release\n");
  
        iounmap(local->sram);
        iounmap(local->rmem);
        iounmap(local->amem);
-       /* Do bother checking to see if these succeed or not */
-       i = pcmcia_release_window(link, local->amem_handle);
-       if (i != 0)
-               dev_dbg(&link->dev, "ReleaseWindow(local->amem) ret = %x\n", i);
-       i = pcmcia_release_window(link, local->rmem_handle);
-       if (i != 0)
-               dev_dbg(&link->dev, "ReleaseWindow(local->rmem) ret = %x\n", i);
        pcmcia_disable_device(link);
  
        dev_dbg(&link->dev, "ray_release ending\n");
@@@ -1715,6 -1699,24 +1698,6 @@@ static void authenticate_timeout(u_lon
        join_net((u_long) local);
  }
  
 -/*===========================================================================*/
 -static int asc_to_int(char a)
 -{
 -      if (a < '0')
 -              return -1;
 -      if (a <= '9')
 -              return (a - '0');
 -      if (a < 'A')
 -              return -1;
 -      if (a <= 'F')
 -              return (10 + a - 'A');
 -      if (a < 'a')
 -              return -1;
 -      if (a <= 'f')
 -              return (10 + a - 'a');
 -      return -1;
 -}
 -
  /*===========================================================================*/
  static int parse_addr(char *in_str, UCHAR *out)
  {
        i = 5;
  
        while (j > 0) {
 -              if ((k = asc_to_int(in_str[j--])) != -1)
 +              if ((k = hex_to_bin(in_str[j--])) != -1)
                        out[i] = k;
                else
                        return 0;
  
                if (j == 0)
                        break;
 -              if ((k = asc_to_int(in_str[j--])) != -1)
 +              if ((k = hex_to_bin(in_str[j--])) != -1)
                        out[i] += k << 4;
                else
                        return 0;
index f370476d5417d49b48540e49432c5f82b97cf53c,66c022579d9b5a32641c2d720b4843c179172feb..ae07b4db8a6ec00def420e5af77bbcede2b90730
@@@ -32,7 -32,6 +32,6 @@@
  #include <mach/pxa2xx-regs.h>
  #include <asm/mach-types.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/ss.h>
  #include <pcmcia/cistpl.h>
  
@@@ -178,6 -177,7 +177,6 @@@ pxa2xx_pcmcia_frequency_change(struct s
                               unsigned long val,
                               struct cpufreq_freqs *freqs)
  {
 -#warning "it's not clear if this is right since the core CPU (N) clock has no effect on the memory (L) clock"
        switch (val) {
        case CPUFREQ_PRECHANGE:
                if (freqs->new > freqs->old) {
                               "pre-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
 -                      pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
 +                      pxa2xx_pcmcia_set_timing(skt);
                }
                break;
  
                               "post-updating\n",
                               freqs->new / 1000, (freqs->new / 100) % 10,
                               freqs->old / 1000, (freqs->old / 100) % 10);
 -                      pxa2xx_pcmcia_set_mcxx(skt, freqs->new);
 +                      pxa2xx_pcmcia_set_timing(skt);
                }
                break;
        }
diff --combined drivers/ssb/main.c
index 7cee7f4eb60b8f761fe2552e483c59f1f6e3efac,06f04b42cb23897cc4b9ca9b3d09e876e1f46ea5..7892ac163522cd0e62f568fbc7cefcea173f298e
@@@ -20,7 -20,6 +20,6 @@@
  #include <linux/mmc/sdio_func.h>
  #include <linux/slab.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/ds.h>
@@@ -486,7 -485,6 +485,7 @@@ static int ssb_devices_register(struct 
  #ifdef CONFIG_SSB_PCIHOST
                        sdev->irq = bus->host_pci->irq;
                        dev->parent = &bus->host_pci->dev;
 +                      sdev->dma_dev = dev->parent;
  #endif
                        break;
                case SSB_BUSTYPE_PCMCIA:
                        break;
                case SSB_BUSTYPE_SSB:
                        dev->dma_mask = &dev->coherent_dma_mask;
 +                      sdev->dma_dev = dev;
                        break;
                }
  
@@@ -1228,6 -1225,80 +1227,6 @@@ u32 ssb_dma_translation(struct ssb_devi
  }
  EXPORT_SYMBOL(ssb_dma_translation);
  
 -int ssb_dma_set_mask(struct ssb_device *dev, u64 mask)
 -{
 -#ifdef CONFIG_SSB_PCIHOST
 -      int err;
 -#endif
 -
 -      switch (dev->bus->bustype) {
 -      case SSB_BUSTYPE_PCI:
 -#ifdef CONFIG_SSB_PCIHOST
 -              err = pci_set_dma_mask(dev->bus->host_pci, mask);
 -              if (err)
 -                      return err;
 -              err = pci_set_consistent_dma_mask(dev->bus->host_pci, mask);
 -              return err;
 -#endif
 -      case SSB_BUSTYPE_SSB:
 -              return dma_set_mask(dev->dev, mask);
 -      default:
 -              __ssb_dma_not_implemented(dev);
 -      }
 -      return -ENOSYS;
 -}
 -EXPORT_SYMBOL(ssb_dma_set_mask);
 -
 -void * ssb_dma_alloc_consistent(struct ssb_device *dev, size_t size,
 -                              dma_addr_t *dma_handle, gfp_t gfp_flags)
 -{
 -      switch (dev->bus->bustype) {
 -      case SSB_BUSTYPE_PCI:
 -#ifdef CONFIG_SSB_PCIHOST
 -              if (gfp_flags & GFP_DMA) {
 -                      /* Workaround: The PCI API does not support passing
 -                       * a GFP flag. */
 -                      return dma_alloc_coherent(&dev->bus->host_pci->dev,
 -                                                size, dma_handle, gfp_flags);
 -              }
 -              return pci_alloc_consistent(dev->bus->host_pci, size, dma_handle);
 -#endif
 -      case SSB_BUSTYPE_SSB:
 -              return dma_alloc_coherent(dev->dev, size, dma_handle, gfp_flags);
 -      default:
 -              __ssb_dma_not_implemented(dev);
 -      }
 -      return NULL;
 -}
 -EXPORT_SYMBOL(ssb_dma_alloc_consistent);
 -
 -void ssb_dma_free_consistent(struct ssb_device *dev, size_t size,
 -                           void *vaddr, dma_addr_t dma_handle,
 -                           gfp_t gfp_flags)
 -{
 -      switch (dev->bus->bustype) {
 -      case SSB_BUSTYPE_PCI:
 -#ifdef CONFIG_SSB_PCIHOST
 -              if (gfp_flags & GFP_DMA) {
 -                      /* Workaround: The PCI API does not support passing
 -                       * a GFP flag. */
 -                      dma_free_coherent(&dev->bus->host_pci->dev,
 -                                        size, vaddr, dma_handle);
 -                      return;
 -              }
 -              pci_free_consistent(dev->bus->host_pci, size,
 -                                  vaddr, dma_handle);
 -              return;
 -#endif
 -      case SSB_BUSTYPE_SSB:
 -              dma_free_coherent(dev->dev, size, vaddr, dma_handle);
 -              return;
 -      default:
 -              __ssb_dma_not_implemented(dev);
 -      }
 -}
 -EXPORT_SYMBOL(ssb_dma_free_consistent);
 -
  int ssb_bus_may_powerdown(struct ssb_bus *bus)
  {
        struct ssb_chipcommon *cc;
index 6d893c65adc8ff8c2aeee5ae4181c5ecbb77064e,7cf0ccb5adefe2b16cfde8a42e4a8370185203af..f8ede1182ccc5113b657a997b3df20460bf729fa
@@@ -37,7 -37,6 +37,6 @@@ Status: experimenta
  #include <linux/delay.h>
  #include <linux/pci.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/ds.h>
@@@ -171,7 -170,7 +170,7 @@@ static int das16cs_attach(struct comedi
        if (!link)
                return -EIO;
  
-       dev->iobase = link->io.BasePort1;
+       dev->iobase = link->resource[0]->start;;
        printk("I/O base=0x%04lx ", dev->iobase);
  
        printk("fingerprint:\n");
@@@ -662,14 -661,14 +661,6 @@@ static void das16cs_pcmcia_detach(struc
     less on other parts of the kernel.
  */
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static dev_info_t dev_info = "cb_das16_cs";
--
  struct local_info_t {
        struct pcmcia_device *link;
        int stop;
@@@ -719,7 -718,8 +710,7 @@@ static void das16cs_pcmcia_detach(struc
        ((struct local_info_t *)link->priv)->stop = 1;
        das16cs_pcmcia_release(link);
        /* This points to the parent struct local_info_t struct */
 -      if (link->priv)
 -              kfree(link->priv);
 +      kfree(link->priv);
  }                             /* das16cs_pcmcia_detach */
  
  
@@@ -736,24 -736,22 +727,22 @@@ static int das16cs_pcmcia_config_loop(s
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
                /* This reserves IO space but doesn't actually enable it */
-               return pcmcia_request_io(p_dev, &p_dev->io);
+               return pcmcia_request_io(p_dev);
        }
  
        return 0;
@@@ -787,12 -785,10 +776,10 @@@ static void das16cs_pcmcia_config(struc
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
                printk(", irq %u", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
+       if (link->resource[0])
+               printk(", io %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(", io %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -846,7 -842,7 +833,7 @@@ struct pcmcia_driver das16cs_driver = 
        .id_table = das16cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "cb_das16_cs",
                },
  };
  
@@@ -880,16 -876,5 +867,16 @@@ void __exit cleanup_module(void
  }
  
  #else
 -COMEDI_INITCLEANUP(driver_das16cs);
 +static int __init driver_das16cs_init_module(void)
 +{
 +      return comedi_driver_register(&driver_das16cs);
 +}
 +
 +static void __exit driver_das16cs_cleanup_module(void)
 +{
 +      comedi_driver_unregister(&driver_das16cs);
 +}
 +
 +module_init(driver_das16cs_init_module);
 +module_exit(driver_das16cs_cleanup_module);
  #endif /* CONFIG_PCMCIA */
index fb561ab7f07cf32888eb2cffeffa0ee8cc5919f9,9ee677f14b661e33de5b3fa0c06ad6062174b866..c6aa52f8dcee3c5f97ea3df1a3f9374cf9a04f04
@@@ -48,7 -48,6 +48,6 @@@ Command support does not exist, but cou
  #include "das08.h"
  
  /* pcmcia includes */
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/ds.h>
@@@ -89,7 -88,7 +88,7 @@@ static int das08_cs_attach(struct comed
                        printk(" no pcmcia cards found\n");
                        return -EIO;
                }
-               iobase = link->io.BasePort1;
+               iobase = link->resource[0]->start;
        } else {
                printk(" bug! board does not have PCMCIA bustype\n");
                return -EINVAL;
@@@ -132,14 -131,14 +131,6 @@@ static void das08_pcmcia_detach(struct 
     less on other parts of the kernel.
  */
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static const dev_info_t dev_info = "pcm-das08";
--
  struct local_info_t {
        struct pcmcia_device *link;
        int stop;
@@@ -206,7 -205,8 +197,7 @@@ static void das08_pcmcia_detach(struct 
        das08_pcmcia_release(link);
  
        /* This points to the parent struct local_info_t struct */
 -      if (link->priv)
 -              kfree(link->priv);
 +      kfree(link->priv);
  
  }                             /* das08_pcmcia_detach */
  
@@@ -224,24 -224,23 +215,23 @@@ static int das08_pcmcia_config_loop(str
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
                p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
                /* This reserves IO space but doesn't actually enable it */
-               return pcmcia_request_io(p_dev, &p_dev->io);
+               return pcmcia_request_io(p_dev);
        }
        return 0;
  }
@@@ -283,12 -282,10 +273,10 @@@ static void das08_pcmcia_config(struct 
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
                printk(", irq %u", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
+       if (link->resource[0])
+               printk(", io %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(" & %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -362,7 -359,7 +350,7 @@@ struct pcmcia_driver das08_cs_driver = 
        .id_table = das08_cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "pcm-das08",
                },
  };
  
index 701abd9eabe6e37e9c3636eb43b7f326f21d028f,bf2e84aa03ea4a755ce069db2ceb72d460b24789..cc15666e5cc195391d5fd5093dc90f4c30169943
@@@ -47,7 -47,6 +47,6 @@@ IRQ is assigned but not used
  
  #include <linux/ioport.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -377,7 -376,7 +376,7 @@@ static int dio700_attach(struct comedi_
                link = pcmcia_cur_dev;  /* XXX hack */
                if (!link)
                        return -EIO;
-               iobase = link->io.BasePort1;
+               iobase = link->resource[0]->start;
  #ifdef incomplete
                irq = link->irq;
  #endif
@@@ -459,14 -458,14 +458,6 @@@ static void dio700_cs_detach(struct pcm
     less on other parts of the kernel.
  */
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static const dev_info_t dev_info = "ni_daq_700";
--
  struct local_info_t {
        struct pcmcia_device *link;
        int stop;
@@@ -537,7 -536,8 +528,7 @@@ static void dio700_cs_detach(struct pcm
        dio700_release(link);
  
        /* This points to the parent struct local_info_t struct */
 -      if (link->priv)
 -              kfree(link->priv);
 +      kfree(link->priv);
  
  }                             /* dio700_cs_detach */
  
@@@ -555,9 -555,6 +546,6 @@@ static int dio700_pcmcia_config_loop(st
                                unsigned int vcc,
                                void *priv_data)
  {
-       win_req_t *req = priv_data;
-       memreq_t map;
        if (cfg->index == 0)
                return -ENODEV;
  
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
                /* This reserves IO space but doesn't actually enable it */
-               if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
  
-       if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
-               cistpl_mem_t *mem =
-                       (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
-               req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
-               req->Attributes |= WIN_ENABLE;
-               req->Base = mem->win[0].host_addr;
-               req->Size = mem->win[0].len;
-               if (req->Size < 0x1000)
-                       req->Size = 0x1000;
-               req->AccessSpeed = 0;
-               if (pcmcia_request_window(p_dev, req, &p_dev->win))
-                       return -ENODEV;
-               map.Page = 0;
-               map.CardOffset = mem->win[0].card_addr;
-               if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
-                       return -ENODEV;
-       }
        /* If we got this far, we're cool! */
        return 0;
  }
@@@ -622,7 -600,7 +591,7 @@@ static void dio700_config(struct pcmcia
  
        dev_dbg(&link->dev, "dio700_config\n");
  
-       ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, &req);
+       ret = pcmcia_loop_config(link, dio700_pcmcia_config_loop, NULL);
        if (ret) {
                dev_warn(&link->dev, "no configuration found\n");
                goto failed;
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
                printk(", irq %d", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
-       if (link->win)
-               printk(", mem 0x%06lx-0x%06lx", req.Base,
-                      req.Base + req.Size - 1);
+       if (link->resource[0])
+               printk(", io %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(" & %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -722,7 -695,7 +686,7 @@@ struct pcmcia_driver dio700_cs_driver 
        .id_table = dio700_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "ni_daq_700",
                },
  };
  
index 0b65f247d5dd28f447e877e449d64cb158662644,9112e70cc85661b24bb64b5fe090b4023051b3ba..773ae2044e0ee8a52435f14879563dd37597d6f4
@@@ -48,7 -48,6 +48,6 @@@ the PCMCIA interface
  
  #include "8255.h"
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -129,7 -128,7 +128,7 @@@ static int dio24_attach(struct comedi_d
                link = pcmcia_cur_dev;  /* XXX hack */
                if (!link)
                        return -EIO;
-               iobase = link->io.BasePort1;
+               iobase = link->resource[0]->start;
  #ifdef incomplete
                irq = link->irq;
  #endif
@@@ -211,14 -210,14 +210,6 @@@ static void dio24_cs_detach(struct pcmc
     less on other parts of the kernel.
  */
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static const dev_info_t dev_info = "ni_daq_dio24";
--
  struct local_info_t {
        struct pcmcia_device *link;
        int stop;
@@@ -289,7 -288,8 +280,7 @@@ static void dio24_cs_detach(struct pcmc
        dio24_release(link);
  
        /* This points to the parent local_info_t struct */
 -      if (link->priv)
 -              kfree(link->priv);
 +      kfree(link->priv);
  
  }                             /* dio24_cs_detach */
  
@@@ -307,9 -307,6 +298,6 @@@ static int dio24_pcmcia_config_loop(str
                                unsigned int vcc,
                                void *priv_data)
  {
-       win_req_t *req = priv_data;
-       memreq_t map;
        if (cfg->index == 0)
                return -ENODEV;
  
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
                /* This reserves IO space but doesn't actually enable it */
-               if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
  
-       if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
-               cistpl_mem_t *mem =
-                       (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
-               req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
-               req->Attributes |= WIN_ENABLE;
-               req->Base = mem->win[0].host_addr;
-               req->Size = mem->win[0].len;
-               if (req->Size < 0x1000)
-                       req->Size = 0x1000;
-               req->AccessSpeed = 0;
-               if (pcmcia_request_window(p_dev, req, &p_dev->win))
-                       return -ENODEV;
-               map.Page = 0;
-               map.CardOffset = mem->win[0].card_addr;
-               if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
-                       return -ENODEV;
-       }
        /* If we got this far, we're cool! */
        return 0;
  }
  static void dio24_config(struct pcmcia_device *link)
  {
        int ret;
-       win_req_t req;
  
        printk(KERN_INFO "ni_daq_dio24: HOLA SOY YO! - config\n");
  
        dev_dbg(&link->dev, "dio24_config\n");
  
-       ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, &req);
+       ret = pcmcia_loop_config(link, dio24_pcmcia_config_loop, NULL);
        if (ret) {
                dev_warn(&link->dev, "no configuration found\n");
                goto failed;
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
                printk(", irq %d", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
-       if (link->win)
-               printk(", mem 0x%06lx-0x%06lx", req.Base,
-                      req.Base + req.Size - 1);
+       if (link->resource[0])
+               printk(" & %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(" & %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -473,7 -445,7 +436,7 @@@ struct pcmcia_driver dio24_cs_driver = 
        .id_table = dio24_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "ni_daq_dio24",
                },
  };
  
index 163245ebb3115c26c82f32d1205a5b2b6bdf1dae,f204961e07867b97b1a79d0ca87b5d5f71d98aa7..68c4ecbd93ae83728c422f00da13e273a13d63a1
@@@ -71,7 -71,6 +71,6 @@@ NI manuals
  #include "comedi_fc.h"
  #include "ni_labpc.h"
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -143,7 -142,7 +142,7 @@@ static int labpc_attach(struct comedi_d
                link = pcmcia_cur_dev;  /* XXX hack */
                if (!link)
                        return -EIO;
-               iobase = link->io.BasePort1;
+               iobase = link->resource[0]->start;
                irq = link->irq;
                break;
        default:
@@@ -189,14 -188,14 +188,6 @@@ static void labpc_cs_detach(struct pcmc
     less on other parts of the kernel.
  */
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static const dev_info_t dev_info = "daqcard-1200";
--
  struct local_info_t {
        struct pcmcia_device *link;
        int stop;
@@@ -286,9 -285,6 +277,6 @@@ static int labpc_pcmcia_config_loop(str
                                unsigned int vcc,
                                void *priv_data)
  {
-       win_req_t *req = priv_data;
-       memreq_t map;
        if (cfg->index == 0)
                return -ENODEV;
  
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ | CONF_ENABLE_PULSE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
                /* This reserves IO space but doesn't actually enable it */
-               if (pcmcia_request_io(p_dev, &p_dev->io) != 0)
+               if (pcmcia_request_io(p_dev) != 0)
                        return -ENODEV;
        }
  
-       if ((cfg->mem.nwin > 0) || (dflt->mem.nwin > 0)) {
-               cistpl_mem_t *mem =
-                       (cfg->mem.nwin) ? &cfg->mem : &dflt->mem;
-               req->Attributes = WIN_DATA_WIDTH_16 | WIN_MEMORY_TYPE_CM;
-               req->Attributes |= WIN_ENABLE;
-               req->Base = mem->win[0].host_addr;
-               req->Size = mem->win[0].len;
-               if (req->Size < 0x1000)
-                       req->Size = 0x1000;
-               req->AccessSpeed = 0;
-               if (pcmcia_request_window(p_dev, req, &p_dev->win))
-                       return -ENODEV;
-               map.Page = 0;
-               map.CardOffset = mem->win[0].card_addr;
-               if (pcmcia_map_mem_page(p_dev, p_dev->win, &map))
-                       return -ENODEV;
-       }
        /* If we got this far, we're cool! */
        return 0;
  }
  static void labpc_config(struct pcmcia_device *link)
  {
        int ret;
-       win_req_t req;
  
        dev_dbg(&link->dev, "labpc_config\n");
  
-       ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, &req);
+       ret = pcmcia_loop_config(link, labpc_pcmcia_config_loop, NULL);
        if (ret) {
                dev_warn(&link->dev, "no configuration found\n");
                goto failed;
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
                printk(", irq %d", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
-       if (link->win)
-               printk(", mem 0x%06lx-0x%06lx", req.Base,
-                      req.Base + req.Size - 1);
+       if (link->resource[0])
+               printk(" & %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(" & %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -449,7 -420,7 +412,7 @@@ struct pcmcia_driver labpc_cs_driver = 
        .id_table = labpc_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "daqcard-1200",
                },
  };
  
index 3a46f0c0bff905e7df83c80e8a794d67a7a24f53,d50b6c409fe7b33385732651fc91a928a5a616a6..1f2426352eb57d82cc0c18ba98d738d224fe31cf
@@@ -48,7 -48,6 +48,6 @@@ See the notes in the ni_atmio.o driver
  #include "ni_stc.h"
  #include "8255.h"
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/ds.h>
@@@ -261,12 -260,12 +260,11 @@@ static void cs_release(struct pcmcia_de
  static void cs_detach(struct pcmcia_device *);
  
  static struct pcmcia_device *cur_dev = NULL;
--static const dev_info_t dev_info = "ni_mio_cs";
  
  static int cs_attach(struct pcmcia_device *link)
  {
-       link->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-       link->io.NumPorts1 = 16;
+       link->resource[0]->flags |= IO_DATA_PATH_WIDTH_16;
+       link->resource[0]->end = 16;
        link->conf.Attributes = CONF_ENABLE_IRQ;
        link->conf.IntType = INT_MEMORY_AND_IO;
  
@@@ -311,13 -310,12 +309,12 @@@ static int mio_pcmcia_config_loop(struc
  {
        int base, ret;
  
-       p_dev->io.NumPorts1 = cfg->io.win[0].len;
-       p_dev->io.IOAddrLines = cfg->io.flags & CISTPL_IO_LINES_MASK;
-       p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = cfg->io.win[0].len;
+       p_dev->io_lines = cfg->io.flags & CISTPL_IO_LINES_MASK;
  
        for (base = 0x000; base < 0x400; base += 0x20) {
-               p_dev->io.BasePort1 = base;
-               ret = pcmcia_request_io(p_dev, &p_dev->io);
+               p_dev->resource[0]->start = base;
+               ret = pcmcia_request_io(p_dev);
                if (!ret)
                        return 0;
        }
@@@ -356,7 -354,7 +353,7 @@@ static int mio_cs_attach(struct comedi_
                return -EIO;
  
        dev->driver = &driver_ni_mio_cs;
-       dev->iobase = link->io.BasePort1;
+       dev->iobase = link->resource[0]->start;
  
        irq = link->irq;
  
@@@ -450,7 -448,7 +447,7 @@@ struct pcmcia_driver ni_mio_cs_driver 
        .id_table = ni_mio_cs_ids,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "ni_mio_cs",
                },
  };
  
index 8b49cb12c2e545c0ec3f11239449d541b98a5981,25f4e67e3e897a327e00caafc722e33fa699719b..bf489d7f49909ce75bc9e9b2c3990b1b840218f6
@@@ -14,7 -14,7 +14,7 @@@
  
      Documentation for the DAQP PCMCIA cards can be found on Quatech's site:
  
 -                ftp://ftp.quatech.com/Manuals/daqp-208.pdf
 +              ftp://ftp.quatech.com/Manuals/daqp-208.pdf
  
      This manual is for both the DAQP-208 and the DAQP-308.
  
@@@ -50,7 -50,6 +50,6 @@@ Devices: [Quatech] DAQP-208 (daqp), DAQ
  #include "../comedidev.h"
  #include <linux/semaphore.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -195,7 -194,7 +194,7 @@@ static struct comedi_driver driver_daq
  
  static void daqp_dump(struct comedi_device *dev)
  {
 -      printk("DAQP: status %02x; aux status %02x\n",
 +      printk(KERN_INFO "DAQP: status %02x; aux status %02x\n",
               inb(dev->iobase + DAQP_STATUS), inb(dev->iobase + DAQP_AUX));
  }
  
@@@ -207,9 -206,9 +206,9 @@@ static void hex_dump(char *str, void *p
        printk(str);
  
        for (i = 0; i < len; i++) {
 -              if (i % 16 == 0) {
 -                      printk("\n0x%08x:", (unsigned int)cptr);
 -              }
 +              if (i % 16 == 0)
 +                      printk("\n%p:", cptr);
 +
                printk(" %02x", *(cptr++));
        }
        printk("\n");
@@@ -223,9 -222,9 +222,9 @@@ static int daqp_ai_cancel(struct comedi
  {
        struct local_info_t *local = (struct local_info_t *)s->private;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
 +
  
        outb(DAQP_COMMAND_STOP, dev->iobase + DAQP_COMMAND);
  
@@@ -355,9 -354,9 +354,9 @@@ static int daqp_ai_insn_read(struct com
        int v;
        int counter = 10000;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
 +
  
        /* Stop any running conversion */
        daqp_ai_cancel(dev, s);
        v = DAQP_SCANLIST_CHANNEL(CR_CHAN(insn->chanspec))
            | DAQP_SCANLIST_GAIN(CR_RANGE(insn->chanspec));
  
 -      if (CR_AREF(insn->chanspec) == AREF_DIFF) {
 +      if (CR_AREF(insn->chanspec) == AREF_DIFF)
                v |= DAQP_SCANLIST_DIFFERENTIAL;
 -      }
 +
  
        v |= DAQP_SCANLIST_START;
  
@@@ -488,10 -487,7 +487,10 @@@ static int daqp_ai_cmdtest(struct comed
        if (err)
                return 1;
  
 -      /* step 2: make sure trigger sources are unique and mutually compatible */
 +      /*
 +       * step 2: make sure trigger sources
 +       * are unique and mutually compatible
 +       */
  
        /* note that mutual compatibility is not an issue here */
        if (cmd->scan_begin_src != TRIG_TIMER &&
@@@ -591,9 -587,9 +590,9 @@@ static int daqp_ai_cmd(struct comedi_de
        int i;
        int v;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
 +
  
        /* Stop any running conversion */
        daqp_ai_cancel(dev, s);
                v = DAQP_SCANLIST_CHANNEL(CR_CHAN(chanspec))
                    | DAQP_SCANLIST_GAIN(CR_RANGE(chanspec));
  
 -              if (CR_AREF(chanspec) == AREF_DIFF) {
 +              if (CR_AREF(chanspec) == AREF_DIFF)
                        v |= DAQP_SCANLIST_DIFFERENTIAL;
 -              }
  
 -              if (i == 0 || scanlist_start_on_every_entry) {
 +              if (i == 0 || scanlist_start_on_every_entry)
                        v |= DAQP_SCANLIST_START;
 -              }
  
                outb(v & 0xff, dev->iobase + DAQP_SCANLIST);
                outb(v >> 8, dev->iobase + DAQP_SCANLIST);
        while (--counter
               && (inb(dev->iobase + DAQP_STATUS) & DAQP_STATUS_EVENTS)) ;
        if (!counter) {
 -              printk("daqp: couldn't clear interrupts in status register\n");
 +              printk(KERN_ERR
 +                     "daqp: couldn't clear interrupts in status register\n");
                return -1;
        }
  
@@@ -787,8 -784,9 +786,8 @@@ static int daqp_ao_insn_write(struct co
        int d;
        unsigned int chan;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
  
        chan = CR_CHAN(insn->chanspec);
        d = data[0];
@@@ -812,8 -810,9 +811,8 @@@ static int daqp_di_insn_read(struct com
  {
        struct local_info_t *local = (struct local_info_t *)s->private;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
  
        data[0] = inb(dev->iobase + DAQP_DIGITAL_IO);
  
@@@ -828,8 -827,9 +827,8 @@@ static int daqp_do_insn_write(struct co
  {
        struct local_info_t *local = (struct local_info_t *)s->private;
  
 -      if (local->stop) {
 +      if (local->stop)
                return -EIO;
 -      }
  
        outw(data[0] & 0xf, dev->iobase + DAQP_DIGITAL_IO);
  
@@@ -871,13 -871,13 +870,13 @@@ static int daqp_attach(struct comedi_de
                }
        }
  
-       dev->iobase = local->link->io.BasePort1;
+       dev->iobase = local->link->resource[0]->start;
  
        ret = alloc_subdevices(dev, 4);
        if (ret < 0)
                return ret;
  
 -      printk("comedi%d: attaching daqp%d (io 0x%04lx)\n",
 +      printk(KERN_INFO "comedi%d: attaching daqp%d (io 0x%04lx)\n",
               dev->minor, it->options[0], dev->iobase);
  
        s = dev->subdevices + 0;
  
  static int daqp_detach(struct comedi_device *dev)
  {
 -      printk("comedi%d: detaching daqp\n", dev->minor);
 +      printk(KERN_INFO "comedi%d: detaching daqp\n", dev->minor);
  
        return 0;
  }
@@@ -995,14 -995,14 +994,6 @@@ static int daqp_cs_resume(struct pcmcia
  static int daqp_cs_attach(struct pcmcia_device *);
  static void daqp_cs_detach(struct pcmcia_device *);
  
--/*
--   The dev_info variable is the "key" that is used to match up this
--   device driver with appropriate cards, through the card configuration
--   database.
--*/
--
--static const dev_info_t dev_info = "quatech_daqp_cs";
--
  /*======================================================================
  
      daqp_cs_attach() creates an "instance" of the driver, allocating
@@@ -1075,7 -1075,8 +1066,7 @@@ static void daqp_cs_detach(struct pcmci
  
        /* Unlink device structure, and free it */
        dev_table[dev->table_index] = NULL;
 -      if (dev)
 -              kfree(dev);
 +      kfree(dev);
  
  }                             /* daqp_cs_detach */
  
@@@ -1101,26 -1102,24 +1092,24 @@@ static int daqp_pcmcia_config_loop(stru
        p_dev->conf.Attributes |= CONF_ENABLE_IRQ;
  
        /* IO window settings */
-       p_dev->io.NumPorts1 = p_dev->io.NumPorts2 = 0;
+       p_dev->resource[0]->end = p_dev->resource[1]->end = 0;
        if ((cfg->io.nwin > 0) || (dflt->io.nwin > 0)) {
                cistpl_io_t *io = (cfg->io.nwin) ? &cfg->io : &dflt->io;
-               p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_AUTO;
-               if (!(io->flags & CISTPL_IO_8BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_16;
-               if (!(io->flags & CISTPL_IO_16BIT))
-                       p_dev->io.Attributes1 = IO_DATA_PATH_WIDTH_8;
-               p_dev->io.IOAddrLines = io->flags & CISTPL_IO_LINES_MASK;
-               p_dev->io.BasePort1 = io->win[0].base;
-               p_dev->io.NumPorts1 = io->win[0].len;
+               p_dev->io_lines = io->flags & CISTPL_IO_LINES_MASK;
+               p_dev->resource[0]->flags &= ~IO_DATA_PATH_WIDTH;
+               p_dev->resource[0]->flags |=
+                       pcmcia_io_cfg_data_width(io->flags);
+               p_dev->resource[0]->start = io->win[0].base;
+               p_dev->resource[0]->end = io->win[0].len;
                if (io->nwin > 1) {
-                       p_dev->io.Attributes2 = p_dev->io.Attributes1;
-                       p_dev->io.BasePort2 = io->win[1].base;
-                       p_dev->io.NumPorts2 = io->win[1].len;
+                       p_dev->resource[1]->flags = p_dev->resource[0]->flags;
+                       p_dev->resource[1]->start = io->win[1].base;
+                       p_dev->resource[1]->end = io->win[1].len;
                }
        }
  
        /* This reserves IO space but doesn't actually enable it */
-       return pcmcia_request_io(p_dev, &p_dev->io);
+       return pcmcia_request_io(p_dev);
  }
  
  static void daqp_cs_config(struct pcmcia_device *link)
        /* Finally, report what we've done */
        dev_info(&link->dev, "index 0x%02x", link->conf.ConfigIndex);
        if (link->conf.Attributes & CONF_ENABLE_IRQ)
-               printk(KERN_INFO ", irq %u", link->irq);
-       if (link->io.NumPorts1)
-               printk(", io 0x%04x-0x%04x", link->io.BasePort1,
-                      link->io.BasePort1 + link->io.NumPorts1 - 1);
-       if (link->io.NumPorts2)
-               printk(" & 0x%04x-0x%04x", link->io.BasePort2,
-                      link->io.BasePort2 + link->io.NumPorts2 - 1);
+               printk(", irq %u", link->irq);
+       if (link->resource[0])
+               printk(" & %pR", link->resource[0]);
+       if (link->resource[1])
+               printk(" & %pR", link->resource[1]);
        printk("\n");
  
        return;
@@@ -1226,7 -1223,7 +1213,7 @@@ static struct pcmcia_driver daqp_cs_dri
        .id_table = daqp_cs_id_table,
        .owner = THIS_MODULE,
        .drv = {
--              .name = dev_info,
++              .name = "quatech_daqp_cs",
                },
  };
  
index 464b0673da42ce4c7743459cdbc1a88d0909c71d,f15afd2050becd6ed25de1070b66e619275bb8e1..19c335458653fc1a293c2533017a5d426cdf4805
@@@ -23,7 -23,7 +23,7 @@@
   * software indicates your acceptance of these terms and conditions.  If you do
   * not agree with these terms and conditions, do not use the software.
   *
 - * Copyright  2003 Agere Systems Inc.
 + * Copyright (c) 2003 Agere Systems Inc.
   * All rights reserved.
   *
   * Redistribution and use in source or binary forms, with or without
@@@ -44,7 -44,7 +44,7 @@@
   *
   * Disclaimer
   *
 - * THIS SOFTWARE IS PROVIDED ï¿½AS IS� AND ANY EXPRESS OR IMPLIED WARRANTIES,
 + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, INFRINGEMENT AND THE IMPLIED WARRANTIES OF
   * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  ANY
   * USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE IS SOLELY AT THE USERS OWN
@@@ -83,7 -83,6 +83,6 @@@
  #include <linux/if_arp.h>
  #include <linux/ioport.h>
  
- #include <pcmcia/cs_types.h>
  #include <pcmcia/cs.h>
  #include <pcmcia/cistpl.h>
  #include <pcmcia/cisreg.h>
@@@ -133,36 -132,35 +132,35 @@@ extern dbg_info_t *DbgInfo
   ******************************************************************************/
  static int wl_adapter_attach(struct pcmcia_device *link)
  {
 -    struct net_device   *dev;
 -    struct wl_private *lp;
 -    /*------------------------------------------------------------------------*/
 -
 -    DBG_FUNC( "wl_adapter_attach" );
 -    DBG_ENTER( DbgInfo );
 -
 -    dev = wl_device_alloc();
 -    if(dev == NULL) {
 -        DBG_ERROR( DbgInfo, "wl_device_alloc returned NULL\n");
 -      return -ENOMEM;
 -    }
 -
 -    link->resource[0]->end      = HCF_NUM_IO_PORTS;
 -    link->resource[0]->flags    = IO_DATA_PATH_WIDTH_16;
 -    link->conf.Attributes   = CONF_ENABLE_IRQ;
 -    link->conf.IntType      = INT_MEMORY_AND_IO;
 -    link->conf.ConfigIndex  = 5;
 -    link->conf.Present      = PRESENT_OPTION;
 -
 -    link->priv = dev;
 -    lp = wl_priv(dev);
 -    lp->link = link;
 -
 -    wl_adapter_insert(link);
 -
 -    DBG_LEAVE( DbgInfo );
 -    return 0;
 -} // wl_adapter_attach
 +      struct net_device   *dev;
 +      struct wl_private   *lp;
 +      /*--------------------------------------------------------------------*/
 +
 +      DBG_FUNC("wl_adapter_attach");
 +      DBG_ENTER(DbgInfo);
 +
 +      dev = wl_device_alloc();
 +      if (dev == NULL) {
 +              DBG_ERROR(DbgInfo, "wl_device_alloc returned NULL\n");
 +              return -ENOMEM;
 +      }
 +
-       link->io.NumPorts1      = HCF_NUM_IO_PORTS;
-       link->io.Attributes1    = IO_DATA_PATH_WIDTH_16;
-       link->io.IOAddrLines    = 6;
++      link->resource[0]->end  = HCF_NUM_IO_PORTS;
++      link->resource[0]->flags= IO_DATA_PATH_WIDTH_16;
 +      link->conf.Attributes   = CONF_ENABLE_IRQ;
 +      link->conf.IntType      = INT_MEMORY_AND_IO;
 +      link->conf.ConfigIndex  = 5;
 +      link->conf.Present      = PRESENT_OPTION;
 +
 +      link->priv = dev;
 +      lp = wl_priv(dev);
 +      lp->link = link;
 +
 +      wl_adapter_insert(link);
 +
 +      DBG_LEAVE(DbgInfo);
 +      return 0;
 +} /* wl_adapter_attach */
  /*============================================================================*/
  
  
   ******************************************************************************/
  static void wl_adapter_detach(struct pcmcia_device *link)
  {
 -    struct net_device   *dev = link->priv;
 -    /*------------------------------------------------------------------------*/
 -
 +      struct net_device   *dev = link->priv;
 +      /*--------------------------------------------------------------------*/
  
 -    DBG_FUNC( "wl_adapter_detach" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_PARAM( DbgInfo, "link", "0x%p", link );
 +      DBG_FUNC("wl_adapter_detach");
 +      DBG_ENTER(DbgInfo);
 +      DBG_PARAM(DbgInfo, "link", "0x%p", link);
  
 -    wl_adapter_release(link);
 +      wl_adapter_release(link);
  
 -    if (dev) {
 -      unregister_wlags_sysfs(dev);
 -      unregister_netdev(dev);
 -    }
 +      if (dev) {
 +              unregister_wlags_sysfs(dev);
 +              unregister_netdev(dev);
 +      }
  
 -    wl_device_dealloc(dev);
 +      wl_device_dealloc(dev);
  
 -    DBG_LEAVE( DbgInfo );
 -} // wl_adapter_detach
 +      DBG_LEAVE(DbgInfo);
 +} /* wl_adapter_detach */
  /*============================================================================*/
  
  
   *      N/A
   *
   ******************************************************************************/
 -void wl_adapter_release( struct pcmcia_device *link )
 +void wl_adapter_release(struct pcmcia_device *link)
  {
 -    DBG_FUNC( "wl_adapter_release" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_PARAM( DbgInfo, "link", "0x%p", link);
 +      DBG_FUNC("wl_adapter_release");
 +      DBG_ENTER(DbgInfo);
 +      DBG_PARAM(DbgInfo, "link", "0x%p", link);
  
 -    /* Stop hardware */
 -    wl_remove(link->priv);
 +      /* Stop hardware */
 +      wl_remove(link->priv);
  
 -    pcmcia_disable_device(link);
 +      pcmcia_disable_device(link);
  
 -    DBG_LEAVE( DbgInfo );
 -} // wl_adapter_release
 +      DBG_LEAVE(DbgInfo);
 +} /* wl_adapter_release */
  /*============================================================================*/
  
  static int wl_adapter_suspend(struct pcmcia_device *link)
  {
 -    struct net_device *dev = link->priv;
 +      struct net_device *dev = link->priv;
  
 -    //if (link->open) {
 +      /* if (link->open) { */
        netif_device_detach(dev);
        wl_suspend(dev);
 -//// CHECK!            pcmcia_release_configuration(link->handle);
 -    //}
 +      /* CHECK! pcmcia_release_configuration(link->handle); */
 +      /* } */
  
 -    return 0;
 -} // wl_adapter_suspend
 +      return 0;
 +} /* wl_adapter_suspend */
  
  static int wl_adapter_resume(struct pcmcia_device *link)
  {
  
        wl_resume(dev);
  
 -      netif_device_attach( dev );
 +      netif_device_attach(dev);
  
        return 0;
 -} // wl_adapter_resume
 +} /* wl_adapter_resume */
  
  /*******************************************************************************
   *    wl_adapter_insert()
   *      N/A
   *
   ******************************************************************************/
 -void wl_adapter_insert( struct pcmcia_device *link )
 +void wl_adapter_insert(struct pcmcia_device *link)
  {
 -    struct net_device       *dev;
 -    int i;
 -    int                     ret;
 -    /*------------------------------------------------------------------------*/
 +      struct net_device *dev;
 +      int i;
 +      int ret;
 +      /*--------------------------------------------------------------------*/
  
 -    DBG_FUNC( "wl_adapter_insert" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_PARAM( DbgInfo, "link", "0x%p", link );
 +      DBG_FUNC("wl_adapter_insert");
 +      DBG_ENTER(DbgInfo);
 +      DBG_PARAM(DbgInfo, "link", "0x%p", link);
  
 -    dev     = link->priv;
 +      dev     = link->priv;
  
 -    /* Do we need to allocate an interrupt? */
 -    link->conf.Attributes |= CONF_ENABLE_IRQ;
 -    link->io_lines = 6;
 +      /* Do we need to allocate an interrupt? */
 +      link->conf.Attributes |= CONF_ENABLE_IRQ;
++      link->io_lines = 6;
  
-       ret = pcmcia_request_io(link, &link->io);
 -    ret = pcmcia_request_io(link);
 -    if (ret != 0)
 -        goto failed;
++      ret = pcmcia_request_io(link);
 +      if (ret != 0)
 +              goto failed;
  
 -    ret = pcmcia_request_irq(link, (void *) wl_isr);
 -    if (ret != 0)
 -        goto failed;
 +      ret = pcmcia_request_irq(link, (void *) wl_isr);
 +      if (ret != 0)
 +              goto failed;
  
 -    ret = pcmcia_request_configuration(link, &link->conf);
 -    if (ret != 0)
 -        goto failed;
 +      ret = pcmcia_request_configuration(link, &link->conf);
 +      if (ret != 0)
 +              goto failed;
  
 -    dev->irq        = link->irq;
 -    dev->base_addr  = link->resource[0]->start;
 +      dev->irq        = link->irq;
-       dev->base_addr  = link->io.BasePort1;
++      dev->base_addr  = link->resource[0]->start;
  
 -    SET_NETDEV_DEV(dev, &link->dev);
 -    if (register_netdev(dev) != 0) {
 -      printk("%s: register_netdev() failed\n", MODULE_NAME);
 -      goto failed;
 -    }
 +      SET_NETDEV_DEV(dev, &link->dev);
 +      if (register_netdev(dev) != 0) {
 +              printk("%s: register_netdev() failed\n", MODULE_NAME);
 +              goto failed;
 +      }
  
 -    register_wlags_sysfs(dev);
 +      register_wlags_sysfs(dev);
  
 -    printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
 -               dev->name, dev->base_addr, dev->irq);
 -    for( i = 0; i < ETH_ALEN; i++ ) {
 -        printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n'));
 -    }
 +      printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
 +              dev->name, dev->base_addr, dev->irq);
 +      for (i = 0; i < ETH_ALEN; i++)
 +              printk("%02X%c", dev->dev_addr[i], ((i < (ETH_ALEN-1)) ? ':' : '\n'));
  
 -    DBG_LEAVE( DbgInfo );
 -    return;
 +      DBG_LEAVE(DbgInfo);
 +      return;
  
  failed:
 -    wl_adapter_release( link );
 +      wl_adapter_release(link);
  
 -    DBG_LEAVE(DbgInfo);
 -    return;
 -} // wl_adapter_insert
 +      DBG_LEAVE(DbgInfo);
 +      return;
 +} /* wl_adapter_insert */
  /*============================================================================*/
  
  
   *      errno value otherwise
   *
   ******************************************************************************/
 -int wl_adapter_open( struct net_device *dev )
 +int wl_adapter_open(struct net_device *dev)
  {
 -    struct wl_private *lp = wl_priv(dev);
 -    struct pcmcia_device *link = lp->link;
 -    int         result = 0;
 -    int         hcf_status = HCF_SUCCESS;
 -    /*------------------------------------------------------------------------*/
 -
 -
 -    DBG_FUNC( "wl_adapter_open" );
 -    DBG_ENTER( DbgInfo );
 -      DBG_PRINT( "%s\n", VERSION_INFO );
 -    DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 -
 -    if(!pcmcia_dev_present(link))
 -    {
 -        DBG_LEAVE( DbgInfo );
 -        return -ENODEV;
 -    }
 -
 -    link->open++;
 -
 -    hcf_status = wl_open( dev );
 -
 -    if( hcf_status != HCF_SUCCESS ) {
 -        link->open--;
 -        result = -ENODEV;
 -    }
 -
 -    DBG_LEAVE( DbgInfo );
 -    return result;
 -} // wl_adapter_open
 +      struct wl_private *lp = wl_priv(dev);
 +      struct pcmcia_device *link = lp->link;
 +      int result = 0;
 +      int hcf_status = HCF_SUCCESS;
 +      /*--------------------------------------------------------------------*/
 +
 +      DBG_FUNC("wl_adapter_open");
 +      DBG_ENTER(DbgInfo);
 +      DBG_PRINT("%s\n", VERSION_INFO);
 +      DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
 +
 +      if (!pcmcia_dev_present(link)) {
 +              DBG_LEAVE(DbgInfo);
 +              return -ENODEV;
 +      }
 +
 +      link->open++;
 +
 +      hcf_status = wl_open(dev);
 +
 +      if (hcf_status != HCF_SUCCESS) {
 +              link->open--;
 +              result = -ENODEV;
 +      }
 +
 +      DBG_LEAVE(DbgInfo);
 +      return result;
 +} /* wl_adapter_open */
  /*============================================================================*/
  
  
   *      errno value otherwise
   *
   ******************************************************************************/
 -int wl_adapter_close( struct net_device *dev )
 +int wl_adapter_close(struct net_device *dev)
  {
 -    struct wl_private *lp = wl_priv(dev);
 -    struct pcmcia_device *link = lp->link;
 -    /*------------------------------------------------------------------------*/
 +      struct wl_private *lp = wl_priv(dev);
 +      struct pcmcia_device *link = lp->link;
 +      /*--------------------------------------------------------------------*/
  
 +      DBG_FUNC("wl_adapter_close");
 +      DBG_ENTER(DbgInfo);
 +      DBG_PARAM(DbgInfo, "dev", "%s (0x%p)", dev->name, dev);
  
 -    DBG_FUNC( "wl_adapter_close" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_PARAM( DbgInfo, "dev", "%s (0x%p)", dev->name, dev );
 +      if (link == NULL) {
 +              DBG_LEAVE(DbgInfo);
 +              return -ENODEV;
 +      }
  
 -    if( link == NULL ) {
 -        DBG_LEAVE( DbgInfo );
 -        return -ENODEV;
 -    }
 +      DBG_TRACE(DbgInfo, "%s: Shutting down adapter.\n", dev->name);
 +      wl_close(dev);
  
 -    DBG_TRACE( DbgInfo, "%s: Shutting down adapter.\n", dev->name );
 -    wl_close( dev );
 +      link->open--;
  
 -    link->open--;
 -
 -    DBG_LEAVE( DbgInfo );
 -    return 0;
 -} // wl_adapter_close
 +      DBG_LEAVE(DbgInfo);
 +      return 0;
 +} /* wl_adapter_close */
  /*============================================================================*/
  
  static struct pcmcia_device_id wl_adapter_ids[] = {
 -#if ! ((HCF_TYPE) & HCF_TYPE_HII5)
 +#if !((HCF_TYPE) & HCF_TYPE_HII5)
        PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0003),
        PCMCIA_DEVICE_PROD_ID12("Agere Systems", "Wireless PC Card Model 0110",
 -                          0x33103a9b, 0xe175b0dd),
 +                              0x33103a9b, 0xe175b0dd),
  #else
        PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0004),
        PCMCIA_DEVICE_PROD_ID12("Linksys", "WCF54G_Wireless-G_CompactFlash_Card",
 -                            0x0733cc81, 0x98a599e1),
 -#endif  // (HCF_TYPE) & HCF_TYPE_HII5
 +                              0x0733cc81, 0x98a599e1),
 +#endif  /* (HCF_TYPE) & HCF_TYPE_HII5 */
        PCMCIA_DEVICE_NULL,
 -      };
 +};
  MODULE_DEVICE_TABLE(pcmcia, wl_adapter_ids);
  
  static struct pcmcia_driver wlags49_driver = {
 -    .owner          = THIS_MODULE,
 -    .drv            = {
 -      .name   = DRIVER_NAME,
 -    },
 -    .probe    = wl_adapter_attach,
 -    .remove   = wl_adapter_detach,
 -    .id_table = wl_adapter_ids,
 -    .suspend  = wl_adapter_suspend,
 -    .resume   = wl_adapter_resume,
 +      .owner      = THIS_MODULE,
 +      .drv        = {
 +              .name = DRIVER_NAME,
 +      },
 +      .probe      = wl_adapter_attach,
 +      .remove     = wl_adapter_detach,
 +      .id_table   = wl_adapter_ids,
 +      .suspend    = wl_adapter_suspend,
 +      .resume     = wl_adapter_resume,
  };
  
  
   *      -1 on error
   *
   ******************************************************************************/
 -int wl_adapter_init_module( void )
 +int wl_adapter_init_module(void)
  {
 -    int ret;
 -    /*------------------------------------------------------------------------*/
 +      int ret;
 +      /*--------------------------------------------------------------------*/
  
 +      DBG_FUNC("wl_adapter_init_module");
 +      DBG_ENTER(DbgInfo);
 +      DBG_TRACE(DbgInfo, "wl_adapter_init_module() -- PCMCIA\n");
  
 -    DBG_FUNC( "wl_adapter_init_module" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_TRACE( DbgInfo, "wl_adapter_init_module() -- PCMCIA\n" );
 +      ret = pcmcia_register_driver(&wlags49_driver);
  
 -    ret = pcmcia_register_driver(&wlags49_driver);
 -
 -    DBG_LEAVE( DbgInfo );
 -    return ret;
 -} // wl_adapter_init_module
 +      DBG_LEAVE(DbgInfo);
 +      return ret;
 +} /* wl_adapter_init_module */
  /*============================================================================*/
  
  
   *      N/A
   *
   ******************************************************************************/
 -void wl_adapter_cleanup_module( void )
 +void wl_adapter_cleanup_module(void)
  {
 -    DBG_FUNC( "wl_adapter_cleanup_module" );
 -    DBG_ENTER( DbgInfo );
 -    DBG_TRACE( DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n" );
 +      DBG_FUNC("wl_adapter_cleanup_module");
 +      DBG_ENTER(DbgInfo);
 +      DBG_TRACE(DbgInfo, "wl_adapter_cleanup_module() -- PCMCIA\n");
  
  
 -    pcmcia_unregister_driver(&wlags49_driver);
 +      pcmcia_unregister_driver(&wlags49_driver);
  
 -    DBG_LEAVE( DbgInfo );
 -    return;
 -} // wl_adapter_cleanup_module
 +      DBG_LEAVE(DbgInfo);
 +      return;
 +} /* wl_adapter_cleanup_module */
  /*============================================================================*/
  
  
   *      0 otherwise
   *
   ******************************************************************************/
 -int wl_adapter_is_open( struct net_device *dev )
 +int wl_adapter_is_open(struct net_device *dev)
  {
 -    struct wl_private *lp = wl_priv(dev);
 -    struct pcmcia_device *link = lp->link;
 +      struct wl_private *lp = wl_priv(dev);
 +      struct pcmcia_device *link = lp->link;
  
 -    if(!pcmcia_dev_present(link)) {
 -        return 0;
 -    }
 +      if (!pcmcia_dev_present(link))
 +              return 0;
  
 -    return( link->open );
 -} // wl_adapter_is_open
 +      return link->open;
 +} /* wl_adapter_is_open */
  /*============================================================================*/
  
  
   *      a pointer to a string describing the error(s)
   *
   ******************************************************************************/
 -const char* DbgEvent( int mask )
 +const char *DbgEvent(int mask)
  {
 -    static char DbgBuffer[256];
 -    char *pBuf;
 -    /*------------------------------------------------------------------------*/
 -
 +      static char DbgBuffer[256];
 +      char *pBuf;
 +      /*--------------------------------------------------------------------*/
  
 -    pBuf    = DbgBuffer;
 -    *pBuf   = '\0';
 +      pBuf    = DbgBuffer;
 +      *pBuf   = '\0';
  
  
 -    if( mask & CS_EVENT_WRITE_PROTECT )
 -        strcat( pBuf, "WRITE_PROTECT " );
 +      if (mask & CS_EVENT_WRITE_PROTECT)
 +              strcat(pBuf, "WRITE_PROTECT ");
  
 -    if(mask & CS_EVENT_CARD_LOCK)
 -        strcat( pBuf, "CARD_LOCK " );
 +      if (mask & CS_EVENT_CARD_LOCK)
 +              strcat(pBuf, "CARD_LOCK ");
  
 -    if(mask & CS_EVENT_CARD_INSERTION)
 -        strcat( pBuf, "CARD_INSERTION " );
 +      if (mask & CS_EVENT_CARD_INSERTION)
 +              strcat(pBuf, "CARD_INSERTION ");
  
 -    if(mask & CS_EVENT_CARD_REMOVAL)
 -        strcat( pBuf, "CARD_REMOVAL " );
 +      if (mask & CS_EVENT_CARD_REMOVAL)
 +              strcat(pBuf, "CARD_REMOVAL ");
  
 -    if(mask & CS_EVENT_BATTERY_DEAD)
 -        strcat( pBuf, "BATTERY_DEAD " );
 +      if (mask & CS_EVENT_BATTERY_DEAD)
 +              strcat(pBuf, "BATTERY_DEAD ");
  
 -    if(mask & CS_EVENT_BATTERY_LOW)
 -        strcat( pBuf, "BATTERY_LOW " );
 +      if (mask & CS_EVENT_BATTERY_LOW)
 +              strcat(pBuf, "BATTERY_LOW ");
  
 -    if(mask & CS_EVENT_READY_CHANGE)
 -        strcat( pBuf, "READY_CHANGE " );
 +      if (mask & CS_EVENT_READY_CHANGE)
 +              strcat(pBuf, "READY_CHANGE ");
  
 -    if(mask & CS_EVENT_CARD_DETECT)
 -        strcat( pBuf, "CARD_DETECT " );
 +      if (mask & CS_EVENT_CARD_DETECT)
 +              strcat(pBuf, "CARD_DETECT ");
  
 -    if(mask & CS_EVENT_RESET_REQUEST)
 -        strcat( pBuf, "RESET_REQUEST " );
 +      if (mask & CS_EVENT_RESET_REQUEST)
 +              strcat(pBuf, "RESET_REQUEST ");
  
 -    if(mask & CS_EVENT_RESET_PHYSICAL)
 -        strcat( pBuf, "RESET_PHYSICAL " );
 +      if (mask & CS_EVENT_RESET_PHYSICAL)
 +              strcat(pBuf, "RESET_PHYSICAL ");
  
 -    if(mask & CS_EVENT_CARD_RESET)
 -        strcat( pBuf, "CARD_RESET " );
 +      if (mask & CS_EVENT_CARD_RESET)
 +              strcat(pBuf, "CARD_RESET ");
  
 -    if(mask & CS_EVENT_REGISTRATION_COMPLETE)
 -        strcat( pBuf, "REGISTRATION_COMPLETE " );
 +      if (mask & CS_EVENT_REGISTRATION_COMPLETE)
 +              strcat(pBuf, "REGISTRATION_COMPLETE ");
  
 -    // if(mask & CS_EVENT_RESET_COMPLETE)
 -    //     strcat( pBuf, "RESET_COMPLETE " );
 +      /* if (mask & CS_EVENT_RESET_COMPLETE)
 +              strcat(pBuf, "RESET_COMPLETE "); */
  
 -    if(mask & CS_EVENT_PM_SUSPEND)
 -        strcat( pBuf, "PM_SUSPEND " );
 +      if (mask & CS_EVENT_PM_SUSPEND)
 +              strcat(pBuf, "PM_SUSPEND ");
  
 -    if(mask & CS_EVENT_PM_RESUME)
 -        strcat( pBuf, "PM_RESUME " );
 +      if (mask & CS_EVENT_PM_RESUME)
 +              strcat(pBuf, "PM_RESUME ");
  
 -    if(mask & CS_EVENT_INSERTION_REQUEST)
 -        strcat( pBuf, "INSERTION_REQUEST " );
 +      if (mask & CS_EVENT_INSERTION_REQUEST)
 +              strcat(pBuf, "INSERTION_REQUEST ");
  
 -    if(mask & CS_EVENT_EJECTION_REQUEST)
 -        strcat( pBuf, "EJECTION_REQUEST " );
 +      if (mask & CS_EVENT_EJECTION_REQUEST)
 +              strcat(pBuf, "EJECTION_REQUEST ");
  
 -    if(mask & CS_EVENT_MTD_REQUEST)
 -        strcat( pBuf, "MTD_REQUEST " );
 +      if (mask & CS_EVENT_MTD_REQUEST)
 +              strcat(pBuf, "MTD_REQUEST ");
  
 -    if(mask & CS_EVENT_ERASE_COMPLETE)
 -        strcat( pBuf, "ERASE_COMPLETE " );
 +      if (mask & CS_EVENT_ERASE_COMPLETE)
 +              strcat(pBuf, "ERASE_COMPLETE ");
  
 -    if(mask & CS_EVENT_REQUEST_ATTENTION)
 -        strcat( pBuf, "REQUEST_ATTENTION " );
 +      if (mask & CS_EVENT_REQUEST_ATTENTION)
 +              strcat(pBuf, "REQUEST_ATTENTION ");
  
 -    if(mask & CS_EVENT_CB_DETECT)
 -        strcat( pBuf, "CB_DETECT " );
 +      if (mask & CS_EVENT_CB_DETECT)
 +              strcat(pBuf, "CB_DETECT ");
  
 -    if(mask & CS_EVENT_3VCARD)
 -        strcat( pBuf, "3VCARD " );
 +      if (mask & CS_EVENT_3VCARD)
 +              strcat(pBuf, "3VCARD ");
  
 -    if(mask & CS_EVENT_XVCARD)
 -        strcat( pBuf, "XVCARD " );
 +      if (mask & CS_EVENT_XVCARD)
 +              strcat(pBuf, "XVCARD ");
  
  
 -    if( *pBuf ) {
 -        pBuf[strlen(pBuf) - 1] = '\0';
 -    } else {
 -        if( mask != 0x0 ) {
 -            sprintf( pBuf, "<<0x%08x>>", mask );
 -        }
 -    }
 +      if (*pBuf) {
 +              pBuf[strlen(pBuf) - 1] = '\0';
 +      } else {
 +              if (mask != 0x0)
 +                      sprintf(pBuf, "<<0x%08x>>", mask);
 +      }
  
 -    return pBuf;
 -} // DbgEvent
 +      return pBuf;
 +} /* DbgEvent */
  /*============================================================================*/
  
  #endif  /* DBG */