Commit 1ea423b0 authored by Luca Coelho's avatar Luca Coelho

iwlwifi: remove unnecessary dev_cmd_headroom parameter

We don't need this parameter anymore, since we always pass 0 anyway.
Remove it from the structure and from all the relevant functions.
Signed-off-by: default avatarLuca Coelho <luciano.coelho@intel.com>
parent bdccdb85
...@@ -70,8 +70,7 @@ ...@@ -70,8 +70,7 @@
struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
struct device *dev, struct device *dev,
const struct iwl_cfg *cfg, const struct iwl_cfg *cfg,
const struct iwl_trans_ops *ops, const struct iwl_trans_ops *ops)
size_t dev_cmd_headroom)
{ {
struct iwl_trans *trans; struct iwl_trans *trans;
#ifdef CONFIG_LOCKDEP #ifdef CONFIG_LOCKDEP
...@@ -90,15 +89,13 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, ...@@ -90,15 +89,13 @@ struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
trans->dev = dev; trans->dev = dev;
trans->cfg = cfg; trans->cfg = cfg;
trans->ops = ops; trans->ops = ops;
trans->dev_cmd_headroom = dev_cmd_headroom;
trans->num_rx_queues = 1; trans->num_rx_queues = 1;
snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name), snprintf(trans->dev_cmd_pool_name, sizeof(trans->dev_cmd_pool_name),
"iwl_cmd_pool:%s", dev_name(trans->dev)); "iwl_cmd_pool:%s", dev_name(trans->dev));
trans->dev_cmd_pool = trans->dev_cmd_pool =
kmem_cache_create(trans->dev_cmd_pool_name, kmem_cache_create(trans->dev_cmd_pool_name,
sizeof(struct iwl_device_cmd) sizeof(struct iwl_device_cmd),
+ trans->dev_cmd_headroom,
sizeof(void *), sizeof(void *),
SLAB_HWCACHE_ALIGN, SLAB_HWCACHE_ALIGN,
NULL); NULL);
......
...@@ -772,9 +772,6 @@ enum iwl_plat_pm_mode { ...@@ -772,9 +772,6 @@ enum iwl_plat_pm_mode {
* the transport must set this before calling iwl_drv_start() * the transport must set this before calling iwl_drv_start()
* @dev_cmd_pool: pool for Tx cmd allocation - for internal use only. * @dev_cmd_pool: pool for Tx cmd allocation - for internal use only.
* The user should use iwl_trans_{alloc,free}_tx_cmd. * The user should use iwl_trans_{alloc,free}_tx_cmd.
* @dev_cmd_headroom: room needed for the transport's private use before the
* device_cmd for Tx - for internal use only
* The user should use iwl_trans_{alloc,free}_tx_cmd.
* @rx_mpdu_cmd: MPDU RX command ID, must be assigned by opmode before * @rx_mpdu_cmd: MPDU RX command ID, must be assigned by opmode before
* starting the firmware, used for tracing * starting the firmware, used for tracing
* @rx_mpdu_cmd_hdr_size: used for tracing, amount of data before the * @rx_mpdu_cmd_hdr_size: used for tracing, amount of data before the
...@@ -825,7 +822,6 @@ struct iwl_trans { ...@@ -825,7 +822,6 @@ struct iwl_trans {
/* The following fields are internal only */ /* The following fields are internal only */
struct kmem_cache *dev_cmd_pool; struct kmem_cache *dev_cmd_pool;
size_t dev_cmd_headroom;
char dev_cmd_pool_name[50]; char dev_cmd_pool_name[50];
struct dentry *dbgfs_dir; struct dentry *dbgfs_dir;
...@@ -998,13 +994,13 @@ iwl_trans_dump_data(struct iwl_trans *trans, ...@@ -998,13 +994,13 @@ iwl_trans_dump_data(struct iwl_trans *trans,
static inline struct iwl_device_cmd * static inline struct iwl_device_cmd *
iwl_trans_alloc_tx_cmd(struct iwl_trans *trans) iwl_trans_alloc_tx_cmd(struct iwl_trans *trans)
{ {
u8 *dev_cmd_ptr = kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC); struct iwl_device_cmd *dev_cmd_ptr =
kmem_cache_alloc(trans->dev_cmd_pool, GFP_ATOMIC);
if (unlikely(dev_cmd_ptr == NULL)) if (unlikely(dev_cmd_ptr == NULL))
return NULL; return NULL;
return (struct iwl_device_cmd *) return dev_cmd_ptr;
(dev_cmd_ptr + trans->dev_cmd_headroom);
} }
int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd); int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
...@@ -1012,9 +1008,7 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd); ...@@ -1012,9 +1008,7 @@ int iwl_trans_send_cmd(struct iwl_trans *trans, struct iwl_host_cmd *cmd);
static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans, static inline void iwl_trans_free_tx_cmd(struct iwl_trans *trans,
struct iwl_device_cmd *dev_cmd) struct iwl_device_cmd *dev_cmd)
{ {
u8 *dev_cmd_ptr = (u8 *)dev_cmd - trans->dev_cmd_headroom; kmem_cache_free(trans->dev_cmd_pool, dev_cmd);
kmem_cache_free(trans->dev_cmd_pool, dev_cmd_ptr);
} }
static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb, static inline int iwl_trans_tx(struct iwl_trans *trans, struct sk_buff *skb,
...@@ -1237,8 +1231,7 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans) ...@@ -1237,8 +1231,7 @@ static inline void iwl_trans_fw_error(struct iwl_trans *trans)
struct iwl_trans *iwl_trans_alloc(unsigned int priv_size, struct iwl_trans *iwl_trans_alloc(unsigned int priv_size,
struct device *dev, struct device *dev,
const struct iwl_cfg *cfg, const struct iwl_cfg *cfg,
const struct iwl_trans_ops *ops, const struct iwl_trans_ops *ops);
size_t dev_cmd_headroom);
void iwl_trans_free(struct iwl_trans *trans); void iwl_trans_free(struct iwl_trans *trans);
/***************************************************** /*****************************************************
......
...@@ -2948,7 +2948,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev, ...@@ -2948,7 +2948,7 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
return ERR_PTR(ret); return ERR_PTR(ret);
trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie), trans = iwl_trans_alloc(sizeof(struct iwl_trans_pcie),
&pdev->dev, cfg, &trans_ops_pcie, 0); &pdev->dev, cfg, &trans_ops_pcie);
if (!trans) if (!trans)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment