diff options
author | Emmanuel Grumbach <emmanuel.grumbach@intel.com> | 2012-01-03 09:28:12 -0500 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2012-02-02 17:36:06 -0500 |
commit | 8467ab4f42396a3714b59ca187f470542970ff9d (patch) | |
tree | f6e861b268a4f10e63a2861cc8bf8e08f73f965d /drivers | |
parent | ea4caade104490de0fadb64660f9e228c050fb3d (diff) |
iwlwifi: don't use the bus for ucode fw_desc any more
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 14 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-trans.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-ucode.c | 20 |
3 files changed, 19 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index d890b6481b8..8b1839aec40 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -1023,31 +1023,33 @@ static void iwl_ucode_callback(const struct firmware *ucode_raw, void *context) | |||
1023 | /* Runtime instructions and 2 copies of data: | 1023 | /* Runtime instructions and 2 copies of data: |
1024 | * 1) unmodified from disk | 1024 | * 1) unmodified from disk |
1025 | * 2) backup cache for save/restore during power-downs */ | 1025 | * 2) backup cache for save/restore during power-downs */ |
1026 | if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_rt.code, | 1026 | if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.code, |
1027 | pieces.inst, pieces.inst_size)) | 1027 | pieces.inst, pieces.inst_size)) |
1028 | goto err_pci_alloc; | 1028 | goto err_pci_alloc; |
1029 | if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_rt.data, | 1029 | if (iwl_alloc_fw_desc(trans(priv), &trans(priv)->ucode_rt.data, |
1030 | pieces.data, pieces.data_size)) | 1030 | pieces.data, pieces.data_size)) |
1031 | goto err_pci_alloc; | 1031 | goto err_pci_alloc; |
1032 | 1032 | ||
1033 | /* Initialization instructions and data */ | 1033 | /* Initialization instructions and data */ |
1034 | if (pieces.init_size && pieces.init_data_size) { | 1034 | if (pieces.init_size && pieces.init_data_size) { |
1035 | if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_init.code, | 1035 | if (iwl_alloc_fw_desc(trans(priv), |
1036 | &trans(priv)->ucode_init.code, | ||
1036 | pieces.init, pieces.init_size)) | 1037 | pieces.init, pieces.init_size)) |
1037 | goto err_pci_alloc; | 1038 | goto err_pci_alloc; |
1038 | if (iwl_alloc_fw_desc(bus(priv), &trans(priv)->ucode_init.data, | 1039 | if (iwl_alloc_fw_desc(trans(priv), |
1040 | &trans(priv)->ucode_init.data, | ||
1039 | pieces.init_data, pieces.init_data_size)) | 1041 | pieces.init_data, pieces.init_data_size)) |
1040 | goto err_pci_alloc; | 1042 | goto err_pci_alloc; |
1041 | } | 1043 | } |
1042 | 1044 | ||
1043 | /* WoWLAN instructions and data */ | 1045 | /* WoWLAN instructions and data */ |
1044 | if (pieces.wowlan_inst_size && pieces.wowlan_data_size) { | 1046 | if (pieces.wowlan_inst_size && pieces.wowlan_data_size) { |
1045 | if (iwl_alloc_fw_desc(bus(priv), | 1047 | if (iwl_alloc_fw_desc(trans(priv), |
1046 | &trans(priv)->ucode_wowlan.code, | 1048 | &trans(priv)->ucode_wowlan.code, |
1047 | pieces.wowlan_inst, | 1049 | pieces.wowlan_inst, |
1048 | pieces.wowlan_inst_size)) | 1050 | pieces.wowlan_inst_size)) |
1049 | goto err_pci_alloc; | 1051 | goto err_pci_alloc; |
1050 | if (iwl_alloc_fw_desc(bus(priv), | 1052 | if (iwl_alloc_fw_desc(trans(priv), |
1051 | &trans(priv)->ucode_wowlan.data, | 1053 | &trans(priv)->ucode_wowlan.data, |
1052 | pieces.wowlan_data, | 1054 | pieces.wowlan_data, |
1053 | pieces.wowlan_data_size)) | 1055 | pieces.wowlan_data_size)) |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index dec935a84a7..d5195998417 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -408,7 +408,7 @@ static inline u32 iwl_trans_read32(struct iwl_trans *trans, u32 ofs) | |||
408 | /***************************************************** | 408 | /***************************************************** |
409 | * Utils functions | 409 | * Utils functions |
410 | ******************************************************/ | 410 | ******************************************************/ |
411 | int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, | 411 | int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc, |
412 | const void *data, size_t len); | 412 | const void *data, size_t len); |
413 | void iwl_dealloc_ucode(struct iwl_trans *trans); | 413 | void iwl_dealloc_ucode(struct iwl_trans *trans); |
414 | 414 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-ucode.c b/drivers/net/wireless/iwlwifi/iwl-ucode.c index 08483d785e2..793524a3ed7 100644 --- a/drivers/net/wireless/iwlwifi/iwl-ucode.c +++ b/drivers/net/wireless/iwlwifi/iwl-ucode.c | |||
@@ -80,29 +80,29 @@ static struct iwl_wimax_coex_event_entry cu_priorities[COEX_NUM_OF_EVENTS] = { | |||
80 | * | 80 | * |
81 | ******************************************************************************/ | 81 | ******************************************************************************/ |
82 | 82 | ||
83 | static void iwl_free_fw_desc(struct iwl_bus *bus, struct fw_desc *desc) | 83 | static void iwl_free_fw_desc(struct iwl_trans *trans, struct fw_desc *desc) |
84 | { | 84 | { |
85 | if (desc->v_addr) | 85 | if (desc->v_addr) |
86 | dma_free_coherent(trans(bus)->dev, desc->len, | 86 | dma_free_coherent(trans->dev, desc->len, |
87 | desc->v_addr, desc->p_addr); | 87 | desc->v_addr, desc->p_addr); |
88 | desc->v_addr = NULL; | 88 | desc->v_addr = NULL; |
89 | desc->len = 0; | 89 | desc->len = 0; |
90 | } | 90 | } |
91 | 91 | ||
92 | static void iwl_free_fw_img(struct iwl_bus *bus, struct fw_img *img) | 92 | static void iwl_free_fw_img(struct iwl_trans *trans, struct fw_img *img) |
93 | { | 93 | { |
94 | iwl_free_fw_desc(bus, &img->code); | 94 | iwl_free_fw_desc(trans, &img->code); |
95 | iwl_free_fw_desc(bus, &img->data); | 95 | iwl_free_fw_desc(trans, &img->data); |
96 | } | 96 | } |
97 | 97 | ||
98 | void iwl_dealloc_ucode(struct iwl_trans *trans) | 98 | void iwl_dealloc_ucode(struct iwl_trans *trans) |
99 | { | 99 | { |
100 | iwl_free_fw_img(bus(trans), &trans->ucode_rt); | 100 | iwl_free_fw_img(trans, &trans->ucode_rt); |
101 | iwl_free_fw_img(bus(trans), &trans->ucode_init); | 101 | iwl_free_fw_img(trans, &trans->ucode_init); |
102 | iwl_free_fw_img(bus(trans), &trans->ucode_wowlan); | 102 | iwl_free_fw_img(trans, &trans->ucode_wowlan); |
103 | } | 103 | } |
104 | 104 | ||
105 | int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, | 105 | int iwl_alloc_fw_desc(struct iwl_trans *trans, struct fw_desc *desc, |
106 | const void *data, size_t len) | 106 | const void *data, size_t len) |
107 | { | 107 | { |
108 | if (!len) { | 108 | if (!len) { |
@@ -110,7 +110,7 @@ int iwl_alloc_fw_desc(struct iwl_bus *bus, struct fw_desc *desc, | |||
110 | return -EINVAL; | 110 | return -EINVAL; |
111 | } | 111 | } |
112 | 112 | ||
113 | desc->v_addr = dma_alloc_coherent(trans(bus)->dev, len, | 113 | desc->v_addr = dma_alloc_coherent(trans->dev, len, |
114 | &desc->p_addr, GFP_KERNEL); | 114 | &desc->p_addr, GFP_KERNEL); |
115 | if (!desc->v_addr) | 115 | if (!desc->v_addr) |
116 | return -ENOMEM; | 116 | return -ENOMEM; |