aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcm4329/dhd_cdc.c
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2011-10-26 13:57:26 -0700
committerDmitry Shmidt <dimitrysh@google.com>2011-10-26 14:01:32 -0700
commitd5b9284a583a7bb073633dbddb4cbb25d1fc0c67 (patch)
tree68888e722b025dd8c5df9eb849588e6cbc8e6b14 /drivers/net/wireless/bcm4329/dhd_cdc.c
parent019c9a9d40f321b4def44b2669ca7511604e5b06 (diff)
downloadkernel_samsung_tuna-d5b9284a583a7bb073633dbddb4cbb25d1fc0c67.zip
kernel_samsung_tuna-d5b9284a583a7bb073633dbddb4cbb25d1fc0c67.tar.gz
kernel_samsung_tuna-d5b9284a583a7bb073633dbddb4cbb25d1fc0c67.tar.bz2
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_cdc.c')
-rw-r--r--drivers/net/wireless/bcm4329/dhd_cdc.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd_cdc.c b/drivers/net/wireless/bcm4329/dhd_cdc.c
index 61f6a6f..4bec0b6 100644
--- a/drivers/net/wireless/bcm4329/dhd_cdc.c
+++ b/drivers/net/wireless/bcm4329/dhd_cdc.c
@@ -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;
}