diff --git a/core/hdd/inc/wlan_hdd_tdls.h b/core/hdd/inc/wlan_hdd_tdls.h index 2208cc119a5b..0339213df54e 100644 --- a/core/hdd/inc/wlan_hdd_tdls.h +++ b/core/hdd/inc/wlan_hdd_tdls.h @@ -188,10 +188,49 @@ int wlan_hdd_cfg80211_tdls_mgmt(struct wiphy *wiphy, #endif #endif -int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, int offchannel); +/** + * hdd_set_tdls_offchannel() - set tdls off-channel number + * @hdd_ctx: Pointer to the HDD context + * @adapter: Pointer to the HDD adapter + * @offchannel: tdls off-channel number + * + * This function sets tdls off-channel number + * + * Return: 0 on success; negative errno otherwise + */ +int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, + int offchannel); + +/** + * hdd_set_tdls_secoffchanneloffset() - set secondary tdls off-channel offset + * @hdd_ctx: Pointer to the HDD context + * @adapter: Pointer to the HDD adapter + * @offchanoffset: tdls off-channel offset + * + * This function sets secondary tdls off-channel offset + * + * Return: 0 on success; negative errno otherwise + */ int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, int offchanoffset); -int hdd_set_tdls_offchannelmode(struct hdd_adapter *adapter, int offchanmode); + +/** + * hdd_set_tdls_offchannelmode() - set tdls off-channel mode + * @hdd_ctx: Pointer to the HDD context + * @adapter: Pointer to the HDD adapter + * @offchanmode: tdls off-channel mode + * 1-Enable Channel Switch + * 2-Disable Channel Switch + * + * This function sets tdls off-channel mode + * + * Return: 0 on success; negative errno otherwise + */ +int hdd_set_tdls_offchannelmode(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, + int offchanmode); int hdd_set_tdls_scan_type(struct hdd_context *hdd_ctx, int val); int wlan_hdd_tdls_antenna_switch(struct hdd_context *hdd_ctx, struct hdd_adapter *adapter, diff --git a/core/hdd/src/wlan_hdd_ioctl.c b/core/hdd/src/wlan_hdd_ioctl.c index b50fb936bd7d..1854ef789749 100644 --- a/core/hdd/src/wlan_hdd_ioctl.c +++ b/core/hdd/src/wlan_hdd_ioctl.c @@ -6077,7 +6077,7 @@ static int drv_cmd_tdls_secondary_channel_offset(struct hdd_adapter *adapter, hdd_debug("Tdls offchannel offset:%d", set_value); - ret = hdd_set_tdls_secoffchanneloffset(hdd_ctx, set_value); + ret = hdd_set_tdls_secoffchanneloffset(hdd_ctx, adapter, set_value); return ret; } @@ -6113,7 +6113,7 @@ static int drv_cmd_tdls_off_channel_mode(struct hdd_adapter *adapter, hdd_debug("Tdls offchannel mode:%d", set_value); - ret = hdd_set_tdls_offchannelmode(adapter, set_value); + ret = hdd_set_tdls_offchannelmode(hdd_ctx, adapter, set_value); return ret; } @@ -6155,7 +6155,7 @@ static int drv_cmd_tdls_off_channel(struct hdd_adapter *adapter, hdd_debug("Tdls offchannel num: %d", set_value); - ret = hdd_set_tdls_offchannel(hdd_ctx, set_value); + ret = hdd_set_tdls_offchannel(hdd_ctx, adapter, set_value); return ret; } diff --git a/core/hdd/src/wlan_hdd_tdls.c b/core/hdd/src/wlan_hdd_tdls.c index 92bf97da4f26..d19bd1f2ebf7 100644 --- a/core/hdd/src/wlan_hdd_tdls.c +++ b/core/hdd/src/wlan_hdd_tdls.c @@ -96,7 +96,6 @@ int wlan_hdd_tdls_get_all_peers(struct hdd_adapter *adapter, buf, buflen); } -#ifdef FEATURE_WLAN_TDLS static const struct nla_policy wlan_hdd_tdls_config_enable_policy[QCA_WLAN_VENDOR_ATTR_TDLS_ENABLE_MAX + 1] = { @@ -742,52 +741,41 @@ int wlan_hdd_cfg80211_send_tdls_discover_req(struct wiphy *wiphy, #endif } -#endif /* End of FEATURE_WLAN_TDLS */ -/** - * hdd_set_tdls_offchannel() - set tdls off-channel number - * @adapter: Pointer to the HDD adapter - * @offchanmode: tdls off-channel number - * - * This function sets tdls off-channel number - * - * Return: 0 on success; negative errno otherwise - */ -int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, int offchannel) +int hdd_set_tdls_offchannel(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, + int offchannel) { - /* TODO */ - return 0; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (hdd_ctx->tdls_umac_comp_active) + status = ucfg_set_tdls_offchannel(adapter->hdd_vdev, + offchannel); + return qdf_status_to_os_return(status); } -/** - * hdd_set_tdls_secoffchanneloffset() - set secondary tdls off-channel offset - * @adapter: Pointer to the HDD adapter - * @offchanmode: tdls off-channel offset - * - * This function sets 2nd tdls off-channel offset - * - * Return: 0 on success; negative errno otherwise - */ int hdd_set_tdls_secoffchanneloffset(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, int offchanoffset) { - /* TODO */ - return 0; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (hdd_ctx->tdls_umac_comp_active) + status = ucfg_set_tdls_secoffchanneloffset(adapter->hdd_vdev, + offchanoffset); + return qdf_status_to_os_return(status); } -/** - * hdd_set_tdls_offchannelmode() - set tdls off-channel mode - * @adapter: Pointer to the HDD adapter - * @offchanmode: tdls off-channel mode - * - * This function sets tdls off-channel mode - * - * Return: 0 on success; negative errno otherwise - */ -int hdd_set_tdls_offchannelmode(struct hdd_adapter *adapter, int offchanmode) +int hdd_set_tdls_offchannelmode(struct hdd_context *hdd_ctx, + struct hdd_adapter *adapter, + int offchanmode) { - /* TODO */ - return 0; + QDF_STATUS status = QDF_STATUS_E_FAILURE; + + if (hdd_ctx->tdls_umac_comp_active) + status = ucfg_set_tdls_offchan_mode(adapter->hdd_vdev, + offchanmode); + return qdf_status_to_os_return(status); } /**