Linux wireless drivers development
 help / color / mirror / Atom feed
From: "Franky Lin" <frankyl@broadcom.com>
To: gregkh@suse.de
Cc: devel@linuxdriverproject.org, linux-wireless@vger.kernel.org
Subject: [PATCH v2 04/19] staging: brcm80211: sparse endianness warnings for struct sdpcm_shared
Date: Thu, 22 Sep 2011 17:07:41 -0700	[thread overview]
Message-ID: <1316736476-23725-5-git-send-email-frankyl@broadcom.com> (raw)
In-Reply-To: <1316736476-23725-1-git-send-email-frankyl@broadcom.com>

From: Roland Vossen <rvossen@broadcom.com>

Structure that is received from dongle has been annotated.

Reported-by: Johannes Berg <johannes@sipsolutions.net>
Reviewed-by: Arend van Spriel <arend@broadcom.com>
Reviewed-by: Franky Lin <frankyl@broadcom.com>
Signed-off-by: Franky Lin <frankyl@broadcom.com>
---
 drivers/staging/brcm80211/brcmfmac/dhd_sdio.c |   31 +++++++++++++++++-------
 1 files changed, 22 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 57001d4..9d4850d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -530,6 +530,17 @@ struct sdpcm_shared {
 	u8 tag[32];
 };
 
+struct sdpcm_shared_le {
+	__le32 flags;
+	__le32 trap_addr;
+	__le32 assert_exp_addr;
+	__le32 assert_file_addr;
+	__le32 assert_line;
+	__le32 console_addr;	/* Address of struct rte_console */
+	__le32 msgtrace_addr;
+	u8 tag[32];
+};
+
 
 /* misc chip info needed by some of the routines */
 struct chip_info {
@@ -2919,6 +2930,7 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
 	u32 addr;
 	__le32 addr_le;
 	int rv;
+	struct sdpcm_shared_le sh_le;
 
 	/* Read last word in memory to determine address of
 			 sdpcm_shared structure */
@@ -2942,19 +2954,20 @@ brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
 	}
 
 	/* Read rte_shared structure */
-	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) sh,
-			      sizeof(struct sdpcm_shared));
+	rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) &sh_le,
+			      sizeof(struct sdpcm_shared_le));
 	if (rv < 0)
 		return rv;
 
 	/* Endianness */
-	sh->flags = le32_to_cpu(sh->flags);
-	sh->trap_addr = le32_to_cpu(sh->trap_addr);
-	sh->assert_exp_addr = le32_to_cpu(sh->assert_exp_addr);
-	sh->assert_file_addr = le32_to_cpu(sh->assert_file_addr);
-	sh->assert_line = le32_to_cpu(sh->assert_line);
-	sh->console_addr = le32_to_cpu(sh->console_addr);
-	sh->msgtrace_addr = le32_to_cpu(sh->msgtrace_addr);
+	sh->flags = le32_to_cpu(sh_le.flags);
+	sh->trap_addr = le32_to_cpu(sh_le.trap_addr);
+	sh->assert_exp_addr = le32_to_cpu(sh_le.assert_exp_addr);
+	sh->assert_file_addr = le32_to_cpu(sh_le.assert_file_addr);
+	sh->assert_line = le32_to_cpu(sh_le.assert_line);
+	sh->console_addr = le32_to_cpu(sh_le.console_addr);
+	sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
+	memcpy(sh->tag, sh_le.tag, sizeof(sh->tag));
 
 	if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
 		brcmf_dbg(ERROR, "sdpcm_shared version %d in brcmf is different than sdpcm_shared version %d in dongle\n",
-- 
1.7.1



  parent reply	other threads:[~2011-09-23  0:08 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23  0:07 [PATCH v2 00/19] staging: brcm80211: 7th reaction for mainline patch #2 Franky Lin
2011-09-23  0:07 ` [PATCH v2 01/19] staging: brcm80211: sparse endianness warnings on dongle events Franky Lin
2011-09-23  0:07 ` [PATCH v2 02/19] staging: brcm80211: various fulmac sparse endianness fixes Franky Lin
2011-09-23  0:07 ` [PATCH v2 03/19] staging: brcm80211: sparse endianness warnings for struct brcmf_proto_cdc_ioctl Franky Lin
2011-09-23  0:07 ` Franky Lin [this message]
2011-09-23  0:07 ` [PATCH v2 05/19] staging: brcm80211: more fullmac sparse endianness scan related changes Franky Lin
2011-09-23  0:07 ` [PATCH v2 06/19] staging: brcm80211: remove unconditional code blocks from brcmfmac Franky Lin
2011-09-23  0:07 ` [PATCH v2 07/19] staging: brcm80211: remove event handler thread from fullmac Franky Lin
2011-09-23  0:07 ` [PATCH v2 08/19] staging: brcm80211: remove fullmac module_param brcmf_dongle_memsize Franky Lin
2011-09-23  0:07 ` [PATCH v2 09/19] staging: brcm80211: remove fullmac module_param brcmf_sdiod_drive_strength Franky Lin
2011-09-23  0:07 ` [PATCH v2 10/19] staging: brcm80211: remove fullmac module_param for watchdog Franky Lin
2011-09-23  0:07 ` [PATCH v2 11/19] staging: brcm80211: remove fullmac module_param brcmf_idletime Franky Lin
2011-09-23  0:07 ` [PATCH v2 12/19] staging: brcm80211: remove global variables for data frame boundary Franky Lin
2011-09-23  0:07 ` [PATCH v2 13/19] staging: brcm80211: removed two fullmac sparse spinlock warnings Franky Lin
2011-09-23  0:07 ` [PATCH v2 14/19] staging: brcm80211: added endianness check flag to fullmac Makefile Franky Lin
2011-09-23  0:07 ` [PATCH v2 15/19] staging: brcm80211: removed likely/unlikely calls Franky Lin
2011-09-23  0:07 ` [PATCH v2 16/19] staging: brcm80211: removed log after kzalloc()/kmalloc() failure Franky Lin
2011-09-23  0:07 ` [PATCH v2 17/19] staging: brcm80211: clarified fullmac io and event codes Franky Lin
2011-09-23  0:07 ` [PATCH v2 18/19] staging: brcm80211: consistent naming of struct net_device *ndev Franky Lin
2011-09-23  0:07 ` [PATCH v2 19/19] staging: brcm80211: simplified internal ioctl function once more Franky Lin

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=1316736476-23725-5-git-send-email-frankyl@broadcom.com \
    --to=frankyl@broadcom.com \
    --cc=devel@linuxdriverproject.org \
    --cc=gregkh@suse.de \
    --cc=linux-wireless@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox