net: wireless: bcm4329: Fix watchdog termination after 'driver stop'
authorDmitry Shmidt <dimitrysh@google.com>
Tue, 9 Nov 2010 18:07:48 +0000 (10:07 -0800)
committerDmitry Shmidt <dimitrysh@google.com>
Tue, 9 Nov 2010 18:15:16 +0000 (10:15 -0800)
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
drivers/net/wireless/bcm4329/dhd_linux.c
drivers/net/wireless/bcm4329/dhd_sdio.c
drivers/net/wireless/bcm4329/wl_iw.c
drivers/net/wireless/bcm4329/wl_iw.h

index cef803fc179e2becfc485755f43bf9a8b434c37c..3426b252c8b87c4f5cca8221895f7587980db2c1 100644 (file)
@@ -3054,6 +3054,14 @@ int net_os_send_hang_message(struct net_device *dev)
        return ret;
 }
 
+void dhd_bus_country_set(struct net_device *dev, char *country_code)
+{
+       dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+
+       if (dhd && dhd->pub.up)
+               strncpy(dhd->pub.country_code, country_code, WLC_CNTRY_BUF_SZ);
+}
+
 void dhd_os_start_lock(dhd_pub_t *pub)
 {
 #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 25))
index abe92b7eb09a4609285bb905b9b1aa54f4d04b55..7494e38367329ee5e7b181d07dc8507d68b3b417 100644 (file)
@@ -2719,6 +2719,9 @@ dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
 
        BUS_WAKE(bus);
 
+       /* Change our idea of bus state */
+       bus->dhd->busstate = DHD_BUS_DOWN;
+
        /* Enable clock for device interrupts */
        dhdsdio_clkctl(bus, CLK_AVAIL, FALSE);
 
@@ -2727,9 +2730,6 @@ dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
        local_hostintmask = bus->hostintmask;
        bus->hostintmask = 0;
 
-       /* Change our idea of bus state */
-       bus->dhd->busstate = DHD_BUS_DOWN;
-
        /* Force clocks on backplane to be sure F2 interrupt propagates */
        saveclk = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, &err);
        if (!err) {
@@ -5801,11 +5801,6 @@ dhd_bus_devreset(dhd_pub_t *dhdp, uint8 flag)
                        /* Force flow control as protection when stop come before ifconfig_down */
                        dhd_txflowcontrol(bus->dhd, 0, ON);
 #endif /* !defined(IGNORE_ETH0_DOWN) */
-                       /* save country settinng if was pre-setup with priv ioctl */
-                       dhd_os_proto_block(dhdp);
-                       dhdcdc_query_ioctl(bus->dhd, 0, WLC_GET_COUNTRY,
-                               bus->dhd->country_code, sizeof(bus->dhd->country_code));
-                       dhd_os_proto_unblock(dhdp);
                        /* Expect app to have torn down any connection before calling */
                        /* Stop the bus, disable F2 */
                        dhd_os_sdlock(dhdp);
index 0c34a6375c69a00dc1808e3c25d9251eff33c1ff..70c258c27d37321bac451a799b713fae0c8228b0 100644 (file)
@@ -635,11 +635,11 @@ wl_iw_set_country(
                strncpy(country_code, extra + country_offset + 1,
                        MIN(country_code_size, sizeof(country_code)));
 
-               
                if ((error = dev_wlc_ioctl(dev, WLC_SET_COUNTRY,
                        &country_code, sizeof(country_code))) >= 0) {
                        p += snprintf(p, MAX_WX_STRING, "OK");
                        WL_TRACE(("%s: set country %s OK\n", __FUNCTION__, country_code));
+                       dhd_bus_country_set(dev, &country_code[0]);
                        goto exit;
                }
        }
index 9fedc839cfb0cf5db39d69a2a83627b6d66227fd..0f5f4db32eff66da2ec7d7079ca1c8cc95dd8594 100644 (file)
@@ -197,6 +197,7 @@ extern int net_os_set_suspend_disable(struct net_device *dev, int val);
 extern int net_os_set_suspend(struct net_device *dev, int val);
 extern int net_os_set_dtim_skip(struct net_device *dev, int val);
 extern int net_os_set_packet_filter(struct net_device *dev, int val);
+extern void dhd_bus_country_set(struct net_device *dev, char *country_code);
 
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)
 #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \