diff options
author | Mordechay Goodstein <mordechay.goodstein@intel.com> | 2020-09-24 16:23:35 +0300 |
---|---|---|
committer | Luca Coelho <luciano.coelho@intel.com> | 2020-10-01 21:56:46 +0300 |
commit | a26014e2de3fff25a0647be40c84b9161b4962bc (patch) | |
tree | 6129ecae9eb27cbaaf3cd0ff649f810132e95000 /drivers/net/wireless/intel/iwlwifi/iwl-trans.c | |
parent | fda1bd0d4a6b3a7de020aa329661661fc14aee7a (diff) | |
download | linux-a26014e2de3fff25a0647be40c84b9161b4962bc.tar.xz |
iwlwifi: move bc_pool to a common trans header
The bc_pool code is not directly related to the PCIe transport,
so move the structures it uses to the common iwl-trans.h header.
Signed-off-by: Mordechay Goodstein <mordechay.goodstein@intel.com>
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Link: https://lore.kernel.org/r/iwlwifi.20200924162105.f6469c62665d.Id920f1ae8f70886b66a98956a6412726d29a9481@changeid
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Diffstat (limited to 'drivers/net/wireless/intel/iwlwifi/iwl-trans.c')
-rw-r--r-- | drivers/net/wireless/intel/iwlwifi/iwl-trans.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c index 4a61ab56d728..105776b39792 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-trans.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-trans.c @@ -66,6 +66,7 @@ #include "iwl-trans.h" #include "iwl-drv.h" #include "iwl-fh.h" +#include <linux/dmapool.h> struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, struct device *dev, @@ -110,6 +111,22 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, trans->ops = ops; trans->num_rx_queues = 1; + if (trans->trans_cfg->device_family >= IWL_DEVICE_FAMILY_AX210) + trans->txqs.bc_tbl_size = sizeof(struct iwl_gen3_bc_tbl); + else + trans->txqs.bc_tbl_size = sizeof(struct iwlagn_scd_bc_tbl); + /* + * For gen2 devices, we use a single allocation for each byte-count + * table, but they're pretty small (1k) so use a DMA pool that we + * allocate here. + */ + if (trans->trans_cfg->gen2) { + trans->txqs.bc_pool = dmam_pool_create("iwlwifi:bc", dev, + trans->txqs.bc_tbl_size, + 256, 0); + if (!trans->txqs.bc_pool) + return NULL; + } snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name), "iwl_cmd_pool:%s", dev_name(trans->dev)); trans->dev_cmd_pool = |