All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Hortmann <philipp.g.hortmann@gmail.com>
To: Forest Bond <forest@alittletooquiet.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH 10/11] staging: vt6655: Add missing BE support on 2x iowrite32
Date: Sun, 22 May 2022 21:49:28 +0200	[thread overview]
Message-ID: <974ef7a9244e7caeafd8c176c7b53a6de3c20219.1653203927.git.philipp.g.hortmann@gmail.com> (raw)
In-Reply-To: <cover.1653203927.git.philipp.g.hortmann@gmail.com>

Add missing big-endian support when using two times iowrite32
to write 64 Bit.

Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com>
---
Code for testing:
dev_info(&priv->pcid->dev, "CARDbUpdateTSF little endian before con.: 0x%016llx", qwTSFOffset);
qwTSFOffset =  le64_to_cpu(qwTSFOffset);
dev_info(&priv->pcid->dev, "CARDbUpdateTSF little endian after con. : 0x%016llx", qwTSFOffset);
dev_info(&priv->pcid->dev, "CARDbUpdateTSF big endian:                0x%016llx", be64_to_cpu(qwTSFOffset));

Log
vt6655 0000:01:05.0: CARDbUpdateTSF little endian before con.: 0xff ff ff ff fd b7 d5 fc
vt6655 0000:01:05.0: CARDbUpdateTSF little endian after con. : 0xff ff ff ff fd b7 d5 fc
vt6655 0000:01:05.0: CARDbUpdateTSF big endian:                0xfc d5 b7 fd ff ff ff ff
---
 drivers/staging/vt6655/card.c        | 4 ++++
 drivers/staging/vt6655/device_main.c | 1 +
 2 files changed, 5 insertions(+)

diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c
index 7a4a8b3f164e..abc74a5633c7 100644
--- a/drivers/staging/vt6655/card.c
+++ b/drivers/staging/vt6655/card.c
@@ -293,6 +293,7 @@ bool CARDbUpdateTSF(struct vnt_private *priv, unsigned char byRxRate,
 		qwTSFOffset = CARDqGetTSFOffset(byRxRate, qwBSSTimestamp,
 						local_tsf);
 		/* adjust TSF, HW's TSF add TSF Offset reg */
+		qwTSFOffset =  le64_to_cpu(qwTSFOffset);
 		iowrite32((u32)qwTSFOffset, priv->port_offset + MAC_REG_TSFOFST);
 		iowrite32((u32)(qwTSFOffset >> 32), priv->port_offset + MAC_REG_TSFOFST + 4);
 		MACvRegBitsOn(priv->port_offset, MAC_REG_TFTCTL,
@@ -327,6 +328,7 @@ bool CARDbSetBeaconPeriod(struct vnt_private *priv,
 	iowrite16(wBeaconInterval, priv->port_offset + MAC_REG_BI);
 	priv->wBeaconInterval = wBeaconInterval;
 	/* Set NextTBTT */
+	qwNextTBTT =  le64_to_cpu(qwNextTBTT);
 	iowrite32((u32)qwNextTBTT, priv->port_offset + MAC_REG_NEXTTBTT);
 	iowrite32((u32)(qwNextTBTT >> 32), priv->port_offset + MAC_REG_NEXTTBTT + 4);
 	MACvRegBitsOn(priv->port_offset, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
@@ -795,6 +797,7 @@ void CARDvSetFirstNextTBTT(struct vnt_private *priv,
 
 	qwNextTBTT = CARDqGetNextTBTT(qwNextTBTT, wBeaconInterval);
 	/* Set NextTBTT */
+	qwNextTBTT =  le64_to_cpu(qwNextTBTT);
 	iowrite32((u32)qwNextTBTT, iobase + MAC_REG_NEXTTBTT);
 	iowrite32((u32)(qwNextTBTT >> 32), iobase + MAC_REG_NEXTTBTT + 4);
 	MACvRegBitsOn(iobase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
@@ -821,6 +824,7 @@ void CARDvUpdateNextTBTT(struct vnt_private *priv, u64 qwTSF,
 
 	qwTSF = CARDqGetNextTBTT(qwTSF, wBeaconInterval);
 	/* Set NextTBTT */
+	qwTSF =  le64_to_cpu(qwTSF);
 	iowrite32((u32)qwTSF, iobase + MAC_REG_NEXTTBTT);
 	iowrite32((u32)(qwTSF >> 32), iobase + MAC_REG_NEXTTBTT + 4);
 	MACvRegBitsOn(iobase, MAC_REG_TFTCTL, TFTCTL_TBTTSYNCEN);
diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c
index c32c0328b602..204994692c90 100644
--- a/drivers/staging/vt6655/device_main.c
+++ b/drivers/staging/vt6655/device_main.c
@@ -1529,6 +1529,7 @@ static void vnt_configure(struct ieee80211_hw *hw,
 			} else {
 				MACvSelectPage1(priv->port_offset);
 
+				multicast =  le64_to_cpu(multicast);
 				iowrite32((u32)multicast, priv->port_offset +  MAC_REG_MAR0);
 				iowrite32((u32)(multicast >> 32),
 					  priv->port_offset + MAC_REG_MAR0 + 4);
-- 
2.25.1


  parent reply	other threads:[~2022-05-22 19:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-22 19:48 [PATCH 00/11] staging: vt6655: Replace macro VNSvOutPortW,D with iowrite16,32() Philipp Hortmann
2022-05-22 19:48 ` [PATCH 01/11] staging: vt6655: Replace MACvSetCurrBCNLength with VNSvOutPortW Philipp Hortmann
2022-05-22 19:48 ` [PATCH 02/11] staging: vt6655: Replace VNSvOutPortW with iowrite16 Philipp Hortmann
2022-05-22 19:48 ` [PATCH 03/11] staging: vt6655: Replace MACvWriteISR with VNSvOutPortD Philipp Hortmann
2022-05-22 19:49 ` [PATCH 04/11] staging: vt6655: Replace MACvIntEnable " Philipp Hortmann
2022-05-22 19:49 ` [PATCH 05/11] staging: vt6655: Replace MACvIntDisable " Philipp Hortmann
2022-05-22 19:49 ` [PATCH 06/11] staging: vt6655: Replace MACvSetCurrBCNTxDescAddr " Philipp Hortmann
2022-05-22 19:49 ` [PATCH 07/11] staging: vt6655: Replace MACvRx0PerPktMode " Philipp Hortmann
2022-05-22 19:49 ` [PATCH 08/11] staging: vt6655: Replace MACvRx1PerPktMode " Philipp Hortmann
2022-05-22 19:49 ` [PATCH 09/11] staging: vt6655: Replace VNSvOutPortD with iowrite32 Philipp Hortmann
2022-05-22 19:49 ` Philipp Hortmann [this message]
2022-05-22 19:49 ` [PATCH 11/11] staging: vt6655: Delete upc.h Philipp Hortmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=974ef7a9244e7caeafd8c176c7b53a6de3c20219.1653203927.git.philipp.g.hortmann@gmail.com \
    --to=philipp.g.hortmann@gmail.com \
    --cc=forest@alittletooquiet.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.