diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-07-02 14:53:02 +0300 |
---|---|---|
committer | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2015-08-04 10:11:44 +0300 |
commit | 31f920b63ae8ff5bf278a00dd8478e58ed89ff95 (patch) | |
tree | 5096a9ac36987a043742b10194a29b2756acb08b /drivers/net/wireless | |
parent | 33b56af188ddbd1027b7eaff7abb1507b708f155 (diff) | |
download | op-kernel-dev-31f920b63ae8ff5bf278a00dd8478e58ed89ff95.zip op-kernel-dev-31f920b63ae8ff5bf278a00dd8478e58ed89ff95.tar.gz |
iwlwifi: pcie: don't warn on long MPDUs when supported
In iwlmvm firmwares, the Byte count written in the scheduler
byte count table is in DWORDs and not in bytes.
We should check that this value fits in the 12 bits and
the value can be either in bits of in DWORD or bytes
depending on the firmware. Check the value after the
translation to DWORDs is done (if needed).
Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r-- | drivers/net/wireless/iwlwifi/pcie/tx.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c index c6572ff..90d02d5f 100644 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c @@ -219,8 +219,6 @@ static void iwl_pcie_txq_update_byte_cnt_tbl(struct iwl_trans *trans, scd_bc_tbl = trans_pcie->scd_bc_tbls.addr; - WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX); - sta_id = tx_cmd->sta_id; sec_ctl = tx_cmd->sec_ctl; @@ -239,6 +237,9 @@ static void iwl_pcie_txq_update_byte_cnt_tbl(struct iwl_trans *trans, if (trans_pcie->bc_table_dword) len = DIV_ROUND_UP(len, 4); + if (WARN_ON(len > 0xFFF || write_ptr >= TFD_QUEUE_SIZE_MAX)) + return; + bc_ent = cpu_to_le16(len | (sta_id << 12)); scd_bc_tbl[txq_id].tfd_offset[write_ptr] = bc_ent; |