]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Staging: wlags49_hs2: Fix wlags49_hs2 driver after build fixes broke it
authorHenk de Groot <henk.de.groot@hetnet.nl>
Thu, 13 May 2010 14:27:33 +0000 (16:27 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 14 May 2010 20:47:07 +0000 (13:47 -0700)
Fixes the driver after merge into the 2.6.34 kernel. Driver should
be functional again (a fix to make it compile broke the driver).

Patch against 2.6.34 RC7 with patch-v2.6.34-rc7-next-20100513
already applied.

Removed conditional code based on kernel version, this is pointless
now the driver is part of the kernel. Also removed obsolte code
left over from previous patches. Includes also small fixes to compile
clean again.

Signed-off-by: Henk de Groot <pe1dnn@amsat.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/wlags49_h2/dhf.c
drivers/staging/wlags49_h2/wl_cs.c
drivers/staging/wlags49_h2/wl_cs.h
drivers/staging/wlags49_h2/wl_internal.h
drivers/staging/wlags49_h2/wl_netdev.c
drivers/staging/wlags49_h2/wl_wext.c

index 80a4707885d8dbbc4478f80fe62b3450d9c3f5f5..bb80b547cc19c852a3795282e8607ec3b0e9987d 100644 (file)
 /*                    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:
index 7c33eade6b8a80f72bca799aba91640de56a1c69..568993f3ffe3064a7f3e2057ef363af7442b1979 100644 (file)
 #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
  ******************************************************************************/
@@ -305,7 +298,7 @@ void wl_adapter_insert( struct pcmcia_device *link )
 {
     struct net_device       *dev;
     int i;
-    int                     last_fn, last_ret;
+    int                     ret;
     /*------------------------------------------------------------------------*/
 
     DBG_FUNC( "wl_adapter_insert" );
@@ -317,10 +310,17 @@ void wl_adapter_insert( struct pcmcia_device *link )
     /* 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;
@@ -330,8 +330,7 @@ void wl_adapter_insert( struct pcmcia_device *link )
        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 ",
@@ -343,11 +342,6 @@ void wl_adapter_insert( struct pcmcia_device *link )
     DBG_LEAVE( DbgInfo );
     return;
 
-
-cs_failed:
-//    cs_error( link, last_fn, last_ret );
-
-
 failed:
     wl_adapter_release( link );
 
index 2a0e67450fbe6c013004c256ac622feec61ee2e9..a9b8828a1a27c2e88e358c4f7d7833cb5683359b 100644 (file)
@@ -84,10 +84,6 @@ int wl_adapter_close(struct net_device *dev);
 
 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 );
 
 
index 466fb6215acd1708dee4def0edc1a5fe6db87100..d9a0ad039c19730853fe29b20ae11208faf0b318 100644 (file)
@@ -69,9 +69,6 @@
  ******************************************************************************/
 #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>
@@ -866,7 +863,6 @@ struct wl_private
 {
 
 #ifdef BUS_PCMCIA
-       dev_node_t                  node;
        struct pcmcia_device        *link;
 #endif // BUS_PCMCIA
 
@@ -1013,13 +1009,13 @@ extern inline struct wl_private *wl_priv(struct net_device *dev)
  * 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);
index 1cfaee3a23500cf6a47ea653b6091ea0cb4cd3ff..91fd3092b47d4c27536a2f676c68595dc435e2a7 100644 (file)
@@ -463,15 +463,10 @@ static void wl_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 //     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");
@@ -1179,7 +1174,6 @@ void wl_multicast( struct net_device *dev, int num_addrs, void *addrs )
 
 #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,
@@ -1199,7 +1193,6 @@ static const struct net_device_ops wl_netdev_ops =
     .ndo_poll_controller    = wl_poll,
 #endif
 };
-#endif // (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,30))
 
 /*******************************************************************************
  *     wl_device_alloc()
@@ -1253,27 +1246,7 @@ struct net_device * wl_device_alloc( void )
     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;
 
index 311d3c5a2ef0d160ef9f8530c6daef3040f33d26..06467f1bf901624db723fb0b7804e02f11f3c429 100644 (file)
    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