| .. | .. |
|---|
| 5 | 5 | * |
|---|
| 6 | 6 | * GPL LICENSE SUMMARY |
|---|
| 7 | 7 | * |
|---|
| 8 | | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
|---|
| 9 | 8 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 10 | 9 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
|---|
| 11 | | - * Copyright(c) 2018 - 2019 Intel Corporation |
|---|
| 10 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
|---|
| 12 | 11 | * |
|---|
| 13 | 12 | * This program is free software; you can redistribute it and/or modify |
|---|
| 14 | 13 | * it under the terms of version 2 of the GNU General Public License as |
|---|
| .. | .. |
|---|
| 28 | 27 | * |
|---|
| 29 | 28 | * BSD LICENSE |
|---|
| 30 | 29 | * |
|---|
| 31 | | - * Copyright(c) 2012 - 2014 Intel Corporation. All rights reserved. |
|---|
| 32 | 30 | * Copyright(c) 2013 - 2015 Intel Mobile Communications GmbH |
|---|
| 33 | 31 | * Copyright(c) 2016 - 2017 Intel Deutschland GmbH |
|---|
| 34 | | - * Copyright(c) 2018 - 2019 Intel Corporation |
|---|
| 32 | + * Copyright(c) 2012 - 2014, 2018 - 2020 Intel Corporation |
|---|
| 35 | 33 | * All rights reserved. |
|---|
| 36 | 34 | * |
|---|
| 37 | 35 | * Redistribution and use in source and binary forms, with or without |
|---|
| .. | .. |
|---|
| 71 | 69 | struct iwl_shared_mem_cfg *mem_cfg = (void *)pkt->data; |
|---|
| 72 | 70 | int i, lmac; |
|---|
| 73 | 71 | int lmac_num = le32_to_cpu(mem_cfg->lmac_num); |
|---|
| 72 | + u8 api_ver = iwl_fw_lookup_notif_ver(fwrt->fw, SYSTEM_GROUP, |
|---|
| 73 | + SHARED_MEM_CFG_CMD, 0); |
|---|
| 74 | 74 | |
|---|
| 75 | 75 | if (WARN_ON(lmac_num > ARRAY_SIZE(mem_cfg->lmac_smem))) |
|---|
| 76 | 76 | return; |
|---|
| .. | .. |
|---|
| 79 | 79 | fwrt->smem_cfg.num_txfifo_entries = |
|---|
| 80 | 80 | ARRAY_SIZE(mem_cfg->lmac_smem[0].txfifo_size); |
|---|
| 81 | 81 | fwrt->smem_cfg.rxfifo2_size = le32_to_cpu(mem_cfg->rxfifo2_size); |
|---|
| 82 | + |
|---|
| 83 | + if (api_ver >= 4 && |
|---|
| 84 | + !WARN_ON_ONCE(iwl_rx_packet_payload_len(pkt) < sizeof(*mem_cfg))) { |
|---|
| 85 | + fwrt->smem_cfg.rxfifo2_control_size = |
|---|
| 86 | + le32_to_cpu(mem_cfg->rxfifo2_control_size); |
|---|
| 87 | + } |
|---|
| 82 | 88 | |
|---|
| 83 | 89 | for (lmac = 0; lmac < lmac_num; lmac++) { |
|---|
| 84 | 90 | struct iwl_shared_mem_lmac_cfg *lmac_cfg = |
|---|
| .. | .. |
|---|
| 151 | 157 | } |
|---|
| 152 | 158 | |
|---|
| 153 | 159 | pkt = cmd.resp_pkt; |
|---|
| 154 | | - if (fwrt->trans->cfg->device_family >= IWL_DEVICE_FAMILY_22000) |
|---|
| 160 | + if (fwrt->trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_22000) |
|---|
| 155 | 161 | iwl_parse_shared_mem_22000(fwrt, pkt); |
|---|
| 156 | 162 | else |
|---|
| 157 | 163 | iwl_parse_shared_mem(fwrt, pkt); |
|---|