From patchwork Tue Apr 4 05:42:38 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: 9660863 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 35289602B9 for ; Tue, 4 Apr 2017 05:42:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 270902847B for ; Tue, 4 Apr 2017 05:42:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BEB928498; Tue, 4 Apr 2017 05:42:37 +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 B10FD2847B for ; Tue, 4 Apr 2017 05:42:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752172AbdDDFmf (ORCPT ); Tue, 4 Apr 2017 01:42:35 -0400 Received: from wolverine01.qualcomm.com ([199.106.114.254]:65167 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751856AbdDDFme (ORCPT ); Tue, 4 Apr 2017 01:42:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qti.qualcomm.com; i=@qti.qualcomm.com; q=dns/txt; s=qcdkim; t=1491284554; x=1522820554; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=or4bT4+rCCQdGaZYAKZFLB2tb/4DIP6kIjX9fi4wAn0=; b=AtuYv1pRIBdNT9ZvvdTVhXjzDaAMJYus7bjTwLBEvb1jrEXPw4yK4Iz+ 012+VgDciFhKlctrG3SV0YvQfRtevpfDYnf77bsaWO0LegbLGU7gu8bzk pK+esiGsabd9sbn4AJ1psOayfX5WfkHUallBJDky6Dpa9adjLh07eYnD4 k=; X-IronPort-AV: E=Sophos;i="5.36,273,1486454400"; d="scan'208";a="275781153" Received: from unknown (HELO ironmsg02-R.qualcomm.com) ([10.53.140.106]) by wolverine01.qualcomm.com with ESMTP; 03 Apr 2017 22:42:33 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8487"; a="932302215" X-MGA-submission: =?us-ascii?q?MDGFyht7jpT6GtGEOq7AX89p9NOybNNsKT4dTk?= =?us-ascii?q?0yS2SEdR7USQaXYurw42lsMw2kawPqnmjNLMsLKnC8iPNkYNPdO5hJE0?= =?us-ascii?q?bwYelO5JXq8w/CT31Wc0GNKszW4+5WeTV6BIkVCX3qns+dNz1mHqdtbs?= =?us-ascii?q?oS?= Received: from nasanexm02a.na.qualcomm.com ([10.85.0.41]) by ironmsg02-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 03 Apr 2017 22:42:33 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by nasanexm02a.na.qualcomm.com (10.85.0.41) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Mon, 3 Apr 2017 22:42:32 -0700 Received: from localhost (10.80.80.8) by aphydexm01b.ap.qualcomm.com (10.252.127.11) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 4 Apr 2017 11:12:26 +0530 From: To: CC: , , , Tamizh chelvam Subject: [PATCHv3 2/2] mac80211: Add support to enable or disable btcoex and set btcoex priority value Date: Tue, 4 Apr 2017 11:12:38 +0530 Message-ID: <1491284558-1915-3-git-send-email-c_traja@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1491284558-1915-1-git-send-email-c_traja@qti.qualcomm.com> References: <1491284558-1915-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 aphydexm01b.ap.qualcomm.com (10.252.127.11) 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. This API will pass user space value to driver to enable or disabe btcoex and set or modify the btcoex priority value. Signed-off-by: Tamizh chelvam --- include/net/mac80211.h | 5 +++++ net/mac80211/cfg.c | 9 +++++++++ net/mac80211/driver-ops.h | 15 +++++++++++++++ net/mac80211/trace.h | 20 ++++++++++++++++++++ 4 files changed, 49 insertions(+) diff --git a/include/net/mac80211.h b/include/net/mac80211.h index b1ac872..7d0f1dd 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_: Called when BTCOEX is enabled/disabled, use + * this callback to enable or disable btcoex and use this callback to + * set btcoex_priority. BTCOEX should be enabled to set this priority. */ struct ieee80211_ops { void (*tx)(struct ieee80211_hw *hw, @@ -3734,6 +3737,8 @@ 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, + u32 btcoex_priority); }; /** diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 8bc3d366..512e5f7 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -3617,6 +3617,14 @@ static int ieee80211_set_multicast_to_unicast(struct wiphy *wiphy, return 0; } +static int ieee80211_set_btcoex(struct wiphy *wiphy, bool enabled, + u32 btcoex_priority) +{ + struct ieee80211_local *local = wiphy_priv(wiphy); + + return drv_set_btcoex(local, enabled, btcoex_priority); +} + const struct cfg80211_ops mac80211_config_ops = { .add_virtual_intf = ieee80211_add_iface, .del_virtual_intf = ieee80211_del_iface, @@ -3709,4 +3717,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..c420da5 100644 --- a/net/mac80211/driver-ops.h +++ b/net/mac80211/driver-ops.h @@ -1248,4 +1248,19 @@ 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, u32 btcoex_priority) +{ + int ret = -EOPNOTSUPP; + + trace_drv_set_btcoex(local, enabled, btcoex_priority); + if (local->ops->set_btcoex) + ret = local->ops->set_btcoex(&local->hw, enabled, + btcoex_priority); + + 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..3a4621e 100644 --- a/net/mac80211/trace.h +++ b/net/mac80211/trace.h @@ -742,6 +742,26 @@ TP_ARGS(local, value) ); +TRACE_EVENT(drv_set_btcoex, + TP_PROTO(struct ieee80211_local *local, bool enabled, + u32 btcoex_priority), + TP_ARGS(local, enabled, btcoex_priority), + TP_STRUCT__entry( + LOCAL_ENTRY + __field(bool, enabled) + __field(u32, btcoex_priority) + ), + TP_fast_assign( + LOCAL_ASSIGN; + __entry->enabled = enabled; + __entry->btcoex_priority = btcoex_priority; + ), + TP_printk( + LOCAL_PR_FMT " enabled:%d btcoex_priority :%u", + LOCAL_PR_ARG, __entry->enabled, __entry->btcoex_priority + ) +); + TRACE_EVENT(drv_set_coverage_class, TP_PROTO(struct ieee80211_local *local, s16 value),