From patchwork Mon Feb 26 09:09:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bas Vermeulen X-Patchwork-Id: 10241731 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 50F96602DC for ; Mon, 26 Feb 2018 09:10:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 456D228418 for ; Mon, 26 Feb 2018 09:10:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 39D1829DD5; Mon, 26 Feb 2018 09:10:09 +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 7DFB428418 for ; Mon, 26 Feb 2018 09:10:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752306AbeBZJKH (ORCPT ); Mon, 26 Feb 2018 04:10:07 -0500 Received: from blackstar.xs4all.nl ([83.163.96.30]:41310 "EHLO blackstar.xs4all.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbeBZJKF (ORCPT ); Mon, 26 Feb 2018 04:10:05 -0500 Received: from alienware17 (unknown [192.168.3.91]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by blackstar.xs4all.nl (Postfix) with ESMTP id E27EE34056C; Mon, 26 Feb 2018 10:09:18 +0100 (CET) Date: Mon, 26 Feb 2018 10:09:17 +0100 From: Bas Vermeulen To: linux-wireless@vger.kernel.org Cc: ath9k-devel@qca.qualcomm.com Subject: [PATCH] ath9k: introduce endian_check module parameter Message-ID: <20180226090917.7iabysywbv6h4rqr@alienware17> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170609 (1.8.3) X-blackstar.nl-MailScanner-Information: Please contact the ISP for more information X-blackstar.nl-MailScanner-ID: E27EE34056C.A8B38 X-blackstar.nl-MailScanner: Found to be clean X-blackstar.nl-MailScanner-From: bvermeul@blackstar.nl 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 A random (little endian eeprom'd) ar9278 card didn't work on my PowerMac G5 without allowing the driver to byte-swap the eeprom. Introduce a module parameter endian_check to allow this to happen, and the PCIe card to function correctly on BE powerpc. Signed-off-by: Bas Vermeulen --- drivers/net/wireless/ath/ath9k/init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/init.c b/drivers/net/wireless/ath/ath9k/init.c index fa58a32227f5..421039dc060a 100644 --- a/drivers/net/wireless/ath/ath9k/init.c +++ b/drivers/net/wireless/ath/ath9k/init.c @@ -67,6 +67,9 @@ static int ath9k_ps_enable; module_param_named(ps_enable, ath9k_ps_enable, int, 0444); MODULE_PARM_DESC(ps_enable, "Enable WLAN PowerSave"); +static int ath9k_endian_check; +module_param_named(endian_check, ath9k_endian_check, int, 0444); +MODULE_PARM_DESC(endian_check, "Check EEPROM for endianness compatibility"); #ifdef CONFIG_ATH9K_CHANNEL_CONTEXT int ath9k_use_chanctx; @@ -587,7 +590,8 @@ static int ath9k_of_init(struct ath_softc *sc) ether_addr_copy(common->macaddr, mac); ah->ah_flags &= ~AH_USE_EEPROM; - ah->ah_flags |= AH_NO_EEP_SWAP; + if (!ath9k_endian_check) + ah->ah_flags |= AH_NO_EEP_SWAP; return 0; }