idualwifi7260: GCC2 fixes.

This commit is contained in:
Augustin Cavalier 2019-01-07 21:05:13 -05:00
parent 53e3d3f593
commit 908c8ced92
4 changed files with 14 additions and 13 deletions

View File

@ -1440,10 +1440,10 @@ 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__
//#ifdef __HAIKU__
/* multi-frame RX seems to cause UAFs and double-frees */
IWM_FH_RCSR_CHNL0_RX_CONFIG_SINGLE_FRAME_MSK |
#endif
//#endif
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) |

View File

@ -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",

View File

@ -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;
/**
@ -5107,7 +5107,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;
@ -5210,7 +5210,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 */
/**
@ -5329,7 +5329,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 */
/**
@ -5426,7 +5426,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.
@ -6093,7 +6093,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

View File

@ -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 */