aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath9k/mac.h
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2010-10-15 19:01:48 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-11-09 16:13:25 -0500
commitada9f1cacb66b74a68254521bb5e3ca4eb8fa871 (patch)
treeb8a256f5f4bd42c9ec37102638cc49e1a11eb242 /drivers/net/wireless/ath/ath9k/mac.h
parentf0e94b479c987abef17eb18e5c8e0ed178d00cd4 (diff)
ath9k_hw: optimize all descriptor access functions
Because all of the descriptor data structures are marked as __packed, GCC assumes the worst case wrt. alignment and generates unaligned load/store instructions on MIPS for access to all fields. Since descriptors always have to be 4-byte-aligned, we can just mark the data structures with __aligned(4), which allows GCC to generate much more efficient code. Verified through disassembly and OProfile comparisons. Signed-off-by: Felix Fietkau <nbd@openwrt.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath9k/mac.h')
-rw-r--r--drivers/net/wireless/ath/ath9k/mac.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/wireless/ath/ath9k/mac.h b/drivers/net/wireless/ath/ath9k/mac.h
index fdc25074ca1f..22907e21cc46 100644
--- a/drivers/net/wireless/ath/ath9k/mac.h
+++ b/drivers/net/wireless/ath/ath9k/mac.h
@@ -237,7 +237,7 @@ struct ath_desc {
237 u32 ds_ctl1; 237 u32 ds_ctl1;
238 u32 ds_hw[20]; 238 u32 ds_hw[20];
239 void *ds_vdata; 239 void *ds_vdata;
240} __packed; 240} __packed __aligned(4);
241 241
242#define ATH9K_TXDESC_CLRDMASK 0x0001 242#define ATH9K_TXDESC_CLRDMASK 0x0001
243#define ATH9K_TXDESC_NOACK 0x0002 243#define ATH9K_TXDESC_NOACK 0x0002
@@ -307,7 +307,7 @@ struct ar5416_desc {
307 u32 status8; 307 u32 status8;
308 } rx; 308 } rx;
309 } u; 309 } u;
310} __packed; 310} __packed __aligned(4);
311 311
312#define AR5416DESC(_ds) ((struct ar5416_desc *)(_ds)) 312#define AR5416DESC(_ds) ((struct ar5416_desc *)(_ds))
313#define AR5416DESC_CONST(_ds) ((const struct ar5416_desc *)(_ds)) 313#define AR5416DESC_CONST(_ds) ((const struct ar5416_desc *)(_ds))