linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Machek <pma@sysgo.com>
To: Larry Finger <Larry.Finger@lwfinger.net>,
	ath9k-devel@venema.h4ckr.net, Sujith.Manoharan@atheros.com
Cc: kernel list <linux-kernel@vger.kernel.org>,
	chunkeey@googlemail.com, linux-wireless@vger.kernel.org,
	rudolf.marek@sysgo.com, cko@sysgo.com, mfa@sysgo.com,
	anl@sysgo.com
Subject: [PATCH?] do structures need to be packed? [was Re: ath9k_htc vs. powerpc (was Re: working usb wifi card, that is still possible to buy)]
Date: Fri, 26 Nov 2010 12:37:00 +0100	[thread overview]
Message-ID: <20101126113700.GB28137@pma.sysgo.com> (raw)
In-Reply-To: <20101126112737.GB11857@pma.sysgo.com>

Hi!

I'm not sure if all the structures shared with hardware are properly
marked as packed. In particular, htc_rx_status contains big endian
data, so it might need packing...? Not sure about others.

...you probably do not want to apply all of this...

Unfortunately, it does not solve the problem on powerpc...
								Pavel
Signed-off-by: Pavel Machek <pma@sysgo.com>

diff --git a/drivers/net/wireless/ath/ath9k/htc_hst.h b/drivers/net/wireless/ath/ath9k/htc_hst.h
index 07b6509..79ef4e7 100644
--- a/drivers/net/wireless/ath/ath9k/htc_hst.h
+++ b/drivers/net/wireless/ath/ath9k/htc_hst.h
@@ -89,7 +89,7 @@ struct htc_packet {
 
 	void *context;
 	u32 reserved;
-};
+} __packed;
 
 struct htc_ep_callbacks {
 	void *priv;
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index 7c1a34d..2afbfc0 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -127,7 +127,7 @@ struct ath_tx_status {
 	u32 evm0;
 	u32 evm1;
 	u32 evm2;
-};
+} __packed;
 
 struct ath_rx_status {
 	u32 rs_tstamp;
@@ -154,7 +154,7 @@ struct ath_rx_status {
 	u32 evm2;
 	u32 evm3;
 	u32 evm4;
-};
+} __packed;
 
 struct ath_htc_rx_status {
 	__be64 rs_tstamp;
@@ -180,7 +180,7 @@ struct ath_htc_rx_status {
 	__be32 evm0;
 	__be32 evm1;
 	__be32 evm2;
-};
+} __packed;
 
 #define ATH9K_RXERR_CRC           0x01
 #define ATH9K_RXERR_PHY           0x02
@@ -297,7 +297,7 @@ struct ar5416_desc {
 			u32 status7;
 			u32 status8;
 			u32 status9;
-		} tx;
+		} __packed tx;
 		struct {
 			u32 status0;
 			u32 status1;
@@ -308,7 +308,7 @@ struct ar5416_desc {
 			u32 status6;
 			u32 status7;
 			u32 status8;
-		} rx;
+		} __packed rx;
 	} u;
 } __packed;
 
@@ -658,7 +658,7 @@ struct ath9k_11n_rate_series {
 	u32 PktDuration;
 	u32 ChSel;
 	u32 RateFlags;
-};
+} __packed;
 
 enum ath9k_key_type {
 	ATH9K_KEY_TYPE_CLEAR,

  parent reply	other threads:[~2010-11-26 11:37 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-03  9:24 working usb wifi card, that is still possible to buy Pavel Machek
2010-11-05  9:26 ` Josh Lehan
2010-11-05 13:15   ` Larry Finger
2010-11-05 17:54     ` Johannes Berg
2010-11-05 20:12       ` Larry Finger
2010-11-06 10:43         ` Christian Lamparter
2010-11-08  7:19           ` Pavel Machek
2010-11-24  8:16 ` Pavel Machek
2010-11-24  8:42   ` Johannes Berg
2010-11-24  9:57     ` Pavel Machek
2010-11-24 13:13   ` Pavel Machek
2010-11-24 15:48     ` Larry Finger
2010-11-26  8:31       ` ath9k_htc vs. powerpc (was Re: working usb wifi card, that is still possible to buy) Pavel Machek
2010-11-26 10:20         ` Pavel Machek
2010-11-26 11:27           ` Pavel Machek
2010-11-26 11:35             ` [PATCH] ath9k_htc: cleanup eeprom endiannes handling Pavel Machek
2010-11-26 11:37             ` Pavel Machek [this message]
2010-11-26 11:47             ` ath9k_htc vs. powerpc (was Re: working usb wifi card, that is still possible to buy) Sujith
2010-11-26 12:37               ` Pavel Machek
2010-11-29  9:58                 ` [PATCH] fix endianity on ath9k_htc Pavel Machek
2010-11-29 11:46                   ` [ath9k-devel] " Felix Fietkau
2010-11-29 12:07                     ` Pavel Machek
2010-11-29 12:11                       ` [patch] remove unneeded prototype " Pavel Machek
2010-11-29  9:59                 ` [PATCH] ath9k_htc cleanups Pavel Machek
2010-11-29 11:34                   ` [PATCH] ath9k_htc more cleanups Pavel Machek
2010-11-29 10:01                 ` ath9k_htc vs. powerpc (was Re: working usb wifi card, that is still possible to buy) Pavel Machek
2010-11-29 12:37                   ` Sujith
2010-11-29 12:48                     ` Pavel Machek
2010-11-29 12:57                     ` Pavel Machek
2010-11-29 13:28                       ` Sujith
2010-11-29 12:16                 ` Sujith
2010-12-06  8:37     ` working usb wifi card, that is still possible to buy Pavel Machek
2010-12-06 15:30       ` Larry Finger

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=20101126113700.GB28137@pma.sysgo.com \
    --to=pma@sysgo.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=Sujith.Manoharan@atheros.com \
    --cc=anl@sysgo.com \
    --cc=ath9k-devel@venema.h4ckr.net \
    --cc=chunkeey@googlemail.com \
    --cc=cko@sysgo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=mfa@sysgo.com \
    --cc=rudolf.marek@sysgo.com \
    /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;
as well as URLs for NNTP newsgroup(s).