summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Shmidt <dimitrysh@google.com>2010-11-09 10:07:48 -0800
committerDmitry Shmidt <dimitrysh@google.com>2010-11-09 10:15:16 -0800
commit1e7a17857e6647628260f764a78d8c497507c2ad (patch)
tree396ee2ecb6128c2a436c8f1444c312e8d6ee0e95
parent8134a0daa58d701f87f3ceda0eb1c1b8378e4b9b (diff)
net: wireless: bcm4329: Fix watchdog termination after 'driver stop'
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r--drivers/net/wireless/bcm4329/dhd_linux.c8
-rw-r--r--drivers/net/wireless/bcm4329/dhd_sdio.c11
-rw-r--r--drivers/net/wireless/bcm4329/wl_iw.c2
-rw-r--r--drivers/net/wireless/bcm4329/wl_iw.h1
4 files changed, 13 insertions, 9 deletions
diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c
index cef803fc179e..3426b252c8b8 100644
--- a/drivers/net/wireless/bcm4329/dhd_linux.c
+++ b/drivers/net/wireless/bcm4329/dhd_linux.c
@@ -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))
diff --git a/drivers/net/wireless/bcm4329/dhd_sdio.c b/drivers/net/wireless/bcm4329/dhd_sdio.c
index abe92b7eb09a..7494e3836732 100644
--- a/drivers/net/wireless/bcm4329/dhd_sdio.c
+++ b/drivers/net/wireless/bcm4329/dhd_sdio.c
@@ -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);
diff --git a/drivers/net/wireless/bcm4329/wl_iw.c b/drivers/net/wireless/bcm4329/wl_iw.c
index 0c34a6375c69..70c258c27d37 100644
--- a/drivers/net/wireless/bcm4329/wl_iw.c
+++ b/drivers/net/wireless/bcm4329/wl_iw.c
@@ -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;
}
}
diff --git a/drivers/net/wireless/bcm4329/wl_iw.h b/drivers/net/wireless/bcm4329/wl_iw.h
index 9fedc839cfb0..0f5f4db32eff 100644
--- a/drivers/net/wireless/bcm4329/wl_iw.h
+++ b/drivers/net/wireless/bcm4329/wl_iw.h
@@ -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) \