From patchwork Fri Jan 16 18:57:26 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: gianluca X-Patchwork-Id: 429985 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from arrakis.dune.hu (arrakis.dune.hu [78.24.191.176]) (using TLSv1.1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3D19614028E for ; Sat, 17 Jan 2015 05:57:41 +1100 (AEDT) Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 1637A28AD25; Fri, 16 Jan 2015 19:55:17 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on arrakis.dune.hu X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,T_DKIM_INVALID autolearn=unavailable version=3.3.2 Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 9C09628A716 for ; Fri, 16 Jan 2015 19:55:12 +0100 (CET) X-policyd-weight: using cached result; rate: -5.5 Received: from m-r2.th.seeweb.it (m-r2.th.seeweb.it [5.144.164.171]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Fri, 16 Jan 2015 19:55:12 +0100 (CET) Received: from fseek.strangled.net (host32-178-dynamic.6-79-r.retail.telecomitalia.it [79.6.178.32]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by m-r2.th.seeweb.it (Postfix) with ESMTPSA id 948A93F4DA for ; Fri, 16 Jan 2015 19:57:27 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=sottospazio.it; h=user-agent:content-disposition:content-type:content-type :mime-version:message-id:subject:subject:from:from:date:date; s= mail; t=1421434646; x=1423249047; bh=Eiw2qZD6K+viwaaL+3noeSf+0Ev fq/3ygkafzu9D0ys=; b=ehiU9XO0ZsUq2H20ZbFArxlAHudeVY+Z98SXnxANJ+E 0ZjrAtwP4Q2Elazmx982WyfrkXnmVfqDx4ErBNVrLUZam/siI0knJV2aXVMgYU5X Qsg2pqt6sIa3gl+sUGZNbj1CA8CP/gJCEFmBNbFjcZVMea4p91ZbPfauKdBytsFI = Received: by mail.seek.priv (Postfix, from userid 1000) id 3E16A60115; Fri, 16 Jan 2015 19:57:26 +0100 (CET) Date: Fri, 16 Jan 2015 19:57:26 +0100 From: Gianluca Anzolin To: openwrt-devel@lists.openwrt.org Message-ID: <20150116185726.GA13845@sottospazio.it> Mail-Followup-To: openwrt-devel@lists.openwrt.org MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Subject: [OpenWrt-Devel] Archer C7, leds and led trigger for ath10k X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: OpenWrt Development List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openwrt-devel-bounces@lists.openwrt.org Sender: "openwrt-devel" Hi, I noticed that on Archer C7 the 2.4Ghz and 5Ghz leds are swapped: this is the relevant section of /etc/config/system config led 'led_wlan2g' option name 'WLAN2G' option sysfs 'tp-link:blue:wlan2g' option trigger 'phy0tpt' config led 'led_wlan5g' option name 'WLAN5G' option sysfs 'tp-link:blue:wlan5g' option trigger 'phy1tpt' However on Archer C7 the 5G interface is on phy0 and 2.4G is on phy1. I've yet to find where (and how) this section is autogenerated but I noticed that the phy0pt trigger doesn't even exist on my system. There is also a bugreport in the bug tracking system pointing at this issue: https://dev.openwrt.org/ticket/18188 I looked at the ath9k implementation and I've come up with the attached patch. Do you think a patch like this is acceptable? Thank you, Gianluca From c0f16f5008b3ad52f8a0c8554503beb655e11928 Mon Sep 17 00:00:00 2001 From: Gianluca Anzolin Date: Fri, 16 Jan 2015 19:19:30 +0100 Subject: [PATCH] ath10k: add throughput led trigger This patch add a throughput led trigger for the ath10k wifi driver. The throughputs in the table are chosen to be linear in a logarithmic scale. Signed-off-by: Gianluca Anzolin --- .../patches/930-ath10k_add_tpt_led_trigger.patch | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch diff --git a/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch new file mode 100644 index 0000000..150e008 --- /dev/null +++ b/package/kernel/mac80211/patches/930-ath10k_add_tpt_led_trigger.patch @@ -0,0 +1,37 @@ +--- a/drivers/net/wireless/ath/ath10k/mac.c ++++ b/drivers/net/wireless/ath/ath10k/mac.c +@@ -4824,6 +4824,21 @@ struct ath10k_vif *ath10k_get_arvif(stru + return arvif_iter.arvif; + } + ++#ifdef CPTCFG_MAC80211_LEDS ++static const struct ieee80211_tpt_blink ath10k_tpt_blink[] = { ++ { .throughput = 0 * 1024, .blink_time = 334 }, ++ { .throughput = 1 * 1024, .blink_time = 260 }, ++ { .throughput = 2 * 1024, .blink_time = 220 }, ++ { .throughput = 5 * 1024, .blink_time = 190 }, ++ { .throughput = 10 * 1024, .blink_time = 170 }, ++ { .throughput = 25 * 1024, .blink_time = 150 }, ++ { .throughput = 54 * 1024, .blink_time = 130 }, ++ { .throughput = 120 * 1024, .blink_time = 110 }, ++ { .throughput = 265 * 1024, .blink_time = 80 }, ++ { .throughput = 586 * 1024, .blink_time = 50 }, ++}; ++#endif ++ + int ath10k_mac_register(struct ath10k *ar) + { + struct ieee80211_supported_band *band; +@@ -4965,6 +4980,12 @@ int ath10k_mac_register(struct ath10k *a + goto err_free; + } + ++#if CPTCFG_MAC80211_LEDS ++ ieee80211_create_tpt_led_trigger(ar->hw, ++ IEEE80211_TPT_LEDTRIG_FL_RADIO, ath10k_tpt_blink, ++ ARRAY_SIZE(ath10k_tpt_blink)); ++#endif ++ + ret = ieee80211_register_hw(ar->hw); + if (ret) { + ath10k_err(ar, "failed to register ieee80211: %d\n", ret); -- 2.2.2