carl9170 toolchain: update to gcc 9.1.0
authorChristian Lamparter <chunkeey@gmail.com>
Sun, 5 May 2019 09:17:45 +0000 (11:17 +0200)
committerChristian Lamparter <chunkeey@gmail.com>
Sun, 5 May 2019 09:17:45 +0000 (11:17 +0200)
gcc will now be warning about conflicting alignments
when a pointer from a packed structure is in play.

the include headers will likely need further fixes, but
we can wait until the linux kernel folks know how they
want to deal with ieee80211.h.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
carlfw/include/wl.h
carlfw/src/hostif.c
carlfw/src/wlantx.c
include/linux/ieee80211.h
include/shared/wlan.h
toolchain/Makefile
toolchain/SHA256SUMS

index 8499ca2d41682b443b42ff6f502fc41440f69011..5566be426406b47c17b0862cc264a231d413ba1b 100644 (file)
@@ -237,7 +237,7 @@ static inline __inline void unhide_super(struct dma_desc *desc)
        desc->totalLen += sizeof(struct carl9170_tx_superdesc);
 }
 
-static inline __inline __hot void read_tsf(uint32_t *tsf)
+static inline __inline __hot void read_tsf(uint32_t tsf[static 2])
 {
        /*
         * "According to the [hardware] documentation:
index 73e89c7137ad237b5712a1f751f49c8421d70fbc..06726dbdf7d9c6e47b9556ef0a550c4b6c61a205 100644 (file)
@@ -213,10 +213,14 @@ void handle_cmd(struct carl9170_rsp *resp)
                fw.reboot = 1;
                break;
 
-       case CARL9170_CMD_READ_TSF:
+       case CARL9170_CMD_READ_TSF: {
+               uint32_t tmptsf[2];
+
+               read_tsf(tmptsf);
                resp->hdr.len = 8;
-               read_tsf((uint32_t *)resp->tsf.tsf);
+               memcpy(resp->tsf.tsf, tmptsf, sizeof(tmptsf));
                break;
+               }
 
        case CARL9170_CMD_RX_FILTER:
                resp->hdr.len = 0;
index 474c040f46fd3d08a7be28f920526bf459fc1830..a8d09522d3619c2d7934d79d74be3dd01414a17c 100644 (file)
@@ -260,7 +260,7 @@ static void __wlan_tx(struct dma_desc *desc)
 
        if (unlikely(super->s.fill_in_tsf)) {
                struct ieee80211_mgmt *mgmt = (void *) &super->f.data.i3e;
-               uint32_t *tsf = (uint32_t *) &mgmt->u.probe_resp.timestamp;
+               uint32_t tmptsf[2];
 
                /*
                 * Truth be told: this is a hack.
@@ -272,7 +272,8 @@ static void __wlan_tx(struct dma_desc *desc)
                 * (even, if it's got an accurate atomic clock source).
                 */
 
-               read_tsf(tsf);
+               read_tsf(tmptsf);
+               memcpy(&mgmt->u.probe_resp.timestamp, tmptsf, sizeof(tmptsf));
        }
 
        wlan_tx_ampdu(super);
index 31c59eac2b59fea407bdbeab861d45c93a9fdc0d..46ce6cf06fc925b362f7283338522c9f4adfbf15 100644 (file)
@@ -897,33 +897,33 @@ struct ieee80211_mgmt {
                        __le16 status_code;
                        /* possibly followed by Challenge text */
                        u8 variable[0];
-               } __packed auth;
+               } __packed __aligned(4) auth;
                struct {
                        __le16 reason_code;
-               } __packed deauth;
+               } __packed __aligned(4) deauth;
                struct {
                        __le16 capab_info;
                        __le16 listen_interval;
                        /* followed by SSID and Supported rates */
                        u8 variable[0];
-               } __packed assoc_req;
+               } __packed __aligned(4) assoc_req;
                struct {
                        __le16 capab_info;
                        __le16 status_code;
                        __le16 aid;
                        /* followed by Supported rates */
                        u8 variable[0];
-               } __packed assoc_resp, reassoc_resp;
+               } __packed __aligned(4) assoc_resp, reassoc_resp;
                struct {
                        __le16 capab_info;
                        __le16 listen_interval;
                        u8 current_ap[6];
                        /* followed by SSID and Supported rates */
                        u8 variable[0];
-               } __packed reassoc_req;
+               } __packed __aligned(4) reassoc_req;
                struct {
                        __le16 reason_code;
-               } __packed disassoc;
+               } __packed __aligned(4) disassoc;
                struct {
                        __le64 timestamp;
                        __le16 beacon_int;
@@ -931,11 +931,11 @@ struct ieee80211_mgmt {
                        /* followed by some of SSID, Supported rates,
                         * FH Params, DS Params, CF Params, IBSS Params, TIM */
                        u8 variable[0];
-               } __packed beacon;
+               } __packed __aligned(4) beacon;
                struct {
                        /* only variable items: SSID, Supported rates */
                        u8 variable[0];
-               } __packed probe_req;
+               } __packed __aligned(4) probe_req;
                struct {
                        __le64 timestamp;
                        __le16 beacon_int;
@@ -943,7 +943,7 @@ struct ieee80211_mgmt {
                        /* followed by some of SSID, Supported rates,
                         * FH Params, DS Params, CF Params, IBSS Params */
                        u8 variable[0];
-               } __packed probe_resp;
+               } __packed __aligned(4) probe_resp;
                struct {
                        u8 category;
                        union {
@@ -1041,8 +1041,8 @@ struct ieee80211_mgmt {
                                        u8 variable[0];
                                } __packed ftm;
                        } u;
-               } __packed action;
-       } u;
+               } __packed __aligned(4) action;
+       } u __aligned(2);
 } __packed __aligned(2);
 
 /* Supported rates membership selectors */
