aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans-pcie.c36
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-trans.h8
4 files changed, 29 insertions, 19 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 8b1839aec40..1c00691c9f0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1829,7 +1829,7 @@ int iwl_probe(struct iwl_bus *bus, const struct iwl_trans_ops *trans_ops,
1829 IWL_INFO(priv, "Detected %s, REV=0x%X\n", 1829 IWL_INFO(priv, "Detected %s, REV=0x%X\n",
1830 cfg(priv)->name, hw_rev); 1830 cfg(priv)->name, hw_rev);
1831 1831
1832 err = iwl_trans_request_irq(trans(priv)); 1832 err = iwl_trans_start_hw(trans(priv));
1833 if (err) 1833 if (err)
1834 goto out_free_traffic_mem; 1834 goto out_free_traffic_mem;
1835 1835
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
index 555175ff4f9..561865f29d5 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
@@ -201,6 +201,7 @@ struct iwl_tx_queue {
201 * @rxq: all the RX queue data 201 * @rxq: all the RX queue data
202 * @rx_replenish: work that will be called when buffers need to be allocated 202 * @rx_replenish: work that will be called when buffers need to be allocated
203 * @trans: pointer to the generic transport area 203 * @trans: pointer to the generic transport area
204 * @irq_requested: true when the irq has been requested
204 * @scd_base_addr: scheduler sram base address in SRAM 205 * @scd_base_addr: scheduler sram base address in SRAM
205 * @scd_bc_tbls: pointer to the byte count table of the scheduler 206 * @scd_bc_tbls: pointer to the byte count table of the scheduler
206 * @kw: keep warm address 207 * @kw: keep warm address
@@ -225,6 +226,7 @@ struct iwl_trans_pcie {
225 int ict_index; 226 int ict_index;
226 u32 inta; 227 u32 inta;
227 bool use_ict; 228 bool use_ict;
229 bool irq_requested;
228 struct tasklet_struct irq_tasklet; 230 struct tasklet_struct irq_tasklet;
229 struct isr_statistics isr_stats; 231 struct isr_statistics isr_stats;
230 232
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
index a1ee2e4b0ce..ffbafb9e447 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
+++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie.c
@@ -1235,7 +1235,7 @@ static void iwl_trans_pcie_kick_nic(struct iwl_trans *trans)
1235 iwl_write32(trans, CSR_RESET, 0); 1235 iwl_write32(trans, CSR_RESET, 0);
1236} 1236}
1237 1237
1238static int iwl_trans_pcie_request_irq(struct iwl_trans *trans) 1238static int iwl_trans_pcie_start_hw(struct iwl_trans *trans)
1239{ 1239{
1240 struct iwl_trans_pcie *trans_pcie = 1240 struct iwl_trans_pcie *trans_pcie =
1241 IWL_TRANS_GET_PCIE_TRANS(trans); 1241 IWL_TRANS_GET_PCIE_TRANS(trans);
@@ -1243,20 +1243,26 @@ static int iwl_trans_pcie_request_irq(struct iwl_trans *trans)
1243 1243
1244 trans_pcie->inta_mask = CSR_INI_SET_MASK; 1244 trans_pcie->inta_mask = CSR_INI_SET_MASK;
1245 1245
1246 tasklet_init(&trans_pcie->irq_tasklet, (void (*)(unsigned long)) 1246 if (!trans_pcie->irq_requested) {
1247 iwl_irq_tasklet, (unsigned long)trans); 1247 tasklet_init(&trans_pcie->irq_tasklet, (void (*)(unsigned long))
1248 iwl_irq_tasklet, (unsigned long)trans);
1248 1249
1249 iwl_alloc_isr_ict(trans); 1250 iwl_alloc_isr_ict(trans);
1250 1251
1251 err = request_irq(trans->irq, iwl_isr_ict, IRQF_SHARED, 1252 err = request_irq(trans->irq, iwl_isr_ict, IRQF_SHARED,
1252 DRV_NAME, trans); 1253 DRV_NAME, trans);
1253 if (err) { 1254 if (err) {
1254 IWL_ERR(trans, "Error allocating IRQ %d\n", trans->irq); 1255 IWL_ERR(trans, "Error allocating IRQ %d\n",
1255 iwl_free_isr_ict(trans); 1256 trans->irq);
1256 return err; 1257 iwl_free_isr_ict(trans);
1258 tasklet_kill(&trans_pcie->irq_tasklet);
1259 return err;
1260 }
1261
1262 INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish);
1263 trans_pcie->irq_requested = true;
1257 } 1264 }
1258 1265
1259 INIT_WORK(&trans_pcie->rx_replenish, iwl_bg_rx_replenish);
1260 return 0; 1266 return 0;
1261} 1267}
1262 1268
@@ -1325,8 +1331,10 @@ static void iwl_trans_pcie_free(struct iwl_trans *trans)
1325#ifndef CONFIG_IWLWIFI_IDI 1331#ifndef CONFIG_IWLWIFI_IDI
1326 iwl_trans_pcie_rx_free(trans); 1332 iwl_trans_pcie_rx_free(trans);
1327#endif 1333#endif
1328 free_irq(trans->irq, trans); 1334 if (trans_pcie->irq_requested == true) {
1329 iwl_free_isr_ict(trans); 1335 free_irq(trans->irq, trans);
1336 iwl_free_isr_ict(trans);
1337 }
1330 1338
1331 pci_disable_msi(trans_pcie->pci_dev); 1339 pci_disable_msi(trans_pcie->pci_dev);
1332 pci_iounmap(trans_pcie->pci_dev, trans_pcie->hw_base); 1340 pci_iounmap(trans_pcie->pci_dev, trans_pcie->hw_base);
@@ -1920,7 +1928,7 @@ static int iwl_trans_pcie_dbgfs_register(struct iwl_trans *trans,
1920#endif /*CONFIG_IWLWIFI_DEBUGFS */ 1928#endif /*CONFIG_IWLWIFI_DEBUGFS */
1921 1929
1922const struct iwl_trans_ops trans_ops_pcie = { 1930const struct iwl_trans_ops trans_ops_pcie = {
1923 .request_irq = iwl_trans_pcie_request_irq, 1931 .start_hw = iwl_trans_pcie_start_hw,
1924 .fw_alive = iwl_trans_pcie_fw_alive, 1932 .fw_alive = iwl_trans_pcie_fw_alive,
1925 .start_device = iwl_trans_pcie_start_device, 1933 .start_device = iwl_trans_pcie_start_device,
1926 .prepare_card_hw = iwl_trans_pcie_prepare_card_hw, 1934 .prepare_card_hw = iwl_trans_pcie_prepare_card_hw,
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h
index d5195998417..ddc3a0627dd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-trans.h
+++ b/drivers/net/wireless/iwlwifi/iwl-trans.h
@@ -133,7 +133,7 @@ struct iwl_host_cmd {
133 133
134/** 134/**
135 * struct iwl_trans_ops - transport specific operations 135 * struct iwl_trans_ops - transport specific operations
136 * @request_irq: requests IRQ - will be called before the FW load in probe flow 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 139 * @prepare_card_hw: claim the ownership on the HW. Will be called during
@@ -164,7 +164,7 @@ struct iwl_host_cmd {
164 */ 164 */
165struct iwl_trans_ops { 165struct iwl_trans_ops {
166 166
167 int (*request_irq)(struct iwl_trans *iwl_trans); 167 int (*start_hw)(struct iwl_trans *iwl_trans);
168 int (*start_device)(struct iwl_trans *trans); 168 int (*start_device)(struct iwl_trans *trans);
169 void (*fw_alive)(struct iwl_trans *trans); 169 void (*fw_alive)(struct iwl_trans *trans);
170 int (*prepare_card_hw)(struct iwl_trans *trans); 170 int (*prepare_card_hw)(struct iwl_trans *trans);
@@ -269,9 +269,9 @@ struct iwl_trans {
269 char trans_specific[0] __attribute__((__aligned__(sizeof(void *)))); 269 char trans_specific[0] __attribute__((__aligned__(sizeof(void *))));
270}; 270};
271 271
272static inline int iwl_trans_request_irq(struct iwl_trans *trans) 272static inline int iwl_trans_start_hw(struct iwl_trans *trans)
273{ 273{
274 return trans->ops->request_irq(trans); 274 return trans->ops->start_hw(trans);
275} 275}
276 276
277static inline void iwl_trans_fw_alive(struct iwl_trans *trans) 277static inline void iwl_trans_fw_alive(struct iwl_trans *trans)