From patchwork Tue Nov 8 13:15:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: c_traja@qti.qualcomm.com X-Patchwork-Id: 9417345 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id BFD166022E for ; Tue, 8 Nov 2016 13:16:16 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B0DC728B76 for ; Tue, 8 Nov 2016 13:16:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A53EF28E7C; Tue, 8 Nov 2016 13:16:16 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 406BE28B76 for ; Tue, 8 Nov 2016 13:16:16 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1c46G3-0000UE-Lx; Tue, 08 Nov 2016 13:16:11 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c46G1-0000Pj-JW for ath10k@lists.infradead.org; Tue, 08 Nov 2016 13:16:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1478610969; x=1510146969; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=AOEZiOfnmbYgeSLycOY7dPuBuG79cwx8uXJKyFX1+uw=; b=u1yvrzBWmMEvjCzolrNcTfdQ2zMjKLmt4FQuHq9rmRYtMpu3U2byAa9c OcLRSbEP9zG72giumhE71V8eRztTHFbh44R/xWe8kIo7R35YOQZvQLxaY Td9qPtOB4wrvkp9qbze90czQ9K4KG6CkMbU1mtOBKwE6wp3kLZZIBtZ0L Y=; X-IronPort-AV: E=Sophos;i="5.31,462,1473145200"; d="scan'208";a="238432581" Received: from unknown (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by wolverine01.qualcomm.com with ESMTP; 08 Nov 2016 05:15:29 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8342"; a="842816923" Received: from nasanexm01b.na.qualcomm.com ([10.85.0.82]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 08 Nov 2016 05:15:28 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by NASANEXM01B.na.qualcomm.com (10.85.0.82) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 8 Nov 2016 05:15:27 -0800 Received: from localhost (10.80.80.8) by aphydexm01f.ap.qualcomm.com (10.252.127.15) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 8 Nov 2016 18:45:21 +0530 From: To: Subject: [PATCH 3/4] mac80211: Add support to enable or disable btcoex Date: Tue, 8 Nov 2016 18:45:31 +0530 Message-ID: <1478610932-21954-4-git-send-email-c_traja@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1478610932-21954-1-git-send-email-c_traja@qti.qualcomm.com> References: <1478610932-21954-1-git-send-email-c_traja@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01C.na.qualcomm.com (10.85.0.83) To aphydexm01f.ap.qualcomm.com (10.252.127.15) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161108_051609_762392_5748ECBB X-CRM114-Status: GOOD ( 10.15 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tamizh chelvam , johannes@sipsolutions.net, tamizhchelvam@codeaurora.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tamizh chelvam This patch introduces a new driver call back drv_set_btcoex This API will pass user space value to driver to enable or disabe btcoex. Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 4 ++++ net/mac80211/cfg.c | 8 ++++++++ net/mac80211/driver-ops.h | 14 ++++++++++++++ net/mac80211/trace.h | 14 ++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b9b24ab..e7db763 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3453,6 +3453,9 @@ enum ieee80211_reconfig_type { * @del_nan_func: Remove a NAN function. The driver must call * ieee80211_nan_func_terminated() with * NL80211_NAN_FUNC_TERM_REASON_USER_REQUEST reason code upon removal. + * + * @set_btcoex_: set_btcoex: Called when BTCOEX is enabled/disabled, use + * this callback to enable or disable btcoex. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3705,6 +3708,7 @@ struct ieee80211_ops { void (*del_nan_func)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, u8 instance_id); + int (*set_btcoex)(struct ieee80211_hw *hw, bool enabled); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index eb68add..a687056 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3562,6 +3562,13 @@ void ieee80211_nan_func_match(struct ieee80211_vif *vif, } EXPORT_SYMBOL(ieee80211_nan_func_match); +static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled) +{ + struct ieee80211_local *local = wiphy_priv(wiphy); + + return drv_set_btcoex(local, enabled); +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -3652,4 +3659,5 @@ void ieee80211_nan_func_match(struct ieee80211_vif *vif, .nan_change_conf = ieee80211_nan_change_conf, .add_nan_func = ieee80211_add_nan_func, .del_nan_func = ieee80211_del_nan_func, + .set_btcoex = ieee80211_set_btcoex, }; diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h index 09f77e4..16d9c98 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1248,4 +1248,18 @@ static inline void drv_del_nan_func(struct ieee80211_local *local, trace_drv_return_void(local); } +static inline int drv_set_btcoex(struct ieee80211_local *local, + bool enabled) +{ + int ret = -EOPNOTSUPP; + + trace_drv_set_btcoex(local, enabled); + if (local->ops->set_btcoex) + ret = local->ops->set_btcoex(&local->hw, enabled); + + trace_drv_return_int(local, ret); + + return ret; +} + #endif /* __MAC80211_DRIVER_OPS */ diff --git a/net/mac80211/trace.h b/net/mac80211/trace.h index 92a47af..760dfb6 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -742,6 +742,20 @@ TP_ARGS(local, value) ); +TRACE_EVENT(drv_set_btcoex, + TP_PROTO(struct ieee80211_local *local, bool enabled), + TP_ARGS(local, enabled), + TP_STRUCT__entry( + LOCAL_ENTRY + __field(bool, enabled) + ), + TP_fast_assign( + LOCAL_ASSIGN; + __entry->enabled = enabled; + ), + TP_printk(LOCAL_PR_FMT " enabled:%d", LOCAL_PR_ARG, __entry->enabled) +); + TRACE_EVENT(drv_set_coverage_class, TP_PROTO(struct ieee80211_local *local, s16 value),