@@ -1245,7 +1245,7 @@ struct ieee80211_bar {
        __u8 ta[6];
        __le16 control;
        __le16 start_seq_num;
-} __packed __aligned(4);
+} __packed __aligned(2);
 
 /* 802.11 BA(R) control masks */
 #define IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL   0x0000
index 9c6b7ffb92286f0d0d0c2d345401e66fa1c98e0e..117f005f20b931a34c2201b5921e23bcc80de026 100644 (file)
@@ -273,7 +273,7 @@ struct ar9170_tx_frame {
                struct ieee80211_hdr i3e;
                u8 payload[0];
        } data;
-} __packed;
+} __packed __aligned(4);
 
 struct carl9170_tx_superframe {
        struct carl9170_tx_superdesc s;
index cfa351c4c4be260ccdace046bd5737f2fffa7c0c..e7a0be773f80fabcecbc2f3769699c44e56d81eb 100644 (file)
@@ -6,7 +6,7 @@ NEWLIB_VER=3.1.0
 NEWLIB_TAR=newlib-$(NEWLIB_VER).tar.gz
 NEWLIB_URL="ftp://sourceware.org/pub/newlib/$(NEWLIB_TAR)"
 
-GCC_VER=8.3.0
+GCC_VER=9.1.0
 GCC_TAR=gcc-$(GCC_VER).tar.xz
 GCC_URL="http://mirrors.kernel.org/gnu/gcc/gcc-$(GCC_VER)/$(GCC_TAR)"
 
index 647d674794e0c6325f4352f598c56c0ce0a6a47e..3a5395960186f470687803a8bc19f02263fbdac8 100644 (file)
@@ -1,20 +1,6 @@
-1cf7adf8ff4b5aa49041c8734bbcf1ad18cc4c94d0029aae0f4e48841088479a  src/gcc-7.2.0.tar.xz
-5b76a9b97c9464209772ed25ce55181a7bb144a66e5669aaec945aa64da3189b  src/newlib-2.5.0.tar.gz
-0b871e271c4c620444f8264f72143b4d224aa305306d85dd77ab8dce785b1e85  src/binutils-2.29.tar.xz
 87b565e89a9a684fe4ebeeddb8399dce2599f9c9049854ca8c0dfbdea0e21912  src/gmp-6.1.2.tar.xz
-617decc6ea09889fb08ede330917a00b16809b8db88c29c31bfbb49cbf88ecc3  src/mpc-1.0.3.tar.gz
-7a62ac1a04408614fccdc506e4844b10cf0ad2c2b1677097f8f35d3a1344a950  src/mpfr-3.1.6.tar.xz
 6985c538143c1208dcb1ac42cedad6ff52e267b47e5f970183a3e75125b43c2e  src/mpc-1.1.0.tar.gz
-fbe2cd1418b321f5c899ce4f0f0f4e73f5ecc7d02145b0e1fd096f5c3afb8a1d  src/mpfr-4.0.0.tar.xz
-c8566335ee74e5fcaeb8595b4ebd0400c4b043d6acb3263ecb1314f8f5501332  src/newlib-3.0.0.tar.gz
-832ca6ae04636adbb430e865a1451adf6979ab44ca1c8374f61fba65645ce15c  src/gcc-7.3.0.tar.xz
-e7010a46969f9d3e53b650a518663f98a5dde3c3ae21b7d71e5e6803bc36b577  src/binutils-2.29.1.tar.xz
-67874a60826303ee2fb6affc6dc0ddd3e749e9bfcb4c8655e3953d0458a6e16e  src/mpfr-4.0.1.tar.xz
-6e46b8aeae2f727a36f0bd9505e405768a72218f1796f0d09757d45209871ae6  src/binutils-2.30.tar.xz
-1d1866f992626e61349a1ccd0b8d5253816222cdc13390dcfaa74b093aa2b153  src/gcc-8.1.0.tar.xz
-5d20086ecf5752cc7d9134246e9588fa201740d540f7eb84d795b1f7a93bca86  src/binutils-2.31.1.tar.xz
-196c3c04ba2613f893283977e6011b2345d1cd1af9abeac58e916b1aab3e0080  src/gcc-8.2.0.tar.xz
 fb4fa1cc21e9060719208300a61420e4089d6de6ef59cf533b57fe74801d102a  src/newlib-3.1.0.tar.gz
 1d3be708604eae0e42d578ba93b390c2a145f17743a744d8f3f8c2ad5855a38a  src/mpfr-4.0.2.tar.xz
 0ab6c55dd86a92ed561972ba15b9b70a8b9f75557f896446c82e8b36e473ee04  src/binutils-2.32.tar.xz
-64baadfe6cc0f4947a84cb12d7f0dfaf45bb58b7e92461639596c21e02d97d2c  src/gcc-8.3.0.tar.xz
+79a66834e96a6050d8fe78db2c3b32fb285b230b855d0a66288235bc04b327a0  src/gcc-9.1.0.tar.xz