From: Dmitry Shmidt Date: Fri, 20 Aug 2010 18:12:22 +0000 (-0700) Subject: net: wireless: bcm4329: Send "HANG" message only once X-Git-Tag: firefly_0821_release~9833^2~5^2~147 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=70eeb9a8f2a7d27e69be48489dba12e7244eed3e;p=firefly-linux-kernel-4.4.55.git net: wireless: bcm4329: Send "HANG" message only once Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c index b08ecd15d7d7..d8621ae0680a 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -279,6 +279,8 @@ typedef struct dhd_info { int wl_count; int wl_packet; + int hang_was_sent; + /* Thread to issue ioctl for multicast */ long sysioc_pid; struct semaphore sysioc_sem; @@ -1113,7 +1115,7 @@ dhd_start_xmit(struct sk_buff *skb, struct net_device *net) /* Send Event when bus down detected during data session */ if (dhd->pub.busstate == DHD_BUS_DOWN) { DHD_ERROR(("%s: Event HANG send up\n", __FUNCTION__)); - wl_iw_send_priv_event(net, "HANG"); + net_os_send_hang_message(net); } dhd_os_wake_unlock(&dhd->pub); return -ENODEV; @@ -1806,7 +1808,7 @@ 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"); + net_os_send_hang_message(net); } if (!bcmerror && buf && ioc.buf) { @@ -3114,3 +3116,17 @@ int net_os_set_packet_filter(struct net_device *dev, int val) } return ret; } + +int net_os_send_hang_message(struct net_device *dev) +{ + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); + int ret = 0; + + if (dhd) { + if (!dhd->hang_was_sent) { + dhd->hang_was_sent = 1; + ret = wl_iw_send_priv_event(dev, "HANG"); + } + } + return ret; +} diff --git a/drivers/net/wireless/bcm4329/wl_iw.h b/drivers/net/wireless/bcm4329/wl_iw.h index c7ddc726d7fe..82af0c716b12 100644 --- a/drivers/net/wireless/bcm4329/wl_iw.h +++ b/drivers/net/wireless/bcm4329/wl_iw.h @@ -180,6 +180,7 @@ extern int net_os_wake_lock_timeout_enable(struct net_device *dev); 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_packet_filter(struct net_device *dev, int val); +extern int net_os_send_hang_message(struct net_device *dev); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \