network: wireless: bcm4329: Fix BUS DOWN in IOCTL
authorGreg Goldman <ggoldman@broadcom.com>
Tue, 29 Jun 2010 20:29:49 +0000 (13:29 -0700)
committerColin Cross <ccross@android.com>
Thu, 30 Sep 2010 00:49:39 +0000 (17:49 -0700)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcm4329/dhd_cdc.c
drivers/net/wireless/bcm4329/dhd_linux.c

index 464aaf5033ddfce2eececb31c647ccf10c5130f5..c95ca9b3471f44e7ba7817cd402934211fe2deef 100644 (file)
@@ -525,7 +525,8 @@ dhd_prot_init(dhd_pub_t *dhd)
        strcpy(buf, "cur_etheraddr");
        ret = dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
        if (ret < 0) {
-               goto fail;
+               dhd_os_proto_unblock(dhd);
+               return ret;
        }
        memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
 
@@ -538,8 +539,6 @@ dhd_prot_init(dhd_pub_t *dhd)
        /* Always assumes wl for now */
        dhd->iswl = TRUE;
 
-fail:
-
        return ret;
 }
 
index da2cb640228d767967f8f32d3f2b76faeae05d60..27b1f55de3d1ea9ae7dee36f152025e99cff7128 100644 (file)
@@ -1764,11 +1764,13 @@ dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
 
        bcmerror = dhd_prot_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf, buflen);
 
-       if (bcmerror == -ETIMEDOUT) {
+done:
+       if ((bcmerror == -ETIMEDOUT) || ((dhd->pub.busstate == DHD_BUS_DOWN) &&
+                       (!dhd->pub.dongle_reset))) {
                DHD_ERROR(("%s: Event HANG send up\n", __FUNCTION__));
                wl_iw_send_priv_event(net, "HANG");
        }
-done:
+
        if (!bcmerror && buf && ioc.buf) {
                if (copy_to_user(ioc.buf, buf, buflen))
                        bcmerror = -EFAULT;