From 4e5f9d975331db5b0e5e4326d90fe6f6e75bd334 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 4 Jul 2018 21:50:14 -0400 Subject: [PATCH] idualwifi7260: C89 fixes to appease GCC2. --- .../wlan/idualwifi7260/dev/iwm/if_iwm.c | 7 +++---- .../wlan/idualwifi7260/dev/iwm/if_iwm_phy_db.c | 4 ++-- .../wlan/idualwifi7260/dev/iwm/if_iwm_util.c | 3 ++- .../wlan/idualwifi7260/dev/iwm/if_iwmreg.h | 18 +++++++++--------- .../wlan/idualwifi7260/dev/iwm/if_iwmvar.h | 2 +- .../freebsd11_network/compat/sys/cdefs.h | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm.c b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm.c index d3294afe4a..823c2f3005 100644 --- a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm.c +++ b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm.c @@ -1437,9 +1437,8 @@ iwm_nic_rx_init(struct iwm_softc *sc) IWM_WRITE(sc, IWM_FH_MEM_RCSR_CHNL0_CONFIG_REG, IWM_FH_RCSR_RX_CONFIG_CHNL_EN_ENABLE_VAL | IWM_FH_RCSR_CHNL0_RX_IGNORE_RXF_EMPTY | /* HW bug */ -#ifdef __HAIKU__ /* We don't support mbuf refcounts, are required for multiframe */ - IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK | -#endif + /* Haiku doesn't support mbuf refcounts, are required for multiframe */ + /* IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK | */ IWM_FH_RCSR_CHNL0_RX_CONFIG_IRQ_DEST_INT_HOST_VAL | IWM_FH_RCSR_RX_CONFIG_REG_VAL_RB_SIZE_4K | (IWM_RX_RB_TIMEOUT << IWM_FH_RCSR_RX_CONFIG_REG_IRQ_RBTH_POS) | @@ -5539,7 +5538,7 @@ iwm_handle_rxb(struct iwm_softc *sc, struct mbuf *m) ieee80211_runtask(&sc->sc_ic, &sc->sc_es_task); break; } - + case IWM_SCAN_COMPLETE_UMAC: { struct iwm_umac_scan_complete *notif; notif = (void *)pkt->data; diff --git a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_phy_db.c b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_phy_db.c index 75521340bc..ad537dbec3 100644 --- a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_phy_db.c +++ b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_phy_db.c @@ -203,7 +203,7 @@ enum iwm_phy_db_section_type { struct iwm_phy_db_cmd { uint16_t type; uint16_t length; - uint8_t data[]; + uint8_t data[0]; } __packed; /* for parsing of tx power channel group data that comes from the firmware*/ @@ -218,7 +218,7 @@ struct iwm_phy_db_chg_txp { struct iwm_calib_res_notif_phy_db { uint16_t type; uint16_t length; - uint8_t data[]; + uint8_t data[0]; } __packed; struct iwm_phy_db * diff --git a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_util.c b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_util.c index 7b379a41f3..4c1f2c3238 100644 --- a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_util.c +++ b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwm_util.c @@ -225,11 +225,12 @@ iwm_send_cmd(struct iwm_softc *sc, struct iwm_host_cmd *hcmd) } if (paylen > datasz) { + size_t totlen; IWM_DPRINTF(sc, IWM_DEBUG_CMD, "large command paylen=%u len0=%u\n", paylen, hcmd->len[0]); /* Command is too large */ - size_t totlen = hdrlen + paylen; + totlen = hdrlen + paylen; if (paylen > IWM_MAX_CMD_PAYLOAD_SIZE) { device_printf(sc->sc_dev, "firmware command too long (%zd bytes)\n", diff --git a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmreg.h b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmreg.h index 42819f64f1..bd9c0029bc 100644 --- a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmreg.h +++ b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmreg.h @@ -844,7 +844,7 @@ struct iwm_fw_cipher_scheme { */ struct iwm_fw_cscheme_list { uint8_t size; - struct iwm_fw_cipher_scheme cs[]; + struct iwm_fw_cipher_scheme cs[0]; } __packed; /* @@ -2012,7 +2012,7 @@ struct iwm_nvm_access_cmd { uint16_t type; uint16_t offset; uint16_t length; - uint8_t data[]; + uint8_t data[0]; } __packed; /* IWM_NVM_ACCESS_CMD_API_S_VER_2 */ #define IWM_NUM_OF_FW_PAGING_BLOCKS 33 /* 32 for data and 1 block for CSS */ @@ -2066,7 +2066,7 @@ struct iwm_nvm_access_resp { uint16_t length; uint16_t type; uint16_t status; - uint8_t data[]; + uint8_t data[0]; } __packed; /* IWM_NVM_ACCESS_CMD_RESP_API_S_VER_2 */ /* IWM_MVM_ALIVE 0x1 */ @@ -4932,7 +4932,7 @@ struct iwm_scan_req_lmac { uint32_t delay; struct iwm_scan_schedule_lmac schedule[IWM_MAX_SCHED_SCAN_PLANS]; struct iwm_scan_channel_opt channel_opt[2]; - uint8_t data[]; + uint8_t data[0]; } __packed; /** @@ -5100,7 +5100,7 @@ struct iwm_lmac_scan_complete_notif { uint8_t last_channel; uint32_t tsf_low; uint32_t tsf_high; - struct iwm_scan_results_notif results[]; + struct iwm_scan_results_notif results[0]; } __packed; @@ -5203,7 +5203,7 @@ struct iwm_scan_config { uint8_t mac_addr[IEEE80211_ADDR_LEN]; uint8_t bcast_sta_id; uint8_t channel_flags; - uint8_t channel_array[]; + uint8_t channel_array[0]; } __packed; /* SCAN_CONFIG_DB_CMD_API_S */ /** @@ -5322,7 +5322,7 @@ struct iwm_scan_req_umac { uint8_t channel_flags; uint8_t n_channels; uint16_t reserved; - uint8_t data[]; + uint8_t data[0]; } __packed; /* SCAN_REQUEST_CMD_UMAC_API_S_VER_1 */ /** @@ -5419,7 +5419,7 @@ struct iwm_umac_scan_iter_complete_notif { uint8_t last_channel; uint32_t tsf_low; uint32_t tsf_high; - struct iwm_scan_results_notif results[]; + struct iwm_scan_results_notif results[0]; } __packed; /* SCAN_ITER_COMPLETE_NTF_UMAC_API_S_VER_1 */ /* Please keep this enum *SORTED* by hex value. @@ -6086,7 +6086,7 @@ struct iwm_rx_packet { */ uint32_t len_n_flags; struct iwm_cmd_header hdr; - uint8_t data[]; + uint8_t data[0]; } __packed; #define IWM_FH_RSCSR_FRAME_SIZE_MSK 0x00003fff diff --git a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmvar.h b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmvar.h index 85d21a7891..86a486340f 100644 --- a/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmvar.h +++ b/src/add-ons/kernel/drivers/network/wlan/idualwifi7260/dev/iwm/if_iwmvar.h @@ -233,7 +233,7 @@ struct iwm_nvm_data { uint8_t max_tx_pwr_half_dbm; boolean_t lar_enabled; - uint16_t nvm_ch_flags[]; + uint16_t nvm_ch_flags[0]; }; /* max bufs per tfd the driver will use */ diff --git a/src/libs/compat/freebsd11_network/compat/sys/cdefs.h b/src/libs/compat/freebsd11_network/compat/sys/cdefs.h index f5efc6d043..6813d75d94 100644 --- a/src/libs/compat/freebsd11_network/compat/sys/cdefs.h +++ b/src/libs/compat/freebsd11_network/compat/sys/cdefs.h @@ -323,7 +323,7 @@ #define ___Static_assert(x, y) typedef char __assert_ ## y[(x) ? 1 : -1] \ __unused #else -#define _Static_assert(x, y) struct __hack +#define _Static_assert(x, y) #endif #endif