aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c22
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h8
3 files changed, 15 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 1c00691c9f0f..5ab7f681991e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1833,12 +1833,6 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1833 if (err) 1833 if (err)
1834 goto out_free_traffic_mem; 1834 goto out_free_traffic_mem;
1835 1835
1836 if (iwl_trans_prepare_card_hw(trans(priv))) {
1837 err = -EIO;
1838 IWL_WARN(priv, "Failed, HW not ready\n");
1839 goto out_free_traffic_mem;
1840 }
1841
1842 /***************** 1836 /*****************
1843 * 4. Read EEPROM 1837 * 4. Read EEPROM
1844 *****************/ 1838 *****************/
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index ffbafb9e447b..d1ab57a7988f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -690,13 +690,14 @@ static int iwl_set_hw_ready(struct iwl_trans *trans)
690} 690}
691 691
692/* Note: returns standard 0/-ERROR code */ 692/* Note: returns standard 0/-ERROR code */
693static int iwl_trans_pcie_prepare_card_hw(struct iwl_trans *trans) 693static int iwl_prepare_card_hw(struct iwl_trans *trans)
694{ 694{
695 int ret; 695 int ret;
696 696
697 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n"); 697 IWL_DEBUG_INFO(trans, "iwl_trans_prepare_card_hw enter\n");
698 698
699 ret = iwl_set_hw_ready(trans); 699 ret = iwl_set_hw_ready(trans);
700 /* If the card is ready, exit 0 */
700 if (ret >= 0) 701 if (ret >= 0)
701 return 0; 702 return 0;
702 703
@@ -788,7 +789,7 @@ static int iwl_trans_pcie_start_device(struct iwl_trans *trans)
788 trans_pcie->mcast_queue[IWL_RXON_CTX_PAN] = IWL_IPAN_MCAST_QUEUE; 789 trans_pcie->mcast_queue[IWL_RXON_CTX_PAN] = IWL_IPAN_MCAST_QUEUE;
789 790
790 if ((hw_params(trans).sku & EEPROM_SKU_CAP_AMT_ENABLE) && 791 if ((hw_params(trans).sku & EEPROM_SKU_CAP_AMT_ENABLE) &&
791 iwl_trans_pcie_prepare_card_hw(trans)) { 792 iwl_prepare_card_hw(trans)) {
792 IWL_WARN(trans, "Exit HW not ready\n"); 793 IWL_WARN(trans, "Exit HW not ready\n");
793 return -EIO; 794 return -EIO;
794 } 795 }
@@ -1254,16 +1255,24 @@ static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
1254 if (err) { 1255 if (err) {
1255 IWL_ERR(trans, "Error allocating IRQ %d\n", 1256 IWL_ERR(trans, "Error allocating IRQ %d\n",
1256 trans->irq); 1257 trans->irq);
1257 iwl_free_isr_ict(trans); 1258 goto error;
1258 tasklet_kill(&trans_pcie->irq_tasklet);
1259 return err;
1260 } 1259 }
1261 1260
1262 INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish); 1261 INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish);
1263 trans_pcie->irq_requested = true; 1262 trans_pcie->irq_requested = true;
1264 } 1263 }
1265 1264
1266 return 0; 1265 err = iwl_prepare_card_hw(trans);
1266 if (err) {
1267 IWL_ERR(trans, "Error while preparing HW: %d", err);
1268 goto error;
1269 }
1270 return err;
1271
1272error:
1273 iwl_free_isr_ict(trans);
1274 tasklet_kill(&trans_pcie->irq_tasklet);
1275 return err;
1267} 1276}
1268 1277
1269static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid, 1278static int iwl_trans_pcie_reclaim(struct iwl_trans *trans, int sta_id, int tid,
@@ -1931,7 +1940,6 @@ const struct iwl_trans_ops trans_ops_pcie = {
1931 .start_hw = iwl_trans_pcie_start_hw, 1940 .start_hw = iwl_trans_pcie_start_hw,
1932 .fw_alive = iwl_trans_pcie_fw_alive, 1941 .fw_alive = iwl_trans_pcie_fw_alive,
1933 .start_device = iwl_trans_pcie_start_device, 1942 .start_device = iwl_trans_pcie_start_device,
1934 .prepare_card_hw = iwl_trans_pcie_prepare_card_hw,
1935 .stop_device = iwl_trans_pcie_stop_device, 1943 .stop_device = iwl_trans_pcie_stop_device,
1936 1944
1937 .wake_any_queue = iwl_trans_pcie_wake_any_queue, 1945 .wake_any_queue = iwl_trans_pcie_wake_any_queue,
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index ddc3a0627dd3..55b5dc3b5dd6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -136,8 +136,6 @@ struct iwl_host_cmd {
136 * @start_hw: starts the HW- from that point on, the HW can send interrupts 136 * @start_hw: starts the HW- from that point on, the HW can send interrupts
137 * @start_device: allocates and inits all the resources for the transport 137 * @start_device: allocates and inits all the resources for the transport
138 * layer. 138 * layer.
139 * @prepare_card_hw: claim the ownership on the HW. Will be called during
140 * probe.
141 * @fw_alive: called when the fw sends alive notification 139 * @fw_alive: called when the fw sends alive notification
142 * @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_* 140 * @wake_any_queue: wake all the queues of a specfic context IWL_RXON_CTX_*
143 * @stop_device:stops the whole device (embedded CPU put to reset) 141 * @stop_device:stops the whole device (embedded CPU put to reset)
@@ -167,7 +165,6 @@ struct iwl_trans_ops {
167 int (*start_hw)(struct iwl_trans *iwl_trans); 165 int (*start_hw)(struct iwl_trans *iwl_trans);
168 int (*start_device)(struct iwl_trans *trans); 166 int (*start_device)(struct iwl_trans *trans);
169 void (*fw_alive)(struct iwl_trans *trans); 167 void (*fw_alive)(struct iwl_trans *trans);
170 int (*prepare_card_hw)(struct iwl_trans *trans);
171 void (*stop_device)(struct iwl_trans *trans); 168 void (*stop_device)(struct iwl_trans *trans);
172 169
173 void (*wake_any_queue)(struct iwl_trans *trans, 170 void (*wake_any_queue)(struct iwl_trans *trans,
@@ -284,11 +281,6 @@ static inline int iwl_trans_start_device(struct iwl_trans *trans)
284 return trans->ops->start_device(trans); 281 return trans->ops->start_device(trans);
285} 282}
286 283
287static inline int iwl_trans_prepare_card_hw(struct iwl_trans *trans)
288{
289 return trans->ops->prepare_card_hw(trans);
290}
291
292static inline void iwl_trans_stop_device(struct iwl_trans *trans) 284static inline void iwl_trans_stop_device(struct iwl_trans *trans)
293{ 285{
294 trans->ops->stop_device(trans); 286 trans->ops->stop_device(trans);