iwlwifi: don't use the bus for ucode fw_desc any more
authorEmmanuel Grumbach <emmanuel.grumbach@intel.com>
Tue, 3 Jan 2012 14:28:12 +0000 (16:28 +0200)
committerWey-Yi Guy <wey-yi.w.guy@intel.com>
Thu, 2 Feb 2012 22:36:06 +0000 (14:36 -0800)
This is transport related

Signed-off-by: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
drivers/net/wireless/iwlwifi/iwl-agn.c
drivers/net/wireless/iwlwifi/iwl-trans.h
drivers/net/wireless/iwlwifi/iwl-ucode.c

index d890b6481b8c132c54c9f3cfcaf5a687a8ca8a77..8b1839aec4050d7126beba396f38509e4ef30e5e 100644 (file)
@@ -1023,31 +1023,33 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context)
        /* Runtime instructions and 2 copies of data:
         * 1) unmodified from disk
         * 2) backup cache for save/restore during power-downs */
-       if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_rt.code,
+       if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.code,
                              pieces.inst, pieces.inst_size))
                goto err_pci_alloc;
-       if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_rt.data,
+       if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.data,
                              pieces.data, pieces.data_size))
                goto err_pci_alloc;
 
        /* Initialization instructions and data */
        if (pieces.init_size && pieces.init_data_size) {
-               if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_init.code,
+               if (iwl_alloc_fw_desc(trans(priv),
+                                     &trans(priv)->ucode_init.code,
                                      pieces.init, pieces.init_size))
                        goto err_pci_alloc;
-               if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_init.data,
+               if (iwl_alloc_fw_desc(trans(priv),
+                                     &trans(priv)->ucode_init.data,
                                      pieces.init_data, pieces.init_data_size))
                        goto err_pci_alloc;
        }
 
        /* WoWLAN instructions and data */
        if (pieces.wowlan_inst_size && pieces.wowlan_data_size) {
-               if (iwl_alloc_fw_desc(bus(priv),
+               if (iwl_alloc_fw_desc(trans(priv),
                                      &trans(priv)->ucode_wowlan.code,
                                      pieces.wowlan_inst,
                                      pieces.wowlan_inst_size))
                        goto err_pci_alloc;
-               if (iwl_alloc_fw_desc(bus(priv),
+               if (iwl_alloc_fw_desc(trans(priv),
                                      &trans(priv)->ucode_wowlan.data,
                                      pieces.wowlan_data,
                                      pieces.wowlan_data_size))
index dec935a84a7fea201e1647075f0a645c43037049..d51959984174fa9c505c479747c0a68c1b2fb9ce 100644 (file)
@@ -408,7 +408,7 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs)
 /*****************************************************
 * Utils functions
 ******************************************************/
-int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
+int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc,
                      const void *data, size_t len);
 void iwl_dealloc_ucode(struct iwl_trans *trans);
 
index 08483d785e2c54139eeb7572fc943dcef1c90cb9..793524a3ed707815bef54db820e6dfa64ff41581 100644 (file)
@@ -80,29 +80,29 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = {
  *
  ******************************************************************************/
 
-static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc)
+static void iwl_free_fw_desc(struct iwl_trans *trans, struct fw_desc *desc)
 {
        if (desc->v_addr)
-               dma_free_coherent(trans(bus)->dev, desc->len,
+               dma_free_coherent(trans->dev, desc->len,
                                  desc->v_addr, desc->p_addr);
        desc->v_addr = NULL;
        desc->len = 0;
 }
 
-static void iwl_free_fw_img(struct iwl_bus *bus, struct fw_img *img)
+static void iwl_free_fw_img(struct iwl_trans *trans, struct fw_img *img)
 {
-       iwl_free_fw_desc(bus, &img->code);
-       iwl_free_fw_desc(bus, &img->data);
+       iwl_free_fw_desc(trans, &img->code);
+       iwl_free_fw_desc(trans, &img->data);
 }
 
 void iwl_dealloc_ucode(struct iwl_trans *trans)
 {
-       iwl_free_fw_img(bus(trans), &trans->ucode_rt);
-       iwl_free_fw_img(bus(trans), &trans->ucode_init);
-       iwl_free_fw_img(bus(trans), &trans->ucode_wowlan);
+       iwl_free_fw_img(trans, &trans->ucode_rt);
+       iwl_free_fw_img(trans, &trans->ucode_init);
+       iwl_free_fw_img(trans, &trans->ucode_wowlan);
 }
 
-int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
+int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc,
                      const void *data, size_t len)
 {
        if (!len) {
@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc,
                return -EINVAL;
        }
 
-       desc->v_addr = dma_alloc_coherent(trans(bus)->dev, len,
+       desc->v_addr = dma_alloc_coherent(trans->dev, len,
                                          &desc->p_addr, GFP_KERNEL);
        if (!desc->v_addr)
                return -ENOMEM;