diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2013-07-16 18:00:42 -0700 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-05-01 23:35:20 +0200 |
commit | 525efd9721e26ff7d10c704839afef7d17c81352 (patch) | |
tree | a81a16062ed51d7ed9b22c2efff7c5f22ebf84f7 | |
parent | 9b690b5e62e19895f06b6c23a3bbcc3515942e9c (diff) | |
download | kernel_samsung_tuna-525efd9721e26ff7d10c704839afef7d17c81352.zip kernel_samsung_tuna-525efd9721e26ff7d10c704839afef7d17c81352.tar.gz kernel_samsung_tuna-525efd9721e26ff7d10c704839afef7d17c81352.tar.bz2 |
net: wireless: bcmdhd: Fix tdls processing from cfg80211
Change-Id: Ie59e3b2e22e0542c5336183d591c1fca4eb490ae
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd.h | 7 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/dhd_linux.c | 58 | ||||
-rw-r--r-- | drivers/net/wireless/bcmdhd/wl_cfg80211.c | 9 |
3 files changed, 54 insertions, 20 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd.h b/drivers/net/wireless/bcmdhd/dhd.h index aa84e57..5aea6fc 100644 --- a/drivers/net/wireless/bcmdhd/dhd.h +++ b/drivers/net/wireless/bcmdhd/dhd.h @@ -306,6 +306,9 @@ typedef struct dhd_pub { #ifdef WLMEDIA_HTSF uint8 htsfdlystat_sz; /* Size of delay stats, max 255B */ #endif +#ifdef WLTDLS + bool tdls_enable; +#endif struct reorder_info *reorder_bufs[WLHOST_REORDERDATA_MAXFLOWS]; #ifdef RXFRAME_THREAD #define MAXSKBPEND 1024 @@ -967,6 +970,10 @@ int dhd_arp_get_arp_hostip_table(dhd_pub_t *dhd, void *buf, int buflen, int idx) void dhd_arp_offload_add_ip(dhd_pub_t *dhd, uint32 ipaddr, int idx); #endif /* ARP_OFFLOAD_SUPPORT */ +#ifdef WLTDLS +int dhd_tdls_enable_disable(dhd_pub_t *dhd, bool flag); +#endif + /* ioctl processing for nl80211 */ int dhd_ioctl_process(dhd_pub_t *pub, int ifidx, struct dhd_ioctl *ioc); diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index dc42eaf..5fc0f98 100644 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -3507,7 +3507,44 @@ dhd_get_concurrent_capabilites(dhd_pub_t *dhd) } return 0; } -#endif +#endif + +#ifdef WLTDLS +int dhd_tdls_enable_disable(dhd_pub_t *dhd, bool flag) +{ + char iovbuf[WL_EVENTING_MASK_LEN + 12]; + uint32 tdls = flag; + int ret; +#ifdef WLTDLS_AUTO_ENABLE + uint32 tdls_auto_op = 1; + uint32 tdls_idle_time = CUSTOM_TDLS_IDLE_MODE_SETTING; +#endif + + bcm_mkiovar("tdls_enable", (char *)&tdls, sizeof(tdls), iovbuf, sizeof(iovbuf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { + DHD_ERROR(("%s: tdls %d failed %d\n", __FUNCTION__, tdls, ret)); + return ret; + } + + dhd->tdls_enable = flag; + if (!flag) + return ret; + +#ifdef WLTDLS_AUTO_ENABLE + bcm_mkiovar("tdls_auto_op", (char *)&tdls_auto_op, sizeof(tdls_auto_op), iovbuf, sizeof(iovbuf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { + DHD_ERROR(("%s: tdls_auto_op failed %d\n", __FUNCTION__, ret)); + return ret; + } + + bcm_mkiovar("tdls_idle_time", (char *)&tdls_idle_time, sizeof(tdls_idle_time), iovbuf, sizeof(iovbuf)); + if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) { + WL_ERR(("%s: tdls_idle_time failed %d\n", __FUNCTION__, ret)); +#endif + return ret; +} +#endif + int dhd_preinit_ioctls(dhd_pub_t *dhd) { @@ -3562,11 +3599,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) #ifdef GET_CUSTOM_MAC_ENABLE struct ether_addr ea_addr; #endif /* GET_CUSTOM_MAC_ENABLE */ -#ifdef WLTDLS_ENABLE - uint32 tdls = 1; - uint32 tdls_auto_op = 1; - uint32 tdls_idle_time = CUSTOM_TDLS_IDLE_MODE_SETTING; -#endif /* WLTDLS */ #ifdef DISABLE_11N uint32 nmode = 0; @@ -3739,18 +3771,8 @@ dhd_preinit_ioctls(dhd_pub_t *dhd) DHD_ERROR(("%s: roam fullscan period set failed %d\n", __FUNCTION__, ret)); #endif /* ROAM_ENABLE */ -#ifdef WLTDLS_ENABLE - bcm_mkiovar("tdls_enable", (char *)&tdls, 4, iovbuf, sizeof(iovbuf)); - if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) - DHD_ERROR(("%s: tdls enable failed %d\n", __FUNCTION__, ret)); - - bcm_mkiovar("tdls_auto_op", (char *)&tdls_auto_op, 4, iovbuf, sizeof(iovbuf)); - if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) - DHD_ERROR(("%s: tdls_auto_op failed %d\n", __FUNCTION__, ret)); - - bcm_mkiovar("tdls_idle_time", (char *)&tdls_idle_time, 4, iovbuf, sizeof(iovbuf)); - if ((dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0)) < 0) - DHD_ERROR(("%s: tdls_idle_time failed %d\n", __FUNCTION__, ret)); +#ifdef WLTDLS + dhd_tdls_enable_disable(dhd, 1); #endif /* WLTDLS */ /* Set PowerSave mode */ diff --git a/drivers/net/wireless/bcmdhd/wl_cfg80211.c b/drivers/net/wireless/bcmdhd/wl_cfg80211.c index 34fff04..b83c223 100644 --- a/drivers/net/wireless/bcmdhd/wl_cfg80211.c +++ b/drivers/net/wireless/bcmdhd/wl_cfg80211.c @@ -9939,14 +9939,19 @@ wl_cfg80211_tdls_oper(struct wiphy *wiphy, struct net_device *dev, { s32 ret = 0; #ifdef WLTDLS - struct wl_priv *wl; + struct wl_priv *wl = wlcfg_drv_priv; tdls_iovar_t info; - wl = wlcfg_drv_priv; + dhd_pub_t *dhd = (dhd_pub_t *)(wl->pub); + memset(&info, 0, sizeof(tdls_iovar_t)); if (peer) memcpy(&info.ea, peer, ETHER_ADDR_LEN); switch (oper) { case NL80211_TDLS_DISCOVERY_REQ: + if (!dhd->tdls_enable) + ret = dhd_tdls_enable_disable(dhd, 1); + if (ret < 0) + return ret; info.mode = TDLS_MANUAL_EP_DISCOVERY; break; case NL80211_TDLS_SETUP: |