From: Dmitry Shmidt Date: Wed, 30 Jun 2010 22:30:54 +0000 (-0700) Subject: network: wireless: bcm4329: Add driver SETSUSPEND command X-Git-Tag: firefly_0821_release~9833^2~5^2~176 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=11d4919b98b5a460f65d75c296e72958359ba879;p=firefly-linux-kernel-4.4.55.git network: wireless: bcm4329: Add driver SETSUSPEND command Signed-off-by: Dmitry Shmidt --- diff --git a/drivers/net/wireless/bcm4329/dhd.h b/drivers/net/wireless/bcm4329/dhd.h index 005681eb6bbe..9db5c6370972 100644 --- a/drivers/net/wireless/bcm4329/dhd.h +++ b/drivers/net/wireless/bcm4329/dhd.h @@ -150,6 +150,9 @@ typedef struct dhd_pub { /* Last error from dongle */ int dongle_error; + /* Suspend disable flag */ + int suspend_disable_flag; + /* Pkt filter defination */ char * pktfilter[100]; int pktfilter_count; diff --git a/drivers/net/wireless/bcm4329/dhd_linux.c b/drivers/net/wireless/bcm4329/dhd_linux.c index 27b1f55de3d1..fc24b852cd02 100644 --- a/drivers/net/wireless/bcm4329/dhd_linux.c +++ b/drivers/net/wireless/bcm4329/dhd_linux.c @@ -507,7 +507,7 @@ int dhd_set_suspend(int value, dhd_pub_t *dhd) #define htod32(i) i - if (dhd && dhd->up) { + if (dhd && (dhd->up && !dhd->suspend_disable_flag)) { dhd_os_proto_block(dhd); if (value) { @@ -3023,3 +3023,12 @@ int net_os_wake_unlock(struct net_device *dev) ret = dhd_os_wake_unlock(&dhd->pub); return ret; } + +int net_os_set_suspend_disable(struct net_device *dev, int val) +{ + dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev); + + if (dhd) + dhd->pub.suspend_disable_flag = val; + return 0; +} diff --git a/drivers/net/wireless/bcm4329/wl_iw.c b/drivers/net/wireless/bcm4329/wl_iw.c index bccf9691a961..98133bbf4b6a 100644 --- a/drivers/net/wireless/bcm4329/wl_iw.c +++ b/drivers/net/wireless/bcm4329/wl_iw.c @@ -822,6 +822,20 @@ wl_iw_set_btcoex_dhcp( return error; } +static int +wl_iw_set_suspend( + struct net_device *dev, + struct iw_request_info *info, + union iwreq_data *wrqu, + char *extra +) +{ + int suspend_flag; + + suspend_flag = *(extra + strlen("SETSUSPEND") + 1) - '0'; + return net_os_set_suspend_disable(dev, suspend_flag); +} + int wl_format_ssid(char* ssid_buf, uint8* ssid, int ssid_len) { @@ -5909,6 +5923,8 @@ static int wl_iw_set_priv( #endif else if (strnicmp(extra, "GETPOWER", strlen("GETPOWER")) == 0) ret = wl_iw_get_power_mode(dev, info, (union iwreq_data *)dwrq, extra); + else if (strnicmp(extra, "SETSUSPEND", strlen("SETSUSPEND")) == 0) + ret = wl_iw_set_suspend(dev, info, (union iwreq_data *)dwrq, extra); #ifdef SOFTAP else if (strnicmp(extra, "ASCII_CMD", strlen("ASCII_CMD")) == 0) { wl_iw_process_private_ascii_cmd(dev, info, (union iwreq_data *)dwrq, extra); diff --git a/drivers/net/wireless/bcm4329/wl_iw.h b/drivers/net/wireless/bcm4329/wl_iw.h index 7514bafa53e0..7b7b16b33b18 100644 --- a/drivers/net/wireless/bcm4329/wl_iw.h +++ b/drivers/net/wireless/bcm4329/wl_iw.h @@ -173,6 +173,7 @@ extern int net_os_wake_lock(struct net_device *dev); extern int net_os_wake_unlock(struct net_device *dev); extern int net_os_wake_lock_timeout(struct net_device *dev); 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); #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27) #define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \