From patchwork Sat Feb 25 13:37:51 2017 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: 9591711 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 080246042C for ; Sat, 25 Feb 2017 13:40:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBCDE28541 for ; Sat, 25 Feb 2017 13:40:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0A5F28601; Sat, 25 Feb 2017 13:40:28 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 88E0428541 for ; Sat, 25 Feb 2017 13:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=fDj/MJQeDQ47fGWbJ6lbdud+0qGB6RdbVBG4qGn6AeU=; b=ZMa0yKsSD57nLM 8q7HkAQDZ7QzP6ao9p9T5x9NkeAwOq9BW6GXba4K/K4cDce4N7AOlx3LcaiCjRkJ+kmu+8X1hGCuA pmkqja7RdKNORpBKT6Uf6uZgBgo8TyMPXMWQCMazKsnWGr4vWqysO6zfVXmfdCTznWeI5+vfIWxdo YHt6l27lmIeDhxU8prEF0euiAmWtY71x14WbPD7IbcbWAR3cOOSP701PikxtgHUD9iXLZTmlx6t68 s2rcJRhJPRPmyz4nlXaLGkdQ8tIyGfBOt7/zAZuyhsMae8RJAAl/rvmJLTT4VOMoIZ65j53+tFNZc lJOUpqGj5JpaiZpp6dKg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1chcaF-0007Fi-8A; Sat, 25 Feb 2017 13:40:23 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1chca6-0005rc-DL for ath10k@lists.infradead.org; Sat, 25 Feb 2017 13:40:18 +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=1488030014; x=1519566014; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=ujUwjKDsFiRz0wUbT497SdwRQMLdCUipleH5KMAKNTQ=; b=Pj5x34sXwaJXG5U8HrRUBCG8JR5AtvicdA69UjEd+vL3eESjixmhmfKL zhPP35lvk/R8BpxcdYVNwbqwtdOWvmcpxgJQm4L/vwc3WgMmSLXP4OqeL bfSlQxtQpa+b7EMKF/DLmYV7sk4+LZyJ5VySDrB1Y/CUg/Q7k9qqJs+7F g=; X-IronPort-AV: E=Sophos;i="5.35,203,1484035200"; d="scan'208";a="361575844" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine02.qualcomm.com with ESMTP; 25 Feb 2017 05:39:58 -0800 X-IronPort-AV: E=McAfee;i="5800,7501,8449"; a="874038578" X-MGA-submission: =?us-ascii?q?MDF3H/gJnVkE2f8DQ4YJ0JNlDKNB+AVKlkJACd?= =?us-ascii?q?0HNksHOAjOQkbFbSo9A5dxRr5gfigZcf3ao5rUeBksYLBnF8m0rgr1NY?= =?us-ascii?q?17O8347PMx3TwEsbI5zQLYnzEamzn7oqBH6yi0VuZLDNzKjcBvXBRUmh?= =?us-ascii?q?ad?= Received: from nasanexm02f.na.qualcomm.com ([10.85.0.87]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 25 Feb 2017 05:39:57 -0800 Received: from aphydexm01f.ap.qualcomm.com (10.252.127.15) by nasanexm02f.na.qualcomm.com (10.85.0.87) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Sat, 25 Feb 2017 05:39:56 -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; Sat, 25 Feb 2017 19:09:51 +0530 From: To: Subject: [PATCHv2 2/4] mac80211: Add support to enable or disable btcoex Date: Sat, 25 Feb 2017 19:07:51 +0530 Message-ID: <1488029873-14600-3-git-send-email-c_traja@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com> References: <1488029873-14600-1-git-send-email-c_traja@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) 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-20170225_054014_717909_51402BE0 X-CRM114-Status: GOOD ( 10.32 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Tamizh chelvam , johannes@sipsolutions.net, 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 | 3 +++ net/mac80211/cfg.c | 8 ++++++++ net/mac80211/driver-ops.h | 14 ++++++++++++++ net/mac80211/trace.h | 14 ++++++++++++++ 4 files changed, 39 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b9a08cd..57717f1 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3447,6 +3447,8 @@ 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_: Called when BTCOEX is enabled/disabled, use + * this callback to enable or disable btcoex. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3728,6 +3730,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 ac879bb..7e17eff 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3574,6 +3574,13 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy, return 0; } +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, @@ -3665,4 +3672,5 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy, .add_nan_func = ieee80211_add_nan_func, .del_nan_func = ieee80211_del_nan_func, .set_multicast_to_unicast = ieee80211_set_multicast_to_unicast, + .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 0d645bc..0d9b5a0 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),