summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
diff options
context:
space:
mode:
authorSara Sharon <sara.sharon@intel.com>2016-06-26 13:17:56 +0300
committerLuca Coelho <luciano.coelho@intel.com>2016-09-16 09:10:21 +0300
commit6983ba6951139c99f0692c94f83d8d75ea559bcc (patch)
tree474b72204352c91f3e2d59041834753a2d4af8df /drivers/net/wireless/intel/iwlwifi/pcie/trans.c
parent8aacf4b73fe87bc8fbe75a83862f411b52b7f272 (diff)
downloadblackbird-obmc-linux-6983ba6951139c99f0692c94f83d8d75ea559bcc.tar.gz
blackbird-obmc-linux-6983ba6951139c99f0692c94f83d8d75ea559bcc.zip
iwlwifi: pcie: assign and access a000 TFD & TBs
Previous patch introduced the new formats. This patch allocates the new structures and adjusts code accordingly. Signed-off-by: Sara Sharon <sara.sharon@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/pcie/trans.c')
-rw-r--r--drivers/net/wireless/intel/iwlwifi/pcie/trans.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
index 21b1be11100a..e908bb8e10b6 100644
--- a/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/intel/iwlwifi/pcie/trans.c
@@ -2437,15 +2437,14 @@ err:
}
#endif /*CONFIG_IWLWIFI_DEBUGFS */
-static u32 iwl_trans_pcie_get_cmdlen(struct iwl_trans *trans,
- struct iwl_tfd *tfd)
+static u32 iwl_trans_pcie_get_cmdlen(struct iwl_trans *trans, void *tfd)
{
struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
u32 cmdlen = 0;
int i;
for (i = 0; i < trans_pcie->max_tbs; i++)
- cmdlen += iwl_pcie_tfd_tb_get_len(tfd, i);
+ cmdlen += iwl_pcie_tfd_tb_get_len(trans, tfd, i);
return cmdlen;
}
@@ -2733,7 +2732,8 @@ static struct iwl_trans_dump_data
u8 idx = get_cmd_index(&cmdq->q, ptr);
u32 caplen, cmdlen;
- cmdlen = iwl_trans_pcie_get_cmdlen(trans, &cmdq->tfds[ptr]);
+ cmdlen = iwl_trans_pcie_get_cmdlen(trans, cmdq->tfds +
+ trans_pcie->tfd_size * ptr);
caplen = min_t(u32, TFD_MAX_PAYLOAD_SIZE, cmdlen);
if (cmdlen) {
@@ -2876,10 +2876,14 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
else
addr_size = 36;
- if (cfg->use_tfh)
+ if (cfg->use_tfh) {
trans_pcie->max_tbs = IWL_TFH_NUM_TBS;
- else
+ trans_pcie->tfd_size = sizeof(struct iwl_tfh_tb);
+
+ } else {
trans_pcie->max_tbs = IWL_NUM_OF_TBS;
+ trans_pcie->tfd_size = sizeof(struct iwl_tfd);
+ }
trans->max_skb_frags = IWL_PCIE_MAX_FRAGS(trans_pcie);
pci_set_master(pdev);
OpenPOWER on IntegriCloud