From patchwork Sun Oct 2 22:29:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Blumenstingl X-Patchwork-Id: 9359819 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 E66CE608A6 for ; Sun, 2 Oct 2016 22:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E84AE28A75 for ; Sun, 2 Oct 2016 22:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DACDE28A77; Sun, 2 Oct 2016 22:29:41 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, 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 2014828A60 for ; Sun, 2 Oct 2016 22:29:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751827AbcJBW31 (ORCPT ); Sun, 2 Oct 2016 18:29:27 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34297 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751425AbcJBW3X (ORCPT ); Sun, 2 Oct 2016 18:29:23 -0400 Received: by mail-wm0-f68.google.com with SMTP id b201so6848267wmb.1; Sun, 02 Oct 2016 15:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=Gvx2SWgi5Y9OVduw2CWp0dxVv8jhy6OGPds/w79l3AE=; b=ZbYoO895ktBUeYfdBZEiLKANavBLpZxC2R3Pf4SjYFDguaMfsfEQYLn46EUxF+Lxkl 7dW0TOHA9EjqGiA3eVzs0zRsz6qaS0zuWPMKvre7th0pQXTghVsNomOtNCuca+HCiBVm nyy9nfmXYgoLpbfzxI+evbtC9KXRqqjasBW0aYl4Sx5bwcstKKh9Cc/01t2R3D4Jdvrk QnjatFtQBsRw7/b2VPpEvnLBLQYRvrPz1OVV1Xrt+CsExlyP8omAEIJHTeJYaFtbjEiJ v99tyV4e+aO8/gyUT+wAvda4Ys858hrXwn1Yy/cVK4onK3a5bGd9PlhDnBXUkNpci0GA dEOQ== 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:in-reply-to :references; bh=Gvx2SWgi5Y9OVduw2CWp0dxVv8jhy6OGPds/w79l3AE=; b=CA2QdSAmweZmX/HuQX6OM8qRf8ixmVKupsbjH515sJME4VMQQgOD9rHroLXv6auXHY G8K/OyQPho3r5tFjjLuZof36XpDCfT9QxaF0raYWs213moArAYK9j9RtgQpNTOQOLqv8 9uxKEXFtG14/7yRsFC74z2aRNQjueMTexv1ykY6feKQFX4gPxntZ7T/Mb1/D+d7RA5L8 l/MC+rSpzZo+ib8/ffuMd2/zw6aGHD0KMVBqza3roqkMpC2PIjKGNzGeLIGA4HbniurU QLko3ubXS5d/hOUAX8dJV34NVJ+LcaoOuwkof5oJGgRW6ujjLH7Mpkkga8LQv3w4jiuD IfKg== X-Gm-Message-State: AA6/9RneogDz1AygQ8ZWmofD48OraWUapVNSs2g559in5VwluR2a7wnJd3T89tPzUwmQmg== X-Received: by 10.28.52.210 with SMTP id b201mr6417194wma.32.1475447361034; Sun, 02 Oct 2016 15:29:21 -0700 (PDT) Received: from blackbox.darklights.net (p200300DCD3D4610440DF0B34A14E22AB.dip0.t-ipconnect.de. [2003:dc:d3d4:6104:40df:b34:a14e:22ab]) by smtp.googlemail.com with ESMTPSA id t65sm15817064wmt.15.2016.10.02.15.29.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Oct 2016 15:29:20 -0700 (PDT) From: Martin Blumenstingl To: kvalo@codeaurora.org, ath9k-devel@qca.qualcomm.com, linux-wireless@vger.kernel.org, ath9k-devel@lists.ath9k.org, devicetree@vger.kernel.org, arnd@arndb.de Cc: chunkeey@googlemail.com, nbd@nbd.name, Martin Blumenstingl Subject: [PATCH v2 2/7] ath9k: indicate that the AR9003 EEPROM template values are little endian Date: Mon, 3 Oct 2016 00:29:08 +0200 Message-Id: <20161002222913.12223-3-martin.blumenstingl@googlemail.com> X-Mailer: git-send-email 2.10.0 In-Reply-To: <20161002222913.12223-1-martin.blumenstingl@googlemail.com> References: <20160821144906.30984-1-martin.blumenstingl@googlemail.com> <20161002222913.12223-1-martin.blumenstingl@googlemail.com> 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 The eepMisc field was not set explicitly. The default value of 0 means that the values in the EEPROM (template) should be interpreted as little endian. However, this is not clear until comparing the AR9003 code with the other EEPROM formats. To make the code easier to understand we explicitly state that the values are little endian - there are no functional changes with this patch. Signed-off-by: Martin Blumenstingl --- drivers/net/wireless/ath/ath9k/ar9003_eeprom.c | 10 +++++----- drivers/net/wireless/ath/ath9k/ar9003_eeprom.h | 3 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c index ea7b819..270d4ae 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.c @@ -53,7 +53,7 @@ static const struct ar9300_eeprom ar9300_default = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, }, .rfSilent = 0, .blueToothOptions = 0, @@ -631,7 +631,7 @@ static const struct ar9300_eeprom ar9300_x113 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, }, .rfSilent = 0, .blueToothOptions = 0, @@ -1210,7 +1210,7 @@ static const struct ar9300_eeprom ar9300_h112 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, }, .rfSilent = 0, .blueToothOptions = 0, @@ -1789,7 +1789,7 @@ static const struct ar9300_eeprom ar9300_x112 = { .txrxMask = 0x77, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, }, .rfSilent = 0, .blueToothOptions = 0, @@ -2367,7 +2367,7 @@ static const struct ar9300_eeprom ar9300_h116 = { .txrxMask = 0x33, /* 4 bits tx and 4 bits rx */ .opCapFlags = { .opFlags = AR5416_OPFLAGS_11G | AR5416_OPFLAGS_11A, - .eepMisc = 0, + .eepMisc = AR9300_EEPMISC_LITTLE_ENDIAN, }, .rfSilent = 0, .blueToothOptions = 0, diff --git a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h index 0a4c736..7dc7205 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h +++ b/drivers/net/wireless/ath/ath9k/ar9003_eeprom.h @@ -69,6 +69,9 @@ #define AR9300_BASE_ADDR 0x3ff #define AR9300_BASE_ADDR_512 0x1ff +/* AR5416_EEPMISC_BIG_ENDIAN not set indicates little endian */ +#define AR9300_EEPMISC_LITTLE_ENDIAN 0 + #define AR9300_OTP_BASE \ ((AR_SREV_9340(ah) || AR_SREV_9550(ah)) ? 0x30000 : 0x14000) #define AR9300_OTP_STATUS \