Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
  • 4 commits
  • 5 files changed
  • 0 commit comments
  • 1 contributor
4 drivers/net/wireless/bcm4329/bcmsdh_linux.c
View
@@ -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;
4 drivers/net/wireless/bcm4329/dhd.h
View
@@ -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>
@@ -143,7 +144,7 @@ typedef struct dhd_pub {
ulong rx_readahead_cnt; /* Number of packets where header read-ahead was used. */
ulong tx_realloc; /* Number of tx packets we had to realloc for headroom */
- ulong fc_packets; /* Number of flow control pkts recvd */
+ ulong fc_packets; /* Number of flow control pkts recvd */
/* Last error return */
int bcmerror;
@@ -155,6 +156,7 @@ typedef struct dhd_pub {
/* Suspend disable flag and "in suspend" flag */
int suspend_disable_flag; /* "1" to disable all extra powersaving during suspend */
int in_suspend; /* flag set to 1 when early suspend called */
+ int hang_was_sent; /* flag that message was send at least once */
#ifdef PNO_SUPPORT
int pno_enable; /* pno status : "1" is pno enable */
#endif /* PNO_SUPPORT */
17 drivers/net/wireless/bcm4329/dhd_cdc.c
View
@@ -150,7 +150,8 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
memcpy(prot->buf, buf, len);
if ((ret = dhdcdc_msg(dhd)) < 0) {
- DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status %d\n", ret));
+ if (!dhd->hang_was_sent)
+ DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status %d\n", ret));
goto done;
}
@@ -205,6 +206,18 @@ dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
DHD_TRACE(("%s: Enter\n", __FUNCTION__));
DHD_CTL(("%s: cmd %d len %d\n", __FUNCTION__, cmd, len));
+ if (dhd->busstate == DHD_BUS_DOWN) {
+ DHD_ERROR(("%s : bus is down. we have nothing to do\n", __FUNCTION__));
+ return -EIO;
+ }
+
+ /* don't talk to the dongle if fw is about to be reloaded */
+ if (dhd->hang_was_sent) {
+ DHD_ERROR(("%s: HANG was sent up earlier. Not talking to the chip\n",
+ __FUNCTION__));
+ return -EIO;
+ }
+
memset(msg, 0, sizeof(cdc_ioctl_t));
msg->cmd = htol32(cmd);
@@ -251,7 +264,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t * ioc, void * buf, int len)
dhd_prot_t *prot = dhd->prot;
int ret = -1;
- if (dhd->busstate == DHD_BUS_DOWN) {
+ if ((dhd->busstate == DHD_BUS_DOWN) || dhd->hang_was_sent) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n", __FUNCTION__));
return ret;
}
80 drivers/net/wireless/bcm4329/dhd_linux.c
View
@@ -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>
@@ -63,14 +60,14 @@
#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,31 +125,38 @@ 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;
}
void *wifi_get_country_code(char *ccode)
{
DHD_TRACE(("%s\n", __FUNCTION__));
+#ifdef CONFIG_WIFI_CONTROL_FUNC
if (!ccode)
return NULL;
if (wifi_control_data && wifi_control_data->get_country_code) {
return wifi_control_data->get_country_code(ccode);
}
+#endif
return NULL;
}
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 +167,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 +219,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);
@@ -308,7 +319,6 @@ typedef struct dhd_info {
int wl_count;
int wl_packet;
- int hang_was_sent; /* flag that message was send at least once */
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
struct mutex wl_start_lock; /* mutex when START called to prevent any other Linux calls */
#endif
@@ -338,7 +348,7 @@ struct semaphore dhd_registration_sem;
#define DHD_REGISTRATION_TIMEOUT 12000 /* msec : allowed time to finished dhd registration */
#endif /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) */
/* load firmware and/or nvram values from the filesystem */
-module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
+module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0660);
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
/* Error bits */
@@ -1509,7 +1519,8 @@ dhd_dpc_thread(void *data)
dhd_os_wake_unlock(&dhd->pub);
}
} else {
- dhd_bus_stop(dhd->pub.bus, TRUE);
+ if (dhd->pub.up)
+ dhd_bus_stop(dhd->pub.bus, TRUE);
dhd_os_wake_unlock(&dhd->pub);
}
}
@@ -1767,6 +1778,14 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
dhd_os_wake_lock(&dhd->pub);
+ /* send to dongle only if we are not waiting for reload already */
+ if (dhd->pub.hang_was_sent) {
+ DHD_ERROR(("%s: HANG was sent up earlier\n", __FUNCTION__));
+ dhd_os_wake_lock_timeout_enable(&dhd->pub);
+ dhd_os_wake_unlock(&dhd->pub);
+ return OSL_ERROR(BCME_DONGLE_DOWN);
+ }
+
ifidx = dhd_net2idx(dhd, net);
DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __FUNCTION__, ifidx, cmd));
@@ -1910,7 +1929,7 @@ dhd_stop(struct net_device *net)
#else
DHD_ERROR(("BYPASS %s:due to BRCM compilation : under investigation ...\n", __FUNCTION__));
#endif /* !defined(IGNORE_ETH0_DOWN) */
-
+ dhd->pub.hang_was_sent = 0;
OLD_MOD_DEC_USE_COUNT;
return 0;
}
@@ -1923,6 +1942,15 @@ dhd_open(struct net_device *net)
uint32 toe_ol;
#endif
int ifidx;
+ int32 ret = 0;
+ dhd_os_wake_lock(&dhd->pub);
+ /* Update FW path if it was changed */
+ if ((firmware_path != NULL) && (firmware_path[0] != '\0')) {
+ if (firmware_path[strlen(firmware_path)-1] == '\n')
+ firmware_path[strlen(firmware_path)-1] = '\0';
+ strcpy(fw_path, firmware_path);
+ firmware_path[0] = '\0';
+ }
/* Force start if ifconfig_up gets called before START command */
wl_control_wl_start(net);
@@ -1930,12 +1958,15 @@ dhd_open(struct net_device *net)
ifidx = dhd_net2idx(dhd, net);
DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx));
- if (ifidx == DHD_BAD_IF)
- return -1;
+ if (ifidx == DHD_BAD_IF) {
+ ret = -1;
+ goto exit;
+ }
if ((dhd->iflist[ifidx]) && (dhd->iflist[ifidx]->state == WLC_E_IF_DEL)) {
DHD_ERROR(("%s: Error: called when IF already deleted\n", __FUNCTION__));
- return -1;
+ ret = -1;
+ goto exit;
}
if (ifidx == 0) { /* do it only for primary eth0 */
@@ -1957,7 +1988,9 @@ dhd_open(struct net_device *net)
dhd->pub.up = 1;
OLD_MOD_INC_USE_COUNT;
- return 0;
+exit:
+ dhd_os_wake_unlock(&dhd->pub);
+ return ret;
}
osl_t *
@@ -2176,9 +2209,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) */
@@ -3179,8 +3209,8 @@ int net_os_send_hang_message(struct net_device *dev)
int ret = 0;
if (dhd) {
- if (!dhd->hang_was_sent) {
- dhd->hang_was_sent = 1;
+ if (!dhd->pub.hang_was_sent) {
+ dhd->pub.hang_was_sent = 1;
ret = wl_iw_send_priv_event(dev, "HANG");
}
}
3  drivers/net/wireless/bcm4329/dhd_sdio.c
View
@@ -1281,7 +1281,8 @@ dhd_bus_txctl(struct dhd_bus *bus, uchar *msg, uint msglen)
DHD_INFO(("%s: ctrl_frame_stat == FALSE\n", __FUNCTION__));
ret = 0;
} else {
- DHD_INFO(("%s: ctrl_frame_stat == TRUE\n", __FUNCTION__));
+ if (!bus->dhd->hang_was_sent)
+ DHD_ERROR(("%s: ctrl_frame_stat == TRUE\n", __FUNCTION__));
ret = -1;
}
}

No commit comments for this range

Something went wrong with that request. Please try again.