From patchwork Sun Jan 11 19:45:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hong Xu X-Patchwork-Id: 5606901 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 73D0D9F443 for ; Sun, 11 Jan 2015 19:46:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8912A2062D for ; Sun, 11 Jan 2015 19:46:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4710F2062A for ; Sun, 11 Jan 2015 19:46:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751192AbbAKTqX (ORCPT ); Sun, 11 Jan 2015 14:46:23 -0500 Received: from mail-pd0-f181.google.com ([209.85.192.181]:44236 "EHLO mail-pd0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921AbbAKTqX (ORCPT ); Sun, 11 Jan 2015 14:46:23 -0500 Received: by mail-pd0-f181.google.com with SMTP id v10so26775925pde.12 for ; Sun, 11 Jan 2015 11:46:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=onyvT4ja6uudKhdI0W4xpUAIk25no8wG8Cv+1FWmkPY=; b=IBFeRYccrUnQjsCyBZgHA2WDRql8Bl+GM6tgyIb+/24SzQ4M7r+9hkgnlMQUbkpV9x e7vChjPbiv/2YLBSUKsNaKbVSCFHTDC1EExLjhjNBa29Afu712/NLmO4V9mw9mT11bYS 0kqD6QtmyrzKT9Ho5l1N1PPEsvD/OVlmary68aoIenSap/Rw1m+HcPKo9OyECrHHTqyX l0ZH3zT3UfgdqhuVaHtmwtdGDYss2KmnntWV/Jz8kLSextkfP0MjhxRoCqm0I1K0rvFw QFszFkwiIXC3rzElh6Au3Fg0QnIbpWDrkz1T1WsFlXEuqN0caQ/utl5KXCfQxRd/8Hjl OhZA== X-Gm-Message-State: ALoCoQkOnO2abWk5n1fXbnK2tCGgFkfuWQPp7RDF1XkUXR1L77a5maAp6jUnMo4bLc1earPFvxrU X-Received: by 10.66.242.238 with SMTP id wt14mr39142164pac.60.1421005582483; Sun, 11 Jan 2015 11:46:22 -0800 (PST) Received: from localhost ([2605:e000:150f:c11f:809f:c598:9edf:7368]) by mx.google.com with ESMTPSA id or4sm12586880pab.30.2015.01.11.11.46.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 11 Jan 2015 11:46:21 -0800 (PST) From: Hong Xu To: linux-wireless@vger.kernel.org Cc: linux@rempel-privat.de, Hong Xu Subject: [PATCH v2] ath9k_htc: Add a module parameter to disable blink Date: Sun, 11 Jan 2015 11:45:53 -0800 Message-Id: <1421005553-19447-1-git-send-email-hong@topbug.net> X-Mailer: git-send-email 2.2.1 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Add an option "blink" to enable or disable the LED blink. The default value is set to 1 so that existing users would not experience any unexpected changes. Signed-off-by: Hong Xu --- drivers/net/wireless/ath/ath9k/htc.h | 3 +++ drivers/net/wireless/ath/ath9k/htc_drv_gpio.c | 4 ++++ drivers/net/wireless/ath/ath9k/htc_drv_init.c | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/drivers/net/wireless/ath/ath9k/htc.h b/drivers/net/wireless/ath/ath9k/htc.h index 9dde265..c43fec5 100644 --- a/drivers/net/wireless/ath/ath9k/htc.h +++ b/drivers/net/wireless/ath/ath9k/htc.h @@ -44,6 +44,9 @@ extern struct ieee80211_ops ath9k_htc_ops; extern int htc_modparam_nohwcrypt; +#ifdef CONFIG_MAC80211_LEDS +extern int led_blink; +#endif enum htc_phymode { HTC_MODE_11NA = 0, diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c index 50f74a2..998b558 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_gpio.c @@ -279,6 +279,10 @@ void ath9k_init_leds(struct ath9k_htc_priv *priv) else priv->ah->led_pin = ATH_LED_PIN_DEF; + if (!led_blink) + priv->led_cdev.default_trigger = + ieee80211_get_radio_led_name(priv->hw); + ath9k_configure_leds(priv); snprintf(priv->led_name, sizeof(priv->led_name), diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_init.c b/drivers/net/wireless/ath/ath9k/htc_drv_init.c index e8fa944..9470127 100644 --- a/drivers/net/wireless/ath/ath9k/htc_drv_init.c +++ b/drivers/net/wireless/ath/ath9k/htc_drv_init.c @@ -39,6 +39,10 @@ module_param_named(ps_enable, ath9k_ps_enable, int, 0444); MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave"); #ifdef CONFIG_MAC80211_LEDS +int led_blink = 1; +module_param_named(blink, led_blink, int, 0444); +MODULE_PARM_DESC(blink, "Enable LED blink on activity"); + static const struct ieee80211_tpt_blink ath9k_htc_tpt_blink[] = { { .throughput = 0 * 1024, .blink_time = 334 }, { .throughput = 1 * 1024, .blink_time = 260 },