aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlegacy/3945-mac.c2
-rw-r--r--drivers/net/wireless/iwlegacy/3945.c10
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c8
-rw-r--r--drivers/net/wireless/iwlegacy/4965.c7
-rw-r--r--drivers/net/wireless/iwlegacy/4965.h2
-rw-r--r--drivers/net/wireless/iwlegacy/common.c2
-rw-r--r--drivers/net/wireless/iwlegacy/common.h9
7 files changed, 13 insertions, 27 deletions
diff --git a/drivers/net/wireless/iwlegacy/3945-mac.c b/drivers/net/wireless/iwlegacy/3945-mac.c
index b7d5ebc512d3..ba01d2d2ff97 100644
--- a/drivers/net/wireless/iwlegacy/3945-mac.c
+++ b/drivers/net/wireless/iwlegacy/3945-mac.c
@@ -3672,7 +3672,7 @@ il3945_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
3672 * PCI Tx retries from interfering with C3 CPU state */ 3672 * PCI Tx retries from interfering with C3 CPU state */
3673 pci_write_config_byte(pdev, 0x41, 0x00); 3673 pci_write_config_byte(pdev, 0x41, 0x00);
3674 3674
3675 /* these spin locks will be used in apm_ops.init and EEPROM access 3675 /* these spin locks will be used in apm_init and EEPROM access
3676 * we should init now 3676 * we should init now
3677 */ 3677 */
3678 spin_lock_init(&il->reg_lock); 3678 spin_lock_init(&il->reg_lock);
diff --git a/drivers/net/wireless/iwlegacy/3945.c b/drivers/net/wireless/iwlegacy/3945.c
index 95d88b4f3106..a21ec25ec9d1 100644
--- a/drivers/net/wireless/iwlegacy/3945.c
+++ b/drivers/net/wireless/iwlegacy/3945.c
@@ -958,12 +958,11 @@ il3945_hw_nic_init(struct il_priv *il)
958 struct il_rx_queue *rxq = &il->rxq; 958 struct il_rx_queue *rxq = &il->rxq;
959 959
960 spin_lock_irqsave(&il->lock, flags); 960 spin_lock_irqsave(&il->lock, flags);
961 il->ops->lib->apm_ops.init(il); 961 il3945_apm_init(il);
962 spin_unlock_irqrestore(&il->lock, flags); 962 spin_unlock_irqrestore(&il->lock, flags);
963 963
964 il3945_set_pwr_vmain(il); 964 il3945_set_pwr_vmain(il);
965 965 il3945_nic_config(il);
966 il->ops->lib->apm_ops.config(il);
967 966
968 /* Allocate the RX queue, or reset if it is already allocated */ 967 /* Allocate the RX queue, or reset if it is already allocated */
969 if (!rxq->bd) { 968 if (!rxq->bd) {
@@ -2641,10 +2640,7 @@ static struct il_lib_ops il3945_lib = {
2641 .txq_init = il3945_hw_tx_queue_init, 2640 .txq_init = il3945_hw_tx_queue_init,
2642 .load_ucode = il3945_load_bsm, 2641 .load_ucode = il3945_load_bsm,
2643 .dump_nic_error_log = il3945_dump_nic_error_log, 2642 .dump_nic_error_log = il3945_dump_nic_error_log,
2644 .apm_ops = { 2643 .apm_init = il3945_apm_init,
2645 .init = il3945_apm_init,
2646 .config = il3945_nic_config,
2647 },
2648 .send_tx_power = il3945_send_tx_power, 2644 .send_tx_power = il3945_send_tx_power,
2649 .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr, 2645 .is_valid_rtc_data_addr = il3945_hw_valid_rtc_data_addr,
2650 .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore, 2646 .eeprom_acquire_semaphore = il3945_eeprom_acquire_semaphore,
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index e113dc5b1c2e..ebfcfc8a9ae6 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -199,18 +199,14 @@ il4965_hw_nic_init(struct il_priv *il)
199 struct il_rx_queue *rxq = &il->rxq; 199 struct il_rx_queue *rxq = &il->rxq;
200 int ret; 200 int ret;
201 201
202 /* nic_init */
203 spin_lock_irqsave(&il->lock, flags); 202 spin_lock_irqsave(&il->lock, flags);
204 il->ops->lib->apm_ops.init(il); 203 il_apm_init(il);
205
206 /* Set interrupt coalescing calibration timer to default (512 usecs) */ 204 /* Set interrupt coalescing calibration timer to default (512 usecs) */
207 il_write8(il, CSR_INT_COALESCING, IL_HOST_INT_CALIB_TIMEOUT_DEF); 205 il_write8(il, CSR_INT_COALESCING, IL_HOST_INT_CALIB_TIMEOUT_DEF);
208
209 spin_unlock_irqrestore(&il->lock, flags); 206 spin_unlock_irqrestore(&il->lock, flags);
210 207
211 il4965_set_pwr_vmain(il); 208 il4965_set_pwr_vmain(il);
212 209 il4965_nic_config(il);
213 il->ops->lib->apm_ops.config(il);
214 210
215 /* Allocate the RX queue, or reset if it is already allocated */ 211 /* Allocate the RX queue, or reset if it is already allocated */
216 if (!rxq->bd) { 212 if (!rxq->bd) {
diff --git a/drivers/net/wireless/iwlegacy/4965.c b/drivers/net/wireless/iwlegacy/4965.c
index 3ddc31f0f9e7..e5e5ab24d171 100644
--- a/drivers/net/wireless/iwlegacy/4965.c
+++ b/drivers/net/wireless/iwlegacy/4965.c
@@ -508,7 +508,7 @@ iw4965_is_ht40_channel(__le32 rxon_flags)
508 chan_mod == CHANNEL_MODE_MIXED); 508 chan_mod == CHANNEL_MODE_MIXED);
509} 509}
510 510
511static void 511void
512il4965_nic_config(struct il_priv *il) 512il4965_nic_config(struct il_priv *il)
513{ 513{
514 unsigned long flags; 514 unsigned long flags;
@@ -1900,10 +1900,7 @@ static struct il_lib_ops il4965_lib = {
1900 .dump_nic_error_log = il4965_dump_nic_error_log, 1900 .dump_nic_error_log = il4965_dump_nic_error_log,
1901 .dump_fh = il4965_dump_fh, 1901 .dump_fh = il4965_dump_fh,
1902 .set_channel_switch = il4965_hw_channel_switch, 1902 .set_channel_switch = il4965_hw_channel_switch,
1903 .apm_ops = { 1903 .apm_init = il_apm_init,
1904 .init = il_apm_init,
1905 .config = il4965_nic_config,
1906 },
1907 .send_tx_power = il4965_send_tx_power, 1904 .send_tx_power = il4965_send_tx_power,
1908 .update_chain_flags = il4965_update_chain_flags, 1905 .update_chain_flags = il4965_update_chain_flags,
1909 .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore, 1906 .eeprom_acquire_semaphore = il4965_eeprom_acquire_semaphore,
diff --git a/drivers/net/wireless/iwlegacy/4965.h b/drivers/net/wireless/iwlegacy/4965.h
index 7c6b9b925c94..208a4564d063 100644
--- a/drivers/net/wireless/iwlegacy/4965.h
+++ b/drivers/net/wireless/iwlegacy/4965.h
@@ -60,6 +60,8 @@ int il4965_rx_init(struct il_priv *il, struct il_rx_queue *rxq);
60int il4965_hw_nic_init(struct il_priv *il); 60int il4965_hw_nic_init(struct il_priv *il);
61int il4965_dump_fh(struct il_priv *il, char **buf, bool display); 61int il4965_dump_fh(struct il_priv *il, char **buf, bool display);
62 62
63void il4965_nic_config(struct il_priv *il);
64
63/* rx */ 65/* rx */
64void il4965_rx_queue_restock(struct il_priv *il); 66void il4965_rx_queue_restock(struct il_priv *il);
65void il4965_rx_replenish(struct il_priv *il); 67void il4965_rx_replenish(struct il_priv *il);
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index 5de2340d08c4..6e63d9fee565 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -730,7 +730,7 @@ il_eeprom_init(struct il_priv *il)
730 } 730 }
731 e = (__le16 *) il->eeprom; 731 e = (__le16 *) il->eeprom;
732 732
733 il->ops->lib->apm_ops.init(il); 733 il->ops->lib->apm_init(il);
734 734
735 ret = il_eeprom_verify_signature(il); 735 ret = il_eeprom_verify_signature(il);
736 if (ret < 0) { 736 if (ret < 0) {
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index b588a5f4da03..ca68b58674c6 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1566,11 +1566,6 @@ struct il_hcmd_utils_ops {
1566 void (*post_scan) (struct il_priv *il); 1566 void (*post_scan) (struct il_priv *il);
1567}; 1567};
1568 1568
1569struct il_apm_ops {
1570 int (*init) (struct il_priv *il);
1571 void (*config) (struct il_priv *il);
1572};
1573
1574#ifdef CONFIG_IWLEGACY_DEBUGFS 1569#ifdef CONFIG_IWLEGACY_DEBUGFS
1575struct il_debugfs_ops { 1570struct il_debugfs_ops {
1576 ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf, 1571 ssize_t(*rx_stats_read) (struct file *file, char __user *user_buf,
@@ -1605,9 +1600,9 @@ struct il_lib_ops {
1605 int (*set_channel_switch) (struct il_priv *il, 1600 int (*set_channel_switch) (struct il_priv *il,
1606 struct ieee80211_channel_switch *ch_switch); 1601 struct ieee80211_channel_switch *ch_switch);
1607 /* power management */ 1602 /* power management */
1608 struct il_apm_ops apm_ops; 1603 int (*apm_init) (struct il_priv *il);
1609 1604
1610 /* power */ 1605 /* tx power */
1611 int (*send_tx_power) (struct il_priv *il); 1606 int (*send_tx_power) (struct il_priv *il);
1612 void (*update_chain_flags) (struct il_priv *il); 1607 void (*update_chain_flags) (struct il_priv *il);
1613 1608