From patchwork Wed Jan 27 00:33:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Cieslakiewicz X-Patchwork-Id: 573783 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.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 8741A140BD6 for ; Wed, 27 Jan 2016 11:50:10 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=wp.pl header.i=@wp.pl header.b=BRnNo32x; dkim-atps=neutral Received: from arrakis.dune.hu (localhost [127.0.0.1]) by arrakis.dune.hu (Postfix) with ESMTP id 204B328C03F; Wed, 27 Jan 2016 01:48:40 +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=-2.5 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RP_MATCHES_RCVD,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 E071928BFB0 for ; Wed, 27 Jan 2016 01:48:22 +0100 (CET) X-policyd-weight: using cached result; rate: -5.5 Received: from mx3.wp.pl (mx3.wp.pl [212.77.101.10]) by arrakis.dune.hu (Postfix) with ESMTPS for ; Wed, 27 Jan 2016 01:48:20 +0100 (CET) Received: (wp-smtpd smtp.wp.pl 5709 invoked from network); 27 Jan 2016 01:49:02 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wp.pl; s=1024a; t=1453855742; bh=4cQPxostdoy75ce4U5APG+0DIS9+i9sO5C2Hiz6leP8=; h=From:To:Cc:Subject; b=BRnNo32xWrfS9olYgkNebB+FhWU8QQL/9LbuSzf4hHFi/BdBoGhLaux80LpeyB/mu pp0vBF9QTyLPCQA3Rcjt2cFzNdFUhETXbTdMdzW2cru5yxzAmki9Awx+xyiPcDx/es CB00GVpv7RU2l2MN53iyw0HbovCEYJVn7J8OX5Ts= Received: from 89-71-116-5.dynamic.chello.pl (HELO kosmio) (michal.cieslakiewicz@[89.71.116.5]) (envelope-sender ) by smtp.wp.pl (WP-SMTPD) with ECDHE-RSA-AES256-GCM-SHA384 encrypted SMTP for ; 27 Jan 2016 01:49:02 +0100 Date: Wed, 27 Jan 2016 01:33:09 +0100 From: Michal To: Hartmut Knaack Message-ID: <20160127013309.10c854e9@kosmio> In-Reply-To: <20160127010415.7bcf7198@kosmio> References: <56a01420c5aba5.36587961@wp.pl> <56A2C125.1090505@gmx.de> <20160127010415.7bcf7198@kosmio> X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.29; x86_64-slackware-linux-gnu) MIME-Version: 1.0 X-WP-MailID: 00b5e1f346ff30401df5250988c4a96f X-WP-AV: skaner antywirusowy poczty Wirtualnej Polski S. A. X-WP-SPAM: NO 0000000 [gWOE] Cc: openwrt-devel@lists.openwrt.org Subject: [OpenWrt-Devel] [PATCH 1/8] ath9k: enable platform WLAN LED name 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" From: Michal Cieslakiewicz Enable platform-supplied WLAN LED name for ath9k device. Signed-off-by: Michal Cieslakiewicz Acked-by: Hartmut Knaack --- .../patches/546-ath9k_platform_led_name.patch | 35 ++++++++++++++++++++++ .../ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c | 12 ++++++++ .../ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h | 3 ++ .../generic/files/include/linux/ath9k_platform.h | 1 + 4 files changed, 51 insertions(+) create mode 100644 package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch diff --git a/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch new file mode 100644 index 0000000..04e312d --- /dev/null +++ b/package/kernel/mac80211/patches/546-ath9k_platform_led_name.patch @@ -0,0 +1,35 @@ +--- a/drivers/net/wireless/ath/ath9k/gpio.c ++++ b/drivers/net/wireless/ath/ath9k/gpio.c +@@ -132,15 +132,19 @@ void ath_init_leds(struct ath_softc *sc) + if (AR_SREV_9100(sc->sc_ah)) + return; + +- snprintf(led_name, sizeof(led_name), "ath9k-%s", +- wiphy_name(sc->hw->wiphy)); ++ if (pdata && pdata->led_name) ++ strncpy(led_name, pdata->led_name, sizeof(led_name)); ++ else ++ snprintf(led_name, sizeof(led_name), "ath9k-%s", ++ wiphy_name(sc->hw->wiphy)); + + if (ath9k_led_blink) + trigger = sc->led_default_trigger; + else + trigger = ieee80211_get_radio_led_name(sc->hw); + +- ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, !sc->sc_ah->config.led_active_high); ++ ath_create_gpio_led(sc, sc->sc_ah->led_pin, led_name, trigger, ++ !sc->sc_ah->config.led_active_high); + + if (!pdata) + return; +--- a/include/linux/ath9k_platform.h ++++ b/include/linux/ath9k_platform.h +@@ -45,6 +45,7 @@ struct ath9k_platform_data { + + int num_leds; + const struct gpio_led *leds; ++ const char *led_name; + }; + + #endif /* _LINUX_ATH9K_PLATFORM_H */ diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c index d382453..bf80d4d 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.c @@ -39,6 +39,18 @@ __init void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin) } } +__init void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name) +{ + switch (wmac) { + case 0: + ap9x_wmac0_data.led_name = led_name; + break; + case 1: + ap9x_wmac1_data.led_name = led_name; + break; + } +} + __init struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) { switch (wmac) { diff --git a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h index ad288cb..dcfe541 100644 --- a/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h +++ b/target/linux/ar71xx/files/arch/mips/ath79/dev-ap9x-pci.h @@ -19,6 +19,7 @@ void ap9x_pci_setup_wmac_led_pin(unsigned wmac, int pin); void ap9x_pci_setup_wmac_gpio(unsigned wmac, u32 mask, u32 val); void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, int num_leds); +void ap9x_pci_setup_wmac_led_name(unsigned wmac, const char *led_name); struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac); void ap91_pci_init(u8 *cal_data, u8 *mac_addr); @@ -33,6 +34,8 @@ static inline void ap9x_pci_setup_wmac_gpio(unsigned wmac, static inline void ap9x_pci_setup_wmac_leds(unsigned wmac, struct gpio_led *leds, int num_leds) {} +static inline void ap9x_pci_setup_wmac_led_name(unsigned wmac, + const char *led_name) {} static inline struct ath9k_platform_data *ap9x_pci_get_wmac_data(unsigned wmac) { return NULL; diff --git a/target/linux/generic/files/include/linux/ath9k_platform.h b/target/linux/generic/files/include/linux/ath9k_platform.h index 30ce216..823e5ac 100644 --- a/target/linux/generic/files/include/linux/ath9k_platform.h +++ b/target/linux/generic/files/include/linux/ath9k_platform.h @@ -45,6 +45,7 @@ struct ath9k_platform_data { int num_leds; const struct gpio_led *leds; + const char *led_name; }; #endif /* _LINUX_ATH9K_PLATFORM_H */