From patchwork Thu Mar 1 17:59:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tamizh chelvam X-Patchwork-Id: 10252137 X-Patchwork-Delegate: johannes@sipsolutions.net 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 1DB9860211 for ; Thu, 1 Mar 2018 17:59:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E8AE2841E for ; Thu, 1 Mar 2018 17:59:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0310E28426; Thu, 1 Mar 2018 17:59:47 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 873DC2841E for ; Thu, 1 Mar 2018 17:59:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1033586AbeCAR7o (ORCPT ); Thu, 1 Mar 2018 12:59:44 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:51830 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1033174AbeCAR7n (ORCPT ); Thu, 1 Mar 2018 12:59:43 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 3130E60791; Thu, 1 Mar 2018 17:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519927183; bh=GIjwYAcuLOdnF2cbz3+K2jpkXWh5EjbTkZ5wpRnDmCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Rl8lPArrXt7fogTkSFYG+r4LtNXmzh3ddRdAQmtkSVEBjJg4FQohlTBpJb0jTFTyV 3oEPkLWIDJmb1u7cNjZ0KIflnWpzK5ofccj04i8zvAhGDE3Rb6JMcf1Wuvf0HkNcy6 ZrN/boV2zRFOhvNL3/wVYjaiObP3WM4YnLB3PoxI= Received: from che-swdbs-01.qca.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: tamizhr@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 6B506602A0; Thu, 1 Mar 2018 17:59:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1519927182; bh=GIjwYAcuLOdnF2cbz3+K2jpkXWh5EjbTkZ5wpRnDmCg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Gm7kFCC8HzjrgDA+FPK67izlslhkq48grUtjnUyj+fgqXNy3g5Qn30p/8Zj1wZlZm g0adcyfx23SrSOMfXzyXY0c/lP2v9s+cbBu0EXL5/1JwL5f411RhHijG/F0vlq8sn1 VIaZPaP7cP15bdTgJUxgn+k+l+aaVtOMF1n54Ogo= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 6B506602A0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=tamizhr@codeaurora.org From: Tamizh chelvam To: johannes@sipsolutions.net Cc: linux-wireless@vger.kernel.org, Tamizh chelvam Subject: [PATCH 2/2] mac80211: Add support to enable or disable btcoex Date: Thu, 1 Mar 2018 23:29:30 +0530 Message-Id: <1519927170-11920-2-git-send-email-tamizhr@codeaurora.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1519927170-11920-1-git-send-email-tamizhr@codeaurora.org> References: <1519927170-11920-1-git-send-email-tamizhr@codeaurora.org> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tamizh chelvam This patch introduces a new driver call back drv_set_btcoex to enable/disable btcoex. Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 2 ++ net/mac80211/cfg.c | 8 ++++++++ net/mac80211/driver-ops.h | 13 +++++++++++++ net/mac80211/trace.h | 17 +++++++++++++++++ 4 files changed, 40 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 2fd59ed..45d4281 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h @@ -3487,6 +3487,7 @@ 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: To enable/disable btcoex. Returns 0 on success. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3768,6 +3769,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 fd68f6f..1a939c1 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3694,6 +3694,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, @@ -3786,4 +3793,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 4d82fe7..c424e17 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1250,4 +1250,17 @@ 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 591ad02..e30e0b1 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -746,6 +746,23 @@ 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),