summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/bcm4329/dhd_linux.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-10-26 13:57:26 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:39:15 -0800
commite2354f9fa52167df0d0eb30d0e99e8fb2f2df38a (patch)
tree9e64feff10578a1d5d9ecf5a03eba8931d90aad0 /drivers/net/wireless/bcm4329/dhd_linux.c
parent62358e5c138e007375e28dd61abdf4c4cbe3963c (diff)
net: wireless: bcm4329: Prohibit FW access in case of FW crash
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
Diffstat (limited to 'drivers/net/wireless/bcm4329/dhd_linux.c')
-rw-r--r--drivers/net/wireless/bcm4329/dhd_linux.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c
index 5c1384bdc215..3ec1f3f108d4 100644
--- a/drivers/net/wireless/bcm4329/dhd_linux.c
+++ b/drivers/net/wireless/bcm4329/dhd_linux.c
@@ -319,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
@@ -1778,6 +1777,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));
@@ -1921,7 +1928,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;
}
@@ -3187,8 +3194,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");
}
}