net: wireless: bcm4329: Fix 2.6.39 compilation
authorDmitry Shmidt <dimitrysh@google.com>
Mon, 2 May 2011 21:52:15 +0000 (14:52 -0700)
committermgross <mark.gross@intel.com>
Wed, 9 Nov 2011 20:07:30 +0000 (12:07 -0800)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcm4329/bcmsdh_linux.c
drivers/net/wireless/bcm4329/dhd.h
drivers/net/wireless/bcm4329/dhd_linux.c

index 94f19a1..6d6097b 100644 (file)
@@ -636,7 +636,7 @@ int bcmsdh_register_oob_intr(void * dhdp)
                if (error)
                        return -ENODEV;
 
-               set_irq_wake(sdhcinfo->oob_irq, 1);
+               enable_irq_wake(sdhcinfo->oob_irq);
                sdhcinfo->oob_irq_registered = TRUE;
        }
 
@@ -662,7 +662,7 @@ void bcmsdh_unregister_oob_intr(void)
        SDLX_MSG(("%s: Enter\n", __FUNCTION__));
 
        if (sdhcinfo->oob_irq_registered) {
-               set_irq_wake(sdhcinfo->oob_irq, 0);
+               disable_irq_wake(sdhcinfo->oob_irq);
                disable_irq(sdhcinfo->oob_irq); /* just in case.. */
                free_irq(sdhcinfo->oob_irq, NULL);
                sdhcinfo->oob_irq_registered = FALSE;
index 573f425..9aeca7e 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/random.h>
 #include <linux/spinlock.h>
 #include <linux/ethtool.h>
+#include <linux/sched.h>
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
 
index 1df2d76..88c573a 100644 (file)
@@ -25,9 +25,6 @@
  * $Id: dhd_linux.c,v 1.65.4.9.2.12.2.104.4.40 2011/02/03 19:55:18 Exp $
  */
 
-#ifdef CONFIG_WIFI_CONTROL_FUNC
-#include <linux/platform_device.h>
-#endif
 #include <typedefs.h>
 #include <linuxver.h>
 #include <osl.h>
 #ifdef CONFIG_HAS_WAKELOCK
 #include <linux/wakelock.h>
 #endif
-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
+#ifdef CUSTOMER_HW2
+#include <linux/platform_device.h>
+#ifdef CONFIG_WIFI_CONTROL_FUNC
 #include <linux/wlan_plat.h>
-
+static struct wifi_platform_data *wifi_control_data = NULL;
+#endif
 struct semaphore wifi_control_sem;
 
-struct dhd_bus *g_bus;
-
-static struct wifi_platform_data *wifi_control_data = NULL;
 static struct resource *wifi_irqres = NULL;
 
 int wifi_get_irq_number(unsigned long *irq_flags_ptr)
@@ -89,18 +86,22 @@ int wifi_get_irq_number(unsigned long *irq_flags_ptr)
 int wifi_set_carddetect(int on)
 {
        printk("%s = %d\n", __FUNCTION__, on);
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        if (wifi_control_data && wifi_control_data->set_carddetect) {
                wifi_control_data->set_carddetect(on);
        }
+#endif
        return 0;
 }
 
 int wifi_set_power(int on, unsigned long msec)
 {
        printk("%s = %d\n", __FUNCTION__, on);
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        if (wifi_control_data && wifi_control_data->set_power) {
                wifi_control_data->set_power(on);
        }
+#endif
        if (msec)
                mdelay(msec);
        return 0;
@@ -109,9 +110,11 @@ int wifi_set_power(int on, unsigned long msec)
 int wifi_set_reset(int on, unsigned long msec)
 {
        DHD_TRACE(("%s = %d\n", __FUNCTION__, on));
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        if (wifi_control_data && wifi_control_data->set_reset) {
                wifi_control_data->set_reset(on);
        }
+#endif
        if (msec)
                mdelay(msec);
        return 0;
@@ -122,9 +125,11 @@ int wifi_get_mac_addr(unsigned char *buf)
        DHD_TRACE(("%s\n", __FUNCTION__));
        if (!buf)
                return -EINVAL;
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        if (wifi_control_data && wifi_control_data->get_mac_addr) {
                return wifi_control_data->get_mac_addr(buf);
        }
+#endif
        return -EOPNOTSUPP;
 }
 
@@ -141,12 +146,15 @@ void *wifi_get_country_code(char *ccode)
 
 static int wifi_probe(struct platform_device *pdev)
 {
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        struct wifi_platform_data *wifi_ctrl =
                (struct wifi_platform_data *)(pdev->dev.platform_data);
 
+       wifi_control_data = wifi_ctrl;
+#endif
+
        DHD_TRACE(("## %s\n", __FUNCTION__));
        wifi_irqres = platform_get_resource_byname(pdev, IORESOURCE_IRQ, "bcm4329_wlan_irq");
-       wifi_control_data = wifi_ctrl;
 
        wifi_set_power(1, 0);   /* Power On */
        wifi_set_carddetect(1); /* CardDetect (0->1) */
@@ -157,12 +165,13 @@ static int wifi_probe(struct platform_device *pdev)
 
 static int wifi_remove(struct platform_device *pdev)
 {
+#ifdef CONFIG_WIFI_CONTROL_FUNC
        struct wifi_platform_data *wifi_ctrl =
                (struct wifi_platform_data *)(pdev->dev.platform_data);
 
-       DHD_TRACE(("## %s\n", __FUNCTION__));
        wifi_control_data = wifi_ctrl;
-
+#endif
+       DHD_TRACE(("## %s\n", __FUNCTION__));
        wifi_set_power(0, 0);   /* Power Off */
        wifi_set_carddetect(0); /* CardDetect (1->0) */
 
@@ -208,7 +217,7 @@ void wifi_del_dev(void)
        DHD_TRACE(("## Unregister platform_driver_register\n"));
        platform_driver_unregister(&wifi_device);
 }
-#endif /* defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
+#endif /* defined(CUSTOMER_HW2) */
 
 static int dhd_device_event(struct notifier_block *this, unsigned long event,
                                void *ptr);
@@ -2173,9 +2182,6 @@ dhd_attach(osl_t *osh, struct dhd_bus *bus, uint bus_hdrlen)
         */
        memcpy(netdev_priv(net), &dhd, sizeof(dhd));
 
-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-       g_bus = bus;
-#endif
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP)
        register_pm_notifier(&dhd_sleep_pm_notifier);
 #endif /*  (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && defined(CONFIG_PM_SLEEP) */