From patchwork Mon Jun 20 13:00:21 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Altshul X-Patchwork-Id: 9187361 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 B9A466075F for ; Mon, 20 Jun 2016 13:01:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A5992271FD for ; Mon, 20 Jun 2016 13:01:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9A0CA27D13; Mon, 20 Jun 2016 13:01:54 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 E6D8B271FD for ; Mon, 20 Jun 2016 13:01:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753030AbcFTNAq (ORCPT ); Mon, 20 Jun 2016 09:00:46 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:54364 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752313AbcFTNAD (ORCPT ); Mon, 20 Jun 2016 09:00:03 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u5KCxAdU012884; Mon, 20 Jun 2016 07:59:10 -0500 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5KCxAI3017147; Mon, 20 Jun 2016 07:59:10 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.294.0; Mon, 20 Jun 2016 07:59:09 -0500 Received: from wlsrv.emea.dhcp.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5KCx3R6013242; Mon, 20 Jun 2016 07:59:08 -0500 From: Maxim Altshul To: , CC: , , , , , , , Maxim Altshul Subject: [PATCH 2/3] wlcore: Add support for get_expected_throughput opcode Date: Mon, 20 Jun 2016 16:00:21 +0300 Message-ID: <1466427622-5953-3-git-send-email-maxim.altshul@ti.com> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1466427622-5953-2-git-send-email-maxim.altshul@ti.com> References: <1466427622-5953-1-git-send-email-maxim.altshul@ti.com> <1466427622-5953-2-git-send-email-maxim.altshul@ti.com> MIME-Version: 1.0 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 Adding this opcode, allows the TI wireless driver, to report throughput directly from FW to mac80211. This is used mainly for mesh metric calculation. Signed-off-by: Maxim Altshul --- drivers/net/wireless/ti/wlcore/main.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/drivers/net/wireless/ti/wlcore/main.c b/drivers/net/wireless/ti/wlcore/main.c index 39dec7d..cf4c6af 100644 --- a/drivers/net/wireless/ti/wlcore/main.c +++ b/drivers/net/wireless/ti/wlcore/main.c @@ -5851,6 +5851,20 @@ out: mutex_unlock(&wl->mutex); } +static u32 wlcore_op_get_expected_throughput(struct ieee80211_sta *sta) +{ + struct wl1271_station *wl_sta = (struct wl1271_station *)sta->drv_priv; + struct wl1271 *wl = wl_sta->wl; + u8 hlid = wl_sta->hlid; + u32 ret = 0; + + /* return in units of 100kbps */ + if (wl) + ret = (wl->links[hlid].fw_rate_mbps * 10); + + return ret; +} + static bool wl1271_tx_frames_pending(struct ieee80211_hw *hw) { struct wl1271 *wl = hw->priv; @@ -6051,6 +6065,7 @@ static const struct ieee80211_ops wl1271_ops = { .switch_vif_chanctx = wlcore_op_switch_vif_chanctx, .sta_rc_update = wlcore_op_sta_rc_update, .sta_statistics = wlcore_op_sta_statistics, + .get_expected_throughput = wlcore_op_get_expected_throughput, CFG80211_TESTMODE_CMD(wl1271_tm_cmd) };