From 4cb145c35151bc54758d808e7ed4d1f7a3cd5657 Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Mon, 2 May 2011 14:52:15 -0700 Subject: [PATCH] net: wireless: bcm4329: Fix 2.6.39 compilation Signed-off-by: Dmitry Shmidt --- drivers/net/wireless/bcm4329/bcmsdh_linux.c | 4 ++-- drivers/net/wireless/bcm4329/dhd.h | 1 + drivers/net/wireless/bcm4329/dhd_linux.c | 36 +++++++++++++++++------------ 3 files changed, 24 insertions(+), 17 deletions(-) diff --git a/drivers/net/wireless/bcm4329/bcmsdh_linux.c b/drivers/net/wireless/bcm4329/bcmsdh_linux.c index 94f19a1..6d6097b 100644 --- a/drivers/net/wireless/bcm4329/bcmsdh_linux.c +++ b/drivers/net/wireless/bcm4329/bcmsdh_linux.c @@ -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; diff --git a/drivers/net/wireless/bcm4329/dhd.h b/drivers/net/wireless/bcm4329/dhd.h index 573f425..9aeca7e 100644 --- a/drivers/net/wireless/bcm4329/dhd.h +++ b/drivers/net/wireless/bcm4329/dhd.h @@ -44,6 +44,7 @@ #include #include #include +#include #include #include diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c index 1df2d76..88c573a 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -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 -#endif #include #include #include @@ -63,14 +60,14 @@ #ifdef CONFIG_HAS_WAKELOCK #include #endif -#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) +#ifdef CUSTOMER_HW2 +#include +#ifdef CONFIG_WIFI_CONTROL_FUNC #include - +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) */ -- 2.7.4