From patchwork Tue Apr 11 10:15:30 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: 9674867 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 77A5B60234 for ; Tue, 11 Apr 2017 10:14:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7343C28535 for ; Tue, 11 Apr 2017 10:14:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 681832853C; Tue, 11 Apr 2017 10:14:27 +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 2B88828536 for ; Tue, 11 Apr 2017 10:14:26 +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=KQGTpjaitR9D/jSVEoV2gDz8BJQbgiaRUHkbLvKNAwE=; b=BzRcfOEfJGjzOq 5rXqGq/tQxlDDIdE6hiv5RthxGFj8fTNuW71V32E1923BT4NoW5C+i2b2sEhvFpx+tLHvAVabknuK a9ckvudYM2uGyF0q309auXX9LLrjL9jaDQWMaX7vI8FTnPqEW+b+7dewVAP4CZXsyL23rIUqcBBbp RtYSysofhBGaNUmvelJIAntzGPZV3XV6voyUhjWQenSl+htMdDqqtWQ84BtjJ3O5RE/MNn0PvNPW1 +tIyljl1tIW7KWbdRXZtRMfs74JhXngCwTkRHtjS83SI4zn4he7nIya5Pxi5B0TGYd3BZa9ki2EeT ifVewOAs+WmwJPuRi8vQ==; 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 1cxsoS-0002OM-Ie; Tue, 11 Apr 2017 10:14:16 +0000 Received: from wolverine02.qualcomm.com ([199.106.114.251]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cxsoO-0002II-3t for ath10k@lists.infradead.org; Tue, 11 Apr 2017 10:14:13 +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=1491905652; x=1523441652; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version; bh=0s9fxgPLWzNIQU4G7WihfcTJSj+bjF50n6tq5eUG7Sw=; b=zYVKlQFVtG7eTQDgtQX0FyVf3NJrdatZd885b9iRewuRbEJpGzFI2rtZ lSGvLG4ztTHrKqBFAQsT/YjN6gmumXWzNQ1GNPCO2An2t8AJYrLBZMwQz 86h4DWItfWiiXcXVupNkelM0gx/PTMagbRZPDobi89fYfbtF6fhArBQwL A=; X-IronPort-AV: E=Sophos;i="5.37,185,1488873600"; d="scan'208";a="373264853" Received: from unknown (HELO Ironmsg04-R.qualcomm.com) ([10.53.140.108]) by wolverine02.qualcomm.com with ESMTP; 11 Apr 2017 03:14:11 -0700 X-IronPort-AV: E=McAfee;i="5800,7501,8494"; a="1396254063" X-MGA-submission: =?us-ascii?q?MDGhcrmK5HcsPh1/ryNDv62e7aL54KA0oLjDSi?= =?us-ascii?q?nisRMtfn2r43Tlb1gp3eeBtUsyBagb95sk2CmKuprqPXeTLermTPHi5o?= =?us-ascii?q?m7ynTqFFtUBse/dlRRar6FaRrflTTzuSu1gGwzEbnGOOnqzClXWqsnIU?= =?us-ascii?q?zX?= Received: from nasanexm02d.na.qualcomm.com ([10.85.0.44]) by Ironmsg04-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 11 Apr 2017 03:14:11 -0700 Received: from aphydexm01b.ap.qualcomm.com (10.252.127.11) by NASANEXM02D.na.qualcomm.com (10.85.0.44) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 11 Apr 2017 03:14:10 -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, 11 Apr 2017 15:44:04 +0530 From: To: Subject: [PATCHv4 2/2] mac80211: Add support to enable or disable btcoex and set btcoex priority value Date: Tue, 11 Apr 2017 15:45:30 +0530 Message-ID: <1491905730-16392-3-git-send-email-c_traja@qti.qualcomm.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1491905730-16392-1-git-send-email-c_traja@qti.qualcomm.com> References: <1491905730-16392-1-git-send-email-c_traja@qti.qualcomm.com> MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To aphydexm01b.ap.qualcomm.com (10.252.127.11) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170411_031412_310750_7DADBF0B X-CRM114-Status: GOOD ( 10.71 ) 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, 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 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..865eb7f 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),