diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2010-11-10 12:56:40 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-11-15 13:26:45 -0500 |
commit | e39fdee1d7856817619326fa114438c146d74510 (patch) | |
tree | fb3730df3164aa6239571c2f39348afe74744fd9 | |
parent | 81baf6ec9c190ae128748cf2a026bff5cb811b70 (diff) |
iwlwifi: put all the isr related function under ops
There were two type of isr supported by iwlwifi devices.
legacy isr - only used by legacy devices (3945 & 4965)
ict isr - used by all new generation of iwlwifi devices
Move all the isr related functions into ops, the ict type of isr
supports only needed for newer devices.
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
-rw-r--r-- | drivers/net/wireless/iwlwifi/Makefile | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-1000.c | 8 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-3945.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-4965.c | 4 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-5000.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-6000.c | 16 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.c | 18 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 12 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl3945-base.c | 2 |
9 files changed, 67 insertions, 17 deletions
diff --git a/drivers/net/wireless/iwlwifi/Makefile b/drivers/net/wireless/iwlwifi/Makefile index b85a9c8ed01e..01aa2468bd69 100644 --- a/drivers/net/wireless/iwlwifi/Makefile +++ b/drivers/net/wireless/iwlwifi/Makefile | |||
@@ -11,14 +11,14 @@ CFLAGS_iwl-devtrace.o := -I$(src) | |||
11 | 11 | ||
12 | # AGN | 12 | # AGN |
13 | obj-$(CONFIG_IWLAGN) += iwlagn.o | 13 | obj-$(CONFIG_IWLAGN) += iwlagn.o |
14 | iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o iwl-agn-ict.o | 14 | iwlagn-objs := iwl-agn.o iwl-agn-rs.o iwl-agn-led.o |
15 | iwlagn-objs += iwl-agn-ucode.o iwl-agn-tx.o | 15 | iwlagn-objs += iwl-agn-ucode.o iwl-agn-tx.o |
16 | iwlagn-objs += iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o | 16 | iwlagn-objs += iwl-agn-lib.o iwl-agn-rx.o iwl-agn-calib.o |
17 | iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o | 17 | iwlagn-objs += iwl-agn-tt.o iwl-agn-sta.o iwl-agn-eeprom.o |
18 | iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o | 18 | iwlagn-$(CONFIG_IWLWIFI_DEBUGFS) += iwl-agn-debugfs.o |
19 | 19 | ||
20 | iwlagn-$(CONFIG_IWL4965) += iwl-4965.o | 20 | iwlagn-$(CONFIG_IWL4965) += iwl-4965.o |
21 | iwlagn-$(CONFIG_IWL5000) += iwl-agn-rxon.o iwl-agn-hcmd.o | 21 | iwlagn-$(CONFIG_IWL5000) += iwl-agn-rxon.o iwl-agn-hcmd.o iwl-agn-ict.o |
22 | iwlagn-$(CONFIG_IWL5000) += iwl-5000.o | 22 | iwlagn-$(CONFIG_IWL5000) += iwl-5000.o |
23 | iwlagn-$(CONFIG_IWL5000) += iwl-6000.o | 23 | iwlagn-$(CONFIG_IWL5000) += iwl-6000.o |
24 | iwlagn-$(CONFIG_IWL5000) += iwl-1000.o | 24 | iwlagn-$(CONFIG_IWL5000) += iwl-1000.o |
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c index baedea8e4d04..068f1e1e3297 100644 --- a/drivers/net/wireless/iwlwifi/iwl-1000.c +++ b/drivers/net/wireless/iwlwifi/iwl-1000.c | |||
@@ -211,7 +211,13 @@ static struct iwl_lib_ops iwl1000_lib = { | |||
211 | .calib_version = iwlagn_eeprom_calib_version, | 211 | .calib_version = iwlagn_eeprom_calib_version, |
212 | .query_addr = iwlagn_eeprom_query_addr, | 212 | .query_addr = iwlagn_eeprom_query_addr, |
213 | }, | 213 | }, |
214 | .isr = iwl_isr_ict, | 214 | .isr_ops = { |
215 | .isr = iwl_isr_ict, | ||
216 | .free = iwl_free_isr_ict, | ||
217 | .alloc = iwl_alloc_isr_ict, | ||
218 | .reset = iwl_reset_ict, | ||
219 | .disable = iwl_disable_ict, | ||
220 | }, | ||
215 | .temp_ops = { | 221 | .temp_ops = { |
216 | .temperature = iwlagn_temperature, | 222 | .temperature = iwlagn_temperature, |
217 | }, | 223 | }, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c index a97c09992a73..1ab171949021 100644 --- a/drivers/net/wireless/iwlwifi/iwl-3945.c +++ b/drivers/net/wireless/iwlwifi/iwl-3945.c | |||
@@ -2727,7 +2727,9 @@ static struct iwl_lib_ops iwl3945_lib = { | |||
2727 | }, | 2727 | }, |
2728 | .send_tx_power = iwl3945_send_tx_power, | 2728 | .send_tx_power = iwl3945_send_tx_power, |
2729 | .is_valid_rtc_data_addr = iwl3945_hw_valid_rtc_data_addr, | 2729 | .is_valid_rtc_data_addr = iwl3945_hw_valid_rtc_data_addr, |
2730 | .isr = iwl_isr_legacy, | 2730 | .isr_ops = { |
2731 | .isr = iwl_isr_legacy, | ||
2732 | }, | ||
2731 | .recover_from_tx_stall = iwl_bg_monitor_recover, | 2733 | .recover_from_tx_stall = iwl_bg_monitor_recover, |
2732 | .check_plcp_health = iwl3945_good_plcp_health, | 2734 | .check_plcp_health = iwl3945_good_plcp_health, |
2733 | 2735 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c index 6d313c817040..a6518caa405c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-4965.c +++ b/drivers/net/wireless/iwlwifi/iwl-4965.c | |||
@@ -2561,7 +2561,9 @@ static struct iwl_lib_ops iwl4965_lib = { | |||
2561 | }, | 2561 | }, |
2562 | .send_tx_power = iwl4965_send_tx_power, | 2562 | .send_tx_power = iwl4965_send_tx_power, |
2563 | .update_chain_flags = iwl_update_chain_flags, | 2563 | .update_chain_flags = iwl_update_chain_flags, |
2564 | .isr = iwl_isr_legacy, | 2564 | .isr_ops = { |
2565 | .isr = iwl_isr_legacy, | ||
2566 | }, | ||
2565 | .temp_ops = { | 2567 | .temp_ops = { |
2566 | .temperature = iwl4965_temperature_calib, | 2568 | .temperature = iwl4965_temperature_calib, |
2567 | }, | 2569 | }, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c index e1f412f915ae..ad43f0fdf919 100644 --- a/drivers/net/wireless/iwlwifi/iwl-5000.c +++ b/drivers/net/wireless/iwlwifi/iwl-5000.c | |||
@@ -385,7 +385,13 @@ static struct iwl_lib_ops iwl5000_lib = { | |||
385 | .calib_version = iwlagn_eeprom_calib_version, | 385 | .calib_version = iwlagn_eeprom_calib_version, |
386 | .query_addr = iwlagn_eeprom_query_addr, | 386 | .query_addr = iwlagn_eeprom_query_addr, |
387 | }, | 387 | }, |
388 | .isr = iwl_isr_ict, | 388 | .isr_ops = { |
389 | .isr = iwl_isr_ict, | ||
390 | .free = iwl_free_isr_ict, | ||
391 | .alloc = iwl_alloc_isr_ict, | ||
392 | .reset = iwl_reset_ict, | ||
393 | .disable = iwl_disable_ict, | ||
394 | }, | ||
389 | .temp_ops = { | 395 | .temp_ops = { |
390 | .temperature = iwlagn_temperature, | 396 | .temperature = iwlagn_temperature, |
391 | }, | 397 | }, |
@@ -449,7 +455,13 @@ static struct iwl_lib_ops iwl5150_lib = { | |||
449 | .calib_version = iwlagn_eeprom_calib_version, | 455 | .calib_version = iwlagn_eeprom_calib_version, |
450 | .query_addr = iwlagn_eeprom_query_addr, | 456 | .query_addr = iwlagn_eeprom_query_addr, |
451 | }, | 457 | }, |
452 | .isr = iwl_isr_ict, | 458 | .isr_ops = { |
459 | .isr = iwl_isr_ict, | ||
460 | .free = iwl_free_isr_ict, | ||
461 | .alloc = iwl_alloc_isr_ict, | ||
462 | .reset = iwl_reset_ict, | ||
463 | .disable = iwl_disable_ict, | ||
464 | }, | ||
453 | .temp_ops = { | 465 | .temp_ops = { |
454 | .temperature = iwl5150_temperature, | 466 | .temperature = iwl5150_temperature, |
455 | }, | 467 | }, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c index b1816900980c..21ac2817722e 100644 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c | |||
@@ -322,7 +322,13 @@ static struct iwl_lib_ops iwl6000_lib = { | |||
322 | .query_addr = iwlagn_eeprom_query_addr, | 322 | .query_addr = iwlagn_eeprom_query_addr, |
323 | .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower, | 323 | .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower, |
324 | }, | 324 | }, |
325 | .isr = iwl_isr_ict, | 325 | .isr_ops = { |
326 | .isr = iwl_isr_ict, | ||
327 | .free = iwl_free_isr_ict, | ||
328 | .alloc = iwl_alloc_isr_ict, | ||
329 | .reset = iwl_reset_ict, | ||
330 | .disable = iwl_disable_ict, | ||
331 | }, | ||
326 | .temp_ops = { | 332 | .temp_ops = { |
327 | .temperature = iwlagn_temperature, | 333 | .temperature = iwlagn_temperature, |
328 | }, | 334 | }, |
@@ -389,7 +395,13 @@ static struct iwl_lib_ops iwl6000g2b_lib = { | |||
389 | .query_addr = iwlagn_eeprom_query_addr, | 395 | .query_addr = iwlagn_eeprom_query_addr, |
390 | .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower, | 396 | .update_enhanced_txpower = iwlcore_eeprom_enhanced_txpower, |
391 | }, | 397 | }, |
392 | .isr = iwl_isr_ict, | 398 | .isr_ops = { |
399 | .isr = iwl_isr_ict, | ||
400 | .free = iwl_free_isr_ict, | ||
401 | .alloc = iwl_alloc_isr_ict, | ||
402 | .reset = iwl_reset_ict, | ||
403 | .disable = iwl_disable_ict, | ||
404 | }, | ||
393 | .temp_ops = { | 405 | .temp_ops = { |
394 | .temperature = iwlagn_temperature, | 406 | .temperature = iwlagn_temperature, |
395 | }, | 407 | }, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c index 573017474610..007fb20d78ab 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn.c | |||
@@ -2815,7 +2815,8 @@ static void __iwl_down(struct iwl_priv *priv) | |||
2815 | STATUS_EXIT_PENDING; | 2815 | STATUS_EXIT_PENDING; |
2816 | 2816 | ||
2817 | /* device going down, Stop using ICT table */ | 2817 | /* device going down, Stop using ICT table */ |
2818 | iwl_disable_ict(priv); | 2818 | if (priv->cfg->ops->lib->isr_ops.disable) |
2819 | priv->cfg->ops->lib->isr_ops.disable(priv); | ||
2819 | 2820 | ||
2820 | iwlagn_txq_ctx_stop(priv); | 2821 | iwlagn_txq_ctx_stop(priv); |
2821 | iwlagn_rxq_stop(priv); | 2822 | iwlagn_rxq_stop(priv); |
@@ -3038,7 +3039,8 @@ static void iwl_bg_alive_start(struct work_struct *data) | |||
3038 | return; | 3039 | return; |
3039 | 3040 | ||
3040 | /* enable dram interrupt */ | 3041 | /* enable dram interrupt */ |
3041 | iwl_reset_ict(priv); | 3042 | if (priv->cfg->ops->lib->isr_ops.reset) |
3043 | priv->cfg->ops->lib->isr_ops.reset(priv); | ||
3042 | 3044 | ||
3043 | mutex_lock(&priv->mutex); | 3045 | mutex_lock(&priv->mutex); |
3044 | iwl_alive_start(priv); | 3046 | iwl_alive_start(priv); |
@@ -4172,8 +4174,10 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4172 | 4174 | ||
4173 | pci_enable_msi(priv->pci_dev); | 4175 | pci_enable_msi(priv->pci_dev); |
4174 | 4176 | ||
4175 | iwl_alloc_isr_ict(priv); | 4177 | if (priv->cfg->ops->lib->isr_ops.alloc) |
4176 | err = request_irq(priv->pci_dev->irq, priv->cfg->ops->lib->isr, | 4178 | priv->cfg->ops->lib->isr_ops.alloc(priv); |
4179 | |||
4180 | err = request_irq(priv->pci_dev->irq, priv->cfg->ops->lib->isr_ops.isr, | ||
4177 | IRQF_SHARED, DRV_NAME, priv); | 4181 | IRQF_SHARED, DRV_NAME, priv); |
4178 | if (err) { | 4182 | if (err) { |
4179 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); | 4183 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); |
@@ -4220,7 +4224,8 @@ static int iwl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
4220 | destroy_workqueue(priv->workqueue); | 4224 | destroy_workqueue(priv->workqueue); |
4221 | priv->workqueue = NULL; | 4225 | priv->workqueue = NULL; |
4222 | free_irq(priv->pci_dev->irq, priv); | 4226 | free_irq(priv->pci_dev->irq, priv); |
4223 | iwl_free_isr_ict(priv); | 4227 | if (priv->cfg->ops->lib->isr_ops.free) |
4228 | priv->cfg->ops->lib->isr_ops.free(priv); | ||
4224 | out_disable_msi: | 4229 | out_disable_msi: |
4225 | pci_disable_msi(priv->pci_dev); | 4230 | pci_disable_msi(priv->pci_dev); |
4226 | iwl_uninit_drv(priv); | 4231 | iwl_uninit_drv(priv); |
@@ -4315,7 +4320,8 @@ static void __devexit iwl_pci_remove(struct pci_dev *pdev) | |||
4315 | 4320 | ||
4316 | iwl_uninit_drv(priv); | 4321 | iwl_uninit_drv(priv); |
4317 | 4322 | ||
4318 | iwl_free_isr_ict(priv); | 4323 | if (priv->cfg->ops->lib->isr_ops.free) |
4324 | priv->cfg->ops->lib->isr_ops.free(priv); | ||
4319 | 4325 | ||
4320 | dev_kfree_skb(priv->beacon_skb); | 4326 | dev_kfree_skb(priv->beacon_skb); |
4321 | 4327 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 7505c16db2a2..c9723da040fc 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -120,6 +120,14 @@ struct iwl_apm_ops { | |||
120 | void (*config)(struct iwl_priv *priv); | 120 | void (*config)(struct iwl_priv *priv); |
121 | }; | 121 | }; |
122 | 122 | ||
123 | struct iwl_isr_ops { | ||
124 | irqreturn_t (*isr) (int irq, void *data); | ||
125 | void (*free)(struct iwl_priv *priv); | ||
126 | int (*alloc)(struct iwl_priv *priv); | ||
127 | int (*reset)(struct iwl_priv *priv); | ||
128 | void (*disable)(struct iwl_priv *priv); | ||
129 | }; | ||
130 | |||
123 | struct iwl_debugfs_ops { | 131 | struct iwl_debugfs_ops { |
124 | ssize_t (*rx_stats_read)(struct file *file, char __user *user_buf, | 132 | ssize_t (*rx_stats_read)(struct file *file, char __user *user_buf, |
125 | size_t count, loff_t *ppos); | 133 | size_t count, loff_t *ppos); |
@@ -193,7 +201,9 @@ struct iwl_lib_ops { | |||
193 | /* power */ | 201 | /* power */ |
194 | int (*send_tx_power) (struct iwl_priv *priv); | 202 | int (*send_tx_power) (struct iwl_priv *priv); |
195 | void (*update_chain_flags)(struct iwl_priv *priv); | 203 | void (*update_chain_flags)(struct iwl_priv *priv); |
196 | irqreturn_t (*isr) (int irq, void *data); | 204 | |
205 | /* isr */ | ||
206 | struct iwl_isr_ops isr_ops; | ||
197 | 207 | ||
198 | /* eeprom operations (as defined in iwl-eeprom.h) */ | 208 | /* eeprom operations (as defined in iwl-eeprom.h) */ |
199 | struct iwl_eeprom_ops eeprom_ops; | 209 | struct iwl_eeprom_ops eeprom_ops; |
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c index 6152a86c19b5..a55b4623e1c8 100644 --- a/drivers/net/wireless/iwlwifi/iwl3945-base.c +++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c | |||
@@ -4120,7 +4120,7 @@ static int iwl3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
4120 | 4120 | ||
4121 | pci_enable_msi(priv->pci_dev); | 4121 | pci_enable_msi(priv->pci_dev); |
4122 | 4122 | ||
4123 | err = request_irq(priv->pci_dev->irq, priv->cfg->ops->lib->isr, | 4123 | err = request_irq(priv->pci_dev->irq, priv->cfg->ops->lib->isr_ops.isr, |
4124 | IRQF_SHARED, DRV_NAME, priv); | 4124 | IRQF_SHARED, DRV_NAME, priv); |
4125 | if (err) { | 4125 | if (err) { |
4126 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); | 4126 | IWL_ERR(priv, "Error allocating IRQ %d\n", priv->pci_dev->irq); |