iwlwifi: pcie: some little cleanups
do some little cleanups in tx.c - eliminate duplicate checks, use locally cached fields and predefined macros. Signed-off-by: Eliad Peller <eliad@wizery.com> Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
e89044d75e
commit
1092b9bc0c
1 changed files with 4 additions and 7 deletions
|
@ -451,13 +451,10 @@ static int iwl_pcie_txq_build_tfd(struct iwl_trans *trans, struct iwl_txq *txq,
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (WARN_ON(addr & ~DMA_BIT_MASK(36)))
|
if (WARN(addr & ~IWL_TX_DMA_MASK,
|
||||||
|
"Unaligned address = %llx\n", (unsigned long long)addr))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
if (unlikely(addr & ~IWL_TX_DMA_MASK))
|
|
||||||
IWL_ERR(trans, "Unaligned address = %llx\n",
|
|
||||||
(unsigned long long)addr);
|
|
||||||
|
|
||||||
iwl_pcie_tfd_set_tb(tfd, num_tbs, addr, len);
|
iwl_pcie_tfd_set_tb(tfd, num_tbs, addr, len);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1631,7 +1628,7 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,
|
||||||
* Check here that the packets are in the right place on the ring.
|
* Check here that the packets are in the right place on the ring.
|
||||||
*/
|
*/
|
||||||
wifi_seq = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
|
wifi_seq = IEEE80211_SEQ_TO_SN(le16_to_cpu(hdr->seq_ctrl));
|
||||||
WARN_ONCE(trans_pcie->txq[txq_id].ampdu &&
|
WARN_ONCE(txq->ampdu &&
|
||||||
(wifi_seq & 0xff) != q->write_ptr,
|
(wifi_seq & 0xff) != q->write_ptr,
|
||||||
"Q: %d WiFi Seq %d tfdNum %d",
|
"Q: %d WiFi Seq %d tfdNum %d",
|
||||||
txq_id, wifi_seq, q->write_ptr);
|
txq_id, wifi_seq, q->write_ptr);
|
||||||
|
@ -1663,7 +1660,7 @@ int iwl_trans_pcie_tx(struct iwl_trans *trans, struct sk_buff *skb,
|
||||||
*/
|
*/
|
||||||
len = sizeof(struct iwl_tx_cmd) + sizeof(struct iwl_cmd_header) +
|
len = sizeof(struct iwl_tx_cmd) + sizeof(struct iwl_cmd_header) +
|
||||||
hdr_len - IWL_HCMD_SCRATCHBUF_SIZE;
|
hdr_len - IWL_HCMD_SCRATCHBUF_SIZE;
|
||||||
tb1_len = (len + 3) & ~3;
|
tb1_len = ALIGN(len, 4);
|
||||||
|
|
||||||
/* Tell NIC about any 2-byte padding after MAC header */
|
/* Tell NIC about any 2-byte padding after MAC header */
|
||||||
if (tb1_len != len)
|
if (tb1_len != len)
|
||||||
|
|
Loading…
Reference in a new issue