lkml.org 
[lkml]   [2010]   [Nov]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
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)]
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,

\
 
 \ /
  Last update: 2010-11-26 12:39    [W:0.073 / U:12.144 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site