carl9170 firmware: introduce __aligned compiler attribute v2
authorChristian Lamparter <chunkeey@googlemail.com>
Sat, 16 Oct 2010 16:42:35 +0000 (18:42 +0200)
committerChristian Lamparter <chunkeey@googlemail.com>
Sat, 16 Oct 2010 19:35:57 +0000 (21:35 +0200)
This patch reduces the firmware image size considerably.

Signed-off-by: Christian Lamparter <chunkeey@googlemail.com>
carlfw/include/dma.h
include/linux/compiler.h
include/linux/ieee80211.h
include/shared/fwcmd.h

index 0f45e513bcf98d9b1db1d94f3a3cd0b76b65add7..ea905f5dca21df60d545b9ca0c168544300e81ad 100644 (file)
@@ -44,7 +44,7 @@ struct dma_desc {
                void *dataAddr;
        } __packed;
        struct dma_desc *nextAddr;      /* Next TD address */
-} __packed;
+} __packed __aligned(4);
 
 /* (Up, Dn, 5x Tx, Rx), USB Int, (5x delayed Tx + retry), CAB, BA */
 #define AR9170_TERMINATOR_NUMBER_B     8
@@ -169,8 +169,8 @@ struct ar9170_data_block {
 struct ar9170_dma_memory {
        struct dma_desc                 terminator[AR9170_TERMINATOR_NUMBER];
        struct dma_desc                 block[AR9170_BLOCK_NUMBER];
-       struct ar9170_data_block        data[AR9170_BLOCK_NUMBER] __attribute__((aligned(BLOCK_ALIGNMENT)));
-       struct carl9170_sram_reserved   reserved __attribute__((aligned(BLOCK_ALIGNMENT)));
+       struct ar9170_data_block        data[AR9170_BLOCK_NUMBER] __aligned(BLOCK_ALIGNMENT);
+       struct carl9170_sram_reserved   reserved __aligned(BLOCK_ALIGNMENT);
 };
 
 extern struct ar9170_dma_memory dma_mem;
index ec4edf7f66dde9c378cad379c021f4d2173ba5a9..f6f144449a78d8c3ff687d879f340b51bfe2dc08 100644 (file)
@@ -25,6 +25,7 @@
 #define __unused       __attribute__((unused))
 #define __force                __attribute__((force))
 #define __section(s)   __attribute__((section("." # s)))
+#define __aligned(a)   __attribute__((aligned(a)))
 #define __packed       __attribute__((packed))
 
 #define BUILD_BUG_ON(condition)        ((void)sizeof(char[1 - 2*!!(condition)]))
index c0cde48df6589eeea0c65219e1e849c2c5447963..8abd5d50ae4bc2ec8341956faa73cc50b5516f54 100644 (file)
@@ -799,7 +799,7 @@ struct ieee80211_bar {
        __u8 ta[6];
        __le16 control;
        __le16 start_seq_num;
-} __attribute__((packed));
+} __attribute__((packed)) __aligned(4);
 
 /* 802.11 BA(R) control masks */
 #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL     0x0000
index d552166db5059149cd8e653fb2e1154dfba85173..6bd374a39dcd91975497d7c2a536111f20cb3806 100644 (file)
@@ -97,13 +97,13 @@ struct carl9170_set_key_cmd {
        __le16          type;
        u8              macAddr[6];
        u32             key[4];
-} __packed;
+} __packed __aligned(4);
 #define CARL9170_SET_KEY_CMD_SIZE              28
 
 struct carl9170_disable_key_cmd {
        __le16          user;
        __le16          padding;
-} __packed;
+} __packed __aligned(4);
 #define CARL9170_DISABLE_KEY_CMD_SIZE          4
 
 struct carl9170_u32_list {
@@ -206,7 +206,7 @@ struct carl9170_cmd {
                struct carl9170_rx_filter_cmd   rx_filter;
                u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
        } __packed;
-} __packed;
+} __packed __aligned(4);
 
 #define        CARL9170_TX_STATUS_QUEUE        3
 #define        CARL9170_TX_STATUS_QUEUE_S      0
@@ -279,6 +279,6 @@ struct carl9170_rsp {
                struct carl9170_psm             psm;
                u8 data[CARL9170_MAX_CMD_PAYLOAD_LEN];
        } __packed;
-} __packed;
+} __packed __aligned(4);
 
 #endif /* __CARL9170_SHARED_FWCMD_H */