/*                    12345678901234 */
 char signature[14] = "FUPU7D37dhfwci";
 
-/* The binary download function "relocates" the image using constructions like:
-       fw->identity = (CFG_IDENTITY_STRCT FAR *)((char FAR *)fw->identity + (hcf_32)fw );
-       under some of the memory models under MSVC 1.52 these constructions degrade to 16-bits pointer arithmetic.
-       fw->identity is limited, such that adding it to fw, does not need to carry over from offset to segment.
-       However the segment is not set at all.
-       As a workaround the PSEUDO_CHARP macro is introduced which is a char pointer except for MSVC 1.52, in
-       which case we know that a 32-bit quantity is adequate as a pointer.
-       Note that other platforms may experience comparable problems when using the binary download feature. */
-#if defined(_MSC_VER) && _MSC_VER ==  800                              /* Visual C++ 1.5 */
-#define PSEUDO_CHARP hcf_32
-#else
-#define PSEUDO_CHARP (hcf_8 *)
-#endif
-
 /*-----------------------------------------------------------------------------
  *
  * LTV-records retrieved from the NIC to:
 
 #include <wl_sysfs.h>
 
 
-/*******************************************************************************
- *  macro definitions
- ******************************************************************************/
-#define CS_CHECK(fn, ret) do { \
-                    last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; \
-            } while (0)
-
 /*******************************************************************************
  *  global definitions
  ******************************************************************************/
 {
     struct net_device       *dev;
     int i;
-    int                     last_fn, last_ret;
+    int                     ret;
     /*------------------------------------------------------------------------*/
 
     DBG_FUNC( "wl_adapter_insert" );
     /* Do we need to allocate an interrupt? */
     link->conf.Attributes |= CONF_ENABLE_IRQ;
 
-//    CS_CHECK(RequestIO, pcmcia_request_io(link, &link->io));
-//    CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq));
-//    CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
+    ret = pcmcia_request_io(link, &link->io);
+    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;
 
     dev->irq        = link->irq.AssignedIRQ;
     dev->base_addr  = link->io.BasePort1;
        printk("%s: register_netdev() failed\n", MODULE_NAME);
        goto failed;
     }
-    link->dev_node = &( wl_priv(dev) )->node;
-    strcpy(( wl_priv(dev) )->node.dev_name, dev->name);
+
     register_wlags_sysfs(dev);
 
     printk(KERN_INFO "%s: Wireless, io_addr %#03lx, irq %d, ""mac_address ",
     DBG_LEAVE( DbgInfo );
     return;
 
-
-cs_failed:
-//    cs_error( link, last_fn, last_ret );
-
-
 failed:
     wl_adapter_release( link );
 
 
 
 int wl_adapter_is_open(struct net_device *dev);
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-void cs_error(client_handle_t handle, int func, int ret);
-#endif
-
 const char *DbgEvent( int mask );
 
 
 
  ******************************************************************************/
 #include <linux/version.h>
 #ifdef BUS_PCMCIA
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#include <pcmcia/version.h>
-#endif
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
 #include <pcmcia/cistpl.h>
 {
 
 #ifdef BUS_PCMCIA
-       dev_node_t                  node;
        struct pcmcia_device        *link;
 #endif // BUS_PCMCIA
 
  * SPARC, due to its weird semantics for save/restore flags. extern
  * inline should prevent the kernel from linking or module from
  * loading if they are not inlined. */
-extern inline void wl_lock(struct wl_private *lp,
+static inline void wl_lock(struct wl_private *lp,
                               unsigned long *flags)
 {
        spin_lock_irqsave(&lp->slock, *flags);
 }
 
-extern inline void wl_unlock(struct wl_private *lp,
+static inline void wl_unlock(struct wl_private *lp,
                                  unsigned long *flags)
 {
        spin_unlock_irqrestore(&lp->slock, *flags);
 
 //     strncpy(info.fw_version, priv->fw_name,
 //     sizeof(info.fw_version) - 1);
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,20))
     if (dev->dev.parent) {
        dev_set_name(dev->dev.parent, "%s", info->bus_info);
        //strncpy(info->bus_info, dev->dev.parent->bus_id,
        //      sizeof(info->bus_info) - 1);
-#else
-           if (dev->class_dev.parent) {
-               sizeof(info->bus_info) - 1);
-#endif
     } else {
        snprintf(info->bus_info, sizeof(info->bus_info) - 1,
                "PCMCIA FIXME");
 
 #endif /* NEW_MULTICAST */
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 static const struct net_device_ops wl_netdev_ops =
 {
     .ndo_start_xmit         = &wl_tx_port0,
     .ndo_poll_controller    = wl_poll,
 #endif
 };
-#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 
 /*******************************************************************************
  *     wl_device_alloc()
     lp->wireless_data.spy_data = &lp->spy_data;
     dev->wireless_data = &lp->wireless_data;
 
-#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
     dev->netdev_ops = &wl_netdev_ops;
-#else
-    dev->hard_start_xmit    = &wl_tx_port0;
-
-    dev->set_config         = &wl_config;
-    dev->get_stats          = &wl_stats;
-    dev->set_multicast_list = &wl_multicast;
-
-    dev->init               = &wl_insert;
-    dev->open               = &wl_adapter_open;
-    dev->stop               = &wl_adapter_close;
-    dev->do_ioctl           = &wl_ioctl;
-
-    dev->tx_timeout         = &wl_tx_timeout;
-
-#ifdef CONFIG_NET_POLL_CONTROLLER
-    dev->poll_controller = wl_poll;
-#endif
-
-#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 
     dev->watchdog_timeo     = TX_TIMEOUT;
 
 
    in the build. */
 #ifdef WIRELESS_EXT
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27)
-#define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
-    iwe_stream_add_event(buf, end, iwe, len)
-#define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
-    iwe_stream_add_point(buf, end, iwe, msg)
-#else
 #define IWE_STREAM_ADD_EVENT(info, buf, end, iwe, len) \
     iwe_stream_add_event(info, buf, end, iwe, len)
 #define IWE_STREAM_ADD_POINT(info, buf, end, iwe, msg) \
     iwe_stream_add_point(info, buf, end, iwe, msg)
-#endif